Penetration Testing Methodology and Execution Questions
Running structured penetration-testing engagements end to end. Covers the pentest lifecycle, reconnaissance and information gathering, network scanning and enumeration (Nmap, service/version detection), tool selection and usage (Metasploit, Burp Suite), engagement scoping and planning, testing across target types, and findings reporting. The methodical offensive-assessment workflow.
Describe the key elements of pre-engagement scoping for a time-boxed penetration test. In your answer include: test objectives and success criteria, a clear asset inventory (IP ranges, domains, application endpoints), in-scope and out-of-scope targets, permitted and prohibited testing techniques, data handling and evidence rules, point(s) of contact and escalation procedures, authorization and legal approvals, scheduling constraints, and what should be included in the Statement of Work (SOW).
Sample Answer
Direct answer
Pre-engagement scoping turns a client's vague security concern into a bounded, authorized, and safely executable test plan, and doing it well is what prevents legal exposure, scope creep mid-engagement, and wasted testing time. It has to cover objectives, a concrete asset inventory, explicit in-scope and out-of-scope boundaries, permitted and prohibited techniques, data handling rules, points of contact, formal authorization, scheduling, and a Statement of Work (SOW) that ties all of it together contractually.
Structured elaboration
- Test objectives and success criteria: state the actual business question being answered, for example whether an external attacker can reach cardholder data, rather than a vague "find vulnerabilities."
- Asset inventory: a concrete list, not a description, IP ranges and CIDRs (Classless Inter-Domain Routing blocks), domains and subdomains, specific application endpoints or API base URLs, and mobile app package identifiers.
- In-scope and out-of-scope targets: explicit exclusions matter as much as inclusions, for example a third-party payment processor or a disaster-recovery site.
- Permitted and prohibited testing techniques: is social engineering allowed, is any denial-of-service-style testing allowed, is destructive testing permitted anywhere, and if so, only against a specific staging environment.
- Data handling and evidence rules: how discovered sensitive data is handled during and after the test, encryption of the report and evidence at rest, and a retention and destruction timeline.
- Points of contact and escalation: a technical contact for day-to-day questions, and a separate emergency contact reachable for a critical finding or an accidental outage, available for the full testing window.
- Authorization and legal approvals: a signed authorization letter, plus separate cloud-provider authorization when assets are hosted on a major cloud platform, since some providers require advance notification for certain testing activity regardless of the client's own sign-off.
- Scheduling constraints: the testing window itself, plus blackout periods such as quarter-end close or a major release week.
- Statement of Work contents: deliverables, timeline, price, the methodology framework referenced (for example PTES, the Penetration Testing Execution Standard), assumptions and exclusions, and the report's delivery format and confidentiality terms.
Worked example
A condensed scope-document excerpt for a retail client spanning web, API, and mobile surfaces:
- Objective: assess whether an external attacker can reach customer payment data or administrative functions.
- Assets: the web storefront domain, the REST API base path, the iOS and Android app package identifiers, and the CIDR range covering the public-facing load balancers.
- Out of scope: the third-party payment gateway's hosted checkout, and the corporate email and collaboration tenant.
- Permitted: standard web and API testing techniques, automated scanning throttled to a defined rate. Prohibited: denial-of-service-style stress testing, social engineering of employees, and any destructive testing directly against the production database, using a provided staging replica instead.
- Data handling: any live customer data discovered is redacted in screenshots, reported to the named security contact within 24 hours rather than held for the final report, and deleted from tester systems within 30 days of delivery.
- Points of contact: a security engineer for day-to-day technical questions, and the CISO's (Chief Information Security Officer's) direct line as the emergency contact for a suspected active breach or unintended outage, both reachable during the agreed testing window.
- Authorization: signed by the client's general counsel; since the hosting provider is a major cloud platform, the engagement is registered under that provider's own penetration-testing policy in advance, since standard tooling is permitted under that policy but denial-of-service simulation is not.
- Scheduling: weekday business hours over three weeks, with a blackout during the client's peak sales week.
- SOW: fixed-price, PTES-aligned methodology, deliverables of interim critical-finding alerts, a final report, and one retest.
Trade-offs and pitfalls
- Scoping too narrowly can exclude a boundary that still matters; excluding a third-party payment iframe doesn't mean the storefront's own session-handling around it is safe to skip.
- Vague or ambiguous "safe" language in the authorization document, rather than a concrete asset list, creates real risk if a finding later gets disputed as unauthorized access.
- Skipping cloud-provider notification because the client already signed off can still violate that provider's own terms of service; the client's authorization and the provider's authorization are two separate approvals.
Identify the legal and compliance notices and statements that should appear in a penetration test report. For each item, explain why it's important and provide a short sample phrasing suitable for inclusion in the report.
Sample Answer
Direct answer: A penetration test report needs a small set of standard front-matter statements that protect both the client and the testing firm legally and set expectations about what the report is and isn't. Missing them is a common gap that undermines an otherwise strong technical report.
Structured elaboration
- Authorization and scope statement. Confirms the test was authorized, states the dates and systems tested, and protects the tester from being mistaken for an actual attacker. Sample: "This assessment was conducted under signed authorization from [Client], limited to the assets and time window defined in the Rules of Engagement; testing outside that scope was not performed and is not covered by this report."
- Confidentiality notice. The report contains exploitable vulnerability detail, so it states who may see it. Sample: "This document is confidential and intended solely for [Client]. It must not be distributed outside authorized personnel."
- Point-in-time disclaimer. A pentest is a snapshot, not an ongoing guarantee, which manages expectations if a new vulnerability appears the next day. Sample: "Findings reflect the environment as tested between [dates]. This report does not guarantee the absence of vulnerabilities introduced after the assessment period."
- Methodology reference. States the framework followed (for example, the Penetration Testing Execution Standard, PTES, or NIST Special Publication 800-115) so the reader can judge rigor. Sample: "This engagement followed a methodology aligned with PTES, covering reconnaissance, scanning, exploitation, and reporting."
- Evidence handling and retention statement. States what happens to captured evidence after delivery. Sample: "All evidence and test artifacts, including any data samples extracted to demonstrate impact, will be securely destroyed 30 days after report acceptance."
- Ownership notice. States who owns the report content. Sample: "This report is the property of [Client] upon delivery."
- Classification marking. A short marking (often the Traffic Light Protocol, TLP, a simple color-coded sharing standard) so recipients know how far they may forward it. Sample: "TLP:AMBER, limited disclosure, restricted to participants' organizations."
Worked example. Together, these appear as a short block on the report's cover or first page: a scope-and-authorization paragraph, a confidentiality line, the point-in-time disclaimer, the methodology reference, and the classification marking, all before the executive summary begins.
Trade-offs and pitfalls. Don't copy a generic disclaimer template without checking it against the actual signed contract for this engagement; a mismatch in dates or scope undermines the protection the notice is meant to provide. Don't overload the front matter with dense legal language duplicating the separately-signed contract; keep it short and let the contract carry the full detail. The evidence-retention statement is the most commonly forgotten item, and it's the one most likely to matter if a client later asks what happened to the data you extracted.
Design an automated penetration test harness for API gateways and WAF rules that performs black box testing. The harness should: enumerate endpoints, send a curated set of malicious payloads and evasions, record which requests were blocked or allowed, and measure rule coverage and false positive rates. Describe how to automate repeated runs safely and how to use results to tune WAF policies.
Sample Answer
Direct answer
An automated black-box harness for testing API gateway and WAF (Web Application Firewall, the filtering layer in front of the app that inspects incoming requests and blocks the ones matching known attack patterns) rules needs three things a manual test rarely bothers to formalize: a labeled payload corpus (a curated, labeled collection of test payloads) organized by attack class with matching evasion variants, a way to reliably tell a WAF block apart from a normal application response, and a second, separate corpus of legitimate-looking requests to measure false positives, since coverage without a false-positive check just rewards a WAF tuned to block everything.
Design
Enumerate endpoints. Seed the target list from the OpenAPI specification when one exists, the same reasoning as fuzzing any other API: it is ground truth for what endpoints and methods exist. Supplement it with a passive crawl or proxy capture of real traffic through the gateway to catch undocumented routes the spec omits, and re-sync this target list on every run rather than treating it as a one-time snapshot, since endpoints change.
Curated payloads and evasions. Organize a labeled corpus by the injection class it targets: boolean, error-based, and time-based SQL injection probes, reflected cross-site scripting markers, path traversal sequences, command injection canaries, deserialization markers, using well-known, non-destructive detection strings for each class, the same "detect, do not exploit" probes used in manual testing, such as a boolean SQL injection pair like ' OR '1'='1 against ' OR '1'='2 to detect a behavioral difference, or a benign reflected-XSS marker. Pair each canonical payload with WAF-evasion variants, double URL-encoding, case variation, comment insertion, Unicode normalization tricks, since the specific purpose of this harness is measuring whether the WAF catches the obfuscated form, not just the textbook payload a WAF vendor's default rule set was written against.
Recording blocked versus allowed. Send each payload through the actual gateway and WAF path, never directly to the backend, and classify the response: a WAF block usually looks distinct (its own error page, a header such as a block-reason identifier, or a connection reset), while an allowed request either reaches the backend, confirmed through a backend-side correlation marker the harness can check, or is rejected by the backend itself for an unrelated reason, which must be distinguished from a WAF block or the harness will undercount real bypasses. Log the full request, the matched rule identifier if the WAF exposes one, and the classification for every payload.
Measuring rule coverage and false-positive rate. Coverage is the fraction of the malicious-payload corpus that gets blocked, reported per injection class so you learn, for example, that SQL injection coverage is strong while coverage for server-side request forgery (SSRF, where the server itself is tricked into making an attacker-directed request) is weak, rather than one blended number that hides the gap. False-positive rate needs a separate corpus of known-benign-but-suspicious-looking requests, a legitimate user bio field containing the word "select," a legitimate query string with several ampersands, run through the same harness; a well-tuned WAF blocks most of the malicious corpus and passes most of the benign corpus, and both numbers should be reported together, since a WAF tuned to maximize coverage alone can trivially do so by blocking almost everything, which destroys usability.
Automating repeated runs safely. Rate-limit the harness's own traffic well below anything that could become a denial-of-service against the gateway itself or trip unrelated infrastructure alarms. Run against a dedicated staging instance of the gateway and WAF configuration wherever possible, since firing thousands of malicious-looking requests at a shared production WAF risks polluting production security logs and consuming the WAF's own CPU or rate-limit budget. Version the payload corpus and the WAF rule set together so a scheduled run's results are diffable against the prior run, did coverage regress after a rule was "simplified," did a new false positive appear after a rule was tightened, rather than being a one-off snapshot with nothing to compare it to.
Using results to tune policy. Feed per-class coverage gaps back to whoever owns the WAF rule set as a prioritized list, the class with the lowest coverage and highest business risk first, and feed false positives back as concrete before-and-after examples so the rule owner can narrow a match pattern rather than being told only "false positives exist." Treat the labeled corpus itself as a regression suite for the WAF configuration going forward: every rule change gets run against it before deployment, turning WAF tuning from an ad hoc, reactive process into something with its own test suite.
Trade-offs & pitfalls
A harness that only reports coverage, with no benign corpus and no false-positive number, will systematically push a WAF owner toward over-blocking, since coverage is the only metric being rewarded. It is also easy to under-invest in the evasion-variant half of the corpus and end up only proving the WAF's default rule set works, which the vendor already tested; the evasion variants are what make this exercise worth automating in the first place.
Compare and contrast three popular subdomain enumeration tools (for example Amass, Sublist3r, and assetfinder). For each tool explain primary data sources it queries (OSINT feeds, CT logs, brute force), strengths and limitations (speed, noise, active vs passive), typical performance characteristics, and an example use-case where that tool is the best fit during a scoped engagement.
Sample Answer
These three tools sit on a speed-versus-coverage spectrum: Amass is the most thorough and configurable but slowest, Sublist3r is a fast, simple passive-only default, and assetfinder is the lightweight option you pipe into other tools rather than run standalone.
Comparison
| Tool | Primary data sources | Strengths / limitations | Best-fit use-case |
|---|---|---|---|
| Amass | Certificate transparency (CT) logs, passive DNS, WHOIS, third-party open-source intelligence (OSINT) APIs, optional active brute-force resolution | Most comprehensive and configurable, with a graph database for correlating assets; slower by default and noisier if active modes are enabled; several sources need free API keys for best results | A full-scope engagement where exhaustive asset inventory matters more than speed |
| Sublist3r | Public search engines, DNSDumpster, Netcraft, and similar passive services | Fast and simple passive discovery; fewer sources and less configurable than Amass; low network noise since it's passive only | Rapid initial reconnaissance during scoping, where speed and staying quiet matter more than exhaustiveness |
| assetfinder | Lightweight OSINT lookups against a handful of passive sources | Very fast and minimal setup, designed to be piped into other tools rather than used as a standalone deliverable; narrower coverage than Amass | Quick first-pass domain enumeration as one stage of a larger recon pipeline |
Worked example
On a scoped external engagement I'd typically chain them: assetfinder for a fast first pass, Amass in passive mode for depth and CT-log coverage, then merge and de-duplicate both output lists before doing anything active, since the union of two passive tools catches more than either alone without adding any network noise.
Trade-offs and pitfalls
A common pitfall is treating any single tool's list as complete, when different tools query different sources and genuinely miss different subdomains. Another is reaching for Amass's active brute-force mode by default, which is far noisier than passive-only enumeration and often isn't appropriate this early in an engagement.
Design a prioritized penetration testing strategy for a five-day engagement against a medium-sized e-commerce company. The environment includes a public storefront, payment integrations, an internal admin panel, and an employee VPN. Explain how you would prioritize assets by business impact, allocate depth of testing per target, select tooling and authentication contexts, and define success criteria for each priority area.
Sample Answer
Direct answer: With five days against a public storefront, payment integrations, an internal admin panel, and an employee VPN, you cannot treat all four as equal-depth targets. Rank them by what a compromise would actually cost the business, and allocate testing days and rigor accordingly, front-loading whatever leads fastest to direct financial loss or full internal access.
Structured elaboration
Business-impact ranking, highest to lowest:
- Payment integrations. A flaw here means direct financial loss and Payment Card Industry Data Security Standard (PCI DSS) exposure, the fastest path to regulatory and brand damage.
- Admin panel. Usually the single highest-privilege point of failure; compromise typically means full control over the storefront's data and configuration.
- Employee VPN. An entry point whose risk is "how big is the blast radius once this door opens," since a foothold here can lead to lateral movement across systems well beyond today's scope.
- Public storefront (excluding payment flow). Larger attack surface by page and endpoint count, but generally lower per-finding severity than the three above; worth full days, but with a wider, shallower sweep rather than deep logic testing on every page.
Depth allocation across five days (adjust based on what day one reveals):
- Day 1: parallel recon and enumeration across all four asset groups, to build the attack-surface map and catch anything that reprioritizes the plan.
- Day 2: focused manual testing of the payment flow and checkout logic, authenticated as a real customer.
- Day 3: the admin panel, authenticated with a low-privilege staff account if provided, focused on authorization boundaries and privilege escalation.
- Day 4: the VPN and what's reachable once connected, plus remaining non-payment storefront functionality.
- Day 5: wrap-up testing of anything chained across days two through four, evidence consolidation, and report writing, which needs real time on a five-day clock, not an afterthought.
Tooling and authentication contexts:
- Payment and storefront: a web proxy for manual and semi-automated testing (intercepting, replaying, and fuzzing requests), real test-customer accounts, and sandbox payment-processor credentials if the provider supports one.
- Admin panel: the same proxy tooling, but starting from a provided low-privilege staff credential rather than fully unauthenticated, since finding the login page itself in five days is a poor use of time against what a phished-credential scenario would actually expose.
- VPN and internal network: an authenticated, employee-simulation starting point, using a network scanner once connected, since testing the VPN's own login from the outside is a narrower question than what a connected employee can reach.
Success criteria per area: payment, no way to manipulate price or currency server-side and card handling matches agreed PCI DSS scope; admin panel, no privilege escalation from the lowest granted role and no unauthenticated access to admin functions; VPN and internal, a documented map of what an authenticated, unprivileged session can reach that it shouldn't, since five days can't fully test a whole internal network; storefront, no exploitable unauthenticated access-control or injection issue.
Trade-offs and pitfalls. The most common five-day mistake is spending two days on broad automated scanning across everything before doing any prioritized manual work; scan in parallel with the plan above, not before it. Being asked to cover all four areas equally in five days is a scoping conversation to have on day zero, not something to accept silently and then deliver shallow coverage against. Write explicit coverage gaps into the report for anything the time box didn't allow, so the client doesn't mistake "not tested" for "tested and clean."
Unlock Full Question Bank
Get access to all Penetration Testing Methodology and Execution interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.