Topic · 16 of 55 questions freeTools and Code Analysis
Question 1Choose 1
While conducting a peer review for a recent assessment, a penetration tester finds the debugging mode is still enabled for the production system. Which of the following is most likely responsible for this observation?
Correct answer:
A. Configuration changes were not reverted.
Explanation
The scenario describes a finding during a peer review after an assessment. The key detail is that a security misconfiguration (debugging mode enabled) exists on the production system.
During a penetration test, it is common practice for the testers to request or for the client to implement temporary configuration changes to facilitate testing. This might include enabling debug logging to gather more detailed error information.
The standard procedure after testing is complete is to revert all temporary changes to restore the system to its original, hardened state. The fact that debugging mode is still enabled indicates that this crucial cleanup step was missed. The changes made for the test were not reverted, leaving the production system in a less secure state.
Why the Other Options Are Incorrect
B. A full backup restoration is required for the server.
This is an extreme measure and is not a standard part of post-penetration test cleanup. Reverting specific configuration changes is a targeted and efficient process. A full backup restoration would imply a catastrophic system compromise, which is not indicated here.
C. The penetration test was not completed on time.
While running over time might cause a rushed cleanup, it is not the direct cause of the debugging mode being enabled. The root cause is the failure to revert the change, regardless of the reason.
D. The penetration tester was locked out of the system.
This might prevent the tester from reverting the changes themselves, but it would not prevent the client's system administrators from doing so. The responsibility for the final state of the production system ultimately lies with the system owner. This observation points to a failure in the handover and cleanup process, not just a tester being locked out.
Reference
This falls under the Post-Engagement Cleanup phase of a penetration test. Professional standards, such as those outlined in the PenTest+ exam objectives (Domain 5.0: Reporting and Communication), emphasize the importance of returning the client's environment to its pre-test state. Leaving debugging enabled is a common real-world oversight that creates a significant security risk.
Question 2Choose 1
A penetration tester wants to create a malicious QR code to assist with a physical security assessment. Which of the following tools has the built-in functionality most likely needed for this task?
Correct answer:
A. BeEF
Explanation
The goal is to create a malicious QR code for a physical security assessment. A QR code is essentially a way to encode a URL or other data that a device (like a smartphone) will automatically act upon when scanned.
BeEF (The Browser Exploitation Framework) is specifically designed to hook web browsers and launch further attacks from there. Its core functionality is to generate a malicious JavaScript hook (a "beef hook") that, when executed by a browser, gives the attacker control over the browser.
To use BeEF in a QR code attack, a penetration tester would:
Set up the BeEF server.
Generate the unique URL for the BeEF hook.
Encode that URL into a QR code using any standard QR code generator.
When a person scans the QR code with their phone, their browser will open the BeEF hook page, and their browser becomes "hooked." The tester can then use BeEF's numerous modules to perform further reconnaissance and attacks against the phone's browser.
This built-in functionality for browser hooking and control makes BeEF the ideal tool for this task.
Why the Other Options Are Incorrect
B. John the Ripper:
This is a password-cracking tool. It is used offline to crack hashes recovered from a system. It has no functionality related to generating web-based attacks or interacting with QR codes.
C. ZAP (OWASP ZAP):
This is a web application vulnerability scanner and proxy. It is used for finding flaws in websites. While it can be used to test for vulnerabilities that might be exploited via a QR code (like XSS), it does not have built-in functionality to create malicious payloads for social engineering in the way BeEF does.
D. Evilginx:
This is a tool for advanced phishing attacks that can bypass two-factor authentication by acting as a reverse proxy. It's used for stealing credentials from specific sites (like Office 365 or Gmail). While powerful, it is not designed for the general-purpose browser hooking that a QR code attack would leverage. Its setup is more complex and targeted than the simple hook generation of BeEF.
Reference
Using QR codes to deliver BeEF hooks is a well-known social engineering technique in physical penetration testing. It falls under the umbrella of client-side attacks. The PenTest+ exam objectives cover social engineering tools and methods, and BeEF is a primary tool in this category for exploiting web browsers.
Question 3Choose 1
A penetration tester gains access to a domain server and wants to enumerate the systems within the domain. Which of the following tools would provide the best oversight of domains?
Correct answer:
C. Nmap
Explanation:
Nmap (Network Mapper) is the best tool for enumerating systems within a domain because it is specifically designed for network discovery and mapping. It can scan networks to identify active hosts, services, operating systems, and other network characteristics. In the context of a penetration test, Nmap can be used to discover systems within a domain by scanning IP ranges or using specific scripts (e.g., SMB or DNS-related scripts) to enumerate domain-joined systems, services, and configurations.
Why Nmap?
Nmap supports a wide range of scanning techniques, such as TCP, UDP, and SYN scans, which help identify live hosts and open ports.
It includes the Nmap Scripting Engine (NSE), which has scripts like smb-enum-domains or dns-zone-transfer that can enumerate domain information, such as hosts, services, and even domain controllers.
Nmap is versatile, efficient, and widely used in penetration testing for network reconnaissance, making it ideal for gaining oversight of systems within a domain.
Why not the other options?
A. Netcat:
Netcat is a versatile networking tool for tasks like port scanning, banner grabbing, or establishing connections, but it lacks the advanced enumeration capabilities of Nmap. It’s not designed for comprehensive domain enumeration and requires manual effort for each connection.
B. Wireshark:
Wireshark is a packet analyzer used for capturing and analyzing network traffic. While it can provide insights into domain-related traffic (e.g., DNS or SMB packets), it’s not a proactive enumeration tool and requires existing traffic to analyze, making it less suitable for this task.
D. Responder:
Responder is a tool for network poisoning attacks (e.g., LLMNR, NBT-NS, or WPAD poisoning) to capture credentials or relay authentication. While it can help in certain domain attack scenarios, it’s not designed for broad system enumeration within a domain.
References:
CompTIA PenTest+ (PT0-003) objectives emphasize reconnaissance and enumeration, with tools like Nmap being central to network discovery (Domain 2: Information Gathering and Vulnerability Scanning).
Nmap official documentation: https://nmap.org/book/man.html
Practical penetration testing guides often highlight Nmap for network enumeration due to its flexibility and scripting capabilities.
Question 4Choose 1
Before starting an assessment, a penetration tester needs to scan a Class B IPv4 network for open ports in a short amount of time. Which of the following is the best tool for this task?
Correct answer:
B. masscan
Explanation:
To scan a Class B IPv4 network (which includes up to 65,536 IP addresses, e.g., 172.16.0.0/16) for open ports in a short amount of time, the penetration tester needs a tool optimized for speed and scalability across large network ranges. Let's evaluate the options:
A. Burp Suite: Description:
Burp Suite is primarily a web application testing tool used for intercepting, analyzing, and manipulating HTTP/HTTPS traffic. It is not designed for network scanning or port enumeration.
Why Incorrect:
Burp Suite lacks the capability to perform fast port scanning across a large network like a Class B IPv4 range, making it unsuitable for this task.
B. masscan: Description:Masscan is an extremely fast, lightweight port scanner designed for scanning large network ranges, such as Class B networks, in minimal time. It can scan the entire internet in minutes under optimal conditions due to its asynchronous scanning capabilities.
Why Correct:
Masscan is optimized for speed, capable of scanning thousands of IPs and ports per second. It is ideal for quickly identifying open ports across a large Class B network, aligning perfectly with the requirement for a fast scan.
C. Nmap: Description:Nmap is a versatile and widely used network scanning tool that can perform port scans, service detection, and OS fingerprinting. It supports scanning large network ranges but is generally slower than masscan due to its comprehensive feature set and synchronous scanning approach.
Why Incorrect:
While Nmap is capable of scanning a Class B network, it is not as fast as masscan for large-scale scans when time is a critical factor. Nmap prioritizes accuracy and detailed output over raw speed.
D. hping: Description:Hping is a packet crafting and analysis tool used for sending custom TCP/IP packets and testing network responses. It is not designed for large-scale port scanning.
Why Incorrect:
Hping is better suited for specific tasks like testing firewall rules or crafting packets, not for rapidly scanning an entire Class B network for open ports.
Why Masscan is the Best Choice:
Speed:
Masscan is specifically engineered for high-speed scanning, capable of handling large network ranges like a Class B network (65,536 IPs) efficiently. It uses techniques like asynchronous packet transmission to achieve scan rates of up to 10 million packets per second.
Port Scanning:
Masscan focuses on identifying open ports quickly, which matches the requirement to scan for open ports in a short amount of time.
Scalability:
Unlike Nmap, which is more feature-rich but slower for large-scale scans, masscan sacrifices some detailed functionality (like service versioning) for raw speed, making it ideal for this scenario.
References:
Masscan Documentation:
The official masscan GitHub page highlights its ability to scan large networks rapidly, including examples of scanning entire IP ranges.
CompTIA PenTest+ PT0-003 Objectives: The exam emphasizes selecting appropriate tools for network reconnaissance and port scanning, with masscan being a recognized tool for high-speed network scans.
Question 5Choose 1
A penetration tester needs to identify all vulnerable input fields on a customer website. Which of the following tools would be best suited to complete this request?
Correct answer:
A. DAST
Explanation
The correct answer is A. DAST (Dynamic Application Security Testing) because it is designed to find vulnerabilities by interacting with a running application from the outside, just like an attacker would. This makes it ideal for testing input fields.
How it works:
A DAST tool (e.g., OWASP ZAP, Burp Suite Scanner) automatically crawls the website to discover all pages, forms, and input fields. It then performs attacks against these inputs, sending various payloads to test for vulnerabilities like SQL Injection, Cross-Site Scripting (XSS), Command Injection, and others. It analyzes the application's responses to determine if the attack was successful.
Why it's best for this task:
The goal is to find vulnerable input fields on a live, deployed website. DAST operates against this running instance without needing access to the source code, perfectly matching the scenario.
Reference to Exam Objective:
This falls under the "Information Gathering and Vulnerability Scanning" domain. Understanding the different types of application security testing tools and when to use them is a key competency.
Analysis of Incorrect Options
B. SAST (Static Application Security Testing):
SAST tools (e.g., SonarQube, Checkmarx) analyze an application's source code, bytecode, or binary code for potential vulnerabilities without running the program. While excellent for finding code-level flaws early in the development lifecycle, it would not be used by a penetration tester against a customer's deployed website, as they typically would not have access to the source code.
C. IAST (Interactive Application Security Testing):
IAST tools combine elements of SAST and DAST. They run inside the application (e.g., via an agent) while it is being tested (e.g., by a DAST tool or manual tester) and analyze the code behavior in real-time. While powerful, IAST requires instrumentation of the application, which is typically a development-level activity. A third-party penetration tester is unlikely to have the ability to install IAST agents on a customer's production or staging website.
D. SCA (Software Composition Analysis):
SCA tools (e.g., Snyk, Black Duck) are used to scan an application's dependencies (libraries, frameworks) to identify known vulnerabilities in those third-party components. For example, it would flag if the website uses a version of the jQuery library with a known security flaw. It does not scan the website's custom input fields for vulnerabilities like SQL Injection or XSS.
In summary, DAST is the correct category of tool for a penetration tester to use when the task is to find vulnerabilities in the user-facing components (like input fields) of a live web application.
Question 6Choose 1
During a security audit, a penetration tester wants to run a process to gather information about a target network's domain structure and associated IP addresses. Which of the following tools should the tester use?
Correct answer:
A. Dnsenum
Explanation:
Dnsenum is a tool specifically designed to gather information about DNS, including domain structure and associated IP addresses.
Here’s why option A is correct:
Dnsenum: This tool is used for DNS enumeration and can gather information about a domain’s DNS records, subdomains, IP addresses, and other related information. It is highly effective for mapping out a target network’s domain structure.
Nmap: While a versatile network scanning tool, Nmap is more focused on port scanning and service detection rather than detailed DNS enumeration.
Netcat: This is a network utility for reading and writing data across network connections, not for DNS enumeration.
Wireshark: This is a network protocol analyzer used for capturing and analyzing network traffic but not specifically for gathering DNS information.
References from Pentest:
Anubis HTB: Shows the importance of using DNS enumeration tools like Dnsenum to gather detailed information about the target’s domain structure.
Forge HTB: Demonstrates the process of using specialized tools to collect DNS and IP information efficiently.
Question 7Choose 1
A penetration tester needs to test a very large number of URLs for public access. Given the following code snippet:1) import request 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?
Correct answer:
A. The condition on line 6
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 References:
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.
Question 8Choose 1
During a penetration test, the tester gains full access to the application's source code. The application repository includes thousands of code files. Given that the assessment timeline is very short, which of the following approaches would allow the tester to identify hard-coded credentials most effectively?
Correct answer:
A. Run TruffleHog against a local clone of the application
Explanation:
When a penetration tester has access to the full source code repository containing thousands of files and the assessment timeline is very short, the most effective and efficient method to identify hard-coded credentials (such as API keys, passwords, tokens, database strings, etc.) is to use an automated secrets scanning tool specifically designed for this purpose.
TruffleHog is a popular, open-source secrets scanning tool that excels at exactly this scenario:
It scans entire Git repositories (including commit history) for hundreds of types of secrets using regex patterns and entropy detection.
It verifies many secrets (e.g., checks if an AWS key is active) to reduce false positives.
It runs very quickly even on large codebases.
It is explicitly covered in CompTIA PenTest+ PT0-003 under vulnerability discovery tools, secrets scanning, and code analysis techniques.
Given the time constraint and scale (thousands of files), automation is essential.
Why not the other options?
B. Scan the live web application using Nikto
Nikto is a web server vulnerability scanner that looks for misconfigurations, outdated software, dangerous files, etc. on a running web application. It does not analyze source code and cannot reliably find hard-coded credentials buried in the codebase (especially if they are not exposed in responses or logs). → Completely wrong tool for this task.
C. Perform a manual code review of the Git repository
Manual review of thousands of files is extremely time-consuming and impractical within a short timeline. Even an experienced tester would miss many secrets or take far too long. Automation is far superior here.
D. Use SCA software to scan the application source code
SCA (Software Composition Analysis) tools (e.g., OWASP Dependency-Check, Snyk, Dependabot) focus on vulnerable third-party libraries/dependencies and license issues — not on detecting hard-coded secrets or credentials in the code itself. While some modern SCA tools include basic secret scanning, the question emphasizes hard-coded credentials, and TruffleHog is the dedicated, faster, more specialized tool taught in PenTest+ for this exact purpose.
Key Reference & Learning Point
CompTIA PenTest+ PT0-003 objectives (Domain 2.0 – Information Gathering and Vulnerability Scanning / Domain 3.0 – Attacks and Exploits) include:
Tools for discovering secrets and credentials in source code.
TruffleHog is frequently highlighted in official study materials, training courses, and exam prep resources (along with tools like Gitleaks) as the go-to for repository secret scanning.
Industry standard: TruffleHog (by Truffle Security) is widely recognized for quickly finding leaked credentials in code repos, even scanning historical commits.
Bottom line: With a massive repo and very limited time → clone it locally and run TruffleHog — that is the fastest, most effective way to uncover hard-coded credentials during a pentest.
Question 9Choose 1
A penetration tester performs an assessment on the target company's Kubernetes cluster using kube-hunter. Which of the following types of vulnerabilities could be detected with the tool?
Correct answer:
B. Weaknesses and misconfigurations in the Kubernetes cluster
Explanation:
Specialized Focus: kube-hunter is an open-source tool specifically engineered to hunt for security issues in Kubernetes clusters. It scans for common configuration errors that could lead to a cluster compromise.
Comprehensive Scanning: It identifies weaknesses such as an exposed API server, unauthenticated access to the Kubelet API, and insecure etcd configurations. It looks at the orchestration layer itself rather than just the applications or the underlying network.
Why other options are incorrect
❌ A. Network configuration errors in Kubernetes services
While kube-hunter might find an exposed port, its primary goal is not general network troubleshooting or VPC-level configuration; tools like Kube-bench or specialized network mappers are more suited for deep service-mesh networking audits.
❌ C. Application deployment issues in Kubernetes
kube-hunter focuses on the infrastructure/orchestration layer. It does not analyze the logic, code, or deployment health of the specific microservices/applications running inside the pods.
❌ D. Security vulnerabilities specific to Docker containers
Tools like Trivy, Clair, or Snyk are used to scan container images for known vulnerabilities (CVEs). kube-hunter focuses on the Kubernetes environment that manages those containers, not the contents of the Docker images themselves.
Question 10Choose 1
During a penetration test, a junior tester uses Hunter.io for an assessment and plans to review the information that will be collected. Which of the following describes the information the junior tester will receive from the Hunter.io tool?
Correct answer:
A. A collection of email addresses for the target domain that is available on multiple sources on the internet
Explanation:
This question asks what information the junior tester will receive from Hunter.io.
Understanding Hunter.io:
Hunter.io (formerly called Email Hunter) is a specialized OSINT (Open-Source Intelligence) tool focused on email address discovery. It scans the internet and aggregates email addresses associated with a specific domain from various public sources, including:
Website pages
Public social media profiles
PDF documents
Online articles and press releases
GitHub repositories
What Hunter.io provides:
Hunter.io returns a list of email addresses for the target domain, often including:
The email address
The source URL where it was found
The likely name of the person
The confidence score (how likely it is to be valid)
This information is valuable for social engineering campaigns, password spraying, and phishing assessments.
Analysis of options: A. A collection of email addresses for the target domain that is available on multiple sources on the internet: This accurately describes what Hunter.io does. Correct.
B. DNS records for the target domain and subdomains: Tools like dnsrecon, dig, or SecurityTrails are used for DNS enumeration, not Hunter.io. Incorrect.
C. Data breach information about the organization: Tools like HaveIBeenPwned or Dehashed provide breach data. Hunter.io focuses on publicly available emails, not breached credentials. Incorrect.
D. Information from the target's main web page that collects usernames, metadata, and possible data exposures: This describes web scraping or tools like FOCA (for metadata), not Hunter.io. Incorrect.
Conclusion:
Hunter.io is primarily an email discovery tool that aggregates publicly available email addresses for a target domain.
Correct Answer: A. A collection of email addresses for the target domain that is available on multiple sources on the internet
Practice Like It's Exam Day
Get exam-ready with a timed PT0 003 CompTIA PenTest+ mock exam designed to match the official exam's question format, question count, and time limit.
Subtopics: Persistence mechanisms, Lateral movement,
Credential harvesting, Privilege escalation,
Pivoting and tunneling, Data exfiltration,
Covering tracks, Cleanup procedures,
Command and control (C2), Session hijacking,
Attack path documentation, Post-exploitation analysis
Master Penetration Testing with PenTest+ PT0-003
CompTIA PenTest+ PT0-003 certification validates your hands-on penetration testing and vulnerability assessment skills. Our realistic practice tests prepare you for the latest exam version, helping you develop the offensive security mindset needed for todays cybersecurity challenges.
Exam Code: PT0-003
Exam Name: CompTIA Pentest+ Exam
Certification Name: Pentest+
Certification Provider: CompTIA
Exam Questions: 85
Type of Questions: MCQs and performance-based
Exam Time: 165 minutes
Passing Score: 700
What Does the PT0-003 Exam Cover?
PT0-003 exam validates hands-on skills and knowledge in key areas such as:
Planning and Scoping — Defining test boundaries, compliance considerations, and client communication
Information Gathering and Vulnerability Scanning — Reconnaissance techniques, vulnerability identification, and analysis
Attacks and Exploits — Performing exploits against various platforms, evasion techniques, and post-exploitation activities
Reporting and Communication — Writing clear reports, recommending remediation, and presenting findings to stakeholders
Tools and Code Analysis — Using tools for scripting, automation, and analyzing scripts and code for vulnerabilities
Penetration testers seeking formal validation
Security consultants expanding service offerings
Red team members demonstrating skills
Ethical hackers pursuing career advancement
Cybersecurity analysts transitioning to offensive roles
Recommended Experience:
3-4 years of hands-on security experience
Network+ and Security+ knowledge (recommended)
Familiarity with scripting (Python, Bash, PowerShell)
These practice questions were the missing piece in my study plan!
As an aspiring penetration tester, I knew the PT0-003 exam would be challenging—but I did not realize how much hands-on, scenario-based thinking it required until I started studying. Textbook knowledge alone was not enough. That is when I discovered these PT0-003 practice questions, and they completely changed my approach. The questions mirrored real-world penetration testing workflows, from reconnaissance and vulnerability scanning to exploitation and reporting. Each scenario forced me to think like an attacker, not just memorize terms.
What stood out most were the detailed explanations, which broke down not only the correct answers but also the reasoning behind common pitfalls. I especially appreciated the focus on tools like Nmap, Metasploit, and Burp Suite, as well as the emphasis on compliance and legal considerations—topics that are critical in real engagements. By the time exam day arrived, I felt prepared to tackle even the most situational questions. This practice test didnt just help me pass—they made me a better pen tester. If you want to truly understand the material, not just scrape by, this is the resource you need.
Jordan L., Cybersecurity Consultant
The updated PenTest+ exam requires hands-on thinking about vulnerability assessment and penetration testing. Preptia.com delivered PT0-003 practice exam that challenged me on attack vectors, tool usage, and reporting. The questions were so accurate that the real exam felt familiar. Passed easily!
Daniel Foster, Cybersecurity Analyst | Chicago, IL
Hands-on penetration testing concepts became clearer through the Preptia.com mock exams for CompTIA PenTest+ (PT0-003). The scenario-based exam questions covered vulnerability assessment and ethical hacking techniques thoroughly.
Arman Qureshi | Saudi Arabia