CompTIA certification · Exam PT0-003

PT0-003 Mock Exam Page 2

CompTIA PenTest+

Free PT0-003 questions on Information Gathering and Vulnerability Scanning, each with the answer and an explanation.

20 questions · 37 minutes · free, no sign-up

Information Gathering and Vulnerability Scanning questions

11–20 of 23 free
Question 11 Choose 1
A penetration tester assesses a complex web application and wants to explore potential security weaknesses by searching for subdomains that might have existed in the past. Which of the following tools should the penetration tester use?
Show answerHide answer

Correct answer: C Wayback Machine

Explanation

Explanation:

The key requirement in the question is:
“searching for subdomains that might have existed in the past.”
The tester wants historical information about a web application — specifically older or forgotten subdomains that may no longer be publicly linked but could still exist or be vulnerable.

✅ C. Wayback Machine — Correct
The Wayback Machine (Internet Archive) stores historical snapshots of websites over time.
A penetration tester can use it to:

View older versions of websites
Discover previously used subdomains
Identify deprecated portals (dev, test, staging)
Find exposed admin panels or APIs that were once public

Example discoveries:

dev.company.com
oldvpn.company.com
beta.company.com

These legacy assets are common attack surfaces because they are often:

Forgotten
Unpatched
Poorly monitored

❌ Why the Other Options Are Wrong
A. Censys.io
Searches internet-exposed hosts and certificates.
Useful for current infrastructure discovery.
Not focused on historical website content.

B. Shodan
Finds currently exposed devices and services.
Provides live exposure data, not historical web pages.

D. SpiderFoot
OSINT automation tool aggregating many data sources.
Useful for reconnaissance, but not specifically designed for historical site snapshots.

🎯 PenTest+ Exam Tip
When CompTIA mentions:

Past infrastructure
Historical domains/subdomains
Old website versions
👉 Think Wayback Machine.

Quick recon mapping:

Goal_Tool
Historical web content_✅ Wayback Machine
Internet-exposed devices_ Shodan
Certificate & host intelligence_ Censys
Automated OSINT collection_ SpiderFoot
Question 12 Choose 1
A penetration tester performs a service enumeration process and receives the following result after scanning a server using the Nmap tool:

PORT STATE SERVICE
22/tcp open ssh
25/tcp filtered smtp
111/tcp open rpcbind
2049/tcp open nfs

Based on the output, which of the following services provides the best target for launching an attack?
Show answerHide answer

Correct answer: D File sharing

Explanation

Explanation:

This question asks which service, based on the Nmap output, provides the best target for launching an attack.

Let's analyze the Nmap output:

PORT---- STATE---- SERVICE
22/tcp---- open---- ssh
25/tcp---- filtered---- smtp
111/tcp---- open---- rpcbind
2049/tcp---- open---- nfs

Understanding the services:
22/tcp (SSH) : Secure Shell - used for remote administration and secure logins. This is a remote access service.
25/tcp (SMTP) : Simple Mail Transfer Protocol - used for email. The state is filtered, meaning a firewall is likely blocking access. This makes it a poor target because the tester cannot directly interact with it.
111/tcp (rpcbind) : This maps RPC (Remote Procedure Call) services to ports. It can be useful for enumeration but is not typically the primary attack vector.
2049/tcp (NFS) : Network File System - used for file sharing over a network. This is a file sharing service.

Which is the best target?
The tester is looking for a service to "launch an attack." This means they need a service that is:
Open (accessible)
Known to have vulnerabilities or misconfigurations
Valuable for gaining access or data

Between SSH and NFS:
SSH is generally secure if properly configured. Brute-forcing SSH is possible but noisy and slow.
NFS is notoriously prone to misconfigurations. Common issues include:
Exporting world-writable shares
No_root_squash (allowing root access to files)
Weak access controls
Exposing sensitive data

NFS misconfigurations often allow attackers to mount shares, access sensitive files, upload malicious files, or even gain remote access through SSH key theft.

Analysis of options:
A. Database: No database services (like MySQL on 3306, MSSQL on 1433) are shown. Incorrect.
B. Remote access: SSH is a remote access service, but it's generally more secure than NFS is often misconfigured. Possible but not best.
C. Email: SMTP is filtered, so it cannot be attacked directly. Incorrect.
D. File sharing: NFS is a file sharing service, and it is open and often misconfigured, making it an excellent target for attackers. Correct.

Conclusion:
NFS (port 2049) is an open file sharing service that is frequently misconfigured, making it the best target among the options.

Correct Answer: D. File sharing
Question 13 Choose 1
A penetration tester completed OSINT work and needs to identify all subdomains for mydomain.com. Which of the following is the best command for the tester to use?
Show answerHide answer

Correct answer: D cat wordlist.txt | xargs -n 1 -I 'X' dig X.mydomain.com

