Is the server under attack, or just busy? This free script reads your access log, the connection table and the SSH auth log, and answers in seconds with PASS, WARN or FAIL per check and the numbers behind each one.
It only reads. No settings change, nothing is installed, and it makes no network calls; the only writes are temp files it removes on exit. POSIX sh, so it runs with dash on Ubuntu and Debian and bash on RHEL, Alma and Rocky.
curl -fsSLO https://alertkick.com/tools/website-attack-check.sh
less website-attack-check.sh
sudo sh website-attack-check.sh It finds the nginx or Apache access log at its default path and reads the last 20,000 requests. For another log, or a longer window:
sudo ACCESS_LOG=/var/log/nginx/shop.access.log LINES=50000 sh website-attack-check.sh Load
The 5-minute load average against the CPU count. Busy above the core count, saturated above twice it.
Top IP
The share of recent requests sent by the busiest client. One address carrying 15-30% or more is concentration, not a crowd.
Probe paths
Requests for wp-login.php, xmlrpc.php, .env, .git, phpMyAdmin, phpunit and similar paths that scanners try on every site.
Status mix
The share of 404s (scanning), 401/403s (password guessing) and 5xx/499s (a backend failing under load).
Top path
One URL taking half of all traffic, which is either a launch or a flood against an expensive page.
User agents
The share of requests with an empty or scripted user agent: curl, python, Go, wget and known scanners.
Request rate
The busiest minute against the median minute in the same log window.
Half-open connections
Connections stuck in SYN_RECV right now, the signature of a SYN flood, plus SYN cookies the kernel has sent.
Web connections
Established connections per remote IP on ports 80 and 443.
SSH
Failed and invalid-user attempts per IP, and any login accepted from an IP that was also failing.
From a test log with a WordPress login flood, a scanner and a compromised SSH account:
host web-1 | Ubuntu 24.04.1 LTS | 2026-12-05 10:46 UTC | uid 0
PASS load 5-min load 0.79 on 16 cores
access log /var/log/nginx/access.log: last 3000 requests, 05/Dec/2026:10:00:00 -> 05/Dec/2026:10:45:59
FAIL top-ip 198.51.100.23 sent 44% of requests (1320 of 3000, 1212 IPs in total)
FAIL probes 1781 probe requests (59%) for wp-login, .env, .git, phpMyAdmin and similar; top: 198.51.100.23 (1320)
WARN status 404 15%, 401/403 44%, 5xx/499 5%: many 401/403s point to password guessing
PASS top-path busiest path /wp-login.php has 44%
WARN user-agents 59% of requests have an empty or scripted user agent (curl, python, Go, scanners)
WARN rate peak minute 300 requests against a median of 60 per minute
PASS syn-recv 0 half-open connections
PASS web-conns no established connections on :80/:443 right now
PASS ssh-failed 3 failed or invalid-user attempts in /var/log/auth.log
FAIL ssh-accepted login ACCEPTED from an IP that also failed: 185.220.101.4 - treat the server as compromised: https://alertkick.com/blog/is-my-linux-server-hacked-checklist/
top web IPs: 198.51.100.23(1320) 45.155.205.4(108) 45.155.205.0(91) 45.155.205.2(90) 45.155.205.1(89)
top SSH IPs: 185.220.101.4(3)
look them up: dig -x <ip> +short, or https://alertkick.com/tools/ip-reputation/
before blocking, confirm a high-volume IP is not Googlebot (reverse DNS googlebot.com or google.com)
5 pass, 3 warn, 3 fail The difference is concentration. An attack shows up as a few IPs, a few paths or one login endpoint taking a share of traffic that real visitors never produce, with 404s, 401s or 5xx errors climbing and scripted user agents in the mix. A real spike spreads across many IPs, normal pages and browser user agents. The script measures each of those, so the WARN and FAIL lines tell you which kind you have.
Look up the top IPs it prints with the IP reputation checker, and confirm a busy address is not Googlebot before blocking it. Paste the SSH log into the auth.log analyzer for usernames tried and the full timeline. Check the site from outside your network with the website down checker. The full runbook, with every command the script runs and what to do next, is in how to check if your website or server is under attack.
Yes. The script only reads: the last lines of the access log, the kernel connection table, /proc and the SSH auth log. It changes no settings, installs nothing and makes no network calls. Its only writes are temporary files it deletes when it exits. Read it before running it.
Linux servers running nginx or Apache with the default combined log format, on Ubuntu, Debian, RHEL, Alma or Rocky. It is POSIX sh, so it runs with dash or bash. For a log at another path, set ACCESS_LOG.
The site sits behind a CDN, load balancer or reverse proxy, so the log records the proxy address instead of the visitor. Configure the log format to record X-Forwarded-For, or CF-Connecting-IP on Cloudflare, and the IP checks become meaningful again.
A FAIL on ssh-accepted means a login succeeded from an address that was also guessing passwords: treat the server as compromised and follow the post-compromise checklist. Any other FAIL points at an attack in progress: block or rate limit the top IPs after checking they are not search crawlers, and put a CDN in front for volumetric floods.
Yes. It exits with code 0 when nothing fails and 1 otherwise, so cron can mail or act on a failing run. For alerts that reach a person within a minute, with escalation when nobody answers, continuous monitoring does the same job without cron.
The script answers when you already suspect something. The AlertKick agent watches the same signals all the time: SSH brute force and logins from new places, scanner floods, load and response time from outside, and pages the on-call person when they cross the line. Free plan, no card.
Monitor my server - free