Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

CompTIA PT0-002 Exam

Certification Provider: CompTIA
Exam Name: CompTIA PenTest+ Certification Exam
Number of questions in our database: 388
Exam Version: Apr. 16, 2024
PT0-002 Exam Official Topics:
  • Topic 1: Single Topic
Disscuss CompTIA PT0-002 Topics, Questions or Ask Anything Related

Currently there are no comments in this discussion, be the first to comment!

Free CompTIA PT0-002 Exam Actual Questions

The questions for PT0-002 were last updated On Apr. 16, 2024

Question #1

During an engagement, a penetration tester was able to upload to a server a PHP file with the following content:

Which of the following commands should the penetration tester run to successfully achieve RCE?

Reveal Solution Hide Solution
Correct Answer: A

The PHP file uploaded by the penetration tester allows for Remote Code Execution (RCE) by executing the command supplied through the cmd POST parameter. To exploit this, the penetration tester needs to send a POST request to the PHP file with the command they want to execute.

Among the given options, Option A is the most suitable for achieving RCE:

It uses Python's requests library to send a POST request, which is appropriate because the PHP script expects data through the POST method.

The data parameter in the requests.post function is correctly formatted as a dictionary, which is the expected format for sending form data in POST requests. It includes the key cmd with the value id, which is a common command used to display the current user ID and group ID.

The only minor issue with Option A is that it prints the entire response object, which includes not just the response content but also metadata like status code and headers. To print just the response content (which would include the output of the id command), appending .text to the requests.post call would be more precise, but this is a small detail and does not affect the execution of the command.

The other options have various issues:

Option B is close but has a syntax error in the data argument. It uses parentheses () instead of curly braces {} for the dictionary, and also lacks the .text at the end to print the response content.

Options C and D use the requests.get method, which is not suitable in this scenario because the PHP script is expecting data through the POST method, not the GET method. Additionally, Option D has a syntax error similar to Option B.


Question #2

Which of the following best explains why communication is a vital phase of a penetration test?

Reveal Solution Hide Solution
Correct Answer: A

Communication is a vital phase of a penetration test to ensure all parties involved are aware of the test's progress, findings, and any potential impact on business operations. Discussing situational awareness involves sharing real-time insights about the security posture, any vulnerabilities found, and potential risks. This enables the organization to make informed decisions, mitigate risks promptly, and ensure the test aligns with business objectives and constraints.


Question #3

Which of the following is the most common vulnerability associated with loT devices that are directly connected to the internet?

Reveal Solution Hide Solution
Correct Answer: D

IoT devices are often shipped with default passwords, which are easily discoverable and widely known. Many users fail to change these default credentials, leaving the devices vulnerable to unauthorized access. This issue is one of the most common vulnerabilities associated with IoT devices connected directly to the internet. Attackers can exploit these default passwords to gain control over the devices, potentially leading to a range of malicious activities, including the recruitment of the devices into botnets for Distributed Denial of Service (DDoS) attacks, data breaches, or other cybercriminal activities.


Question #4

A penetration tester is enumerating shares and receives the following output:

Which of the following should the penetration tester enumerate next?

Reveal Solution Hide Solution
Correct Answer: A

The output displayed is typical of what one might see when using a tool like smbclient or enum4linux to list shared directories on a system that uses the SMB (Server Message Block) protocol. Here's a brief overview of the shared resources that have been found:

1. print$ - This share is generally used for printer drivers.

2. home - Could be a user's home directory, usually requires authentication.

3. dev - Suggests a development environment, possibly containing code, scripts, or tools that could be useful for further penetration.

4. notes - This has read and write permissions and could contain information such as user notes or documentation.

While all these shares could potentially provide valuable information, the dev share stands out for several reasons:

* Development Environment: As it seems to be a development share, it may contain scripts, tools, or code repositories which could be less secure than production environments and possibly contain sensitive information such as hardcoded credentials, configuration files, or backup files.

* Standard Names: Shares like print$ and home are common and are likely to be properly secured or to contain less sensitive information.

* Writable Share: The notes share is also interesting because it has read and write permissions, which could be exploited to upload malicious files or modify existing ones. However, the potential for finding exploitable material or sensitive information might be higher with the dev share.

In penetration testing, the goal is to find the path of least resistance that provides the highest potential for deeper access or sensitive information discovery. The dev share represents a target that could yield such information or further avenues for exploitation, making it the next logical step for enumeration.


Question #5

A penetration tester managed to exploit a vulnerability using the following payload:

IF (1=1) WAIT FOR DELAY '0:0:15'

Which of the following actions would best mitigate this type ol attack?

Reveal Solution Hide Solution
Correct Answer: B

The payload used by the penetration tester is a type of blind SQL injection attack that delays the response of the database by 15 seconds if the condition is true. This can be used to extract information from the database by asking a series of true or false questions. To prevent this type of attack, the best practice is to use parameterized queries, which separate the user input from the SQL statement and prevent the injection of malicious code. Encrypting passwords, encoding output, and sanitizing HTML are also good security measures, but they do not directly address the SQL injection vulnerability.Reference:

The Official CompTIA PenTest+ Study Guide (Exam PT0-002), Chapter 5: Attacks and Exploits, Section 5.2: Perform Network Attacks, Subsection: SQL Injection, p. 235-237

Blind SQL Injection | OWASP Foundation, Description and Examples sections

Time-Based Blind SQL Injection Attacks, Introduction and Microsoft SQL Server sections



Unlock all PT0-002 Exam Questions with Advanced Practice Test Features:
  • Select Question Types you want
  • Set your Desired Pass Percentage
  • Allocate Time (Hours : Minutes)
  • Create Multiple Practice tests with Limited Questions
  • Customer Support
Get Full Access Now

Save Cancel