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.
Explain the purpose and typical contents of 'rules of engagement' (RoE) for an authorized penetration test. Provide concrete examples of restrictions organizations commonly impose (for example: test time windows, systems to avoid, thresholds for failed logins, or third-party-supplied systems), how to implement a kill-switch or emergency stop, and how to respond if an unexpected production outage occurs during testing.
Sample Answer
Direct answer
Rules of engagement (RoE) are the operational rulebook layered on top of the legal authorization: they spell out exactly what a tester may and may not do, when, and what happens if something goes wrong, so both sides have a shared, written answer before anything unexpected happens mid-test. Beyond the broad scope document, RoE typically nail down concrete restrictions, an explicit kill-switch process, and a pre-agreed response if testing itself causes an outage.
Structured elaboration
Common concrete restrictions organizations impose:
- Testing time windows, for example only during business hours, or conversely only after-hours, to limit collateral impact on real users.
- Systems to avoid entirely, legacy systems known to be fragile, anything already flagged as unstable, or third-party-supplied systems the client doesn't have authority to authorize testing against.
- Thresholds for automated actions, for example a maximum number of failed login attempts per account before automated authentication testing must stop, to avoid mass account lockouts.
- Third-party-supplied systems, a payment processor's hosted checkout or a SaaS vendor's admin console, anything requiring separate authorization from a party who isn't part of the client's own authorization letter.
Kill-switch and emergency stop implementation:
- A named, reachable point of contact on both sides for the full duration of the testing window, not just office hours.
- A pre-agreed communication channel, commonly a shared chat channel or a dedicated phone line, monitored throughout testing.
- A pre-agreed stop signal, a specific phrase or command, that immediately halts all active testing the moment either side invokes it, with no negotiation required in the moment.
- A written expectation that invoking the kill-switch is never treated as an accusation or a failure; it's simply the safety mechanism doing its job.
Response if an unexpected production outage occurs during testing:
- Stop all active testing immediately via the kill-switch, before investigating cause.
- Notify the pre-agreed emergency contact right away, even before root cause is confirmed, since minutes matter for a real outage.
- Preserve everything you were doing at the moment of the outage, the exact request, timestamp, and tool state, so the client's team can correlate it against their own monitoring, whether or not your testing turns out to be the actual cause.
- Only resume testing after the client explicitly confirms it's safe to do so, and consider adjusting technique, slower timing or avoiding the specific action that coincided with the outage, before resuming.
- Document the incident and the response in the final report regardless of whether testing was the actual cause, since it's a real event that happened during an authorized engagement.
Worked example
An RoE document for an internal network engagement might read: testing permitted weekday business hours only; do not target the legacy inventory management server flagged as unstable by the client; automated login testing must not exceed five failed attempts per account per hour; emergency contact reachable for the full testing window; kill-switch phrase honored immediately by all testers upon receipt in the shared incident channel. If the client's monitoring flags a service disruption during the window and the tester's own log shows a scan running against an in-scope host at that exact time, testing stops immediately via the kill-switch phrase, the emergency contact is notified before the cause is even confirmed, and the specific scan configuration is preserved for the client's own investigation.
Trade-offs and pitfalls
- An RoE with vague restrictions, such as "avoid causing problems," gives no actual guidance in the moment something looks risky; restrictions need to be concrete enough to act on without a judgment call under pressure.
- A kill-switch that only one side can invoke, or that requires approval before taking effect, isn't actually a kill-switch; it needs to work the instant either party says stop.
- Treating an outage during testing as automatically the tester's fault, or automatically not, before investigating wastes the client relationship either way; the right first move is always to stop and preserve evidence, not to assign blame.
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.
List and explain at least six operational safety and non-destructive scanning practices you follow to avoid causing outages during a production penetration test. For each practice, include why it reduces risk and one example of how you implement it in a real engagement.
Sample Answer
Direct answer
Avoiding an unintended outage during a production pentest comes down to treating every action as a controlled experiment: throttle anything that could exhaust a resource, prefer proving a finding non-destructively over actually triggering its worst-case impact, and keep a live communication channel open so a problem can be stopped in seconds rather than discovered after the fact.
Structured elaboration
- Throttle scan timing and concurrency against fragile or production hosts. Aggressive, high-concurrency scanning can exhaust connection handling on older or resource-constrained infrastructure. Example: dropping to a slower timing template and capping the scan's minimum packet rate specifically against a load balancer the scoping document flagged as fragile.
- Exclude denial-of-service-class checks from automated vulnerability scans by default. Some scanner plugin categories are specifically designed to crash a service to confirm a flaw exists, risking an outage the client never authorized. Example: disabling the denial-of-service plugin family in a vulnerability scanning policy before running it against a live production segment.
- Prove exploitability non-destructively wherever a safer alternative exists. Confirming an issue through a minimal, reversible signal, a boolean or timing difference, a version banner, rather than through the action that would actually cause the worst-case impact reduces the chance of crashing a service or corrupting real data while still proving the finding.
- Use a staging or replica environment for anything genuinely destructive, when one exists and is in scope. Testing account-lockout thresholds, backup and restore logic, or anything else that intentionally degrades a system is safer against a snapshot or staging clone than against the live production system.
- Rate-limit and avoid mass account lockout during authentication testing. Spacing out login attempts and using a designated, authorized test account rather than real employee or customer accounts protects actual users from being locked out mid-business-day as a side effect of testing.
- Maintain a live communication channel and a pre-agreed stop condition throughout the active testing window. This turns a potential outage into a near-miss: if anything looks like it's degrading a service, testing can be paused within seconds rather than after damage is already done. Example: a shared channel actively monitored by both sides for the duration of testing, with an agreed stop phrase honored immediately.
- Snapshot or back up state before any test that writes or modifies data, and revert afterward. A proof-of-concept that changes an account setting or stores a test value should leave the environment exactly as it was found once the finding is confirmed.
- Schedule heavier or higher-risk activity, full UDP sweeps or aggressive scripted checks, during lower-traffic windows agreed in advance, rather than peak business hours. This avoids the added load compounding with real user traffic in a way that neither alone would have caused.
Worked example
Testing a login endpoint for weak lockout policy on a production system, the safe sequence is: confirm the rules of engagement's stated failed-attempt threshold, use a single designated test account rather than any real customer or employee account, space attempts out rather than firing them in a burst, and stop the moment the threshold behavior is confirmed either way, rather than continuing to hammer the endpoint past the point where the answer is already known.
Trade-offs and pitfalls
- Being maximally cautious everywhere slows the engagement down and can leave real time on the table; the judgment call is knowing which specific systems actually need this level of care, based on what the scoping document says about fragility, rather than applying the same caution uniformly to every host.
- A stop condition that exists only on paper and isn't actively monitored during the testing window isn't a real safety mechanism; it needs an actual person watching an actual channel.
- Non-destructive verification is not an excuse to under-prove a finding; it needs to still be convincing evidence, just achieved through the lowest-risk method available.
List and describe the types of evidence that should accompany a technical finding in a penetration test report. For each evidence type, explain preferred file formats, minimum metadata to include (timestamps, tester ID, environment), and how to reference it in the finding so engineers can reproduce the issue.
Sample Answer
A technical finding is only as credible and reproducible as the evidence behind it, and different evidence types need different formats and metadata: screenshots and packet captures for visual and network proof, logs and request/response dumps for exact reproduction, and proof-of-concept (PoC) scripts or configuration snippets when the issue is easier to show than to describe in prose.
Evidence types, formats, and required metadata
| Evidence type | Preferred format | Minimum metadata | How it's referenced |
|---|---|---|---|
| Annotated screenshots | PNG, or a single PDF for a multi-step sequence | Timestamp (UTC), tester ID, target hostname, browser/OS, one-line action description | "See S-01.png (2026-02-15T14:22:31Z); annotations A-C map to steps 3-5" |
| Packet captures (PCAP) | .pcap or .pcapng | Capture start/end time, capture filter used, tester ID, capture interface | "See P-01.pcapng, filtered to the target IP; packet #345 shows the injected payload" |
| Server or application logs | Raw .log or .txt, compressed if large | Time range (UTC), log source, correlation ID if available, tester ID | "See server-app-2026-02-15.log, lines 1024-1040, matching the 14:22:31Z timestamp" |
| HTTP request/response dumps | Raw text export from the proxy tool used | Full headers, timestamp, tool used to capture it | "Full request/response saved as req-12.txt; the injected parameter is on line 4" |
| Proof-of-concept (PoC) scripts | Plain source file with a comment header | Purpose, target, tester ID, explicit note that it is non-destructive | "poc_idor_check.py demonstrates the object-reference swap described above" |
| Configuration snippets | Plain text, secrets redacted | Source file/host, timestamp collected, redaction note | "Excerpt from web.config confirming the missing security header, secrets redacted" |
Worked example
For an insecure-direct-object-reference finding, the evidence bundle is: the two HTTP request/response pairs (User A requesting User B's record, and the resulting 200 response), a screenshot of the browser rendering User B's data while logged in as User A, and one line of metadata: 2026-02-15T14:22:31Z, tester JD, staging environment. That's enough for an engineer to reproduce the exact request without a follow-up call.
Trade-offs and pitfalls
A serious pitfall is dumping a raw, unredacted config file or log that contains real secrets, like API keys or password hashes, directly into the report, which turns evidence collection into its own security incident; redact before attaching, always. A subtler one is relying on a screenshot alone for something that needs byte-level proof, like a header change, when a raw request/response dump would settle the question without any ambiguity.
You are given a single target domain in-scope for a penetration test. Describe how you would use WHOIS, passive DNS, DNS record inspection, DNS zone transfer (AXFR) attempts, and reverse DNS lookups to enumerate related assets. Provide example commands or queries you would run (tool and flags) and explain how to interpret ambiguous or conflicting DNS results.
Sample Answer
Direct answer
Enumerating related assets from a single in-scope domain works by pulling every domain-adjacent record type from an independent source and cross-referencing what agrees, since WHOIS, DNS records, and zone transfers each expose a different slice of the same infrastructure, and gaps or lies in one are often caught by another.
Structured elaboration
- WHOIS:
whois target.examplereturns the domain's registration record: registrar, name servers, and registration/expiry dates, plus registrant or admin contact details when a privacy proxy has not redacted them (most registrars redact this by default today). A reused registrant email or phone number can sometimes link the target to other domains the same organization owns, though many registries have restricted this kind of reverse lookup. - Passive DNS: historical resolution data collected by third-party aggregators showing what IP addresses a hostname has resolved to over time, and which other hostnames have pointed at a given IP. Because it comes from a third party's archive rather than a live query against the target, it never touches the target's own infrastructure, which keeps this step fully passive.
- Active DNS record inspection: querying specific record types directly, for example
dig target.example MXfor mail servers,dig target.example TXTfor text records (which often reveal SPF, Sender Policy Framework, and DKIM, DomainKeys Identified Mail, entries or third-party SaaS verification tokens naming vendors the target uses),dig target.example NSfor authoritative name servers, anddig target.example SOA(Start of Authority, which identifies the zone's primary name server and serial number). A broaddig target.example ANYused to return everything at once, but most public resolvers now restrict or ignore ANY queries, so querying specific types explicitly is the reliable path. - DNS zone transfer (AXFR) attempts: an AXFR ("asynchronous full transfer") is meant only for a secondary name server replicating a zone from the primary, but a misconfigured server that allows AXFR from any source hands over the entire zone file, every subdomain and record, in a single response. Run
dig axfr target.example @<nameserver>against each authoritative server the NS lookup identified, one at a time, since it is common for only one of several servers to be misconfigured. - Reverse DNS (PTR) lookups: given an IP found from an A record,
dig -x <ip>returns any hostname assigned to that address via a PTR record, sometimes revealing an internal naming convention, or a completely different domain sharing the same IP or subnet, which expands the asset list beyond what forward lookups alone would surface.
Interpreting ambiguous or conflicting results: if an A record resolves to a shared hosting IP with dozens of unrelated reverse-DNS entries, that pattern almost always means shared or cloud hosting (a content delivery network, load balancer, or hosting provider), not that every site on that IP belongs to the same organization, so co-hosted domains should never be assumed in-scope without independent confirmation such as a WHOIS organization match or a shared certificate seen in certificate-transparency logs. Conversely, if WHOIS shows a different organization as registrant for what looks like the client's own subdomain, that usually means the asset is a third-party SaaS vendor's infrastructure fronted with the client's brand through a CNAME alias, which needs separate authorization before testing, not an assumption that it is client-owned.
Worked example
An NS lookup for target.example returns two authoritative servers, ns1.target.example and ns2.target.example. dig axfr target.example @ns1.target.example comes back refused, the expected and correct behavior. Trying the second server, dig axfr target.example @ns2.target.example, succeeds because that secondary was misconfigured to accept AXFR from any source, exposing a full internal subdomain list including staging-payments.target.example, a host never referenced anywhere on the public site. This is exactly the scenario that justifies testing every authoritative server rather than stopping at the first refusal, and the misconfiguration itself is a reportable finding independent of whatever staging-payments turns out to expose.
Trade-offs and pitfalls
- Testing every authoritative server for AXFR, not just the first, matters because a single misconfigured secondary is a realistic and common finding pattern; stopping early misses exactly the case worth finding.
- Passive DNS should generally come before active queries when stealth matters, since it never touches the target, but its data can lag real infrastructure changes by days or weeks, so treat it as a lead to confirm, not a final answer.
- Zone transfer attempts and broad DNS queries are noisy and get logged easily; confirm whether the rules of engagement treat DNS reconnaissance as active testing subject to the same timing and notification constraints as later, more intrusive phases.
Unlock Full Question Bank
Get access to all 36 Penetration Testing Methodology and Execution interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.