blob: 26526b76c3fc51b92dd52596af3e39cec013077d [file] [log] [blame]
Jonas Berlinf33c4612005-04-01 06:54:23 +00001Captures and holds incoming TCP connections using no local
2per-connection resources. Connections are accepted, but immediately
3switched to the persist state (0 byte window), in which the remote
4side stops sending data and asks to continue every 60-240 seconds.
5Attempts to close the connection are ignored, forcing the remote side
6to time out the connection in 12-24 minutes.
7
8This offers similar functionality to LaBrea
9<http://www.hackbusters.net/LaBrea/> but doesn't require dedicated
10hardware or IPs. Any TCP port that you would normally DROP or REJECT
11can instead become a tarpit.
12
13To tarpit connections to TCP port 80 destined for the current machine:
14.IP
15iptables -A INPUT -p tcp -m tcp --dport 80 -j TARPIT
16.P
17To significantly slow down Code Red/Nimda-style scans of unused address
18space, forward unused ip addresses to a Linux box not acting as a router
19(e.g. "ip route 10.0.0.0 255.0.0.0 ip.of.linux.box" on a Cisco), enable IP
20forwarding on the Linux box, and add:
21.IP
22iptables -A FORWARD -p tcp -j TARPIT
23.IP
24iptables -A FORWARD -j DROP
25.TP
26NOTE:
27If you use the conntrack module while you are using TARPIT, you should
28also use the NOTRACK target, or the kernel will unnecessarily allocate
29resources for each TARPITted connection. To TARPIT incoming
30connections to the standard IRC port while using conntrack, you could:
31.IP
32iptables -t raw -A PREROUTING -p tcp --dport 6667 -j NOTRACK
33.IP
34iptables -A INPUT -p tcp --dport 6667 -j TARPIT