while read -r url; do
domain=$(echo "$url" | sed 's|https\?://||')
(
echo "# $domain Findings" > "$OUTDIR/findings/${domain}_findings.md"
wp_code=$(curl -sk -o /dev/null -w "%{http_code}" --max-time 10 --connect-timeout 10 "$url/wp-login.php")
[[ "$wp_code" =~ ^(200|301|302|403)$ ]] && echo "- WordPress: YES (wp-login: $wp_code)" >> "$OUTDIR/findings/${domain}_findings.md"
users=$(curl -sk --max-time 10 --connect-timeout 10 "$url/wp-json/wp/v2/users" | python3 -c "import sys,json; d=json.load(sys.stdin); print(len(d) if isinstance(d,list) else 0)" 2>/dev/null)
[[ "$users" -gt 0 ]] && echo "- Users exposed: $users" >> "$OUTDIR/findings/${domain}_findings.md"
cors=$(curl -skI --max-time 10 --connect-timeout 10 "$url/wp-json/wp/v2/users" -H "Origin: https://evil.com" 2>/dev/null | grep -i "access-control-allow-credentials: true")
[[ -n "$cors" ]] && echo "- CORS: CREDENTIAL REFLECTION CONFIRMED" >> "$OUTDIR/findings/${domain}_findings.md"
xmlrpc=$(curl -sk -o /dev/null -w "%{http_code}" --max-time 10 --connect-timeout 10 -X POST "$url/xmlrpc.php" \
-d '<?xml version="1.0"?><methodCall><methodName>demo.sayHello</methodName></methodCall>')
[[ "$xmlrpc" == "200" ]] && echo "- XMLRPC: OPEN" >> "$OUTDIR/findings/${domain}_findings.md"
reg=$(curl -sk --max-time 10 --connect-timeout 10 "$url/wp-login.php?action=register" | grep -o 'user_login')
[[ -n "$reg" ]] && echo "- Open Registration: YES" >> "$OUTDIR/findings/${domain}_findings.md"
for path in ".env" "wp-config.php.bak" ".git/config" "debug.log" "backup.sql" "info.php" "phpinfo.php" "wp-config.php~" ".env.backup" ".env.local" "docker-compose.yml" "Dockerfile"; do
leak_code=$(curl -sk -o /dev/null -w "%{http_code}" --max-time 5 --connect-timeout 5 "$url/$path")
if [[ "$leak_code" == "200" ]]; then
content=$(curl -sk --max-time 5 --connect-timeout 5 "$url/$path" | head -c 500)
if echo "$content" | grep -qiE 'DB_|APP_|_KEY|_SECRET|password|mysql|\[core\]|PHP Version|CREATE TABLE'; then
echo "- Source leak: /$path (VERIFIED)" >> "$OUTDIR/findings/${domain}_findings.md"
fi
fi
done
) &
while [[ $(jobs -r | wc -l) -ge 20 ]]; do sleep 0.5; done
done < $OUTDIR/urls.txt
wait
import concurrent.futures, subprocess, json
def curl_code(url, timeout=8):
cmd = ["curl", "-sk", "-m", str(timeout), "-o", "/dev/null", "-w", "%{http_code}", url]
r = subprocess.run(cmd, capture_output=True, timeout=timeout+5)
return r.stdout.decode().strip()
def test_target(domain):
proto = None
for p in ["https", "http"]:
code = curl_code(f"{p}://{domain}/")
if code not in ["000", ""]: proto = p; break
if not proto: return None
login_code = curl_code(f"{proto}://{domain}/wp-login.php")
json_code = curl_code(f"{proto}://{domain}/wp-json/")
is_wp = login_code not in ["000","404",""] or json_code not in ["000","404",""]
if not is_wp: return {"domain":domain, "is_wp":False}
score = 1
findings = ["wordpress"]
body, _ = curl_raw(f"{proto}://{domain}/wp-json/wp/v2/users")
try:
data = json.loads(body.decode())
if isinstance(data, list) and len(data) > 0:
findings.append(f"wp_users_{len(data)}")
score += 2
except: pass
cmd = ["curl","-sk","-m","8","-I","-H","Origin: https://evil.com",
f"{proto}://{domain}/wp-json/wp/v2/users"]
r = subprocess.run(cmd, capture_output=True, timeout=10)
hdrs = r.stdout.decode().lower()
acao = [l.split(":",1)[1].strip() for l in hdrs.split('\n') if 'access-control-allow-origin:' in l]
acac = [l.split(":",1)[1].strip() for l in hdrs.split('\n') if 'access-control-allow-credentials:' in l]
if acao and "evil.com" in acao[0] and acac and acac[0] == "true":
findings.append("cors_credentialed")
score += 3
xml = '<?xml version="1.0"?><methodCall><methodName>system.listMethods</methodName></methodCall>'
body, _ = curl_raw(f"{proto}://{domain}/xmlrpc.php", method="POST", data=xml)
txt = body.decode()
if "system.multicall" in txt:
findings.append("xmlrpc_multicall")
score += 3
elif "methodName" in txt:
findings.append("xmlrpc_active")
body, _ = curl_raw(f"{proto}://{domain}/wp-login.php?action=register")
rt = body.decode().lower()
if "register" in rt and "user_login" in rt and "wp-submit" in rt:
findings.append("registration_open")
score += 2
if score >= 8: severity = "CRITICAL"
elif score >= 5: severity = "HIGH"
elif score >= 3: severity = "MEDIUM"
elif score >= 1: severity = "LOW"
else: severity = "NONE"
return {"domain":domain, "severity":severity, "score":score, "findings":findings}
targets = [(d.strip(), s.strip()) for line in open("targets.txt") if (p := line.split("|")) and (d:=p[0]) and (s:=p[-1] if len(p)>2 else "unknown")]
with concurrent.futures.ThreadPoolExecutor(max_workers=20) as ex:
futures = {ex.submit(test_target, t[0]): t for t in targets}
for f in concurrent.futures.as_completed(futures):
r = f.result()
if r and r.get("score",0) > 0:
print(f"[{r['severity']:>8}] {r['domain']:40s} | {r['score']:2d} | {', '.join(r['findings'])}")