ExamGecko
Home Home / CompTIA / PT0-002

CompTIA PT0-002 Practice Test - Questions Answers, Page 40

Question list
Search
Search

List of questions

Search

Related questions











A penetration tester captures SMB network traffic and discovers that users are mistyping the name of a fileshare server. This causes the workstations to send out requests attempting to resolve the fileshare server's name. Which of the following is the best way for a penetration tester to exploit this situation?

A.
Relay the traffic to the real file server and steal documents as they pass through.
A.
Relay the traffic to the real file server and steal documents as they pass through.
Answers
B.
Host a malicious file to compromise the workstation.
B.
Host a malicious file to compromise the workstation.
Answers
C.
Reply to the broadcasts with a fake IP address to deny access to the real file server.
C.
Reply to the broadcasts with a fake IP address to deny access to the real file server.
Answers
D.
Respond to the requests with the tester's IP address and steal authentication credentials.
D.
Respond to the requests with the tester's IP address and steal authentication credentials.
Answers
Suggested answer: D

Explanation:

In the scenario where users are mistyping the name of a fileshare server, leading to broadcast requests, the most effective exploitation strategy would be for the penetration tester to respond to these requests with their own IP address (D) and set up a service to capture authentication credentials. This technique is known as a 'Man-in-the-Middle' (MitM) attack, where the attacker intercepts communication between two parties. In this case, the tester can exploit the misdirected requests to potentially capture sensitive information such as usernames and passwords.

During a security assessment of a web application, a penetration tester was able to generate the following application response:

Unclosed quotation mark after the character string Incorrect syntax near '.

Which of the following is the most probable finding?

A.
SQL injection
A.
SQL injection
Answers
B.
Cross-site scripting
B.
Cross-site scripting
Answers
C.
Business logic flaw
C.
Business logic flaw
Answers
D.
Race condition
D.
Race condition
Answers
Suggested answer: A

Explanation:

The error message 'Unclosed quotation mark after the character string Incorrect syntax near '.' suggests that the application is vulnerable to SQL Injection (A). This type of vulnerability occurs when an attacker is able to inject malicious SQL queries into an application's database query. The error message indicates that the application's input handling allows for the manipulation of the underlying SQL queries, which can lead to unauthorized data access, data modification, and other database-related attacks.

A penetration tester uses Hashcat to crack hashes discovered during a penetration test and obtains the following output:

ad09cd16529b5f5a40a3e15344e57649f4a43a267a97f008af01af803603c4c8 : Summer2023 !!

7945bb2bb08731fc8d57680ffa4aefec91c784d231de029c610b778eda5ef48b:p@ssWord123

ea88ceab69cb2fb8bdcf9ef4df884af219fffbffab473ec13f20326dc6f84d13: Love-You999

Which of the following is the best way to remediate the penetration tester's discovery?

A.
Requiring passwords to follow complexity rules
A.
Requiring passwords to follow complexity rules
Answers
B.
Implementing a blocklist of known bad passwords
B.
Implementing a blocklist of known bad passwords
Answers
C.
Setting the minimum password length to ten characters
C.
Setting the minimum password length to ten characters
Answers
D.
Encrypting the passwords with a stronger algorithm
D.
Encrypting the passwords with a stronger algorithm
Answers
Suggested answer: B

Explanation:

The penetration tester's discovery of passwords vulnerable to hash cracking suggests a lack of robust password policies within the organization. Among the options provided, implementing a blocklist of known bad passwords is the most effective immediate remediation. This measure would prevent users from setting passwords that are easily guessable or commonly used, which are susceptible to hash cracking tools like Hashcat.

Requiring passwords to follow complexity rules (Option A) can be helpful, but attackers can still crack complex passwords if they are common or have been exposed in previous breaches. Setting a minimum password length (Option C) is a good practice, but length alone does not ensure a password's strength against hash cracking techniques. Encrypting passwords with a stronger algorithm (Option D) is a valid long-term strategy but would not prevent users from choosing weak passwords that could be easily guessed before hash cracking is even necessary.

Therefore, a blocklist addresses the specific vulnerability exposed by the penetration tester---users setting weak passwords that can be easily cracked. It's also worth noting that the best practice is a combination of strong, enforced password policies, user education, and the use of multi-factor authentication to enhance security further.

Which of the following tools provides Python classes for interacting with network protocols?

A.
Responder
A.
Responder
Answers
B.
Impacket
B.
Impacket
Answers
C.
Empire
C.
Empire
Answers
D.
PowerSploit
D.
PowerSploit
Answers
Suggested answer: B

