iptables TARPIT on Debian

I read about using TARPITS a while back, and discovered it's pretty easy to set it up on Debian.

Update 2013/05/12: This works for both Sqeeze and Wheezy. You need to build the modules again after upgrading to Wheezy, since it's a newer kernel.

The original article explain what tarpits actually do can be found here:

Install packages

apt-get update
apt-get install iptables module-assistant xtables-addons-common

Build kernel modules

module-assistant --verbose --text-mode auto-install xtables-addons

Test if it works

iptables -A INPUT -p tcp --dport 999 -j TARPIT

If that worked, and the above command exited properly, installation is successful.

Note: To remove the above rule again, use 'iptables -D INPUT -p tcp --dport 999 -j TARPIT'.