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?

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

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .