ExamGecko
Home Home / CompTIA / PT0-003

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

Question list
Search
Search

List of questions

Search

Related questions











A penetration tester is testing a power plant's network and needs to avoid disruption to the grid. Which of the following methods is most appropriate to identify vulnerabilities in the network?

A.
Configure a network scanner engine and execute the scan.
A.
Configure a network scanner engine and execute the scan.
Answers
B.
Execute a testing framework to validate vulnerabilities on the devices.
B.
Execute a testing framework to validate vulnerabilities on the devices.
Answers
C.
Configure a port mirror and review the network traffic.
C.
Configure a port mirror and review the network traffic.
Answers
D.
Run a network mapper tool to get an understanding of the devices.
D.
Run a network mapper tool to get an understanding of the devices.
Answers
Suggested answer: C

Explanation:

When testing a power plant's network and needing to avoid disruption to the grid, configuring a port mirror and reviewing the network traffic is the most appropriate method to identify vulnerabilities without causing disruptions.

Port Mirroring:

Definition: Port mirroring (SPAN - Switched Port Analyzer) is a method of monitoring network traffic by duplicating packets from one or more switch ports to another port where a monitoring device is connected.

Purpose: Allows passive monitoring of network traffic without impacting network operations or device performance.

Avoiding Disruption:

Non-Intrusive: Port mirroring is non-intrusive and does not generate additional traffic or load on the network devices, making it suitable for sensitive environments like power plants where disruption is not acceptable.

Other Options:

Network Scanner Engine: Active scanning might disrupt network operations or devices, which is not suitable for critical infrastructure.

Testing Framework: Validating vulnerabilities on devices might involve active testing, which can be disruptive.

Network Mapper Tool: Running a network mapper tool (like Nmap) actively scans the network and might disrupt services.

Pentest

Reference:

Passive Monitoring: Passive techniques such as port mirroring are essential in environments where maintaining operational integrity is critical.

Critical Infrastructure Security: Understanding the need for non-disruptive methods in critical infrastructure penetration testing to ensure continuous operations.

By configuring a port mirror and reviewing network traffic, the penetration tester can identify vulnerabilities in the power plant's network without risking disruption to the grid.

A penetration tester finished a security scan and uncovered numerous vulnerabilities on several hosts. Based on the targets' EPSS and CVSS scores, which of the following targets is the most likely to get attacked?

Host | CVSS | EPSS

Target 1 | 4 | 0.6

Target 2 | 2 | 0.3

Target 3 | 1 | 0.6

Target 4 | 4.5 | 0.4

A.
Target 1: CVSS Score = 4 and EPSS Score = 0.6
A.
Target 1: CVSS Score = 4 and EPSS Score = 0.6
Answers
B.
Target 2: CVSS Score = 2 and EPSS Score = 0.3
B.
Target 2: CVSS Score = 2 and EPSS Score = 0.3
Answers
C.
Target 3: CVSS Score = 1 and EPSS Score = 0.6
C.
Target 3: CVSS Score = 1 and EPSS Score = 0.6
Answers
D.
Target 4: CVSS Score = 4.5 and EPSS Score = 0.4
D.
Target 4: CVSS Score = 4.5 and EPSS Score = 0.4
Answers
Suggested answer: A

Explanation:

Based on the CVSS (Common Vulnerability Scoring System) and EPSS (Exploit Prediction Scoring System) scores, Target 1 is the most likely to get attacked.

CVSS:

Definition: CVSS provides a numerical score to represent the severity of a vulnerability, helping to prioritize the response based on the potential impact.

Score Range: Scores range from 0 to 10, with higher scores indicating more severe vulnerabilities.

EPSS:

Definition: EPSS estimates the likelihood that a vulnerability will be exploited in the wild within the next 30 days.

Score Range: EPSS scores range from 0 to 1, with higher scores indicating a higher likelihood of exploitation.

Analysis:

Target 1: CVSS = 4, EPSS = 0.6

Target 2: CVSS = 2, EPSS = 0.3

Target 3: CVSS = 1, EPSS = 0.6

