Block a remote IP
-
Dear Sirs,
Looking further into NinjaWP docs, I found out that with .htninja file
it’s possible to create custom rules to use with the FW engine.I’ve put this file in public_html folder and it’s loaded correctly by
the FW (see attached screenshot).I was doing some tests using a WPScan web service
(https://hackertarget.com/wordpress-security-scan/) and trying to block
some IP I found looking at FW’s log.Here’s the rule that I used from your .htninja-sample file:
$ip_array = array( ‘104.237.147.13’ , ‘104.237.147.13’ , ‘104.211.30.57’
, ‘34.230.71.33’ );
if ( in_array( $_SERVER[“REMOTE_ADDR”], $ip_array ) ) {
return ‘BLOCK’; // blacklist
}However, running the scan service nothing happens…. IPs are not
blocked…Am I missing something? Do I have to set something else in .htninja
file?Thanks for any help!
Best regards
- The topic ‘Block a remote IP’ is closed to new replies.