Skip to content

Instantly share code, notes, and snippets.

@w33zy
Forked from ksolomon/xmlrpc-brute-protection.php
Created October 9, 2015 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save w33zy/a78cb4d4e496bde3fee0 to your computer and use it in GitHub Desktop.
Save w33zy/a78cb4d4e496bde3fee0 to your computer and use it in GitHub Desktop.
Block XMLRPC Brute Force Amplification Attacks on WordPress
<?php
/*
Plugin Name: XML-RPC Brute Protection
Description: Disable XML-RPC methods used in brute-force amplification attacks
Author: Keith Solomon
Version: 1.0
License: GPL2
*/
function mmx_remove_xmlrpc_methods($methods) {
unset($methods['system.multicall']);
unset($methods['system.listMethods']);
unset($methods['system.getCapabilities']);
return $methods;
}
add_filter( 'xmlrpc_methods', 'mmx_remove_xmlrpc_methods');
?>
@w33zy
Copy link
Author

w33zy commented Oct 9, 2015

For future reference.

@w33zy
Copy link
Author

w33zy commented Oct 9, 2015

Rewrite using clousure

add_filter( 'xmlrpc_methods', function( $methods ) {
    unset($methods['system.multicall']);
    unset($methods['system.listMethods']);
    unset($methods['system.getCapabilities']);
    return $methods;
} );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment