The 5 Stages of Penetration Testing
(And How AI Expands Them to 12)
Penetration testing follows a structured methodology to ensure thorough and repeatable security assessments. The traditional model defines 5 stages: Reconnaissance, Scanning, Exploitation, Post-Exploitation, and Reporting. Modern AI frameworks like zeScanner expand this into 12 specialized phases, adding granularity that enables autonomous agents to work more effectively.
The Classic 5 Stages
Reconnaissance
Gathering information about the target through passive and active means. Includes OSINT, DNS lookups, WHOIS queries, and social engineering research.
Scanning
Actively probing the target to identify live hosts, open ports, running services, and potential vulnerabilities.
Exploitation
Attempting to exploit discovered vulnerabilities to gain unauthorized access. Validates that vulnerabilities have real-world impact.
Post-Exploitation
After gaining access, assessing the full impact by exploring internal resources, testing lateral movement, and evaluating data exposure.
Reporting
Documenting all findings with severity ratings, evidence, attack chains, and prioritized remediation recommendations.
How AI Expands 5 Stages into 12 Phases
The 5-stage model was designed for human pentesters who naturally handle subtasks within each stage. When you introduce autonomous AI agents, you need more granular phase definitions so each agent has a clear scope and objective. zeScanner's 12-phase model breaks down broad stages into specific, actionable phases:
Passive Reconnaissance
Gather intelligence from public sources without touching the target. WHOIS lookups, certificate transparency logs, DNS records, and OSINT collection to build a complete picture before active scanning begins.
Network Discovery
Identify live hosts and open ports across the target range using masscan for speed and nmap for accuracy. Adaptive rate limiting based on the selected scan profile.
Service Detection
Probe discovered ports to fingerprint running services, versions, and operating systems. Uses nmap service detection with version intensity tuned to the scan profile.
Internet Research
Cross-reference detected services and versions against NVD, ExploitDB, and GitHub PoC repositories. RAG-powered intelligence enriches findings with real-world exploit availability.
Service Enumeration
Deep-dive into discovered services with protocol-specific agents. SMB shares, SNMP communities, DNS zones, LDAP trees, FTP listings, and Active Directory structures are methodically enumerated.
Web Analysis
Fingerprint web technologies, discover hidden directories, analyze TLS configurations, identify CMS platforms, and test API endpoints for security weaknesses.
Vulnerability Scanning
Run targeted vulnerability scans using nuclei templates and specialized scanners. Findings are validated and enriched with CVSS scores, MITRE ATT&CK mappings, and exploit availability.
Finding Correlation
The reasoning engine connects individual findings into attack chains. Identifies multi-step exploitation paths and calculates compounded risk scores across correlated vulnerabilities.
Compliance Checks
Evaluate discovered services and configurations against security benchmarks and compliance frameworks. CIS, PCI-DSS, and custom policy checks are run automatically.
Exploitation
Attempt controlled exploitation of confirmed vulnerabilities with safety guardrails. Credential testing, brute-force attacks, and known exploit execution validate real-world impact.
Post-Exploitation
After gaining access, enumerate internal resources, test lateral movement paths, and assess the true blast radius of compromised systems within the network.
Reporting
Generate comprehensive, actionable reports with executive summaries, technical details, attack chain visualizations, remediation priorities, and confidence scores for every finding.
Why More Phases Matter
Breaking the assessment into 12 phases provides several advantages:
- Agent specialization — Each agent focuses on a narrow domain, becoming expert-level at its specific task instead of being a generalist.
- Parallel execution — Phases 5 and 6 (Service Enumeration and Web Analysis) can run simultaneously, dramatically reducing total scan time.
- Clear handoffs — Phase transitions act as quality gates where the orchestrator validates completeness before proceeding.
- Granular control — Users can skip or customize individual phases without affecting others (e.g., skip exploitation for a passive-only assessment).
- Better reporting — Findings are organized by phase, making reports more structured and actionable.
Related Questions
Experience 12-phase AI-powered pentesting