Explanation

Explanation:

The tester’s goal is:
Identify all subdomains for mydomain.com

This requires subdomain enumeration, typically done through DNS brute forcing using a wordlist.

✅ D. Correct — Subdomain brute-force enumeration
cat wordlist.txt | xargs -n 1 -I 'X' dig X.mydomain.com

What this does:
Reads possible subdomain names from a wordlist:
dev
mail
vpn
test
staging

Appends each entry to the domain:
dev.mydomain.com
mail.mydomain.com

Performs DNS lookups using dig.

This is a standard penetration testing technique to discover hidden or forgotten subdomains.

✔ Automated
✔ Scalable
✔ Common real-world recon method

❌ Why the Other Options Are Wrong

A. nslookup mydomain.com
Queries only the main domain.
Does not enumerate subdomains.

B. crunch 1 2 | xargs ...
Generates random short strings.
Inefficient and unrealistic for real enumeration.
Not based on meaningful subdomain wordlists.

C. dig @8.8.8.8 mydomain.com ANY
Queries DNS records for the root domain only.
Modern DNS servers often block ANY queries.
Does not discover subdomains.

🎯 PenTest+ Exam Tip
Subdomain discovery methods CompTIA expects you to recognize:

Method----Example
Wordlist brute force ----✅ dig/nslookup + wordlist
Certificate transparency ----crt.sh
OSINT tools ----Amass, Sublist3r
Historical sources ----Wayback Machine

If you see:
“identify all subdomains”
scripting or command-line options
👉 Choose the option using a wordlist-based DNS brute force.
Question 14 Choose 1
A penetration tester completes a scan and sees the following Nmap output on a host:

Nmap scan report for victim (10.10.10.10)
Host is up (0.0001s latency)
PORT STATE SERVICE
161/udp open snmp
445/tcp open microsoft-ds
3389/tcp open ms-wbt-server
Running Microsoft Windows 7
OS CPE: cpe:/o:microsoft:windows_7::sp0

The tester wants to obtain shell access. Which of the following related exploits should the tester try first?
Show answerHide answer

Correct answer: C exploit/windows/smb/ms17_010_eternalblue

Explanation

Explanation:

The Nmap scan shows three critical services: SNMP (161/udp), SMB (445/tcp), and RDP (3389/tcp). The host is identified as Windows 7 SP0, which is historically vulnerable to MS17-010 (EternalBlue) if unpatched. EternalBlue is a remote code execution exploit against SMBv1 that allows attackers to gain shell access without authentication. Since the tester’s goal is shell access, this is the most direct and effective exploit to attempt first.

Option A: exploit/windows/smb/psexec
PsExec requires valid credentials to execute commands remotely over SMB. Without credentials, this exploit cannot succeed, so it is not the first choice.

Option B: exploit/windows/smb/ms08_067_netapi
MS08-067 targets Windows XP and Server 2003 systems. While extremely famous, it does not apply to Windows 7, making it irrelevant in this scenario.

Option D: auxiliary/scanner/snmp/snmp_login
This module only attempts SNMP login brute force. It can provide information but does not yield shell access. Since the tester’s objective is shell access, this option is not suitable.

Therefore, MS17-010 EternalBlue is the correct exploit to try first. It directly targets the SMB service on port 445, matches the OS fingerprint (Windows 7), and is known to provide remote shell access if the system is unpatched. In penetration testing methodology, testers prioritize exploits that match the identified OS and services, especially those with high impact and no credential requirement.

References

CompTIA PenTest+ PT0-003 Exam Objectives – Domain 3.0 Attacks and Exploits (Network-based vulnerabilities).
Microsoft Security Bulletin MS17-010: CVE-2017-0144 (EternalBlue) – Microsoft Learn (learn.microsoft.com in Bing)
Question 15 Choose 1
A penetration tester conducts a scan on an exposed Linux web server and gathers the following data:

Host: 192.168.55.23
Open Ports:

