CompTIA PenTest+ (PT0-003) — Free Practice Questions
10 free sample questions from a bank of 608, with the correct answers and explanations. No signup required — start practising right now.
1A penetration tester wants to send a specific network packet with custom flags and sequence numbers to a vulnerable target. Which of the following should the tester use?
tcprelay
Bluecrack
Scapy
tcpdump
Answer: C
The short version
C — C builds custom packets correctly. Scapy crafts custom flags plus sequence numbers. Scapy is a packet-manipulation library that lets testers construct, send, and receive frames with arbitrary flags, sequence numbers, and payloads for probe and exploit validation.
Key concepts in this question
Crafting need: Testing vulnerable stacks needs control over header fields that normal sockets do not expose.
Scapy role: Scapy exposes layers and fields as scriptable objects plus send-receive loops for custom exchanges.
Capture contrast: Sniffers observe wire traffic but cannot forge new flag and sequence combinations.
Why C is correct
Scapy is a packet-manipulation library that lets testers construct, send, and receive frames with arbitrary flags, sequence numbers, and payloads for probe and exploit validation. Tcprelay replays traffic, Bluecrack targets Bluetooth PINs, and tcpdump only captures and displays packets. The settled key therefore follows tool-capability mapping for custom packet crafting.
Why the others are wrong
A. names tcprelay, which relays or replays existing flows rather than forging arbitrary flag sequences.
B. names Bluecrack, which attacks Bluetooth pairing rather than general IP packet crafting.
D. names tcpdump, which captures and filters traffic without generating custom packets.
PT0-003 exam tip
Hear custom flags plus sequence numbers and pick Scapy.
2Which of the following explains the reason a tester would opt to use DREAD over PTES during the planning phase of a penetration test?
The tester is conducting a web application test.
The tester is assessing a mobile application.
The tester is evaluating a thick client application.
The tester is creating a threat model.
Answer: D
The short version
D — D chooses threat modeling over test phases correctly. DREAD rates threats while PTES structures test phases. DREAD scores Damage, Reproducibility, Exploitability, Affected users, and Discoverability to rank threats during threat modeling, which is the planning activity that benefits from such scoring.
Key concepts in this question
DREAD use: DREAD quantifies threat severity to prioritize mitigations identified in modeling.
Planning fit: Creating a threat model needs a scoring scheme, which DREAD supplies and PTES does not.
Why D is correct
DREAD scores Damage, Reproducibility, Exploitability, Affected users, and Discoverability to rank threats during threat modeling, which is the planning activity that benefits from such scoring. PTES defines penetration-test phases and execution steps rather than a risk-rating model. Web, mobile, or thick-client scope does not decide between them, so the settled key follows framework-purpose mapping for planning.
Why the others are wrong
A. ties the choice to web testing, but test target type does not select a threat-scoring model over a methodology.
B. ties the choice to mobile scope, which likewise does not determine rating versus phase needs.
C. ties the choice to thick-client scope, which is orthogonal to threat-model scoring selection.
PT0-003 exam tip
Link threat model plus scoring to DREAD and test phases to PTES.
3A penetration tester is performing a security review of a web application. Which of the following should the tester leverage to identify the presence of vulnerable open-source libraries?
VM
IAST
DAST
SCA
Answer: D
The short version
D — D finds vulnerable libraries with composition analysis correctly. software composition analysis inventories open-source libraries. Software Composition Analysis scans manifests and binaries to inventory third-party and open-source components plus known vulnerabilities in them.
Key concepts in this question
Manifest inventory: SCA parses lockfiles and fingerprints to list library names and versions in use.
Vuln correlation: Inventoried versions are matched to CVE feeds to flag vulnerable open-source inclusion.
Review timing: Security reviews catch outdated libraries before release without needing exploitation.
Why D is correct
Software Composition Analysis scans manifests and binaries to inventory third-party and open-source components plus known vulnerabilities in them. VM tracks host flaws, IAST instruments running code, and DAST probes live behaviour, but only SCA answers which library versions are embedded. The settled key therefore follows review-tool mapping for supply-chain checks.
Why the others are wrong
A. names VM, which assesses infrastructure patching rather than application library composition.
B. names IAST, which observes running code paths but is not the library-inventory approach.
C. names DAST, which attacks the running app externally instead of enumerating embedded libraries.
PT0-003 exam tip
Hear vulnerable open-source libraries and choose SCA.
4A penetration tester finds that an application responds with the contents of the /etc/passwd file when the following payload is sent:
Which of the following should the tester recommend in the report to best prevent this type of vulnerability?
Drop all excessive file permissions with chmod o-rwx.
Ensure the requests application access logs are reviewed frequently.
Disable the use of external entities.
Implement a WAF to filter all incoming requests.
Answer: C
The short version
C — C prevents entity-driven passwd disclosure correctly. disabling external entities blocks XXE file disclosure. Returning etc passwd content after a crafted payload indicates XML external entity injection, where the parser resolves an external file reference.
Key concepts in this question
XXE primitive: External entities let XML parsers include local files whose content is reflected in responses.
Parser hardening: Disabling DTDs and external access removes the feature rather than blocking single payloads.
Defense depth: Permissions and WAF add layers but cannot substitute for disabling unsafe parsing.
Why C is correct
Returning etc passwd content after a crafted payload indicates XML external entity injection, where the parser resolves an external file reference. Disabling external entity processing and DTDs stops the parser from reading local files, which is the definitive fix. Permission tightening, log reviews, and WAF filtering reduce impact or detect attempts but do not remove the parser primitive, so the settled key follows remediation hierarchy.
Why the others are wrong
A. drops file permissions, which may hide one file but leaves the entity mechanism exploitable elsewhere.
B. reviews access logs frequently, which detects after the fact instead of preventing disclosure.
D. adds a WAF filter, which can be bypassed with encoding while the parser stays vulnerable.
PT0-003 exam tip
Map passwd via XML payload to disable external entities as the fix.
5A penetration tester is conducting reconnaissance for an upcoming assessment of a large corporate client. The client authorized spear phishing in the rules of engagement. Which of the following should the tester do first when developing the phishing campaign?
Shoulder surfing
Recon-ng
Social media
Password dumps
Answer: C
The short version
C — C starts phishing recon with social media correctly. social media yields first targeting data for spear phishing. With spear phishing authorized, the first campaign step is open-source target research on social media to learn roles, relationships, and lures for believable messages.
Key concepts in this question
Target modeling: Effective spear phish needs names, duties, and recent events to craft credible pretexts.
OSINT source: Social platforms expose org charts, projects, and tone that shape lure selection.
Sequence logic: Broad OSINT precedes tool-driven harvesting and payload crafting in campaign order.
Why C is correct
With spear phishing authorized, the first campaign step is open-source target research on social media to learn roles, relationships, and lures for believable messages. Shoulder surfing needs physical proximity, Recon-ng is a later harvesting framework, and password dumps assume prior compromise. The settled key therefore follows recon sequencing that begins with public profile analysis.
Why the others are wrong
A. starts with shoulder surfing, which is opportunistic physical observation, not scalable campaign recon.
B. starts with Recon-ng, which automates harvesting after initial targeting direction is set.
D. starts with password dumps, which require a breach that recon is meant to enable, not assume.
PT0-003 exam tip
Start authorized phishing with social media profiling before tooling.
6A penetration tester needs to test a very large number of URLs for public access. Given the following code snippet:
Which of the following changes is required?
The condition on line 6
The method on line 5
The import on line 1
The delimiter in line 3
Answer: A
The short version
A — A fixes the URL-check condition correctly. line 6 condition mishandles public-access determination. For bulk URL public-access testing, the settled key identifies the condition on line 6 as the required change, meaning the status or content test misclassifies accessible versus blocked responses.
Key concepts in this question
Bulk pattern: Looping many URLs needs a precise success predicate, often status code plus content marker.
Condition role: Line 6 gates the pass-fail label, so an off-by-one comparison or wrong operator corrupts all results.
Support lines: Import, request method, and delimiter enable the loop but do not determine access semantics.
Why A is correct
For bulk URL public-access testing, the settled key identifies the condition on line 6 as the required change, meaning the status or content test misclassifies accessible versus blocked responses. Method, import, and delimiter lines support fetching and parsing but do not decide the access verdict. Correcting the conditional logic therefore restores accurate bulk classification.
Why the others are wrong
B. changes the method on line 5, which would alter request type rather than fixing the access decision test.
C. changes the import on line 1, which affects library availability, not per-URL verdict logic.
D. changes the delimiter on line 3, which affects parsing of input lists rather than access evaluation.
PT0-003 exam tip
When bulk checks mislabel, inspect the verdict condition first.
7During a penetration test, a tester captures information about an SPN account. Which of the following attacks requires this information as a prerequisite to proceed?
Golden Ticket
Kerberoasting
DCShadow
LSASS dumping
Answer: B
The short version
B — B links SPN data to Kerberoasting correctly. SPN capture enables Kerberoasting of service tickets. Capturing Service Principal Name account details lets the tester request service tickets and attempt offline cracking of the service password hash, which is Kerberoasting.
Key concepts in this question
SPN role: SPNs map services to accounts whose ticket encryption derives from the account password.
Kerberoasting flow: Requesting a service ticket yields crackable material without contacting the service account directly.
Prerequisite fit: SPN enumeration is the specific gate before Kerberoasting can proceed at scale.
Why B is correct
Capturing Service Principal Name account details lets the tester request service tickets and attempt offline cracking of the service password hash, which is Kerberoasting. Golden Ticket forges domain trust tickets, DCShadow registers rogue domain controllers, and LSASS dumping extracts local secrets, each with different prerequisites. The settled key therefore follows Active Directory attack chaining.
Why the others are wrong
A. names Golden Ticket, which needs KRBTGT hash rather than a captured SPN service account.
C. names DCShadow, which needs elevated replication rights to register a rogue controller.
D. names LSASS dumping, which extracts memory secrets rather than abusing service tickets.
PT0-003 exam tip
See SPN plus crack service ticket and answer Kerberoasting.
8While performing an internal assessment, a tester uses the following command:
crackmapexec smb 192.168.1.0/24 -u user.txt -p Summer123@
Which of the following is the main purpose of the command?
To perform a pass-the-hash attack over multiple endpoints within the internal network
To perform common protocol scanning within the internal network
To perform password spraying on internal systems
To execute a command in multiple endpoints at the same time
Answer: C
The short version
C — C reads the crackmapexec run as spraying correctly. user-list plus single password signals spraying across hosts. The command passes a user list file with one password across a subnet via SMB, which is password spraying: one guess per account spread widely to avoid lockouts.
Key concepts in this question
Spray shape: One password against many users across many hosts maximizes coverage while minimizing per-account failures.
Tool flags: User file plus single password arguments in crackmapexec express that spray shape directly.
Lockout logic: Low per-user attempt counts stay under thresholds that brute force would trip.
Why C is correct
The command passes a user list file with one password across a subnet via SMB, which is password spraying: one guess per account spread widely to avoid lockouts. Pass-the-hash would use hashes, protocol scanning would enumerate without auth, and mass execution would run a command module. The settled key therefore follows spraying pattern recognition.
Why the others are wrong
A. claims pass-the-hash, which replays NTLM hashes rather than a plaintext spray password.
B. claims common protocol scanning, which discovers services instead of testing one credential widely.
D. claims mass command execution, which would add an execution module rather than just auth testing.
PT0-003 exam tip
Spot user file plus one password across subnet as spraying.
9A penetration testing team needs to determine whether it is possible to disrupt the wireless communications for PCs deployed in the client's offices. Which of the following techniques should the penetration tester leverage?
Port mirroring
Sidecar scanning
ARP poisoning
Channel scanning
Answer: D
The short version
D — D selects the settled wireless technique correctly. wireless disruption testing uses channel assessment techniques. The settled key selects channel scanning as the technique for determining whether wireless communications for office PCs can be disrupted.
Key concepts in this question
Wireless surface: Office PC disruption via radio focuses on channels, signal, and association rather than switched routing.
Technique scope: Channel work surveys and interacts with the RF layer where disruption would manifest.
Wired contrast: Mirroring and ARP abuse operate on Ethernet switching, not on wireless channel access.
Why D is correct
The settled key selects channel scanning as the technique for determining whether wireless communications for office PCs can be disrupted. Port mirroring captures wired traffic, sidecar scanning is not the wireless disruption path, and ARP poisoning targets wired-switched resolution rather than radio availability. The explanation upholds the already decided mapping for this bank row.
Why the others are wrong
A. uses port mirroring, which copies wired switch traffic and does not assess wireless disruption.
B. uses sidecar scanning, which is not the settled wireless disruption technique for this row.
C. uses ARP poisoning, which manipulates wired resolution caches rather than radio communications.
PT0-003 exam tip
For wireless disruption rows recall the settled channel technique rather than wired attacks.
10Which of the following tasks would ensure the key outputs from a penetration test are not lost as part of the cleanup and restoration activities?
Preserving artifacts
Reverting configuration changes
Keeping chain of custody
Exporting credential data
Answer: A
The short version
A — A protects outputs during restoration correctly. preserving artifacts retains test outputs through cleanup. Cleanup and restoration revert changes, rebuild systems, and remove tools, which can destroy evidence of findings unless artifacts such as logs, screenshots, and dumps are preserved first.
Key concepts in this question
Artifact value: Reports depend on raw outputs that prove impact and guide remediation after targets are restored.
Restoration risk: Reimaging and config rollback erase the very traces that demonstrate success.
Preservation action: Copying artifacts to the test vault before cleanup keeps outputs intact for reporting.
Why A is correct
Cleanup and restoration revert changes, rebuild systems, and remove tools, which can destroy evidence of findings unless artifacts such as logs, screenshots, and dumps are preserved first. Reverting configs, keeping chain of custody, and exporting credentials are hygiene or handling steps but do not by themselves save the key outputs. The settled key therefore follows post-test preservation practice.
Why the others are wrong
B. reverts configuration changes, which restores the environment but discards findings if done before preservation.
C. keeps chain of custody, which documents handling yet does not copy outputs to safe storage by itself.
D. exports credential data narrowly, which saves one artifact type while neglecting broader test evidence.
PT0-003 exam tip
Before any revert, preserve artifacts or lose the proof.