Table of Contents [TOC]
The XMLRPC.PHP is a system that authorizes remote updates to WordPress from various other applications. This post about WordPress Xmlrpc will help you understand why disabling WordPress XMLRPC is a good idea and 4 ways to disable xmlrpc in wordpress, manually & using plugins.
XMLRPC.php is a feature that allows remote connection to WordPress. This API offers developers of desktop apps and mobile apps an ability to communicate to your WordPress website. This API offers developers to write applications that empower you to do numerous things whenever you are logged in to WordPress through web interface including –
To have a better understanding of the xmlrpc.php file, it is imperative to be familiar with the following basics –
So, technically speaking, with xmlrpc.php file a remote procedure call gets facilitated. This is done using XML to encode the message and send it across HTTP. Using this, information can be exchanged between devices or computers.
Although it does sounds amazing to updating a website with a single command that is triggered remotely. but unfortunately, it also raises a big red flag , and that’s exactly what happened with the XML-RPC function in WordPress.
Initially, it was a good idea to include this functionality in wordpress, but soon it was realized that it may open a backdoor in wordpress for hackers, script bots or anyone trying to access your wordpress site to enter and abuse it. Before WordPress 3.5, this functionality was disabled by default but soon after nowadays wordpress xmlrps is turned on by default.
No doubt, this has become the most abused functionality on wordpress. It may result in loads of faulty requests from hackers, bots and scripts, all trying to hack into your WordPress site via an organised XML-RPC WordPress DDOS attack.
In the past two years, following two attacks on XMLRPC have received immense coverage, let us discuss them in detail –
1 – When you open xmlrpc.php, you will see this located at –
http://<xyz.com>/<wordpress directory>/xmlrpc.php
2- Now, open your proxy and you need to send the request again.
3- At this stage, you need to send a post request and make a list of all methods accessible to you. You might be wondering why? This is how you are going to be familiar with all the actions that are possible to make and use it for the attack.
To list all the methods, you need to send a post request with the post data mentioned below in the image, you will receive a feedback with all the methods available.
<methodCall> <methodName>system.listMethods</methodName> <params></params> </methodCall>
Have a closer look at the following, if they are with you then we can move ahead with the attack
*)wp.getUserBlogs *)wp.getCategories *)metaWeblog.getUsersBlogs
3- You need to send the following in the POST request in order to carry out brute force login. If you are aware of any other valid usernames, wp-scan can help you find valid usernames.
<methodCall> <methodName>wp.getUsersBlogs</methodName> <params> <param><value>admin</value></param> <param><value>pass</value></param> </params> </methodCall>
4 – All you need to enter this into intruder and brute force away. It does not matter whether you have entered a correct password or wrong, you will end up having a correct response. This is where you will have to decide between the wrong and correct based on the size of the response. In case you are using intruder, the response on the correct login will be like the following –
XMLRPC has its fair share of uses, let us discuss them –
You can install the WordPress application on your smartphone to post to your website. The app can carry out this with the help of a feature known as remote access which is enabled by a file known as xmlrpc.php.
Why not just disable xmlrpc altogether
It is easy to do this with the help of the plugin discussed above; however, if you use famous plugins such as JetPack then those plugins will stop working completely.
This is where we will discuss three ways using which you can easily disable XML-RPC in WordPress website.
All you have to do is paste the following code in a site-specific plugin:
1 | add_filter( 'xmlrpc_enabled' , '__return_false' ); |
Since there are multiple plugins in the WordPress repository, disabling xmlrpc.php will be easy-peasy. We are going to show you how to do it, step by step, with the help of ‘disable xmlrpc plugin’.
With the help of a search bar, you need to look for disable Xmlrpc. You need to see the following plugin in the results –
This is where you need to activate and install a disable xmlrpc plugin. Once you activate the plugin, the xmlrpc feature will be disabled. The version of your WordPress website must be 3.5 and above.
Since the plugin is free, so you should keep a check on the regular updates that the plugin receives, ensuring that it is still in use by its creator.
This plugin will work on WordPress website version running on 3.5 or above. WordPress websites running on version 3.5 or above, xmlrpc is enabled by default. Furthermore, the option that enables and disables the xmlrpc was removed. There are numerous reasons due to which the owners may want to disable the functionality. Using this plugin, it can be easily done. Here is how you can install this plugin –
You don’t have to be a victim of pingback denial of service attacks. Once you have activated the plugin, xml-rpc is disabled automatically. The best thing about this plugin is that you don’t have to configure anything. When you disable xmlrpc pingback, you will be able to cut down the server CPU usage.
Install the plugin using the WordPress dashboard –
Uploading in WordPress Dashboard –
Using FTP –
This is one of the most effective WordPress plugins which helps you fight against a brutforce attack. The plugin does this by blocking the login for the IP once it has reached the highest retires allowed. With the help of this plugin, you can easily blacklist or whitelist IPs for login purposes. Loginizer also provide the accessibility to use passwordless login to your wordpress site. You have the provision of using features like – reCAPTCHA, PasswordLess Login, Two Factor Author, etc.
Follow the below-mentioned steps to install the plugin –
All you need is a random three-digit number for WordPress login. You can see the correct number which is displayed above the field through a JavaScript code. The best thing about the plugin is that it is compatible with WooCommerce login form.
Pretty much like any other plugin, you just need to install and activate the plugin. It lacks settings.
Talking about Apache web server software, .htaccess files alter the configuration of the files. As a result, before it gets passed on to WordPress, the access requests are disabled.
You can easily disable xmlrpc in WordPress by following the below-mentioned steps –
# Block WordPress xmlrpc.php requests <Files xmlrpc.php> order deny,allow deny from all allow from 123.123.123.123 </Files>
At last, save all the changes you have made and you are good to go.
If you still have any query or doubt regarding how to disable xmlrpc in WordPress, you can get in touch with us and our expert team will help you out.
Also check out our GUIDE ON – Most Common WordPress Errors in 2020