Answer before reviewing
Pick the one answer that fits every condition in the scenario. Then read why each other option falls short.
No sign-up needed
20 questions, each with a clear explanation.
Question review
Try the set above first, then use this list to review. Each answer and explanation stays closed until you open it.
Correct answer: C · Leave it alone and ask the client contact to approve it in writing
NIST SP 800-115 says the rules of engagement should list authorized and unauthorized IP addresses, and calls it crucial to identify systems that are not authorized for testing. An address outside the agreed ranges stays out of scope until the client changes the scope in writing, so the tester leaves it alone and raises it through the engagement's communication path. A light port scan is still testing without authorization. Apparent ownership does not grant permission, and the address might belong to a hosting provider or another third party. Dropping the host from the notes loses information the client would want, so the tester records it and asks.
Look for this next time: An asset outside the written scope stays untouched until the client approves a scope change in writing.
Correct answer: A · The underlying hosts that AWS manages to run the RDS service
AWS's penetration testing policy lets customers assess their own AWS resources on its list of permitted services, which includes EC2 instances, Amazon RDS, and Lambda functions, without prior approval. The same policy says customers are not permitted to assess AWS infrastructure or the AWS services themselves. That split follows the shared responsibility model: the company can authorize tests only of what it controls. Its EC2 instances, its RDS database instance, and its Lambda functions are customer resources on the permitted list. The hosts that run the managed service belong to AWS, so the company's signature cannot authorize testing them.
Look for this next time: A cloud customer can authorize tests of its own resources, not of the provider's infrastructure, so check the provider's testing policy during scoping.
Correct answer: D · Rewrite the query as a parameterized statement that binds the input
OWASP's SQL Injection Prevention Cheat Sheet names parameterized queries as the preferred defense: the SQL structure is defined separately and the input is bound as a data value, so it cannot change the query. The cheat sheet calls manual escaping error-prone and strongly discouraged, because escaping rules differ between databases and settings. A web application firewall rule and a generic error page can reduce what an attacker sends or sees, but the vulnerable query stays in the code. A report can list them as added layers, along with least-privilege database accounts, after the primary fix.
Look for this next time: For SQL injection, recommend parameterized queries as the root-cause fix; WAF rules and error handling are added layers.
Correct answer: B · Certificate transparency logs that list the certificates for the domain
The Certificate Transparency project describes CT logs as publicly available, append-only records that let anyone see which certificate authorities issued which certificates, when, and for which domains. Searching them reveals hostnames named in certificates without contacting the client's systems, which makes it passive reconnaissance. A zone transfer request and a wordlist resolved against the client's name servers both send queries to the client's DNS, and crawling the website sends requests to its web server, so each one touches the target. Names found in CT logs can be old or internal, so the tester still checks them against the scope before any testing.
Look for this next time: Certificate transparency logs are a passive source of subdomains because they are public records of issued certificates.
Correct answer: D · Nmap cannot tell whether the port is open or a filter dropped it
Nmap's reference guide says a UDP port is classified as open|filtered when no response arrives after retransmissions: the port could be open, or a packet filter could be blocking the traffic. A UDP reply from a service would prove the port open, and an ICMP port unreachable error would mark it closed, so neither fits a probe that got no answer. The state describes one port, not the host, and says nothing about the host being down. Nmap's documentation adds that version detection can help tell truly open ports from filtered ones.
Look for this next time: In a UDP scan, open|filtered means no reply came back, so the port may be open or filtered; version detection can help resolve it.
Correct answer: A · Run ping quietly inside an if test and echo the address on success
The GNU Bash manual says an if statement runs its then branch when the test command returns a zero status. The ping manual page says ping exits with code 1 when it receives no reply at all and 0 otherwise, which makes the exit code usable to see whether a host is alive. Running ping with its output discarded as the if test, and echoing the address in the then branch, prints only the hosts that answered. A while loop changes how the loop counts, not what it prints. A sleep slows the sweep without filtering anything, and sorting reorders the output but still shows every timeout.
Look for this next time: In shell scripts, test a command's exit status with if; ping returns 0 when a reply arrives.
Correct answer: C · As requests to crawlers, which do not control access to the paths
RFC 9309, the Robots Exclusion Protocol, says the rules in robots.txt are not a form of access authorization. A Disallow line asks well-behaved crawlers to skip a path, so it neither protects the path with a login nor proves that the path was removed. Listed paths can still exist and respond, which is why a tester notes them for review within the agreed scope. Scope comes from the rules of engagement and the statement of work, not from a file written for search engines, so the entries do not exclude anything from the test.
Look for this next time: robots.txt asks crawlers to skip paths; it is not access control and does not define the test scope.
Correct answer: B · Software composition analysis of the libraries the app depends on
OWASP describes component analysis as identifying risk from the use of third-party and open-source components, and says that with a limited scope it is commonly called software composition analysis (SCA). Checking the app's libraries for known vulnerabilities is exactly that. OWASP describes static application security testing tools as analyzing source code to find security flaws, which suits the client's own code, and web application vulnerability scanners as testing a running app, normally from the outside. Neither is built to inventory third-party components. A wireless channel scan looks at radio networks, not software.
Look for this next time: To find known vulnerabilities in third-party and open-source libraries, use software composition analysis.
Correct answer: A · Check Red Hat's advisory for the CVE against the installed package
Red Hat explains that it backports security fixes into older package versions, so the version number alone does not show whether a system is vulnerable, and that tools judging only by version produce false positives. Red Hat names the CVEs in its advisories, so comparing the advisory with the installed package shows whether the fix is present. Reporting the flaw as critical from the banner alone risks a false positive. Upgrading the server is the client's decision, not a validation step. Repeating the same version-based scan would repeat the same result without new evidence.
Look for this next time: Validate version-based findings against the vendor's advisories, because backported fixes keep old version numbers.
Correct answer: D · TruffleHog, which looks for leaked credentials in Git repositories
TruffleHog's documentation describes it as a tool to find, verify, and analyze leaked credentials, and lists Git among the places it scans. Its output records the commit in which each secret was found, so a key removed in a later commit can still turn up in the commit that added it. Nikto is a web server scanner, Nmap reports hosts and port states, and WiGLE maps wireless networks, and none of them reads a repository's history. Any live key found should be reported so the client can revoke and replace it, because deleting the line from the code does not invalidate the key.
Look for this next time: Secrets scanners such as TruffleHog check a repository's commits, so a key removed later can still be found and must be revoked.
Correct answer: B · There is an estimated 85% chance of exploitation in the next 30 days
FIRST describes the Exploit Prediction Scoring System as a model that estimates the probability that a published CVE will be exploited in the wild in the next 30 days, published daily as a 0–1 probability for every CVE. A score of 0.85 is an estimated 85% probability, which makes that CVE the stronger candidate for priority when the severity of the two is similar. EPSS is not a severity scale; CVSS describes severity. It also says nothing about how many hosts in this network share the flaw or how many versions a vendor has patched.
Look for this next time: EPSS estimates the chance that a CVE will be exploited in the wild within 30 days; CVSS describes severity.
Correct answer: C · Pause and raise it with the client contact before taking any action
NIST SP 800-115 says the rules of engagement should identify the risks of intrusive tests and the techniques used to reduce them, give criteria for halting testing, and set out the communication path and points of contact. CompTIA's objectives also list scope limitations and labeling sensitive systems under preparing attacks. A system already labeled fragile calls for the client's explicit decision before any step that could disrupt it, so the tester pauses and asks. A quieter hour or a watched restart is a choice the client must approve, not one the tester makes alone. Leaving out a confirmed weakness hides a real risk from the client.
Look for this next time: When a proof step could disrupt a system the client labeled sensitive, stop and get the client's decision first.
Correct answer: A · Require multifactor authentication for every sign-in on the portal
MITRE ATT&CK describes password spraying as trying one or a few common passwords against many accounts to avoid the lockouts that repeated guesses against one account would trigger, and lists multifactor authentication on externally facing services among its mitigations. With a second factor required, a guessed password alone no longer opens the account. A lower per-account threshold does not help when each account sees a single attempt, and MITRE warns that overly strict lockout policies can lock out legitimate users. A generic error message still lets a correct password in, and a 30-day change schedule does not stop users from picking another common password.
Look for this next time: Password spraying stays under per-account lockout limits, so the direct fix is multifactor authentication on exposed sign-ins.
Correct answer: D · Check on the server that each invoice belongs to the signed-in user
OWASP's Insecure Direct Object Reference Prevention Cheat Sheet says IDOR comes from a missing object-level authorization check, which lets a user reach objects that are not theirs by changing an identifier. It adds that even hard-to-guess identifiers still need access control checks, because a leaked reference would still work. The fix is a server-side check that each invoice belongs to the signed-in user. Random or encrypted identifiers only make references harder to guess. Moving the number into a POST body changes where it travels, not whether the server checks ownership, and the cheat sheet notes that values in a POST body can be manipulated too.
Look for this next time: Fix IDOR with a server-side ownership check on every object request; hard-to-guess IDs alone are not access control.
Correct answer: C · Turn on S3 Block Public Access for the bucket and the account
AWS's documentation says S3 Block Public Access settings override bucket policies, access point policies, and object permissions to limit public access, and that they are enforced regardless of how the resources are created. That directly ends the public read the tester found. A new bucket name is obscurity, not access control. Default encryption protects the stored data at rest, but it does not decide who may read the objects. Access logging records requests, which helps the client investigate what was already read, but it does not stop anyone from reading the backups. Both can follow as added steps.
Look for this next time: For an S3 bucket that should be private, block public access first; encryption and logging do not change who can read it.
Correct answer: B · Turn on number matching so approving needs the code on the screen
CISA's October 2022 fact sheet on number matching describes MFA fatigue, also called push bombing, as flooding a user with push prompts until the user approves one. It recommends number matching for organizations that cannot yet move to phishing-resistant MFA, because a user cannot approve a request without the numbers shown on the sign-in screen, which makes repeated prompts ineffective. CISA calls phishing-resistant MFA the stronger goal. A shorter prompt lifetime still lets a tired user tap approve. CISA also recommends training users to report unknown requests, but training does not change the approval step. A longer password does not help once the password is known.
Look for this next time: MFA fatigue is countered most directly by number matching, with phishing-resistant MFA as the stronger long-term goal.
Correct answer: D · Treat uploaded text as untrusted data and cut the bot's note access
OWASP's LLM01:2025 Prompt Injection entry describes indirect prompt injection: a model accepts input from external sources such as websites or files, and content inside them changes the model's behavior. Its prevention list includes separating and clearly marking untrusted external content and enforcing least privilege, so the model cannot reach data it does not need. Antivirus scanning looks for malicious code, not instructions written as plain text. Signing in identifies the uploader but does not make the document's content safe. Logging helps the team review what happened afterward, but it does not prevent the next disclosure.
Look for this next time: Indirect prompt injection arrives inside external content, so treat that content as untrusted and limit what the model can reach.
Correct answer: A · Remove them as agreed with the client, and record that in the report
CompTIA's PT0-003 objectives list removing tester-created credentials, removing tools, and removing persistence mechanisms among cleanup and restoration activities. NIST SP 800-115 says the rules of engagement should explain the required actions for files the testers create once testing is completed, and that tools and the files they generate should be removed from systems. Leaving the accounts active for study, until the report arrives, or for a possible retest keeps valid credentials in the client's directory that no one is watching. The report should record what the team created and when it was removed.
Look for this next time: Accounts and other artifacts created during a test are removed at the end, as agreed with the client, and the removal is documented.
Correct answer: C · The attack narrative, which tells the story of the test step by step
CompTIA's PT0-003 objectives list the attack narrative as its own report component, next to the executive summary, methodology, detailed findings, and recommendations, and the exam page's summary of the post-exploitation domain mentions creating attack narratives. A narrative follows the test in sequence, so the client's team can match each step with what its tools recorded. The executive summary is written for decision-makers in plain language. The methodology section explains how the test was run, and the limitations and assumptions record what was not covered or what was assumed.
Look for this next time: The attack narrative retells the test in order, which helps defenders trace each step against their monitoring.
Correct answer: B · Destroy it securely and confirm the destruction to the client contact
NIST SP 800-115 says the assessment plan should address data handling, including how data is stored and transmitted during and after the assessment and how it is removed when the assessment ends. CompTIA's PT0-003 objectives list secure data destruction among cleanup activities. Here the plan requires destruction after delivery, so the tester destroys the sample securely and confirms it in writing. Keeping an encrypted copy breaks the agreed plan. Emailing customer records creates a new copy in transit, and a shared drive spreads the data further. The client already holds the original records.
Look for this next time: Client data taken as proof follows the engagement's data-handling plan, which often ends in secure destruction and a written confirmation.
Use the sample well
A short set can show you what deserves another look. A strong run shows you can read a scoping detail, a tool result, or a finding and choose the step a careful, authorized tester would take. Twenty questions are a small sample, so the result does not predict a 750 on the 100–900 scale.
Pick the one answer that fits every condition in the scenario. Then read why each other option falls short.
Confirm why the best option fits, even when you were right.
Use recurring misses—not one score—to choose your next focus.
Full CompTIA PenTest+ prep
Want more than 20 questions?
At launch: 1,150 exam-style CompTIA PenTest+ questions and 600 flashcards, practiced one domain at a time.
Explore Full CompTIA PenTest+ PrepFree CompTIA PenTest+ resources
Open the exam overview, build a study plan, or browse the CompTIA PenTest+ guides.
Review the exam format, official sources, and preparation options.
Open exam hub →Practical planning aidTurn the time you have into a clear study rhythm.
Build my outline →Source-backed answersGo straight to the question already on your mind.
Browse guides →