Answer the question
In order to leave comments, you need to log in
How to block user-agent via iptables in Debian 7 OS?
Actually how to block user-agent through IPtables?
there is a wordpress attack by bots, and they are clogged in the logs ... I
tried to write this
iptables -I INPUT -p tcp -m string -algo kmp -string “WordPress” -j DROP
nothing helps, it does not block ...
Answer the question
In order to leave comments, you need to log in
The solution with string is very dubious
. Try writing them in a separate log, something like this
# Apache config
RewriteCond %{HTTP_USER_AGENT} ^WordPress/4\.0
RewriteRule - [L,R=403,E=WordPress]
LogFormat "%t\t%a\t%{remote}p\t%{User-Agent}i"
CustomLog wordpress wordpress.log env=WordPress
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question