0

I Used a mod security rule for deny wp login attept.

<LocationMatch /wp-login.php>
SecRule REQUEST_METHOD "@streq POST" \
"phase:5,chain,t:none,auditlog,pass,msg:'Login Failure Detection: Wordpress Login Attempt Failure ',id:'377360',rev:2,severity:'4',tag:'no_ar'"
SecRule RESPONSE_STATUS "200"  "t:none"
</LocationMatch>

i want this rule Block Access And show 401 Status.

Can u help me ?

Federico Sierra
  • 3,499
  • 1
  • 18
  • 24

1 Answers1

0

You can block with adding "deny,status:401" to your rule:

<LocationMatch /wp-login.php>
SecRule REQUEST_METHOD "@streq POST" \
"phase:5,chain,t:none,auditlog,deny,status:401,msg:'Login Failure Detection: Wordpress Login Attempt Failure ',id:'377360',rev:2,severity:'4',tag:'no_ar'"
SecRule RESPONSE_STATUS "200"  "t:none"
</LocationMatch>

More detail here:

However I'm confused as to why you would want to do this for above rule. This matches any POST method which is also successful (status 200), not any one that fails? Presumably you'd only want to block a failed attempt?

Barry Pollard
  • 4,461
  • 14
  • 26