-
-
Save w33zy/a78cb4d4e496bde3fee0 to your computer and use it in GitHub Desktop.
Block XMLRPC Brute Force Amplification Attacks on WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); | |
?> |
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
For future reference.