Why per-IP thresholds see nothing
maxretry = 5 over a 600-second window. An attacker sending 50 login attempts from one IP gets banned on attempt six.
Modern credential stuffing tools — OpenBullet being a well-documented example — route requests through pools of residential proxies. Each proxy IP sends one or two requests, then the tool moves to the next IP. If an attacker has a list of 100,000 stolen credential pairs and a pool of 50,000 residential proxy IPs, each IP averages about two requests total. No IP ever reaches maxretry = 5. fail2ban never fires. The WAF rate-limit rule never triggers. From the perspective of any per-IP counter, every request looks like a normal user trying to log in.
This is not a theoretical concern. Residential proxy networks rent access to real consumer IP addresses, so the traffic even passes IP reputation checks — these are not datacenter IPs or known Tor exit nodes.
What the reverse proxy actually records
- Client IP
- Timestamp
- HTTP method and URI (e.g.,
POST /wp-login.phporPOST /api/auth/login) - HTTP status code returned
- Response size
- Referer header
- User-Agent string
Signal 1: User-agent clustering on login endpoints
BASH
# Extract user-agents hitting the login endpoint in the last 24h of logs
grep 'POST /wp-login.php' /var/log/nginx/access.log \\
| awk -F'"' '{print $6}' \\
| sort | uniq -c | sort -rn | head -20TEXT
4821 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
4793 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
4410 Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
12 Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X)
3 Mozilla/5.0 (Linux; Android 14; Pixel 8)grep pattern to match your actual login endpoint path (/api/v1/login, /auth/token, /administrator/index.php, etc.).
Signal 2: Geographic spread of failed logins
geoiplookup from the legacy GeoIP package, or mmdbinspect for MaxMind's newer GeoLite2 databases), you can map source IPs from failed login attempts to countries:
BASH
# Extract unique IPs that got a non-2xx response on the login endpoint
grep 'POST /wp-login.php' /var/log/nginx/access.log \\
| awk '9 !~ /^2/ {print1}' \\
| sort -u \\
| while read ip; do
country=(geoiplookup "ip" 2>/dev/null | head -1 | awk -F': ' '{print $2}')
echo "$country"
done \\
| sort | uniq -c | sort -rn$9 field position assumes Nginx combined log format where the status code is the ninth space-delimited field. If you use a custom log_format, adjust accordingly.
Signal 3: Success-rate spikes on auth endpoints
BASH
# Hourly success (302) vs failure (200 or 401) on login endpoint
grep 'POST /wp-login.php' /var/log/nginx/access.log \\
| awk '{split(4,a,":"); hour=a[2]; if(9=="302") s[hour]++; else f[hour]++}
END {for(h in s) printf "Hour %s: success=%d fail=%d ratio=%.4f\
", h, s[h], f[h]+0, s[h]/(s[h]+f[h]+0.001)}' \\
| sortPutting the signals together
- Identify the time window where login volume increased.
- Check user-agent diversity during that window — is it suspiciously low?
- Check geographic distribution of source IPs — is it suspiciously wide?
- Check the success-to-failure ratio — did it shift?
What to do once you find it
The logs are already there
grep, awk, sort, and the willingness to look at the data from the attacker's perspective instead of one IP at a time.