![]() |
SecFilterSelective not working?
I'm trying to block users who don't have a user agent:
SecFilterSelective HEADER_USER_AGENT "^$" SecFilterSelective HTTP_USER_AGENT "^$" Neither work and yes I am using vhosts, no Apache. Any suggestions? |
I tested
SecFilterSelective HEADER_USER_AGENT "^$" and SecFilterSelective HEADER_USER_AGENT "" not working.the test command is #curl -A "" -I 127.0.0.1/test.html however, if not empty, e.g. SecFilterSelective HEADER_USER_AGENT "chome" will work as expected -- will forbid Chrome browser to access. however, you can use rewrite rule to archive the same goal, and much simpler. RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule . - [F] rewriterule is widely used and well tested, it's simpler yet powerful. |
I think the issue is I am trying to grab the access my site by the domain (root) - that goes through, but everything else doesn't. For some reason that rule isn't applying to /.
77.9.186.5 - - [22/Jun/2012:19:20:55 +0200] "GET / HTTP/1.1" 200 25992 "-" "-" 77.9.186.5 - - [22/Jun/2012:19:20:55 +0200] "GET / HTTP/1.1" 200 25992 "-" "-" 77.9.186.5 - - [22/Jun/2012:19:20:56 +0200] "GET / HTTP/1.1" 200 25992 "-" "-" 77.9.186.5 - - [22/Jun/2012:19:20:56 +0200] "GET / HTTP/1.1" 200 25992 "-" "-" vs 77.9.186.5 - - [22/Jun/2012:19:20:55 +0200] "GET /index.php HTTP/1.1" 403 25992 "-" "-" Is there a reason why rules aren't applying to the root? |
then please try:
RewriteCond %{HTTP_USER_AGENT} ^$ RewriteRule .* - [F] |
This doesn't seem to be effective enough to block a DDOS. In fact attacking IPs spam the access logs and don't seem to be blocked lsws's firewall.
|
Code:
77.9.186.5 - - [22/Jun/2012:19:20:55 +0200] "GET /index.php HTTP/1.1" 403 25992 "-" "-"i.e., response body's size is 380 bytes. content is Quote:
|
I just edited the code, because I was too lazy to find the request. The same is there though.
|
| All times are GMT -7. The time now is 12:22 AM. |