Conducting network penetration test

From mukul975/Anthropic-Cybersecurity-Skills · View interactive version

Conducting network penetration test is an AI agent skill from the GitHub repository mukul975/Anthropic-Cybersecurity-Skills. Conducts comprehensive network penetration tests against authorized target environments by performing host discovery, port scanning, service enumeration, vulnerability identification, and controlled exploitation to assess the security posture of network infrastructure. The tester follows PTES method

How to use this skill

Skill file

Conducting Network Penetration Test

When to Use

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.

Prerequisites

Workflow

Step 1: Pre-Engagement and Scope Validation

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.

Step 2: Host Discovery and Network Mapping

Identify live hosts within the authorized scope using layered discovery techniques:

Consolidate 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.

Step 3: Port Scanning and Service Enumeration

Perform detailed port scanning on discovered hosts:

Enumerate discovered services in depth using protocol-specific tools:

Step 4: Vulnerability Identification

Correlate discovered service versions against known vulnerability databases:

Prioritize vulnerabilities by CVSS score, exploitability, and business impact. Document each finding with CVE identifier, affected host, service, and version.

Step 5: Exploitation

Attempt controlled exploitation of validated vulnerabilities using the principle of minimum necessary access:

Document every exploitation attempt including failures. Capture screenshots of successful compromises showing hostname, IP, current user, and privilege level.

Step 6: Post-Exploitation and Pivoting

After gaining access to a host, demonstrate business impact:

Maintain detailed notes on every pivot point, credential obtained, and system accessed to build the attack chain narrative.

Step 7: Cleanup and Reporting

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.

Key Concepts

| 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 |

Tools & Systems

Common Scenarios

Scenario: Internal Network Penetration Test for a Financial Institution

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:

  1. Perform ARP-based host discovery on accessible subnets and TCP SYN discovery for hosts with ICMP disabled
  2. Conduct full port scans on all discovered hosts, prioritizing Windows servers and domain controllers
  3. Enumerate SMB shares, SNMP communities, and web management interfaces for quick wins
  4. Identify and exploit an unpatched Apache Tomcat instance with default credentials to gain initial foothold
  5. Escalate privileges via a local Windows kernel vulnerability, then extract cached domain credentials with Mimikatz
  6. Demonstrate lateral movement to the database server containing customer records, proving inadequate network segmentation
  7. Document the complete attack path from initial access to sensitive data, with remediation steps for each vulnerability

Pitfalls:

Output Format

## 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
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.