How to Enable Iptables Tarpit?

How to Enable Iptables Tarpit?

I'm using ubuntu server 10.04 and I have to enable tarpit module . I installed the followning packet :

aptitude install xtables-addons-common xtables-addons-source
module-assistant auto-install xtables-addons-source

but when i try to add a tarpit rule I get this error:

iptables: No chain/target/match by that name.

Thanks for your help .

1 Answer

Clean all rules:

iptables -F
iptables -X

Use these default parameters:

iptables -P INPUT    DROP
iptables -P OUTPUT   DROP
iptables -P FORWARD  ACCEPT

Then do the following:

 iptables-save > /etc/network/iptables
 iptables-restore < /etc/network/iptables

Then enter:

iptables -A INPUT -p tcp -m tcp -dport 80 -j TARPIT

Or you can set a trap for ALL ports, except for your own:

   iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
   iptables -A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
   iptables -A INPUT -p tcp -m tcp -j TARPIT

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.