01What a penetration test is, and is not
Security assessments vary along two dimensions: how broad they are and how deep they go. A vulnerability scan is broad and shallow: it lists what might be wrong. A penetration test is narrower and deeper: a skilled tester chains weaknesses together to prove what an attacker could actually reach. A red team goes deeper still, emulating a specific adversary and testing whether defenders notice.
| Vulnerability scan | Penetration test | Red team | |
|---|---|---|---|
| Question | What is exposed or unpatched? | What can an attacker achieve? | Would we detect and stop a real adversary? |
| Method | Automated signatures | Manual chaining of weaknesses | Adversary emulation over weeks |
| Defenders informed? | Yes | Usually | Only a small control group |
| Output | List of findings | Attack paths with evidence | Detection and response gaps |
- NIST SP 800-115 — Technical Guide to Information Security Testing and Assessment
- Bishop, M. (2007). About penetration testing. IEEE Security & Privacy, 5(6).
- Arkin, B., Stender, S. & McGraw, G. (2005). Software penetration testing. IEEE Security & Privacy, 3(1).
02Authorization is what makes it a test
The techniques of a penetration tester and a criminal are the same. The only difference is written permission from someone with the authority to give it.
Before any packet is sent, both sides agree on rules of engagement. Ambiguity here causes real harm: in 2019 two testers hired to assess an Iowa courthouse were arrested mid-engagement because the state agency that hired them and the county that owned the building disagreed about who could authorize physical entry.
Scope
Exact IP ranges, domains, applications, and locations in bounds, and what is explicitly out.
Authority
Signed by the asset owner. Cloud and hosting providers have their own testing policies that also apply.
Constraints
Testing windows, no denial-of-service, fragile systems to avoid, how to handle sensitive data found.
Communication
Emergency contacts, a stop word, and what to do if the tester finds evidence of a real intruder.
How much does the tester know?
| Approach | Tester starts with | Simulates | Trade-off |
|---|---|---|---|
| Black box | A company name | External attacker | Realistic, but time is spent on discovery rather than depth |
| Gray box | User account, network diagram | Insider or phished employee | Most common; efficient and still realistic |
| White box | Source code, configs, credentials | Worst-case knowledgeable adversary | Most thorough per hour of effort |
- PTES — Pre-engagement interactions
- AWS penetration testing policy — an example of provider rules that sit on top of the client's permission
- U.S. DOJ policy on good-faith security research under the CFAA
03The methodology
Published methodologies such as NIST SP 800-115, PTES, and the OWASP testing guide use different names, but they share a shape. The important part is the loop: every new foothold is a new vantage point, and reconnaissance starts again from there.
- Penetration Testing Execution Standard (PTES)
- OWASP Web Security Testing Guide
- Kali Linux documentation — the standard tester's distribution
04Reconnaissance and scanning
Passive reconnaissance gathers information without touching the target: DNS records, certificate transparency logs, job postings that reveal technologies, leaked credentials, and internet-wide scan databases. Active reconnaissance probes the target directly, mainly by port scanning, which reveals what is listening.
The classic technique is the SYN scan: send the first packet of a TCP handshake and read the reply, without ever completing the connection.
After finding open ports, the tester enumerates: identifies service versions, operating systems, shares, user names, and directory information. Enumeration usually yields more than the scan itself, because misconfigured services volunteer far more than they should.
- Nmap — port scanning basics · TCP SYN scan explained
- crt.sh — certificate transparency search, a rich source of subdomains
- OSINT Framework — a map of open-source intelligence tools
- Durumeric, Z., Wustrow, E. & Halderman, J. A. (2013). ZMap: fast internet-wide scanning and its security applications. USENIX Security.
05Vulnerability analysis and prioritization
Scanners such as OpenVAS and Nessus match service banners and responses against databases of known flaws. They are fast and broad, but they produce false positives (a patched service still reporting an old version) and miss whole classes of problems, especially logic flaws and anything that needs authentication or context. Studies of automated web scanners have repeatedly found that they miss a large share of the vulnerabilities a human tester finds.
Severity alone is a poor guide to priority. Only a small fraction of published vulnerabilities are ever exploited in the wild, so modern triage combines how bad a flaw would be with how likely it is to be used.
- Greenbone OpenVAS documentation
- CVSS v4.0 · EPSS · CISA Known Exploited Vulnerabilities
- Doupé, A., Cova, M. & Vigna, G. (2010). Why Johnny can't pentest: an analysis of black-box web vulnerability scanners. DIMVA.
- Bau, J. et al. (2010). State of the art: automated black-box web application vulnerability testing. IEEE S&P.
- Allodi, L. & Massacci, F. (2014). Comparing vulnerability severity and exploits using case-control studies. ACM TISSEC, 17(1).
- Jacobs, J. et al. (2021). Exploit Prediction Scoring System (EPSS). Digital Threats: Research and Practice, 2(3).
06Exploitation
Exploitation turns a weakness into access. It helps to separate three ideas:
Vulnerability
The flaw: an unpatched service, a default password, an injectable parameter.
Exploit
The technique or code that triggers the flaw to gain control.
Payload
What runs once control is gained: a shell, a beacon, a command. Frameworks let testers mix exploits and payloads freely.
In practice, most successful internal tests do not need a novel exploit. Weak and reused passwords, password spraying against single-factor logins, default credentials on management interfaces, and overly permissive file shares account for a large share of real compromises. Memory-corruption exploits are powerful but can crash services, which is why rules of engagement often require approval before running them against production systems.
- Metasploit Framework documentation · Metasploitable 2, an intentionally vulnerable practice target
- PortSwigger Web Security Academy — free hands-on labs for web exploitation
- TryHackMe · Hack The Box — legal practice environments
- Thompson, H. H. (2005). Application penetration testing. IEEE Security & Privacy, 3(1).
07Post-exploitation: where impact is proven
A first foothold is rarely the goal. Post-exploitation shows what that foothold leads to: privilege escalation on the compromised host, credential harvesting from memory and files, lateral movement to other machines, and pivoting through the foothold to reach networks that were never exposed to the tester directly.
Thinking in attack graphs
Researchers formalized this chaining two decades ago as attack graphs: nodes are attacker privileges, edges are exploitable steps, and the question becomes whether any path reaches the target. The same idea now powers practical tools that map Active Directory relationships and show the shortest path from an ordinary user to domain administrator, which defenders use to cut those paths before attackers find them.
- BloodHound — graph analysis of Active Directory attack paths
- GTFOBins — how ordinary Unix binaries enable privilege escalation
- MITRE ATT&CK — Lateral Movement tactic
- Sheyner, O. et al. (2002). Automated generation and analysis of attack graphs. IEEE S&P.
- Ou, X., Govindavajhala, S. & Appel, A. (2005). MulVAL: a logic-based network security analyzer. USENIX Security.
08Common network-level findings
Internal network tests turn up the same weaknesses again and again. Most are configuration defaults rather than software bugs.
Name-resolution poisoning
When DNS fails, Windows falls back to broadcast protocols (LLMNR, NBT-NS). Anyone on the segment can answer and capture or relay the victim's authentication.
Weak segmentation
Guest Wi-Fi, IoT, or user VLANs that can reach servers and management interfaces. Testing it means verifying from each zone, not reading the diagram.
Cleartext and legacy protocols
Telnet, FTP, SNMP with default community strings, and unsigned SMB expose credentials or allow tampering.
Exposed management
Admin panels for printers, switches, hypervisors, and backup systems, often with default passwords.
Layer-2 trust
ARP spoofing and rogue DHCP or IPv6 router advertisements put the tester in the middle of other hosts' traffic.
Wireless
Weak pre-shared keys, evil-twin access points, and enterprise Wi-Fi clients that do not validate the server certificate.
- Responder — the standard tool for demonstrating LLMNR and NBT-NS poisoning
- ATT&CK T1557.001 — LLMNR/NBT-NS poisoning and SMB relay, with mitigations
- CIS Critical Security Controls — the defensive baseline most findings map back to
09The report is the product
A brilliant compromise that the client cannot understand or fix is worth nothing. The engagement is judged by its report.
Executive summary
Business risk in plain language: what an attacker could reach and what matters most to fix.
Attack narrative
The story of each successful chain, step by step, so readers see how small issues combined.
Findings
Each with affected assets, evidence, severity in context, and reproduction steps.
Remediation
Specific, prioritized fixes, including which single change breaks the most paths.
Good reports also record what was not tested and what was tried but failed, since "no finding" is only meaningful within the scope and time available. A retest after remediation confirms that fixes worked and did not open new gaps.
- PTES — Reporting
- Public penetration testing reports — real examples from security firms
10Red teams, purple teams, and automation
Red team exercises emulate a specific adversary's tactics against the live organization, with the defenders mostly unaware. Purple teaming runs the same techniques collaboratively: attackers execute one technique at a time while defenders check whether it was logged, alerted, and handled, then tune detections on the spot. MITRE ATT&CK gives both sides a shared vocabulary.
Automation has moved in two directions. Breach-and-attack simulation replays known techniques continuously to catch regressions between human tests. Research systems have planned attacks with AI since the early 2010s, and recent work uses large language models as testing assistants. Results so far show they handle routine steps well but struggle to keep long multi-step engagements on track, so they augment rather than replace skilled testers.
- MITRE ATT&CK · MITRE Caldera — automated adversary emulation
- Atomic Red Team — small tests mapped to ATT&CK techniques, ideal for purple teaming
- Applebaum, A. et al. (2016). Intelligent, automated red team emulation. ACSAC.
- Sarraute, C., Buffet, O. & Hoffmann, J. (2012). POMDPs make better hackers: accounting for uncertainty in penetration testing. AAAI.
- Happe, A. & Cito, J. (2023). Getting pwn'd by AI: penetration testing with large language models. ESEC/FSE.
- Deng, G. et al. (2024). PentestGPT: evaluating and harnessing large language models for automated penetration testing. USENIX Security.
11Common misconceptions
—References
Peer-reviewed
- Allodi, L. & Massacci, F. (2014). Comparing vulnerability severity and exploits using case-control studies. ACM TISSEC, 17(1). doi:10.1145/2630069
- Applebaum, A. et al. (2016). Intelligent, automated red team emulation. ACSAC. doi:10.1145/2991079.2991111
- Arkin, B., Stender, S. & McGraw, G. (2005). Software penetration testing. IEEE Security & Privacy, 3(1). doi:10.1109/MSP.2005.23
- Bau, J. et al. (2010). State of the art: automated black-box web application vulnerability testing. IEEE S&P. doi:10.1109/SP.2010.27
- Bishop, M. (2007). About penetration testing. IEEE Security & Privacy, 5(6). doi:10.1109/MSP.2007.159
- Deng, G. et al. (2024). PentestGPT. USENIX Security. usenix.org
- Denis, M., Zena, C. & Hayajneh, T. (2016). Penetration testing: concepts, attack methods, and defense strategies. IEEE LISAT. doi:10.1109/LISAT.2016.7494156
- Doupé, A., Cova, M. & Vigna, G. (2010). Why Johnny can't pentest. DIMVA. doi:10.1007/978-3-642-14215-4_7
- Durumeric, Z., Wustrow, E. & Halderman, J. A. (2013). ZMap. USENIX Security. usenix.org
- Happe, A. & Cito, J. (2023). Getting pwn'd by AI. ESEC/FSE. doi:10.1145/3611643.3613083
- Jacobs, J. et al. (2021). Exploit Prediction Scoring System (EPSS). Digital Threats: Research and Practice, 2(3). doi:10.1145/3436242
- Ou, X., Govindavajhala, S. & Appel, A. (2005). MulVAL. USENIX Security. usenix.org
- Sarraute, C., Buffet, O. & Hoffmann, J. (2012). POMDPs make better hackers. AAAI. doi:10.1609/aaai.v26i1.8363
- Sheyner, O. et al. (2002). Automated generation and analysis of attack graphs. IEEE S&P. doi:10.1109/SECPRI.2002.1004377
- Thompson, H. H. (2005). Application penetration testing. IEEE Security & Privacy, 3(1). doi:10.1109/MSP.2005.3