0

I used the following command to drop connection matching the string wp-login

-I INPUT -p tcp --dport 80 -m string --to 70 --algo bm --string 'GET /wp-login' -j DROP

I am getting error Line 1 failed. What I am doing wrong with my Debian 9?

  • 1
    Why don't you use fail2ban? – Michael Hampton Apr 13 '18 at 17:35
  • I have logging disabled so I cannot use fail2ban. – Saud Iqbal Apr 14 '18 at 0:50
0

Answering my own question, fixed it using the following code.

*filter
-N wpadmin
-I INPUT -p tcp --dport 80 -m string --algo bm --string "wp-login" -j wpadmin
-I INPUT -p tcp --dport 80 -m string --algo bm --string "wp-admin" -j wpadmin
-I INPUT -p tcp --dport 80 -m string --algo bm --string "wordpress" -j wpadmin
-A wpadmin -j DROP
COMMIT

Now all the connections are correctly being dropped using the keyword wordpress.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.