Hi,
I would suggest using mod_dosevasive which is available from http://www.nuclearelephant
to help proect your server
Main Topics
Browse All Topicsdear, all
my server's being under heavily attacked. my server's OS: linux whitebox with iptables, apache2.0
i've configed my kernel with appropriate parameters to prenvet SYN flood as well as dDos. My Iptables is also written with this: to drop stealth scans
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
-A INPUT -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -j DROP
-A INPUT -p tcp -m tcp --tcp-flags FIN,RST FIN,RST -j DROP
-A INPUT -p tcp -m tcp --tcp-flags FIN,ACK FIN -j DROP
-A INPUT -p tcp -m tcp --tcp-flags ACK,URG URG -j DROP
-A INPUT -p tcp -m tcp --tcp-flags PSH,ACK PSH -j DROP
I added this rule in order to prevent the attacks from that IP address
-A INPUT -s 220.231.65.27 -p tcp -m tcp -m limit --limit 50/sec --limit-burst 150 -j REJECT --reject-with icmp-port-unreachable
However, most of my web's vistors used dial up internet, one IPs = thousands of visitors, so that the rule is not a good solution.
The attacker send out a bunch of request with POST (apache2, www.myweb.com/server-statu
is there anyway by iptables for my to block certain accesses from a MAC address.
or is therey any solutions by iptables for this kind of attacks
thanks alot alot
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
I would suggest using mod_dosevasive which is available from http://www.nuclearelephant
to help proect your server
Have a look at my answer in this thread:
http://www.experts-exchang
Using the dstlimit match for iptables you should be able to block dos attacks even from changing source IPs.
HTH,
-XoF-
> > then..is there any way to limit access to certain pages within an interval of time?
> you still have a rule posted yourself in the question to do that, why are you asking then?
I think the emphasis was on "certain pages". In my understanding, the OP thinks of setting up limits for several different server (html) pages...
The short & precise answer to that question is:
No, you can't accomplish that by means of iptables.
You could use iptables for such a purpose when using different official IP addresses and IP-based vhosts in apache, so you can set up different limits for each vhost.
HTH,
-XoF-
> The short & precise answer to that question is:
> No, you can't accomplish that by means of iptables.
disagreed, you can with the iptable's string match module
But I highly recommend to *not* use that for blocking HTTP requests, it's a waste of resources ...
Also: it does not make any sense to block request to URLs in the web server itself, 'cause the DDoS happens exactly there, hence the target victim tries to protect itself, which fails for obvious reason.
If you want to protect a web server based on URLs, you need a special device (phisical seperated hardware with special software) like a WAF (web application firewall), be prepared for $$$ ...
> disagreed, you can with the iptable's string match module
ACK. Development of netfilter seems to be too fast for me sometimes...;)
Just another thing no one has noticed up to now:
> I added this rule in order to prevent the attacks from that IP address
> -A INPUT -s 220.231.65.27 -p tcp -m tcp -m limit --limit 50/sec --limit-burst 150 -j REJECT --reject-with icmp-port-unreachable
That rule is absolutely useless, since it rejects every packet which doesn't come in bursts of at least 50 per second. So in fact DOS packets might actually be allowed. That highly likely isn't what one would want.
The correct rule would be:
-A INPUT -s 220.231.65.27 -p tcp -m tcp -m limit --limit 50/sec --limit-burst 150 -j ACCEPT
-A INPUT -s 220.231.65.27 -p tcp -j REJECT --reject-with icmp-port-unreachable
whereby I'd suggest limiting SYN packets only - but then with a fair and strong limit:
-A INPUT -s 220.231.65.27 -p tcp -m tcp --syn -m limit --limit 1/sec --limit-burst 5 -j ACCEPT
-A INPUT -s 220.231.65.27 -p tcp -j REJECT --reject-with icmp-port-unreachable
Cheers,
-XoF-
Business Accounts
Answer for Membership
by: ahoffmannPosted on 2006-02-05 at 02:50:28ID: 15875746
> .. block certain accesses from a MAC address.
only if these client are located in the same physical and logical subnet (not switched!), I doubt that this is the case ..
> .. one IPs = thousands of visitors,
do you say that this IP is used for DDoS? then it might be a wice decission to block that IP at all :-))