Claude Skills Guide

Claude Code Penetration Tester Recon Automation Workflow

Reconnaissance remains the most time-intensive phase of any penetration test. The difference between a thorough assessment and a superficial scan often hinges on how effectively you automate repetitive enumeration tasks. Claude Code transforms this workflow by combining natural language interaction with powerful scripting capabilities, enabling penetration testers to build reusable automation pipelines that scale across engagements.

This guide walks you through building a practical recon automation workflow using Claude Code skills and features designed for security professionals.

Setting Up Your Penetration Testing Environment

Before diving into automation, establish a dedicated working environment for your reconnaissance activities. Create a structured project directory that organizes tools, outputs, and scripts logically.

Initialize your project structure with clear separation between active scans, completed assessments, and reusable scripts. This organization becomes crucial when managing multiple concurrent engagements or returning to follow up on previous findings.

mkdir -p ~/pt-recon/{active,completed,scripts,wordlists}
cd ~/pt-recon

Install essential recon tools that Claude Code will orchestrate: nmap, subfinder, amass, nuclei, and httpx form the backbone of most enumeration workflows. Use your system’s package manager or containerized solutions to maintain consistency across environments.

Automating Subdomain Enumeration

Subdomain enumeration typically involves chaining multiple tools with varying methodologies—passive DNS aggregation, certificate transparency logs, and active brute forcing. Claude Code excels at orchestrating these pipelines while maintaining result correlation.

Create a Claude Code skill for subdomain enumeration that coordinates multiple data sources. The skill should accept a root domain, execute disparate enumeration methods in parallel where possible, and aggregate results while removing duplicates.

#!/usr/bin/env python3
import subprocess
import concurrent.futures

def passive_enum(domain):
    """Passive subdomain enumeration using multiple sources"""
    results = []
    
    # Certificate transparency
    ct_cmd = f"ctfr {domain} -o /tmp/ct_{domain}.txt"
    subprocess.run(ct_cmd, shell=True, capture_output=True)
    
    # Passive DNS aggregation  
    amass_cmd = f"amass enum -passive -d {domain}"
    result = subprocess.run(amass_cmd, shell=True, capture_output=True, text=True)
    results.extend(result.stdout.splitlines())
    
    return results

The power of Claude Code lies in its ability to sequence these operations intelligently. Rather than running tools sequentially, identify opportunities for parallel execution while respecting dependencies—passive enumeration should complete before active brute forcing begins.

Port Scanning Automation with Nmap

Network enumeration demands careful attention to timing and scope compliance. Build a Claude Code workflow that handles common scanning scenarios while providing clear progress feedback.

Implement modular scan profiles targeting different assessment objectives:

#!/bin/bash
# Quick port discovery scan
TARGET=$1
OUTPUT_DIR=$2

nmap -T4 -F -sV -oA "$OUTPUT_DIR/nmap-quick-$TARGET" "$TARGET"

# Extract interesting ports for deeper investigation
grep -E "^(22|80|443|445|3389|8080)" "$OUTPUT_DIR/nmap-quick-$TARGET".gnmap | \
  cut -d' ' -f2 > "$OUTPUT_DIR/interesting-ports-$TARGET.txt"

Integrate scan results automatically into your findings database. Claude Code can parse nmap output formats and populate tracking spreadsheets or security tooling APIs, eliminating manual data transfer between tools.

Web Application Discovery and categorization

Web applications often hide behind non-standard ports or unconventional URLs. Automate the discovery and initial categorization process to quickly identify attack surfaces.

Build workflows that perform HTTP fingerprinting across all discovered hosts, categorize findings by technology stack, and prioritize targets based on exposure. This automation transforms raw scan data into actionable reconnaissance intelligence.

def categorize_web_tech(tech_stack):
    """Categorize discovered web technologies"""
    categories = {
        "high_value": ["wordpress", "drupal", "sharepoint", "jenkins"],
        "api": ["rest", "graphql", "swagger", "api"],
        "legacy": ["apache-1", "iis-6", "old-tomcat"]
    }
    
    for category, keywords in categories.items():
        if any(kw.lower() in tech_stack.lower() for kw in keywords):
            return category
    return "standard"

Claude Code can maintain context across reconnaissance phases, remembering which targets yielded interesting findings and suggesting logical next steps. This contextual awareness distinguishes AI-assisted workflows from simple script chaining.

Vulnerability Assessment Integration

Transform raw enumeration data into focused vulnerability assessment runs. Connect reconnaissance outputs directly to vulnerability scanners, targeting discovered services with appropriate check categories.

Build templates that map service fingerprints to relevant Nuclei templates, ensuring you validate only applicable vulnerability checks against each target. This targeted approach reduces scan time while improving result relevance.

# vuln-mapping.yaml
service_mappings:
  ssh:
    templates: [cves/2023,-exposed-adminpanels]
    severity: [critical,high]
  http:
    templates: [cves/2023,technologies,exposed-panels]
    severity: [critical,high,medium]
  smb:
    templates: [smb-vulns,netbios]
    severity: [critical,high]

Managing Reconnaissance Scope

Effective penetration testers maintain strict scope discipline. Claude Code workflows should enforce scope boundaries automatically, alerting when targets fall outside defined parameters.

Implement scope validation as a gating function in your automation pipeline. Any enumeration target must pass scope verification before tool execution begins. This prevents accidental testing of out-of-scope assets—a critical compliance requirement for professional engagements.

def validate_scope(target, scope_file):
    """Verify target is within allowed scope"""
    with open(scope_file) as f:
        allowed_domains = [line.strip() for line in f if line.strip()]
    
    # Check exact match or subdomain
    return any(
        target == domain or target.endswith(f".{domain}")
        for domain in allowed_domains
    )

Building Reusable Workflows

The true value of Claude Code-assisted reconnaissance emerges through workflow reuse. Document your automation pipelines as Claude Code skills that accept parameters and produce consistent outputs.

Structure skills to handle common variations—different output formats, scan intensities, or target types—while maintaining core functionality. This flexibility allows senior testers to focus on methodology improvements while junior team members execute proven automation templates.

Create skill documentation that explains when to apply each workflow, required inputs, expected outputs, and common troubleshooting scenarios. Well-documented skills accelerate team knowledge transfer and ensure consistent methodology across engagements.

Continuous Improvement and Iteration

Review reconnaissance outputs after each engagement to identify automation gaps. Track which workflow stages produced valuable findings versus those requiring refinement. This feedback loop continuously improves your automation toolkit.

Consider implementing machine learning-assisted prioritization that correlates historical findings with current scan results. As your engagement database grows, pattern recognition can help focus tester attention on high-probability vulnerability locations.

The combination of Claude Code’s natural language interface with structured automation creates powerful possibilities for penetration testing teams. By systematically automating routine enumeration tasks, you free analyst time for deeper security testing activities that require human intuition and creativity.


Related Resources

Built by theluckystrike — More at zovo.one