How to implement attack detection?
Hi All,
I am new to Netfilter/Iptables and am trying to write a dummy firewall with a skeleton Intrusion Detection System in it, using Netfilter/Iptables for my Suse 9.0 distro. I noticed that we can specify limits to incoming/outgoing packets for example if I am getting more than 5 SYN packets from a particular IP address, I can block any further SYN requests from that IP Address.
Now to write a Intrusion Detection System, how that limit counter is exposed by Nefilter/Iptables and how can I use it in my userspace firewall? So that I can easily check for the exposed counter and drop/reject the packets or allow them.
Any help in this regard is highly appreciated.
Thanks
Ashish
Quoted 3 lines · Swaroop Ashish
limits to incoming/outgoing packets for example if I am getting more than 5 SYN packets from a particular IP address, I can block any further SYN requests from that IP Address.
Are you sure you want to do this? Makes it trivial for attackers to block others access to your server by only knowign their IP address..
Quoted 4 lines
Now to write a Intrusion Detection System, how that limit counter is exposed by Nefilter/Iptables and how can I use it in my userspace firewall? So that I can easily check for the exposed counter and drop/reject the packets or allow them.
You can do what you describe in the kernel by using a combination of the limit match and the pool/ipset functions to remember the offending IP address.
You can also use the QUEUE method to have selected packets sent to userspace for further processing.
Regards
Henrik