Explanation:

Impacket is a collection of Python classes focused on providing access to network protocols. It is designed for low-level protocol access and crafted to perform various networking tasks from Python scripts. This toolkit is widely used in penetration testing for creating and decoding network protocols and for crafting and injecting packets into the network. Impacket supports a myriad of protocols like IP, TCP, UDP, ICMP, SMB, MSRPC, NTP, and more. With its vast array of functionalities, Impacket is very useful in protocol testing and attacks, like the ones a penetration tester would conduct.

Responder, on the other hand, is a LLMNR, NBT-NS, and MDNS poisoner that can be used for capturing NetNTLM hashes. Empire is a post-exploitation framework that allows the use of PowerShell for offensive security and PowerSploit is a collection of Microsoft PowerShell modules that can be used to aid penetration testers during all phases of an assessment.

Given these descriptions, Impacket is the tool that fits the context of the question due to its direct interaction with network protocols through Python.

After successfully compromising a remote host, a security consultant notices an endpoint protection software is running on the host. Which of the following commands would be best for the consultant to use to terminate the protection software and its child processes?

A.
taskkill /PID <PID> /T /F
A.
taskkill /PID <PID> /T /F
Answers
B.
taskkill /PID <PID> /IM /F
B.
taskkill /PID <PID> /IM /F
Answers
C.
taskkill /PID <PID> /S /U
C.
taskkill /PID <PID> /S /U
Answers
D.
taskkill /PID <PID> /F /P
D.
taskkill /PID <PID> /F /P
Answers
Suggested answer: A

Explanation:

The taskkill command is used in Windows to terminate tasks by process ID (PID) or image name (IM). The correct command to terminate a specified process and any child processes which were started by it uses the /T flag, and the /F flag is used to force terminate the process. Therefore, taskkill /PID <PID> /T /F is the correct syntax to terminate the endpoint protection software and its child processes.

The other options listed are either incorrect syntax or do not accomplish the task of terminating the child processes:

* /IM specifies the image name but is not necessary when using /PID.

* /S specifies the remote system to connect to and /U specifies the user context under which the command should execute, neither of which are relevant to terminating processes.

* There is no /P flag in the taskkill command.



An organization's Chief Information Security Officer debates the validity of a critical finding from a penetration assessment that was completed six months ago. Which of the following post-report delivery activities would have most likely prevented this scenario?

A.
Client acceptance
A.
Client acceptance
Answers
B.
Data destruction process
B.
Data destruction process
Answers
C.
Attestation of findings
C.
Attestation of findings
Answers
D.
Lessons learned
D.
Lessons learned
Answers
Suggested answer: A

Explanation:

Client acceptance (A) is a critical post-report delivery activity that involves the client formally accepting the findings and conclusions of a penetration assessment report. This process usually includes a review of the findings by the client, discussions about the impact, and agreement on the accuracy and relevance of the reported vulnerabilities and issues. Ensuring client acceptance soon after the delivery of the report can prevent scenarios where the validity of findings is debated long after the assessment, as in the case described.

Data destruction process (B), attestation of findings (C), and lessons learned (D) are also important aspects of a penetration testing engagement, but they do not directly address the issue of the client disputing the findings well after the report has been delivered. Client acceptance ensures both parties are in agreement on the outcomes of the assessment, minimizing disputes about the findings later on.

A penetration testing firm wants to hire three additional consultants to support a newly signed long-term contract with a major customer. The following is a summary of candidate background checks:

Which of the following candidates should most likely be excluded from consideration?

A.
Candidate 1
A.
Candidate 1
Answers
B.
Candidate 2
B.
Candidate 2
Answers
C.
Candidate 3
C.
Candidate 3
Answers
D.
Candidate 4
D.
Candidate 4
Answers
Suggested answer: B

Explanation:

In the context of penetration testing or cybersecurity, hiring a consultant with a background in unauthorized system access could present both risks and benefits. From a risk management perspective, Candidate 2's history of unauthorized system access is a significant red flag. Such past behavior indicates a willingness to operate outside of legal and ethical boundaries, which could pose a risk to the firm and its clients, especially in a role that requires trust and adherence to legal guidelines.

However, the very skills that enabled unauthorized access might also provide the firm with deep insights into hacker methodologies, potentially enhancing the firm's capability to secure systems against such intrusions. It is a common practice in the cybersecurity industry to employ individuals with a history of hacking in roles where they can contribute positively, known as 'ethical hacking' or 'white hat' roles.