Target 4: CVSS = 4.5, EPSS = 0.4

Target 1 has a moderate CVSS score and a high EPSS score, indicating it has a significant vulnerability that is quite likely to be exploited.

Pentest

Reference:

Vulnerability Prioritization: Using CVSS and EPSS scores to prioritize vulnerabilities based on severity and likelihood of exploitation.

Risk Assessment: Understanding the balance between impact (CVSS) and exploit likelihood (EPSS) to identify the most critical targets for remediation or attack.

By focusing on Target 1, which has a balanced combination of severity and exploitability, the penetration tester can address the most likely target for attacks based on the given scores.

A penetration tester discovers evidence of an advanced persistent threat on the network that is being tested. Which of the following should the tester do next?

A.
Report the finding.
A.
Report the finding.
Answers
B.
Analyze the finding.
B.
Analyze the finding.
Answers
C.
Remove the threat.
C.
Remove the threat.
Answers
D.
Document the finding and continue testing.
D.
Document the finding and continue testing.
Answers
Suggested answer: A

Explanation:

Upon discovering evidence of an advanced persistent threat (APT) on the network, the penetration tester should report the finding immediately.

Advanced Persistent Threat (APT):

Definition: APTs are prolonged and targeted cyberattacks in which an intruder gains access to a network and remains undetected for an extended period.

Significance: APTs often involve sophisticated tactics, techniques, and procedures (TTPs) aimed at stealing data or causing disruption.

Immediate Reporting:

Criticality: Discovering an APT requires immediate attention from the organization's security team due to the potential impact and persistence of the threat.

Chain of Command: Following the protocol for reporting such findings ensures that appropriate incident response measures are initiated promptly.

Other Actions:

Analyzing the Finding: While analysis is important, it should be conducted by the incident response team after reporting.

Removing the Threat: This action should be taken by the organization's security team following established incident response procedures.

Documenting and Continuing Testing: Documentation is crucial, but the immediate priority should be reporting the APT to ensure prompt action.

Pentest

Reference:

Incident Response: Understanding the importance of immediate reporting and collaboration with the organization's security team upon discovering critical threats like APTs.

Ethical Responsibility: Following ethical guidelines and protocols to ensure the organization can respond effectively to significant threats.

By reporting the finding immediately, the penetration tester ensures that the organization's security team is alerted to the presence of an APT, allowing them to initiate an appropriate incident response.

A penetration tester needs to evaluate the order in which the next systems will be selected for testing. Given the following output:

Hostname | IP address | CVSS 2.0 | EPSS

hrdatabase | 192.168.20.55 | 9.9 | 0.50

financesite | 192.168.15.99 | 8.0 | 0.01

legaldatabase | 192.168.10.2 | 8.2 | 0.60

fileserver | 192.168.125.7 | 7.6 | 0.90

Which of the following targets should the tester select next?

A.
fileserver
A.
fileserver
Answers
B.
hrdatabase
B.
hrdatabase
Answers
C.
legaldatabase
C.
legaldatabase
Answers
D.
financesite
D.
financesite
Answers
Suggested answer: A

Explanation:

Given the output, the penetration tester should select the fileserver as the next target for testing, considering both CVSS and EPSS scores.

CVSS (Common Vulnerability Scoring System):

Purpose: CVSS provides a numerical score to represent the severity of vulnerabilities, helping to prioritize remediation efforts.

Higher Scores: Indicate more severe vulnerabilities.

EPSS (Exploit Prediction Scoring System):

Purpose: EPSS estimates the likelihood that a vulnerability will be exploited in the wild within the next 30 days.

Higher Scores: Indicate a higher likelihood of exploitation.

Evaluation:

hrdatabase: CVSS = 9.9, EPSS = 0.50

financesite: CVSS = 8.0, EPSS = 0.01

legaldatabase: CVSS = 8.2, EPSS = 0.60

fileserver: CVSS = 7.6, EPSS = 0.90

The fileserver has the highest EPSS score, indicating a high likelihood of exploitation, despite having a slightly lower CVSS score compared to hrdatabase and legaldatabase.

Pentest

Reference:

