All CompTIA exams
Free PT0-003 practice test: 30 questions with answers
30 original questions for CompTIA PenTest+, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.
- Free questions
- 30
- Full bank
- 100 questions
- Real exam
- Maximum of 90 questions, 165 min
- Passing score
- 750 (scale 100-900)
All 30 PT0-003 questions with answers
The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.
Attacks and Exploits (6 questions)
Question 1
A tester obtains a low-privilege shell on a Linux host. Which privilege escalation check is most useful early?
- AChanging the hostname to something more formal for corporate naming rules
- BDeleting the system's log files to hide the shell session from administrators
- CReviewing sudo rights, SUID binaries, and scheduled jobs that run with elevated privileges
- DRenaming the home directory to a name that matches the service account and its group
Show answer and explanationHide answer
Correct answer: CSudo rules, SUID binaries and privileged scheduled jobs are common paths from a low-privilege shell to root. Hostnames, log deletion and renamed directories do not provide escalation paths and can damage evidence.
Question 2
A tester has captured password hashes from a Windows domain. Which technique is most appropriate for testing password strength within the agreed scope?
- AOffline password cracking of the captured hashes with a wordlist and rules, limited to the authorized accounts
- BUsing a live brute force against every account at the domain controller with a password spraying list until lockout threshold
- CPosting the hashes publicly to see who recognizes them on a paste site and social media, with the domain name attached for crowd cracking
- DEmailing the hashes to the client's executives as an attachment in a spreadsheet so they can review the cracked accounts quickly
Show answer and explanationHide answer
Correct answer: AOffline cracking of authorized hashes measures password strength without locking accounts or leaking data. Public posting, live brute force and emailing hashes are unsafe or disruptive.
Question 3
Which attack technique exploits a trust relationship in a Windows domain by forging Kerberos tickets with a compromised account hash?
- ACross-site request forgery on a banking login page
- BClickjacking of a user's browser via a hidden iframe
- CPass-the-ticket or Golden Ticket style attacks
- DSQL injection on a public web form using a search field
Show answer and explanationHide answer
Correct answer: CPass-the-ticket and Golden Ticket attacks abuse Kerberos trust by reusing or forging tickets using stolen key material. SQL injection, CSRF and clickjacking target web applications rather than Kerberos.
Question 4
A tester gained access to a web application by exploiting a vulnerable upload feature that accepts any file type. What is the best recommendation for the report?
- AEnforce server-side file type validation, store uploads outside the web root, and scan files before use
- BAdd a warning that the upload may be unsafe and show it on upload forms and on pages
- CAsk users to upload files they trust and to verify the sender of each file before opening it from their own email
- DRemove the upload feature and leave the storage path and extension handling unchanged
Show answer and explanationHide answer
Correct answer: AServer-side validation, storage outside the web root and scanning remove the root causes that allow code execution. Trust-based guidance and warnings do not stop an attacker, and removing the feature without fixing root causes leaves similar flaws.
Question 5
A tester is performing a social engineering test authorized in the scope. The tester calls an employee pretending to be IT support. What should the tester do after the test?
- APost the employee's name on social media along with the call recording, the company name, and the department, so customers can identify them
- BDebrief the employee in a supportive way, explain the technique, and report the result without publicly shaming the person
- CRecord the call and share it with coworkers as entertainment in the office kitchen during lunch, with the employee's voice and name audible throughout
- DContinue calling the employee daily for two weeks to wear them down with varied pretexts at different hours
Show answer and explanationHide answer
Correct answer: BA supportive debrief turns the test into training and protects the employee, and reporting the result keeps the program constructive. Public shaming, sharing recordings and repeated harassment are inappropriate.
Question 6
A tester wants to demonstrate that a wireless network allows unauthorized access. Which activity within authorized scope best shows this?
- AJamming the entire radio spectrum for a city block with a powerful transmitter to disrupt emergency services
- BBreaking into a neighbor's network that is outside the scope via a weak WPA2 key
- CTesting whether a rogue or misconfigured access point accepts connections from unauthorized clients
- DChanging the building's Wi-Fi password without permission on the core router afterward
Show answer and explanationHide answer
Correct answer: CTesting access point configuration within scope shows whether unauthorized clients can connect. Jamming, testing outside the scope and changing passwords without permission are either illegal or unauthorized.
Information Gathering and Vulnerability Scanning (6 questions)
Question 7
A tester wants to find subdomains of a target organization without sending traffic directly to the target's systems. Which technique is most appropriate?
- ASending brute-force requests to the login page on the customer portal at scale
- BExploiting a known vulnerability on the web server running an unpatched Apache 2.4 build
- CPassive reconnaissance using certificate transparency logs and public DNS records
- DRunning a full port scan against each IP address with service version detection enabled
Show answer and explanationHide answer
Correct answer: CPassive reconnaissance uses public records such as certificate transparency logs and DNS data, which avoids touching the target. Port scans, brute force and exploitation all interact directly with target systems.
Question 8
A tester needs to identify which hosts are alive on a subnet quickly before deeper scanning. Which approach is the most efficient first step?
- AManual inspection of each host's keyboard at the desk
- BBrute forcing SSH credentials on each address in turn
- CA full UDP scan of 65,535 ports on every address with extended retries
- DA host discovery sweep such as an ICMP or ARP-based ping scan
Show answer and explanationHide answer
Correct answer: DA host discovery sweep quickly identifies responsive hosts, which narrows deeper scanning. Full UDP scans across all ports are slow for discovery, manual inspection is impractical, and brute forcing is intrusive and unnecessary at this stage.
Question 9
A scan reports a service version that may be vulnerable, but the tester wants to confirm before reporting it. What is the best next step?
- AReporting the finding as confirmed based on the version string alone
- BRunning a denial-of-service test against the service during business hours without prior notice
- CVerifying the vulnerability with a safe, non-destructive check against the service
- DDeleting the service's logs to hide the scan traces from the security team
Show answer and explanationHide answer
Correct answer: CSafe verification confirms whether the issue is real, which reduces false positives in the report. Reporting unverified findings as confirmed is inaccurate, and denial-of-service testing is disruptive and out of scope for verification.
Question 10
Which tool is primarily used to intercept and modify HTTP and HTTPS traffic between a browser and a web application during testing?
- ANmap
- BWireshark used only for DNS
- CHydra for password cracking
- DBurp Suite
Show answer and explanationHide answer
Correct answer: DBurp Suite is a proxy that intercepts, inspects and modifies web traffic for testing. Nmap is for scanning, Wireshark captures traffic for analysis, and Hydra performs credential attacks.
Question 11
A tester wants to enumerate SMB shares and user accounts on a Windows network. Which technique fits this goal?
- AInstalling a rootkit on a workstation to maintain persistent access without detection
- BEnumerating SMB and RPC services using tools that query shares and users with appropriate permissions
- CSending spam emails to every staff member with a spoofed sender address and a lure link
- DPhysically removing the network cable from the core switches during business hours
Show answer and explanationHide answer
Correct answer: BEnumeration tools query SMB and RPC services to list shares and accounts that the network exposes, within the authorized scope. Spam, rootkits and cable removal are unrelated or harmful.
Question 12
Which finding is most likely to indicate a weak web application input validation control during testing?
- ASpecial characters in a form field are echoed back or processed by the backend without encoding
- BThe footer contains the current year and it is rendered from a static template by the CMS
- CThe site uses a green color theme throughout the brand guidelines and navigation menus
- DThe logo loads slowly on mobile connections because the image is not compressed
Show answer and explanationHide answer
Correct answer: AUnvalidated special characters that reach the backend or appear unencoded in output point to injection or cross-site scripting risks. Colors, load speed and footers are unrelated to input validation.
Planning and Scoping (6 questions)
Question 13
Before a penetration test begins, the client asks the tester to avoid all production databases. Which document should the tester confirm first to ensure the boundary is agreed?
- AThe vendor's marketing brochure for the scanner, with its feature list
- BThe client's holiday calendar for the office, listing staff vacation dates
- CThe tester's personal résumé, listing previous engagements and certifications
- DThe rules of engagement that define in-scope and out-of-scope systems and testing windows
Show answer and explanationHide answer
Correct answer: DThe rules of engagement set scope, exclusions, timing and escalation contacts, which defines what the tester may touch. A résumé, a brochure and a calendar do not define authorization boundaries.
Question 14
A client wants a tester to test a third-party cloud service that hosts part of its application. What should the tester check before testing it?
- AWhether the tester can use a free trial account on the provider's platform to avoid billing during testing
- BWhether the provider's terms permit the test and whether the client has authority over the component
- CWhether the service's logo is visible on the site's landing pages, footer, login screen, and header bar
- DWhether the test can be run during the provider's maintenance window, once the vendor's status page shows no incidents
Show answer and explanationHide answer
Correct answer: BTesting a third party needs its permission under the provider's terms, and the client must have authority over what is tested. A trial account, logos and maintenance windows do not establish authorization.
Question 15
A tester discovers a critical flaw during an engagement that exposes customer data outside the agreed scope. What is the most appropriate action?
- AContinue to exploit the flaw to prove the full impact by pulling more customer records from production
- BPublish the flaw online to pressure the client by posting details on public forums and social media
- CDelete the data to prevent misuse from the production database and its replicas before the report is filed
- DStop testing that path, document the finding, and notify the client contact defined in the rules of engagement
Show answer and explanationHide answer
Correct answer: DStopping, documenting and escalating through the agreed contact respects the scope while making the client aware. Continuing exploitation, publishing and deleting data each exceed authority or destroy evidence.
Question 16
Which two items should be confirmed before a penetration test starts? (Choose two.)
- AThe tester's favorite programming language
- BThe number of coffee breaks allowed
- CThe weather forecast for the test location
- DWritten authorization signed by someone with authority over the in-scope systems
- EEmergency contacts and an escalation path for critical findings
Show answer and explanationHide answer
Correct answer: D, EWritten authorization gives legal permission, and emergency contacts ensure critical issues reach the right people quickly. The other items do not affect authorization or safe escalation.
Question 17
A client asks for a penetration test of its internal network, but the tests must not interfere with a safety-critical industrial control system on the same segment. What is the best planning decision?
- AAssuming that industrial controllers on the segment are safe to scan with default Nmap probes, since the vendor has not objected to scanning
- BTesting the control system first, during a quiet overnight window, because it is the most important target for the engagement
- CExcluding the control system explicitly in the rules of engagement and testing only segments the client has approved
- DScanning the control system with aggressive settings, including full port sweeps and OS fingerprinting.
Show answer and explanationHide answer
Correct answer: CExplicit exclusions protect safety-critical systems, and the test should cover only approved segments. Industrial control systems can fail under aggressive scanning, so assuming safety or scanning them is dangerous.
Question 18
A tester must decide how many days a test should take. Which factor is the most important input to the estimate?
- AThe size and complexity of the in-scope environment and the agreed test objectives
- BThe tester's preferred working hours, commuting schedule, and lunch breaks across the full week
- CThe color of the client's logo, font choices, and brand palette used on the company letterhead
- DThe number of pages in the tester's résumé, cover letter, and professional certification records
Show answer and explanationHide answer
Correct answer: AScope size, complexity and objectives drive effort and time. Personal schedules, logos and résumés do not affect how much testing is needed.
Tools and Code Analysis (6 questions)
Question 19
A tester reviews a script that builds SQL queries by concatenating user input. Which code review finding should be reported?
- AVariable names that are too long in the utility helper module
- BComments written in English and the team reviews them weekly
- CUse of tabs instead of spaces for indentation in the Python source files for consistency
- DSQL injection risk caused by unparameterized queries built from user input
Show answer and explanationHide answer
Correct answer: DConcatenating untrusted input into SQL allows injection, which parameterized queries prevent. Indentation, name length and comment language are style issues, not security findings.
Question 20
A tester wants to review a Python web application for insecure functions quickly before manual testing. Which tool category is most appropriate?
- AA disk defragmenter for the Windows fleet and its nightly jobs
- BStatic application security testing (SAST) tools that analyze source code
- CA password manager that stores shared vault entries for the marketing team
- DA network printer driver installed on the reception desk computers
Show answer and explanationHide answer
Correct answer: BSAST tools analyze source code for insecure patterns, which speeds up identifying candidates for manual verification. Password managers, printer drivers and defragmenters are unrelated.
Question 21
A tester must write a small script to automate a repetitive check against many hosts. Which safeguard is most important before running it against the client's systems?
- AReviewing the script's logic and testing it in a lab, plus confirming the target list matches the approved scope
- BRunning it against every IP address on the internet to be thorough with maximum concurrency and no rate limits across each port
- CAdding a random delay so no one notices from the security team's monitoring, and to keep the run
- DDisabling error handling so it runs faster when hosts return unexpected responses and continue scanning
Show answer and explanationHide answer
Correct answer: AReviewing and lab-testing the script and confirming the target list keeps the activity within scope and prevents accidental damage. Scanning the internet, hiding activity and disabling error handling all increase risk.
Question 22
A tester needs to analyze a compiled binary provided by the client to find hardcoded credentials. Which tool category is most appropriate?
- AA calendar application for scheduling client meetings, reminders, and team availability
- BA video editor for trimming recorded screen captures and audio
- CSpreadsheet software for tracking the client's asset inventory
- DReverse engineering or string analysis tools that inspect binary contents
Show answer and explanationHide answer
Correct answer: DString extraction and reverse engineering tools reveal hardcoded secrets in binaries. Spreadsheets, video editors and calendars do not analyze compiled code.
Question 23
During a code review, a tester finds that the application stores passwords using an unsalted fast hash. What is the most accurate recommendation?
- AUse a slow, salted password hashing function such as bcrypt, scrypt or Argon2
- BStore passwords in plain text in a reversible column for faster lookups
- CUse a longer username with a numeric prefix and stricter naming
- DRemove password complexity and rotation requirements entirely for users
Show answer and explanationHide answer
Correct answer: ASalted, slow password hashing functions resist offline cracking, while fast unsalted hashes are easy to attack at scale. Plain text, longer usernames and removing requirements all weaken security.
Question 24
A tester wants to check whether third-party open-source dependencies in an application have known vulnerabilities. Which technique is most appropriate?
- AMeasuring the lines of code, cyclomatic complexity, and comment density in the project
- BReviewing the font and color palette used in the application's user interface
- CCounting the number of commits per day and the average size of each change set
- DSoftware composition analysis that matches dependency versions against vulnerability databases
Show answer and explanationHide answer
Correct answer: DSoftware composition analysis compares dependency versions with known vulnerability data, which identifies risky components. Line counts, fonts and commit counts do not reveal known vulnerabilities.
Reporting and Communication (6 questions)
Question 25
A penetration test report must help the client prioritize fixes. Which element should accompany each finding?
- AA severity rating with justification, the affected asset, and a clear remediation recommendation
- BA list of unrelated improvements to the tester's own tools that the client did not request in writing
- CThe tester's favorite exploit name, listed in place of the affected asset, the risk, and the fix, with a short note
- DA statement that the systems are secure, based on the scanner output and the tester's judgment alone
Show answer and explanationHide answer
Correct answer: ASeverity with justification, affected assets and remediation guidance let the client prioritize and fix issues. Exploit names alone, unrelated tool improvements and blanket security claims do not help remediation.
Question 26
After a test, a client asks the tester to remove the evidence of exploitation from its logs. What is the appropriate response?
- AEdit the logs to show that no testing occurred by replacing entries with clean baseline records
- BDecline to alter logs, since that would destroy evidence, and recommend the client preserve logs and fix the findings
- CDelete the logs quietly to protect the client's reputation and remove the archives so no investigator can reconstruct the testing timeline
- DMove the logs to a personal drive without telling anyone and keep copies on an unencrypted USB device for later forensic review
Show answer and explanationHide answer
Correct answer: BAltering or deleting logs destroys evidence and undermines audit trails. The appropriate response is to preserve logs and focus on remediation and reporting.
Question 27
A tester must retain sensitive client data collected during testing. Which practice is most appropriate?
- AEncrypting the data, limiting access, and securely deleting it according to the agreed retention period
- BCopying the data to removable media left on a desk for quick access by the team
- CStoring the data unencrypted on a shared public drive with read access for contractors
- DKeeping the data indefinitely on a personal laptop after the engagement ends, with copies synced to a cloud account
Show answer and explanationHide answer
Correct answer: AEncryption, restricted access and secure deletion after the agreed retention period protect client data. Unencrypted public storage, indefinite personal copies and unattended media expose it.
Question 28
Which two elements should appear in a penetration test finding so that the client can reproduce and verify the fix? (Choose two.)
- ARemediation validation criteria that show how to confirm the fix
- BThe tester's personal opinion about the client's staff
- CAn unrelated summary of the tester's previous jobs
- DA list of every tool installed on the tester's laptop
- EClear steps or evidence that reproduce the issue
Show answer and explanationHide answer
Correct answer: A, EReproduction steps and validation criteria let the client confirm the issue and check the fix. Personal opinions, past jobs and laptop inventories do not help verification.
Question 29
A tester finds a critical vulnerability in a system the client did not ask to be tested, but which is on the same network segment. What should the report do?
- APublicize the vulnerability without telling the client by posting technical details, a proof-of-concept exploit, and affected hostnames on a public forum for other researchers
- BLeave the observation out of the report entirely to avoid complications with the client's internal team and its vendors after the readout
- CTest the system fully, including credential brute forcing, lateral movement, and privilege escalation, to make the report more complete and detailed across its connected hosts
- DNote the observation as out of scope, describe the risk without further testing, and recommend the client confirm whether it should be added to scope
Show answer and explanationHide answer
Correct answer: DReporting an out-of-scope observation with a recommendation respects authorization while still informing the client. Further testing exceeds scope, omitting it hides risk, and public disclosure without notice harms the client.
Question 30
A penetration test finds that a finding has been fixed after the initial report. What is the best way to record the status?
- AMarking it fixed in the final report without retesting, based on the developer's verbal confirmation and a ticket comment
- BRetesting the finding, documenting the verification evidence, and updating its status in the report
- CRemoving the finding from the report entirely once the developer says the ticket is closed, to keep the report short
- DAdding a note that the tester does not care about the fix and would prefer the client's developers spend time elsewhere
Show answer and explanationHide answer
Correct answer: BRetesting and documenting verification provides evidence that the fix works. Removing findings or marking them fixed without evidence hides the remediation history.