Nonetheless, given the legal and ethical responsibilities inherent in cybersecurity work, Candidate 2's past criminal charge of unauthorized system access is the most pertinent to the role and poses the most direct risk to the firm's operations and reputation. It would be crucial for the firm to conduct a thorough risk assessment, including the nature of the unauthorized access, the candidate's subsequent actions, rehabilitation, and current capabilities, before making a hiring decision.

From the provided information, it appears that Candidate 2 should most likely be excluded from consideration due to the direct relevance of their criminal charges to the position in question. Without evidence of rehabilitation and a clear demonstration of ethical standards, the liability risks might outweigh the potential benefits to the firm.

During a security assessment, a penetration tester decides to write the following Python script: import requests

x= ['OPTIONS', 'TRACE', 'TEST'l

for y in x;

z - requests.request(y, 'http://server.net')

print(y, z.status_code, z.reason)

Which of the following is the penetration tester trying to accomplish? (Select two).

A.
Web server denial of service
A.
Web server denial of service
Answers
B.
HTTP methods availability
B.
HTTP methods availability
Answers
C.
'Web application firewall detection
C.
'Web application firewall detection
Answers
D.
'Web server fingerprinting
D.
'Web server fingerprinting
Answers
E.
Web server error handling
E.
Web server error handling
Answers
F.
Web server banner grabbing
F.
Web server banner grabbing
Answers
Suggested answer: B, D

Explanation:

The Python script mentioned in the question is designed to send HTTP requests using different methods ('OPTIONS', 'TRACE', 'TEST') to a specified URL ('http://server.net') and print out the method used along with the status code and reason for each response. The key objectives of this script are:

HTTP Methods Availability (B): By cycling through different HTTP methods, the script checks which methods are supported by the web server. This can reveal potential vulnerabilities, as certain methods like 'TRACE' can be exploited in certain situations (e.g., Cross Site Tracing (XST) attacks).

Web Server Fingerprinting (D): The response to different HTTP methods can provide clues about the web server's software and configuration, contributing to server fingerprinting. This information can be used to tailor further attacks or understand the security posture of the server.

This script is not designed for causing a denial of service, detecting web application firewalls, examining error handling, or performing banner grabbing directly, which excludes options A, C, E, and F.

Which of the following documents should be consulted if a client has an issue accepting a penetration test report that was provided?

A.
Rules of engagement
A.
Rules of engagement
Answers
B.
Signed authorization letter
B.
Signed authorization letter
Answers
C.
Statement of work
C.
Statement of work
Answers
D.
Non-disclosure agreement
D.
Non-disclosure agreement
Answers
Suggested answer: A

Explanation:

The Rules of Engagement (RoE) document is crucial when there's a dispute or issue with accepting a penetration test report. The RoE outlines the scope, methods, timing, legal considerations, and objectives of a penetration test. It serves as a guideline for both the client and the testing team on what is expected and permissible during the assessment. If there are issues with the report, referring back to the agreed-upon RoE can clarify whether the test was conducted within the agreed parameters and help resolve any disputes.

The signed authorization letter, statement of work, and non-disclosure agreement are also important documents but are more related to the permission, scope of work, and confidentiality aspects of the engagement, respectively, rather than the specifics of how the test was to be conducted, which is what the RoE covers.

After obtaining a reverse shell connection, a penetration tester runs the following command: www-data@server!2:sudo -1

User www-data may run the following commands on serverl2: (root) NOPASSWD: /usr/bin/vi

Which of the following is the fastest way to escalate privileges on this server?

A.
Editing the file /etc/passwd to add a new user with uid 0
A.
Editing the file /etc/passwd to add a new user with uid 0
Answers
B.
Creating a Bash script, saving it on the /tmp folder, and then running it
B.
Creating a Bash script, saving it on the /tmp folder, and then running it
Answers
C.
Executing the command sudo vi -c ' Jbash'
C.
Executing the command sudo vi -c ' Jbash'
Answers
D.
Editing the file/etc/sudoers to allow any command
D.
Editing the file/etc/sudoers to allow any command
Answers
Suggested answer: C

Explanation:

When the penetration tester has NOPASSWD privileges to run vi as root, the quickest way to escalate privileges is to leverage vi to execute a shell. The command sudo vi -c ':!bash' opens vi as the root user and immediately spawns a shell within vi. This method is fast and effective because vi (or vim) has the capability to run shell commands.

Executing sudo vi -c ':!bash' will open vi and then immediately run the :!bash command, which spawns a Bash shell with root privileges.

GTFOBins - vi

Example from penetration testing reports where vi is used to escalate privileges: Writeup.

Total 422 questions
Go to page: of 43