Do not use for testing networks without explicit written authorization from the asset owner, against production systems without a pre-approved change window and rollback plan, or for denial-of-service testing unless explicitly scoped and authorized.
Validate the scope by confirming IP ranges with the client. Verify that all IP addresses in scope are owned by the client using ARIN/RIPE WHOIS lookups. Confirm testing windows, escalation procedures, and any sensitivity constraints. Set up the testing environment with a dedicated VM, VPN connection, and logging enabled on all tools. Create a timestamped activity log that records every command executed, every scan launched, and every exploit attempted throughout the engagement.
Identify live hosts within the authorized scope using layered discovery techniques:
nmap -sn -PE -PP -PM 10.10.0.0/16 -oA discovery_icmp to find hosts responding to pingnmap -sn -PR 10.10.0.0/24 -oA discovery_arp or arp-scan -l for local subnet enumerationnmap -sn -PS21,22,25,80,443,445,3389,8080 10.10.0.0/16 -oA discovery_tcp to find hosts with ICMP blockednmap -sn -PU53,161,500 10.10.0.0/16 -oA discovery_udp for hosts only responding on UDPConsolidate live hosts into a target list. Map the network topology by identifying gateways, VLAN boundaries, and trust relationships using traceroute and SNMP community string guessing where authorized.
Perform detailed port scanning on discovered hosts:
nmap -sS -p- --min-rate 1000 -T4 -oA full_tcp <target> to identify all open TCP portsnmap -sU --top-ports 200 -T4 -oA top_udp <target> for commonly exploitable UDP servicesnmap -sV -sC -p <open_ports> -oA service_enum <target> to fingerprint service versions and run default NSE scriptsnmap -O --osscan-guess -oA os_detection <target> to identify operating systemsEnumerate discovered services in depth using protocol-specific tools:
enum4linux -a <target>, crackmapexec smb <target> --shares
snmpwalk -v2c -c public <target>
dig axfr @<dns_server> <domain> for zone transfer attemptsldapsearch -x -H ldap://<target> -b "dc=example,dc=com"
Correlate discovered service versions against known vulnerability databases:
nmap --script vuln -p <ports> <target> for NSE vulnerability scriptssearchsploit <service> <version> to query the Exploit-DB offline databasePrioritize vulnerabilities by CVSS score, exploitability, and business impact. Document each finding with CVE identifier, affected host, service, and version.
Attempt controlled exploitation of validated vulnerabilities using the principle of minimum necessary access:
msfconsole with appropriate exploit modules matched to confirmed vulnerabilities. Set RHOSTS, RPORT, and payload options. Prefer bind/reverse TCP Meterpreter for post-exploitation flexibility.hydra or crackmapexec for password spraying against discovered services (SSH, RDP, SMB, HTTP basic auth) using common credential lists. Respect lockout policies.impacket-psexec or relay attacks with impacket-ntlmrelayx where SMB signing is disabled.Document every exploitation attempt including failures. Capture screenshots of successful compromises showing hostname, IP, current user, and privilege level.
After gaining access to a host, demonstrate business impact:
linpeas.sh (Linux) or winPEAS.exe (Windows). Look for misconfigured services, SUID binaries, unquoted service paths, or kernel exploits.mimikatz), files (config files, browser stores), or cached hashes (hashdump).Maintain detailed notes on every pivot point, credential obtained, and system accessed to build the attack chain narrative.
Remove all testing artifacts from compromised systems:
Prepare the penetration test report with executive summary, methodology description, finding details with CVSS scores, proof-of-concept evidence, and prioritized remediation recommendations.
| Term | Definition |
|---|---|
| Rules of Engagement (RoE) | Formal document defining the scope, boundaries, testing hours, authorized actions, and escalation procedures for a penetration test |
| Pivot | Using a compromised host as a relay point to access additional network segments not directly reachable from the tester's position |
| Service Enumeration | The process of identifying running services, their versions, and configurations on discovered hosts to map the attack surface |
| Credential Spraying | Testing a small number of commonly used passwords against many accounts simultaneously to avoid account lockout thresholds |
| CVSS | Common Vulnerability Scoring System; an industry-standard framework for rating the severity of vulnerabilities on a 0-10 scale |
| Lateral Movement | Techniques used to move from one compromised system to another within a network, expanding the scope of access |
| Post-Exploitation | Activities performed after initial compromise including privilege escalation, persistence, credential harvesting, and data access |
Context: The client is a mid-size bank requiring PCI-DSS compliance. Scope includes the internal corporate network (10.10.0.0/16), excluding payment processing systems in a separate VLAN. Testing window is Monday-Friday 20:00-06:00 to minimize impact on operations.
Approach:
Pitfalls:
## Finding: Unpatched Apache Tomcat with Default Credentials
**ID**: NET-001
**Severity**: Critical (CVSS 9.8)
**Affected Host**: 10.10.5.23 (tomcat-prod.internal.corp)
**Service**: Apache Tomcat 8.5.31 on port 8080
**CVE**: CVE-2019-0232
**Description**:
The Apache Tomcat instance on 10.10.5.23:8080 is running version 8.5.31, which is
vulnerable to CVE-2019-0232 (remote code execution via CGI Servlet). Additionally,
the Tomcat Manager interface is accessible with default credentials (tomcat:tomcat),
allowing deployment of arbitrary WAR files.
**Proof of Concept**:
1. Accessed http://10.10.5.23:8080/manager/html with credentials tomcat:tomcat
2. Deployed malicious WAR file containing a reverse shell payload
3. Obtained command execution as NT AUTHORITY\SYSTEM
**Impact**:
Full system compromise of the Tomcat server. From this host, the tester
pivoted to 3 additional systems on the same subnet using harvested credentials,
ultimately accessing the customer database containing 50,000+ records.
**Remediation**:
1. Immediately change default Tomcat Manager credentials
2. Upgrade Apache Tomcat to the latest stable release (currently 10.1.x)
3. Restrict access to the Tomcat Manager interface to authorized management IPs only
4. Implement network segmentation between web servers and database tier