Prioritization: Balancing between severity (CVSS) and exploitability (EPSS) is crucial for effective vulnerability management.

Risk Assessment: Evaluating both the impact and the likelihood of exploitation helps in making informed decisions about testing priorities.

By selecting the fileserver, which has a high EPSS score, the penetration tester focuses on a target that is more likely to be exploited, thereby addressing the most immediate risk.

During an engagement, a penetration tester wants to enumerate users from Linux systems by using finger and rwho commands. However, the tester realizes these commands alone will not achieve the desired result. Which of the following is the best tool to use for this task?

A.
Nikto
A.
Nikto
Answers
B.
Burp Suite
B.
Burp Suite
Answers
C.
smbclient
C.
smbclient
Answers
D.
theHarvester
D.
theHarvester
Answers
Suggested answer: C

Explanation:

The smbclient tool is used to access SMB/CIFS resources on a network. It allows penetration testers to connect to shared resources and enumerate users on a network, particularly in Windows environments. While finger and rwho are more common on Unix/Linux systems, smbclient provides better functionality for enumerating users across a network.

Step-by-Step Explanation

Understanding smbclient:

Purpose: smbclient is used to access and manage files and directories on SMB/CIFS servers.

Capabilities: It allows for browsing shared resources, listing directories, downloading and uploading files, and enumerating users.

User Enumeration:

Command: Use smbclient with the -L option to list available shares and users.

smbclient -L //target_ip -U username

Example: Enumerating users on a target system.

smbclient -L //192.168.50.2 -U anonymous

Advantages:

Comprehensive: Provides detailed information about shared resources and users.

Cross-Platform: Can be used on both Linux and Windows systems.

Reference from Pentesting Literature:

SMB enumeration is a common practice discussed in penetration testing guides for identifying shared resources and users in a network environment.

HTB write-ups frequently mention the use of smbclient for enumerating network shares and users.

Penetration Testing - A Hands-on Introduction to Hacking

HTB Official Writeups

A penetration tester needs to complete cleanup activities from the testing lead. Which of the following should the tester do to validate that reverse shell payloads are no longer running?

A.
Run scripts to terminate the implant on affected hosts.
A.
Run scripts to terminate the implant on affected hosts.
Answers
B.
Spin down the C2 listeners.
B.
Spin down the C2 listeners.
Answers
C.
Restore the firewall settings of the original affected hosts.
C.
Restore the firewall settings of the original affected hosts.
Answers
D.
Exit from C2 listener active sessions.
D.
Exit from C2 listener active sessions.
Answers
Suggested answer: A

Explanation:

To ensure that reverse shell payloads are no longer running, it is essential to actively terminate any implanted malware or scripts. Here's why option A is correct:

Run Scripts to Terminate the Implant: This ensures that any reverse shell payloads or malicious implants are actively terminated on the affected hosts. It is a direct and effective method to clean up after a penetration test.

Spin Down the C2 Listeners: This stops the command and control listeners but does not remove the implants from the hosts.

Restore the Firewall Settings: This is important for network security but does not directly address the termination of active implants.

Exit from C2 Listener Active Sessions: This closes the current sessions but does not ensure that implants are terminated.

Reference from Pentest:

Anubis HTB: Demonstrates the process of cleaning up and ensuring that all implants are removed after an assessment.

Forge HTB: Highlights the importance of thoroughly cleaning up and terminating any payloads or implants to leave the environment secure post-assessment.

A penetration testing team wants to conduct DNS lookups for a set of targets provided by the client. The team crafts a Bash script for this task. However, they find a minor error in one line of the script:

1 #!/bin/bash

2 for i in $(cat example.txt); do

3 curl $i

4 done

Which of the following changes should the team make to line 3 of the script?

A.
resolvconf $i
A.
resolvconf $i
Answers
B.
rndc $i
B.
rndc $i
Answers
C.
systemd-resolve $i
C.
systemd-resolve $i
Answers
D.
host $i
D.
host $i
Answers
Suggested answer: D

Explanation:

Script Analysis:

Line 1: #!/bin/bash - This line specifies the script should be executed in the Bash shell.

