| About | Download | Docs | FAQ | TODO | Support | Log analysis |
|---|
Frequently asked questions:
CONFIG_NETFILTER_XT_TARGET_CONNMARK=[y|m] CONFIG_NETFILTER_XT_MATCH_CONNMARK=[y|m] CONFIG_IP_NF_QUEUE=[y|m] CONFIG_IP6_NF_QUEUE=[y|m] CONFIG_IP_NF_TARGET_REJECT=[y|m] CONFIG_IP6_NF_TARGET_REJECT=[y|m]By default, any distribution stock kernel should be okay. Use packages if they're available for your distribution, it's the simplest way to do things. Also please note that synspam requires your Linux kernel to have the following elements activated (in kernel or module)
If you want to do it by hand, just do the following:
# cp synspam.pl /usr/local/sbin # /sbin/iptables -N synspam # /sbin/iptables -A synspam -m mark --mark 1 -p tcp -j REJECT --reject-with tcp-reset # /sbin/iptables -A synspam -j NFQUEUE --queue-num 0 # /sbin/iptables -A INPUT -p tcp --syn --dport 25 -j synspam # /usr/local/sbin/synspam.pl
# cp synspam.pl /usr/local/sbin # /sbin/iptables -I INPUT 1 -m tcp -p tcp ! -s 127.0.0.1 --syn --dport 25 -j NFQUEUE --queue-num 0 # /usr/local/sbin/synspam.pl
# cp synspam.pl /usr/local/sbin # /sbin/iptables -I INPUT 1 -m tcp -p tcp ! -s 127.0.0.1 --syn --dport 25 -j QUEUE # /usr/local/sbin/synspam.plOf course if your smtp server is running on a port other than 25, use the correct port number. Dependencies installation depends on your distribution, you should install packages if they're available.
$ pgrep synspam 12345 if you're using synspam >= 0.2.5 # iptables -L |grep NFQUEUE\ num\ 0 NFQUEUE tcp -- !localhost anywhere tcp dpt:smtp flags:FIN,SYN,RST,ACK/SYN NFQUEUE num 0 if you're using synspam < 0.2.5 # iptables -L |grep ^QUEUE QUEUE tcp -- !localhost.c0a8.org anywhere tcp dpt:smtp flags:FIN,SYN,RST,ACK/SYN (download and install hping) # hping -a 123.123.123.123 -S -c 1 localhost -p 25 # grep 123\.123\.123\.123 /var/log/daemon.log |tail -1 Oct 27 13:27:09 sturmgeist synspam: reject connection from 123.123.123.123:3020 score=6