The idea
You're Hugo, on a signed engagement against Saltmarsh Ferries, working from the Kali box kali. Their whole business is the
booking site on 10.0.1.10 — if it stops answering, the ferries stop selling seats.
A SYN flood abuses the TCP handshake: spray SYNs from forged sources
and never send the final ACK, so the server fills with half-open connections waiting for a reply that never
comes. It is the textbook denial-of-service — and this lab teaches the honest version of it: a modern server with
SYN cookies on will keep serving right through a small single-box flood, so the real exposure is the host that has
cookies off, and the network edge that should never have let a forged source out in the first place.
Steps
-
The booking site, and one lone SYN
First, the ground truth: the booking site answers, and a single
SYNshows what the attack abuses. Book a seat as a customer, then send one craftedSYNwith hping3 and read the reply.hping3 -Ssends a loneSYN; the server answersSA(SYN-ACK) and waits for anACKthat a real client would send to finish the handshake. hping3 never sends it — that unfinished third step is the whole attack, multiplied.customer:~# curl -s -o /dev/null -w 'code=%{http_code}\n' --max-time 6 http://10.0.1.10/ kali:~# sudo hping3 -S -p 80 -c 1 10.0.1.10 -
The flood: half-open connections pile up
Now the flood. Twelve senders on Kali, each spraying
SYNs to port 80 from a forged source (10.0.1.101–10.0.1.112) Hugo does not own, none of them ever sending theACK. The forged sources are the point: the server'sSYN-ACKgoes to an address that never asked and never replies, so each connection sits half-open. List the server's half-open connections while the flood runs.booking:~# ss -tn state syn-recv
-
The server shrugs it off
The flood is in full flow and the queue is full of forged half-open connections. So book a seat as a real customer right now, and read the kernel's own counter for why it still works.
customer:~# curl -s -o /dev/null -w 'code=%{http_code}\n' --max-time 6 http://10.0.1.10/ booking:~# nstat -az TcpExtSyncookiesSent -
Cut the forgery at the edge — and the fixes
The flood only works because Hugo can forge its source. The durable network fix is anti-spoofing at the edge (BCP 38): a port may send only packets whose source is its own address. Put that filter on Kali, run the same flood, and watch what reaches the server.
Then the defender's checklist, because no single control is the whole answer:
- Keep SYN cookies on (
net.ipv4.tcp_syncookies=1) on every host — the reason this server shrugged the flood off, and free. - Anti-spoofing at the edge (BCP 38 / uRPF, IP Source Guard per switch port) — a forged source never leaves the network it was faked on.
- Upstream scrubbing for a real distributed flood no host can absorb — the volume is dropped before it reaches you.
Running a flood against a system whose owner has not authorised you in writing is an offence under laws like the UK Computer Misuse Act and the United States' CFAA — the engagement letter is what makes it a test and not a crime.
kali:~# sudo iptables -I OUTPUT ! -s 10.0.1.11 -j DROP customer:~# curl -s -o /dev/null -w 'code=%{http_code}\n' --max-time 6 http://10.0.1.10/ - Keep SYN cookies on (
Run these steps on real machines
Keep reading
- Kali Tools: hping3 article
- RFC 4987: TCP SYN Flooding Attacks and Common Mitigations article
- Cloudflare: SYN flood attack article