Forum Discussion

dgytech's avatar
dgytech
Icon for Altostratus rankAltostratus
Dec 15, 2015

iRule to block URI /xmlrpc.php

I want to throw a 404 anytime URI /xmlrpc.php is encountered. This is to block brute force attacks via XML-RPC on my WordPress sites. All I get is a white screen with this rule. I tried in IE/Chrome/Firefox.

I'm 99% sure this is right though... thoughts?

when HTTP_REQUEST {

if { [string tolower [HTTP::uri]] contains "/xmlrpc.php" } {

    HTTP::respond 404 "Not Found" "Connection" "close"

}

}

1 Reply

  • Hi DGYarrington,

    try this rule...

    when HTTP_REQUEST {
        if { [string tolower [HTTP::uri]] contains "/xmlrpc.php" } {
            HTTP::respond 404 content "Not Found" "Connection" "close"
        }
    }
    

    Cheers, Kai