Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to prevent my system from DoS attacks. The first thing i am trying to do is to prevent my system from fragmented ICMP packets.
To do the same i have installed the following rule:
iptables -A INPUT -p icmp -f -j DROP
With the above rule, i don't see anything happening. Still i am able to receive echo-responses for echo requests that i sent with size as 5000.
I saw the iptables statistics and i see the rule is not getting hit at all.
[root@myPc ~]# iptables -L -v -n
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 DROP icmp -f * * 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Then i slightly modified the rule as :
iptables -A INPUT -p icmp ! -f -j DROP
With the above rule, all ICMP echo-requests(both fragmented and non-fragmented) are getting dropped. I am not able to ping at all.
[root@myPc ~]# iptables -L -v -n
Chain INPUT (policy ACCEPT 17 packets, 1132 bytes)
pkts bytes target prot opt in out source destination
4 10224 DROP icmp !f * * 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 9 packets, 798 bytes)
pkts bytes target prot opt in out source destination
For any ICMP packets, the drop counter is incremented by 1. Which means in case of fragmented packets only the first packet matches the rule and gets dropped.
Thank you for your suggestion.
The main problem i face is my rule is not getting correctly match(pls see in the iptables statistics that i have mentioned).
As the rule is not getting matched, even if give log option is specified no entries is getting logged.
iptables -A INPUT -f -j LOG --log-prefix "IN_frags "
iptables -A INPUT -f -j DROP
else try using the "connbytes" module (see 'iptables -m connbytes --help')?
*Do realize though a fragmentation attack doesn't necessarily require overly large packets: it can also be about many packets very small in size that only cause problems when reassembly starts. While the kernel and the Netfilter framework are very good at detecting, and at time correcting, anomalies an IDS like Snort may be of more help because of its IP defragmentation preprocessor.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.