#!/usr/bin/env bash # Reproduce suspected false positives against the demo site. set -uo pipefail H='Host: demo.test' req() { # path [extra curl args...] local path="$1"; shift printf '%-42s -> %s\n' "$path" "$(curl -s -o /dev/null -w '%{http_code}' -H "$H" "$@" "http://127.0.0.1$path")" } echo "== 静态/正常资源 ==" req /index.html req /style.css req /app.js req /logo.png echo "== 可能误伤的路径 ==" req /download/app.zip req /download/pkg.tar.gz req /.well-known/security.txt req /.well-known/acme-challenge/token req /blog/phpmyadmin-guide req /adminer req /wp-login.php req /docs/app.sql echo "== 空 UA ==" req / -A '' echo "== 正常浏览器 UA ==" req / -A 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/131.0' echo "== 突发 60 个请求(模拟页面加载大量资源) ==" codes=$(for i in $(seq 1 60); do curl -s -o /dev/null -w '%{http_code} ' -H "$H" "http://127.0.0.1/asset-$i.css" done) echo "$codes" | tr ' ' '\n' | sort | uniq -c | sort -rn echo "== 突发 60 个动态请求 ==" codes=$(for i in $(seq 1 60); do curl -s -o /dev/null -w '%{http_code} ' -H "$H" "http://127.0.0.1/api-$i" done) echo "$codes" | tr ' ' '\n' | sort | uniq -c | sort -rn