22/tcp Open OpenSSH 7.2p2 Ubuntu 4ubuntu2.10
80/tcp Open Apache httpd 2.4.18 (Ubuntu)
111/tcp Open rpcbind 2-4 (RPC #100000)
Additional notes:

Directory listing enabled on /admin
Apache mod_cgi enabled
No authentication required to access /cgi-bin/debug.sh
X-Powered-By: PHP/5.6.40-0+deb8u12
Which of the following is the most effective action to take?
Show answerHide answer

Correct answer: B Review the contents of /cgi-bin/debug.sh.

Explanation

Explanation:

The scan reveals that /cgi-bin/debug.sh requires no authentication and is accessible via Apache with mod_cgi enabled. CGI scripts are executed on the server when requested. Reviewing the contents of debug.sh is the most effective immediate action because:

It may contain hardcoded credentials, debug commands, or system calls.
It could allow command injection or direct remote code execution.
This is a low-effort, high-impact information gathering step before any exploitation.

Why other options are incorrect

A. msfvenom + /admin upload
– /admin has directory listing enabled, but that does not guarantee write permissions. Uploading a payload may fail due to missing file write access or upload functionality. Premature without understanding the environment.

C. Nikto scan on port 80
– Nikto is a web vulnerability scanner, but the tester already has specific actionable intelligence (CGI script with no auth). Running a full Nikto scan is redundant and slower than directly reviewing the script.

D. Brute-force against OpenSSH 7.2p2
– SSH brute-forcing is noisy, time-consuming, and may trigger lockouts or alerts. No indication of weak SSH credentials. Higher risk and lower priority than exploiting an already discovered unauthenticated CGI script.

References

CompTIA PenTest+ PT0-003 – Domain 3.2 (Exploits): "Abuse misconfigured CGI scripts for remote code execution."

OWASP Testing Guide – Testing for CGI vulnerabilities (CVE-2014-6271 Shellshock, command injection).

Apache mod_cgi documentation – CGI scripts execute with web server privileges; unauthenticated access is a critical finding.
Question 16 Choose 1
A penetration tester must identify hosts without alerting an IPS. The tester has access to a local network segment. Which of the following is the most logical action?
Show answerHide answer

Correct answer: A Performing reverse DNS lookups

Explanation

Explanation:

Reverse DNS lookups query DNS servers to map IP addresses back to hostnames. This method generates standard DNS traffic (UDP/TCP 53), which is almost never blocked or alerted by IPS because DNS is essential for normal network operations. No raw packets are sent to target IPs directly, so it bypasses IPS signature detection that triggers on ICMP, ARP, or SYN scans. This is a passive or low-noise discovery technique when the tester already has access to the local network segment and DNS servers.

Why other options are incorrect

B. Nmap ping sweep
– Sends ICMP echo requests, TCP SYN/ACK, or ARP probes. These are actively scanned and easily detected by IPS signatures (e.g., "ICMP sweep," "port scan").

C. LLMNR poisoning using Responder
– Actively listens and responds to LLMNR/NBT-NS requests. This is not a host discovery method; it's a spoofing attack for credential theft. It also generates suspicious traffic that some IPS can detect.

D. Viewing local routing table
– Shows the tester's own routing information (default gateway, local subnets). It does not identify other hosts on the network.

References

CompTIA PenTest+ PT0-003 – Domain 2.1 (Passive/Stealth Discovery): "Use DNS interrogation to identify hosts without active scanning."

MITRE ATT&CK T1046 – Network Service Scanning – but reverse DNS is a passive alternative (T1590.005).
Question 17 Choose 1
A penetration tester performs the following scan: nmap -sU -p 53,161,162 192.168.1.51
PORT | STATE
53/udp | open|filtered
161/udp | open|filtered
162/udp | open|filtered
The tester then manually uses snmpwalk against port 161 and receives valid SNMP responses. Which of the following best explains the scan result for port 161?
Show answerHide answer

Correct answer: B Nmap marked the port as open|filtered because no response was received.

Explanation

Explanation:

Nmap’s UDP scan (-sU) sends an empty UDP packet to the target port. If it receives a UDP response (e.g., SNMP trap or protocol-specific reply), the port is marked open. If it receives an ICMP port unreachable error, the port is closed. If no response is received at all (due to filtering, packet loss, or silent services), Nmap marks the port open|filtered. SNMP (port 161) often does not reply to empty UDP probes — it waits for a properly formatted SNMP GET request. Since snmpwalk later succeeded with valid responses, the port is truly open, but the initial probe received no reply, causing the open|filtered state.

Why other options are incorrect

A. SNMP daemon delayed response
– UDP scan timeouts are fixed (default ~1s). SNMP typically does not respond to empty probes at all, not just delayed.

C. Rate limiting
– No evidence of rate limiting; snmpwalk worked fine. Rate limiting would cause intermittent replies, not complete silence for an empty probe.

D. Lack of root privileges
– Root is not required for UDP scans; non-root users can send raw UDP packets. Root is needed for SYN scans (-sS) or certain OS detection features.

References

CompTIA PenTest+ PT0-003 – Domain 2.2: "Interpret Nmap UDP scan states (open|filtered)."

Nmap documentation – UDP scan: no response = open|filtered; ICMP unreachable = closed.

SNMP behavior – Port 161 ignores malformed/empty UDP packets; requires proper community string and OID request.
Question 18 Choose 1
A penetration tester executes multiple enumeration commands to find a path to escalate privileges. Given the following command:
find / -user root -perm -4000 -exec ls -ldb {} \; 2>/dev/nul
l Which of the following is the penetration tester attempting to enumerate?
Show answerHide answer

Correct answer: D Permission

Explanation

Explanation:

The command searches the entire filesystem (find /) for files owned by root (-user root) with the SETUID bit set (-perm -4000). SETUID files execute with the owner's privileges (root), even when run by a non-root user. Misconfigured or vulnerable SETUID binaries are a common privilege escalation vector. The tester is enumerating special permissions (SETUID) to identify potential privilege escalation paths — not general permissions, but specifically the SETUID permission bit.

Why other options are incorrect

A. Attack path mapping
– Too broad; refers to mapping multi-step attack chains. This command is a specific enumeration for one vulnerability type (SETUID binaries).

B. API keys
– Not relevant. API keys are typically found in config files, environment variables, or source code — not identified by searching for SETUID root files.

C. Passwords
– Passwords are stored in /etc/shadow, configuration files, or databases. This command does not search for password artifacts.

References
CompTIA PenTest+ PT0-003 – Domain 3.4 (Privilege Escalation): "Enumerate SETUID binaries for privilege escalation."
Linux file permissions – -4000 = SETUID bit; find -perm checks permission masks.
MITRE ATT&CK T1548.001 – "Abuse Elevation Control Mechanism: Setuid and Setgid."
GTFOBins – Documents exploitable SETUID binaries for privilege escalation.
Question 19 Choose 1
A penetration tester successfully gains access to a Linux system and then uses the following command: find / -type f -ls > /tmp/recon.txt Which of the following best describes the tester’s goal?
Show answerHide answer

Correct answer: A Permission enumeration

Explanation

Explanation:

The command find / -type f -ls > /tmp/recon.txt searches the entire filesystem (/) for regular files (-type f) and outputs detailed information using -ls (similar to ls -l), which includes permissions, ownership, size, and timestamps. The output is saved to /tmp/recon.txt. While this captures many attributes, the primary goal in a post-exploitation context is to enumerate file permissions — specifically looking for world-writable files, SUID/SGID binaries, or files with weak permissions that can lead to privilege escalation.

Why other options are incorrect

B. Secrets enumeration
– Searching for secrets (passwords, API keys, SSH keys) typically uses grep with patterns (e.g., grep -r "password") or targets specific files (/etc/shadow, .ssh/). The find -ls command does not search file contents.

C. User enumeration
– User enumeration involves checking /etc/passwd, /etc/shadow, /home/ directories, or who, w, last commands. find -ls on all files is inefficient for just user discovery.

D. Service enumeration
– Service enumeration includes checking running processes (ps aux), listening ports (netstat), systemd units, or init scripts. The command does not target service-related files specifically.

References

CompTIA PenTest+ PT0-003 – Domain 3.4 (Privilege Escalation): "Enumerate file permissions to identify privilege escalation vectors."

Linux find manual – -ls outputs permission bits, ownership, and file metadata.

MITRE ATT&CK T1083 – "File and Directory Discovery" — used to identify writable or misconfigured files.

Privilege escalation methodology – Step 1: Enumerate permissions on all files to find weak configurations.
Question 20 Choose 1
A client warns the assessment team that an ICS application is maintained by the manufacturer. Any tampering of the host could void the enterprise support terms of use. Which of the following techniques would be most effective to validate whether the application encrypts communications in transit?
Show answerHide answer

Correct answer: A Utilizing port mirroring on a firewall appliance

Explanation

Explanation:

The client cannot tamper with the ICS host (risk of voiding support). Port mirroring (SPAN port) copies network traffic from a switch or firewall appliance to a monitoring port without touching the target host. The tester can then analyze the captured packets (e.g., with Wireshark) to determine if the application encrypts communications (look for TLS handshakes or plaintext data). This method is completely passive and non-intrusive.

Why other options are incorrect

B. Installing packet capture software on the server
– Requires modifying the host (installing software), which may void support terms. Also risks agent instability on sensitive ICS systems.

C. Reconfiguring the application to use a proxy
– Requires changing application settings on the host, which is tampering and may break support agreements.

D. Requesting certificate pinning be disabled
– Requires application or configuration change on the host; also assumes certificate pinning is enabled, which is not the question (tester just needs to validate encryption).

References

CompTIA PenTest+ PT0-003 – Domain 4.0 (Operational Constraints): "Use passive monitoring techniques when host modification is prohibited."

ICS security best practices – Port mirroring is preferred for assessment of vendor-locked systems (e.g., ISA/IEC 62443).

Wireshark + port mirroring – Standard method for passive traffic analysis without endpoint changes.
Full mock exam

Sit the PT0-003 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real PT0-003 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full PT0-003 mock exam
  • 90questions per mock
  • 165 mintime limit
  • 361questions in the bank
  • Newmock on every attempt