What's new

Iptables settings against attacks

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

firewolf89

New Around Here
Hi all!

I am trying to set up some rules against brute-force attack because in the past days i have experienced several attack... in one of them, they succefully registered to my asterisk and they placed many calls around the world (from guatemala to nigeria...:eek:)....

I want to add some line to my firewall-start script but i encounter a problem...

These are the lines i want to add:
Code:
# Fight the sipreg bots
iptables -I INPUT -s ! 192.168.2.1/24 -p udp --dport 5060 -m recent --set --name ASTERISK
iptables -I INPUT -s ! 192.268.2.1/24 -p udp --dport 5060 -m recent --update --seconds 15 --hitcount 10 --name ASTERISK -j DROP
#iptables -I INPUT -s ! 192.168.2.1/24 -p tcp --dport 5060 -m recent --set --name ASTERISK
#iptables -I INPUT -s ! 192.268.2.1/24 -p tcpp --dport 5060 -m recent --update --seconds 15 --hitcount 10 --name ASTERISK -j DROP

#Fight ssh brute force
iptables -N SSH_CHECK
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j SSH_CHECK
iptables -A SSH_CHECK -m recent --set --name SSH
iptables -A SSH_CHECK -m recent --update --seconds 60 --hitcount 4 --name SSH -j DROP

but i get this error:
Code:
iptables: No chain/target/match by that name
iptables v1.3.8: host/network `192.268.2.1' not found
Try `iptables -h' or 'iptables --help' for more information.
iptables: Chain already exists
iptables: No chain/target/match by that name
iptables: No chain/target/match by that name

Anyone can help me?

[edit] ok, it is related to some missing modules... but i don't know how and what to add...
 
Last edited:
Load the module first:

Code:
modprobe xt_recent
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top