Free CompTIA PT0-002 Exam Actual Questions

The questions for PT0-002 were last updated On Mar 22, 2025

At ValidExamDumps, we consistently monitor updates to the CompTIA PT0-002 exam questions by CompTIA. Whenever our team identifies changes in the exam questions,exam objectives, exam focus areas or in exam requirements, We immediately update our exam questions for both PDF and online practice exams. This commitment ensures our customers always have access to the most current and accurate questions. By preparing with these actual questions, our customers can successfully pass the CompTIA PenTest+ Certification Exam exam on their first attempt without needing additional materials or study guides.

Other certification materials providers often include outdated or removed questions by CompTIA in their CompTIA PT0-002 exam. These outdated questions lead to customers failing their CompTIA PenTest+ Certification Exam exam. In contrast, we ensure our questions bank includes only precise and up-to-date questions, guaranteeing their presence in your actual exam. Our main priority is your success in the CompTIA PT0-002 exam, not profiting from selling obsolete exam questions in PDF or Online Practice Test.

 

Question No. 1

A penetration tester is reviewing the logs of a proxy server and discovers the following URLs:

https://test.comptia.com/profile.php?userid=1546

https://test.cpmptia.com/profile.php?userid=5482

https://test.comptia.com/profile.php?userid=3618

Which of the following types of vulnerabilities should be remediated?

Show Answer Hide Answer
Correct Answer: A

Insecure Direct Object Reference (IDOR) occur when an application provides direct access to objects based on user-supplied input. In the provided URLs, the userid parameter is directly referenced, which can allow attackers to manipulate these references to access unauthorized data. This vulnerability can lead to unauthorized access to other users' profiles by simply changing the userid parameter value. The other vulnerabilities listed (Improper error handling, Race condition, Weak or default configurations) do not directly relate to the issue demonstrated by the URLs.


Question No. 2

During a web application test, a penetration tester was able to navigate to https://company.com and view all links on the web page. After manually reviewing the pages, the tester used a web scanner to automate the search for vulnerabilities. When returning to the web application, the following message appeared in the browser: unauthorized to view this page. Which of the following BEST explains what occurred?

Show Answer Hide Answer
Correct Answer: B

The most likely explanation for what occurred is that the tester IP was blocked by the web server. The web server may have detected the web scanner as a malicious or suspicious activity and blocked the tester's IP address from accessing the web application. This could result in an unauthorized to view this page message in the browser.


Question No. 3

A penetration tester gains access to a system and establishes persistence, and then runs the following commands:

cat /dev/null > temp

touch --r .bash_history temp

mv temp .bash_history

Which of the following actions is the tester MOST likely performing?

Show Answer Hide Answer
Correct Answer: C

The commands are used to clear the Bash history file of the current user, which records the commands entered in the terminal. The first command redirects /dev/null (a special file that discards any data written to it) to temp, which creates an empty file named temp. The second command changes the timestamp of temp to match that of .bash_history (the hidden file that stores the Bash history). The third command renames temp to .bash_history, which overwrites the original file with an empty one. This effectively erases any trace of the commands executed by the user.


Question No. 4

A penetration tester is assessing a wireless network. Although monitoring the correct channel and SSID, the tester is unable to capture a handshake between the clients and the AP. Which of the following attacks is the MOST effective to allow the penetration tester to capture a handshake?

Show Answer Hide Answer
Correct Answer: B

Deauth will make the client connect again


Question No. 5

In Java and C/C++, variable initialization is critical because:

Show Answer Hide Answer
Correct Answer: A

Variable initialization is the process of assigning a value to a variable at the time of declaration. In Java and C/C++, variable initialization is critical because if a variable is not initialized, it may contain a garbage value that is unpredictable and may lead to erroneous results or runtime errors when the variable is used later in the program. For example, if a variable is used in a mathematical expression or a conditional statement, the outcome may depend on the value of the variable. If the variable is not initialized, the outcome may be different each time the program is run, or the program may crash due to an invalid operation. Therefore, it is a good practice to always initialize variables before using them, or to check if they have been initialized before using them123. Reference:

* Different Ways to Initialize a Variable in C++, GeeksforGeeks article by Anshul Aggarwal

* Static variable initialization?, Stack Overflow answer by Pawe Hajdan

* A Guide to Java Initialization, Baeldung article by Eugen Paraschiv