The idea
You're Beatrix, on a signed engagement against Kelp & Anchor, working from the Kali box kali. Their recursive
resolver at 10.0.1.10 answers the whole internet — an open resolver, and there are millions like
it. A DNS reflection attack turns one into a weapon: UDP never checks who sent a
query, so you stamp a victim's address on a tiny request and the resolver mails a large DNSSEC answer to the
victim, who never asked. The flood arrives from Kelp & Anchor's resolver, not from you (reflection), and the answer
dwarfs the question (amplification). The only real fix is to stop being an open resolver.
Steps
-
A resolver that answers the whole internet
A resolver should recurse only for its own network. Ask this one for a name from inside Kelp & Anchor's LAN, and again as a stranger out on the internet, and see whether both are served. That second answer is the whole problem.
staff:~# dig +short www.lab @10.0.1.10 kali:~# dig +short www.lab @10.0.1.10
-
A small question, a huge answer
Now the amplification. Ask for everything about a DNSSEC-signed zone (an
ANYquery, signatures included). The question is a few dozen bytes; weigh the answer, stuffed with keys and signatures, against it.kali:~# dig +notcp +dnssec ANY lab @10.0.1.10
-
Reflected onto someone who never asked
Put the two together. Stamp the victim's address (
10.0.2.13) on each query, so the resolver mails the big answer to the victim instead of to you. Fire a small burst and capture what lands on the victim.kali:~# sudo nping --udp -p 53 -g 7777 -e eth0 -S 10.0.2.13 --data abcd01000001000000000001036c61620000ff00010000291000000080000000 -c 30 --rate 30 10.0.1.10
-
Close the resolver — and the fixes
The attack needs a resolver that answers strangers, so the fix is to not be one. On Kelp & Anchor's router, drop DNS arriving from the internet toward the resolver. Fire the same burst and confirm nothing reflects — while the staff client, which never crosses the router, still resolves names.
Then the defender's checklist:
- Do not run an open resolver. Answer recursion only for your own network (
allow-recursion), the single fix that removes you as a reflector — what you do here. - Response Rate Limiting on authoritative servers, and refusing
ANY(RFC 8482), cut the amplification. - Anti-spoofing at the edge (BCP 38) stops the forged source leaving the attacker's network in the first place — the control that would end reflection everywhere, if everyone deployed it.
Running this 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.
kelpRouter:~# iptables -A FORWARD -d 10.0.1.10 -p udp --dport 53 -j DROP kali:~# sudo nping --udp -p 53 -g 7777 -e eth0 -S 10.0.2.13 --data abcd01000001000000000001036c61620000ff00010000291000000080000000 -c 30 --rate 30 10.0.1.10 staff:~# dig +short www.lab @10.0.1.10
- Do not run an open resolver. Answer recursion only for your own network (
Run these steps on real machines
Keep reading
- Cloudflare: DNS amplification attack article
- US-CERT TA13-088A: DNS Amplification Attacks article
- Kali Tools: nping (nmap) article