Comprehensive deep pentest methodology for targets flagged as high-value by wp-mass-recon (score >= 6). Goes beyond surface recon into SSRF via XMLRPC pingback, error log credential mining, plugin CVE exploitation, JavaScript secret extraction, subdomain/staging discovery, port scanning, and API enumeration. Proven across 7 US company targets over 9 waves of increasingly deep probes.
TARGET="$1"
DOMAIN=$(echo"$TARGET" | sed 's|https\?://||')
echo"[*] Phase 5: Subdomain/Staging Discovery"# crt.sh certificate transparency
curl -sk "https://crt.sh/?q=%25.$DOMAIN&output=json" 2>/dev/null | \
jq -r '.[].name_value' 2>/dev/null | sed 's/\*\.//g' | sort -u > /tmp/subs_$DOMAIN.txt
sub_count=$(wc -l < /tmp/subs_$DOMAIN.txt)
echo"[+] crt.sh: $sub_count subdomains"# Filter for interesting onesecho"[*] Interesting subdomains:"
grep -iE 'staging|stage|dev|test|uat|beta|old|new|admin|portal|api|app|dashboard' /tmp/subs_$DOMAIN.txt | head -20
# Probe them for WordPress install pages (staging takeover vector)echo"[*] Staging takeover check:"for sub in $(grep -iE 'staging|stage|dev' /tmp/subs_$DOMAIN.txt | head -5); dofor path in"/wp-admin/install.php""/wp-admin/upgrade.php""/wp-admin/setup-config.php"; do
code=$(curl -sk -o /dev/null -w "%{http_code}" --max-time 5 "https://$sub$path" 2>/dev/null)
[[ "$code" == "200" ]] && echo"[TAKEOVER] https://$sub$path — HTTP $code"donedone
Phase 6 — Port Scan
TARGET="$1"
DOMAIN=$(echo"$TARGET" | sed 's|https\?://||')
echo"[*] Phase 6: Port Scan"
nmap -F --open -T4 "$DOMAIN" -oN /tmp/nmap_$DOMAIN.txt 2>/dev/null
echo"[*] Open ports:"
grep 'open' /tmp/nmap_$DOMAIN.txt
# Flag critical exposures
grep -q '3306.*open' /tmp/nmap_$DOMAIN.txt && echo"[CRITICAL] MySQL 3306 open to internet!"
grep -q '27017.*open' /tmp/nmap_$DOMAIN.txt && echo"[CRITICAL] MongoDB 27017 open to internet!"
grep -q '6379.*open' /tmp/nmap_$DOMAIN.txt && echo"[HIGH] Redis 6379 open to internet!"
grep -q '8080.*open\|8081.*open\|8082.*open\|8084.*open' /tmp/nmap_$DOMAIN.txt && echo"[HIGH] Internal API port(s) exposed!"
grep -q '22.*open' /tmp/nmap_$DOMAIN.txt && echo"[INFO] SSH 22 open"
grep -q '21.*open' /tmp/nmap_$DOMAIN.txt && echo"[INFO] FTP 21 open"
Phase 7 — API Discovery
TARGET="$1"echo"[*] Phase 7: API Discovery"# Swagger / OpenAPIfor path in"swagger.json""swagger.yaml""openapi.json""api-docs""api/docs" \
"swagger-ui.html""swagger/index.html""api/v1/swagger.json""v2/api-docs""v3/api-docs"; do
code=$(curl -sk -o /dev/null -w "%{http_code}" --max-time 5 "https://$TARGET/$path")
[[ "$code" == "200" ]] && echo"[API] Swagger: /$path"done# GraphQLfor path in"graphql""api/graphql""gql""query""wp/graphql"; do
code=$(curl -sk -o /dev/null -w "%{http_code}" --max-time 5 "https://$TARGET/$path" \
-X POST -H "Content-Type: application/json" -d '{"query":"{__schema{types{name}}}"}')
[[ "$code" == "200" ]] && echo"[API] GraphQL: /$path"done# WooCommerce API
curl -sk "https://$TARGET/wp-json/wc/v3/" | python3 -c "
import sys, json
try:
data = json.load(sys.stdin)
if 'namespace' in data:
print('[API] WooCommerce REST API active')
except: pass" 2>/dev/null
# Gravity Forms API
curl -sk "https://$TARGET/wp-json/gf/v2/forms" | python3 -c "
import sys, json
try:
data = json.load(sys.stdin)
if isinstance(data, list) and len(data) > 0:
print(f'[API] Gravity Forms: {len(data)} forms')
except: pass" 2>/dev/null
Pitfalls
SSRF faultCode 0 is NOT proof of reachability. Some servers return 0 for unreachable hosts. Always confirm with your own collaborator callback first.
Error logs can be multi-GB. Use curl -r 0-100000 to fetch only the first 100KB for sampling.
Plugin namespace HTTP 200 doesn't mean the plugin is present. Some themes/setups return 200 for all /wp-json/ paths. Check response body for actual plugin data.
nmap requires root for SYN scan. Use -sT (TCP connect) if running as non-root inside the container.
Verification
Every SSRF callback MUST appear on your controlled collaborator/interactsh server.
Error log MUST contain real PHP errors (not be a generic HTML page).
Plugin CVEs MUST be verified against actual version numbers from readme.txt (not just namespace presence).
Port scan results MUST be confirmed with banner grab (nmap -sV).