Line 2: for i in $(cat example.txt); do - This line starts a loop that reads each line from the file example.txt and assigns it to the variable i.

Line 3: curl $i - This line attempts to fetch the content from the URL stored in i using curl. However, for DNS lookups, curl is inappropriate.

Line 4: done - This line ends the loop.

Error Identification:

The curl command is used for transferring data from or to a server, often used for HTTP requests, which is not suitable for DNS lookups.

Correct Command:

To perform DNS lookups, the host command should be used. The host command performs DNS lookups and displays information about the given domain.

Corrected Script:

Replace curl $i with host $i to perform DNS lookups on each target specified in example.txt.

Pentest

Reference:

In penetration testing, DNS enumeration is a crucial step. It involves querying DNS servers to gather information about the target domain, which includes resolving domain names to IP addresses and vice versa.

Common tools for DNS enumeration include host, dig, and nslookup. The host command is particularly straightforward for simple DNS lookups.

By correcting the script to use host $i, the penetration testing team can effectively perform DNS lookups on the targets specified in example.txt.

A penetration tester needs to test a very large number of URLs for public access. Given the following code snippet:

1 import requests

2 import pathlib

3

4 for url in pathlib.Path('urls.txt').read_text().split('\n'):

5 response = requests.get(url)

6 if response.status == 401:

7 print('URL accessible')

Which of the following changes is required?

A.
The condition on line 6
A.
The condition on line 6
Answers
B.
The method on line 5
B.
The method on line 5
Answers
C.
The import on line 1
C.
The import on line 1
Answers
D.
The delimiter in line 3
D.
The delimiter in line 3
Answers
Suggested answer: A

Explanation:

Script Analysis:

Line 1: import requests - Imports the requests library to handle HTTP requests.

Line 2: import pathlib - Imports the pathlib library to handle file paths.

Line 4: for url in pathlib.Path('urls.txt').read_text().split('\n'): - Reads the urls.txt file, splits its contents by newline, and iterates over each URL.

Line 5: response = requests.get(url) - Sends a GET request to the URL and stores the response.

Line 6: if response.status == 401: - Checks if the response status code is 401 (Unauthorized).

Line 7: print('URL accessible') - Prints a message indicating the URL is accessible.

Error Identification:

The condition if response.status == 401: is incorrect for determining if a URL is publicly accessible. A 401 status code indicates that the resource requires authentication.

Correct Condition:

The correct condition should check for a 200 status code, which indicates that the request was successful and the resource is accessible.

Corrected Script:

Replace if response.status == 401: with if response.status_code == 200: to correctly identify publicly accessible URLs.

Pentest

Reference:

In penetration testing, checking the accessibility of multiple URLs is a common task, often part of reconnaissance. Identifying publicly accessible resources can reveal potential entry points for further testing.

The requests library in Python is widely used for making HTTP requests and handling responses. Understanding HTTP status codes is crucial for correctly interpreting the results of these requests.

By changing the condition to check for a 200 status code, the script will correctly identify and print URLs that are publicly accessible.

As part of an engagement, a penetration tester wants to maintain access to a compromised system after rebooting. Which of the following techniques would be best for the tester to use?

A.
Establishing a reverse shell
A.
Establishing a reverse shell
Answers
B.
Executing a process injection attack
B.
Executing a process injection attack
Answers
C.
Creating a scheduled task
C.
Creating a scheduled task
Answers
D.
Performing a credential-dumping attack
D.
Performing a credential-dumping attack
Answers
Suggested answer: C

Explanation:

To maintain access to a compromised system after rebooting, a penetration tester should create a scheduled task. Scheduled tasks are designed to run automatically at specified times or when certain conditions are met, ensuring persistence across reboots.

Persistence Mechanisms:

Scheduled Task: Creating a scheduled task ensures that a specific program or script runs automatically according to a set schedule or in response to certain events, including system startup. This makes it a reliable method for maintaining access after a system reboot.

Reverse Shell: While establishing a reverse shell provides immediate access, it typically does not survive a system reboot unless coupled with another persistence mechanism.

