how to enable iptables tarpit?
2,272
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
Related videos on Youtube
Author by
sleepsort
Updated on September 18, 2022Comments
-
sleepsort over 1 year
I hope to record the result of stderr & stdout to different files, while watching both outputs from the terminal.
So I use
tee
, and found a solution in this page.But the sad thing is, it can't work when put into a makefile:
all: @command > >(tee stdout.log) 2> >(tee stderr.log >&2)
It seems that
make
will usesh -c
to execute this line, which doesn't understand well about the syntax.Can we have another solution for this?
-
chepner almost 11 years
tee
works; it's the process substitution that the shell used bymake
doesn't understand. -
Anya Shenanigans almost 11 yearsa workaround is to set the variable
SHELL
in make to/bin/bash
usingmake SHELL=/bin/bash
, or puttingSHELL:=/bin/bash
at the start of theMakefile
. -
sleepsort almost 11 yearsThanks @Petesh, can you post the answer so I can mark this as solved?
-