What Is Penetration Testing?
Penetration testing — or pen testing — is the practice of legally and ethically attacking a system, network, or application to find security weaknesses before malicious actors do. It's a controlled simulation of real-world attacks, performed with explicit permission from the asset owner.
A good pen test doesn't just find vulnerabilities — it demonstrates their real-world impact, chains them together into attack paths, and provides actionable remediation guidance. This guide covers the standard phases that professional pen testers follow.
Phase 1: Pre-Engagement and Scoping
Before any technical work begins, you must establish clear boundaries. This phase protects both you and the client.
- Rules of Engagement (RoE): Define exactly what is in scope (IP ranges, domains, applications) and what is explicitly out of scope.
- Testing window: Agree on when testing will occur — business hours, after-hours, or continuous.
- Emergency contacts: Establish a communication chain in case live systems are accidentally impacted.
- Authorization letter: Get written permission. This is non-negotiable and protects you legally.
Phase 2: Reconnaissance
Reconnaissance is about gathering intelligence on the target before touching any systems. Split into two types:
Passive Reconnaissance
No direct interaction with the target. Sources include:
- WHOIS records and DNS enumeration
- Google dorking (advanced search operators)
- Shodan and Censys for internet-facing asset discovery
- LinkedIn and job postings for technology stack clues
- Certificate Transparency logs (crt.sh)
Active Reconnaissance
Direct interaction with target systems. Includes port scanning, service enumeration, and OS fingerprinting using tools like Nmap.
Phase 3: Scanning and Enumeration
With a target map in hand, dig deeper into each identified service:
- Port and service scanning: Identify open ports, running services, and version numbers.
- Vulnerability scanning: Use tools like OpenVAS or Nessus to identify known vulnerabilities in detected software versions.
- Web application enumeration: Directory brute-forcing (gobuster, feroxbuster), technology fingerprinting (Wappalyzer), and crawling.
- SMB/LDAP/SNMP enumeration: Extract shares, users, and configuration details from network services.
Phase 4: Exploitation
This is where you attempt to leverage discovered vulnerabilities to gain unauthorized access. Key principles:
- Work from low-hanging fruit first: Default credentials, unpatched public exploits, and misconfigured services often yield quick wins.
- Document everything: Screenshot commands, outputs, and timestamps as you go. You'll need this for the report.
- Avoid destructive actions: Don't delete files, crash services, or exfiltrate real data. Demonstrate impact without causing harm.
- Use established frameworks: Metasploit, Cobalt Strike (licensed), and manual exploitation give you reliable, repeatable results.
Phase 5: Post-Exploitation and Lateral Movement
After gaining initial access, demonstrate the realistic impact by:
- Attempting privilege escalation to admin or root
- Pivoting to other network segments
- Harvesting credentials from memory or configuration files
- Identifying paths to critical assets (domain controllers, databases, backups)
The goal is to show the client how far a real attacker could get — not just that one server was compromised.
Phase 6: Reporting
A pen test is only as valuable as its report. A strong report includes:
- Executive summary: Non-technical overview of key findings and overall risk rating for leadership.
- Technical findings: Each vulnerability with description, evidence (screenshots/logs), CVSS score, and step-by-step reproduction.
- Remediation guidance: Specific, actionable fixes — not just "patch your systems."
- Attack narrative: A walkthrough of the attack chain showing how findings combine into real impact.
Getting Started
Build your skills legally using practice environments: HackTheBox, TryHackMe, and VulnHub offer intentionally vulnerable machines. Study frameworks like PTES (Penetration Testing Execution Standard) and OWASP Testing Guide for structured methodology references. Always practice within authorized environments — the methodology only works when it's legal.