Process Injection: Injecting a malicious process into another running process can provide stealthy access but may not persist through reboots.

Credential Dumping: Dumping credentials allows for re-access by using stolen credentials, but it does not ensure automatic access upon reboot.

Creating a Scheduled Task:

On Windows, the schtasks command can be used to create scheduled tasks. For example:

schtasks /create /tn 'Persistence' /tr 'C:\path\to\malicious.exe' /sc onlogon /ru SYSTEM

On Linux, a cron job can be created by editing the crontab:

(crontab -l; echo '@reboot /path/to/malicious.sh') | crontab -

Pentest

Reference:

Maintaining persistence is a key objective in post-exploitation. Scheduled tasks (Windows Task Scheduler) and cron jobs (Linux) are commonly used techniques.

Reference to real-world scenarios include creating scheduled tasks to execute malware, keyloggers, or reverse shells automatically on system startup.

By creating a scheduled task, the penetration tester ensures that their access method (e.g., reverse shell, malware) is executed automatically whenever the system reboots, providing reliable persistence.

In a file stored in an unprotected source code repository, a penetration tester discovers the following line of code:

<a target='_blank' href='mailto:[email protected]'>sshpass -p donotchange ssh [email protected]</a>

Which of the following should the tester attempt to do next to take advantage of this information? (Select two).

A.
Use Nmap to identify all the SSH systems active on the network.
A.
Use Nmap to identify all the SSH systems active on the network.
Answers
B.
Take a screen capture of the source code repository for documentation purposes.
B.
Take a screen capture of the source code repository for documentation purposes.
Answers
C.
Investigate to find whether other files containing embedded passwords are in the code repository.
C.
Investigate to find whether other files containing embedded passwords are in the code repository.
Answers
D.
Confirm whether the server 192.168.6.14 is up by sending ICMP probes.
D.
Confirm whether the server 192.168.6.14 is up by sending ICMP probes.
Answers
E.
Run a password-spraying attack with Hydra against all the SSH servers.
E.
Run a password-spraying attack with Hydra against all the SSH servers.
Answers
F.
Use an external exploit through Metasploit to compromise host 192.168.6.14.
F.
Use an external exploit through Metasploit to compromise host 192.168.6.14.
Answers
Suggested answer: B, C

Explanation:

When a penetration tester discovers hard-coded credentials in a file within an unprotected source code repository, the next steps should focus on documentation and further investigation to identify additional security issues.

Taking a Screen Capture (Option B):

Documentation: It is essential to document the finding for the final report. A screen capture provides concrete evidence of the discovered hard-coded credentials.

Audit Trail: This ensures that there is a record of the vulnerability and can be used to communicate the issue to stakeholders, such as the development team or the client.

Investigating for Other Embedded Passwords (Option C):

Thorough Search: Finding one hard-coded password suggests there might be others. A thorough investigation can reveal additional credentials, which could further compromise the security of the system.

Automation Tools: Tools like truffleHog, git-secrets, and grep can be used to scan the repository for other instances of hard-coded secrets.

Pentest

Reference:

Initial Discovery: Discovering hard-coded credentials often occurs during source code review or automated scanning of repositories.

Documentation: Keeping detailed records of all findings is a critical part of the penetration testing process. This ensures that all discovered vulnerabilities are reported accurately and comprehensively.

Further Investigation: After finding a hard-coded credential, it is best practice to look for other security issues within the same repository. This might include other credentials, API keys, or sensitive information.

Steps to Perform:

Take a Screen Capture:

Use a screenshot tool to capture the evidence of the hard-coded credentials. Ensure the capture includes the context, such as the file path and relevant code lines.

Investigate Further:

Use tools and manual inspection to search for other embedded passwords.

Commands such as grep can be helpful:

grep -r 'password' /path/to/repository

Tools like truffleHog can search for high entropy strings indicative of secrets:

trufflehog --regex --entropy=True /path/to/repository

By documenting the finding and investigating further, the penetration tester ensures a comprehensive assessment of the repository, identifying and mitigating potential security risks effectively.

Total 120 questions
Go to page: of 12