tonia.ai · Concepts

Penetration Testing

A penetration test is an authorized, simulated attack. It answers a question a scanner cannot: if a capable adversary targeted this network today, how far would they get, and what would it cost us?

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.

depth · realism · human effort → breadth of coverage → Vulnerability scanautomated · every host Penetration testexpert · scoped · proves impact Red teamgoal-driven · stealthy · tests detection Bug bountycrowd · ongoing · public scope
Each answers a different question. Scans find known weaknesses; pen tests show consequences; red teams test the defenders.
Vulnerability scanPenetration testRed team
QuestionWhat is exposed or unpatched?What can an attacker achieve?Would we detect and stop a real adversary?
MethodAutomated signaturesManual chaining of weaknessesAdversary emulation over weeks
Defenders informed?YesUsuallyOnly a small control group
OutputList of findingsAttack paths with evidenceDetection and response gaps

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?

ApproachTester starts withSimulatesTrade-off
Black boxA company nameExternal attackerRealistic, but time is spent on discovery rather than depth
Gray boxUser account, network diagramInsider or phished employeeMost common; efficient and still realistic
White boxSource code, configs, credentialsWorst-case knowledgeable adversaryMost thorough per hour of effort

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.

Planscope · RoE ReconOSINT · scan Enumeratehosts · users Analyzeweaknesses Exploitgain access Post-exploitescalate · pivot new foothold → recon again from inside Report and retestevidence · risk · fixes documentation runs through every phase
Notes, screenshots, and timestamps are taken throughout. They become the report's evidence and let the client separate test activity from a real attack.

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.

Open Closed Filtered scannertargetscannertargetscannertarget SYNSYN/ACKRST SYNRST SYN no reply, or ICMPunreachable service listening host up, nothing listening a firewall dropped the probe
The scanner sends RST instead of completing the handshake, so the application never logs a connection. Firewalls and IDS still see the probes.

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.

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.

Schedulesevere but rarely exploited Fix nowsevere and actively exploited Accept or batchlow impact, unlikely Fix soonmodest impact, often chained likelihood of exploitation (EPSS, KEV listing, public exploit) → impact (CVSS, asset value) →
A pen test adds a third input no scanner has: whether the flaw was actually part of a working attack path in this environment.

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.

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.

tester DMZ web server① foothold Internal network workstation② cached admin creds file server③ reuse creds domain④ controller exploit the firewall allowed DMZ → internal traffic: that is the pivot
No single step is dramatic. The finding is the chain, and breaking any one link (segmentation, unique local admin passwords, tiered admin accounts) stops it.

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.

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.

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.

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.

11Common misconceptions

MythA clean pen test means we are secure.
RealityIt is a snapshot bounded by scope, time, and the testers' skill. Tomorrow's change or next month's vulnerability is untested.
MythA pen test is running a vulnerability scanner.
RealityScanning is one early step. The value is human judgment that chains findings and proves impact.
MythReal attacks need zero-day exploits.
RealityCredentials, default settings, and missing segmentation drive most internal compromises.
MythTesting is always harmless.
RealityExploits can crash fragile or industrial systems and lock out accounts. That is why scope and constraints are negotiated first.
MythThe IT team's permission is enough.
RealityAuthorization must come from the owner of every asset in scope, including hosting and cloud providers.

—References

Peer-reviewed

  1. Allodi, L. & Massacci, F. (2014). Comparing vulnerability severity and exploits using case-control studies. ACM TISSEC, 17(1). doi:10.1145/2630069
  2. Applebaum, A. et al. (2016). Intelligent, automated red team emulation. ACSAC. doi:10.1145/2991079.2991111
  3. Arkin, B., Stender, S. & McGraw, G. (2005). Software penetration testing. IEEE Security & Privacy, 3(1). doi:10.1109/MSP.2005.23
  4. 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
  5. Bishop, M. (2007). About penetration testing. IEEE Security & Privacy, 5(6). doi:10.1109/MSP.2007.159
  6. Deng, G. et al. (2024). PentestGPT. USENIX Security. usenix.org
  7. Denis, M., Zena, C. & Hayajneh, T. (2016). Penetration testing: concepts, attack methods, and defense strategies. IEEE LISAT. doi:10.1109/LISAT.2016.7494156
  8. Doupé, A., Cova, M. & Vigna, G. (2010). Why Johnny can't pentest. DIMVA. doi:10.1007/978-3-642-14215-4_7
  9. Durumeric, Z., Wustrow, E. & Halderman, J. A. (2013). ZMap. USENIX Security. usenix.org
  10. Happe, A. & Cito, J. (2023). Getting pwn'd by AI. ESEC/FSE. doi:10.1145/3611643.3613083
  11. Jacobs, J. et al. (2021). Exploit Prediction Scoring System (EPSS). Digital Threats: Research and Practice, 2(3). doi:10.1145/3436242
  12. Ou, X., Govindavajhala, S. & Appel, A. (2005). MulVAL. USENIX Security. usenix.org
  13. Sarraute, C., Buffet, O. & Hoffmann, J. (2012). POMDPs make better hackers. AAAI. doi:10.1609/aaai.v26i1.8363
  14. Sheyner, O. et al. (2002). Automated generation and analysis of attack graphs. IEEE S&P. doi:10.1109/SECPRI.2002.1004377
  15. Thompson, H. H. (2005). Application penetration testing. IEEE Security & Privacy, 3(1). doi:10.1109/MSP.2005.3

Standards and guidance