阿里云检出WordPress xmlrpc.php 存在SSRF漏洞解决方法2023-6-20更新
【所有wordpress网站 必做】
2023-6-20 更新方法:
删除根目录下的xmlrpc.php 会在下次更新时候又恢复,所以最新办法是:
把 xmlrpc.php 文件权限改为 000(如图),这样我感觉就可以了,更新也改不了它,外部也访问不了!

WordPress xmlrpc.php 存在SSRF漏洞安全建议
通过.htaccess屏蔽xmlrpc.php文件的访问 # protect xmlrpc Order Deny,Allow Deny from all
删除根目录下的xmlrpc.php。
WordPress xmlrpc.php 存在SSRF漏洞具体解决方法:
Apache 可以通过在 .htaccess 文件前面添加以下代码【宝塔的话直接加在伪静态规则最前面】:
<Files xmlrpc.php>
Order Allow,Deny
Deny from all
</Files>
nginx 服务器可以添加下面的规则【宝塔的话直接加在伪静态规则最前面】:
location ~* ^/xmlrpc.php$ {
return 403;
}
Nginx 如果失效可以尝试在wp主题functions.php文件中添加:
同时还移除了不需要的RDS 和 wlwmanifest.xml
//关闭XML-RPC的pingback端口
add_filter('xmlrpc_enabled', '__return_false');
// 移除 wlwmanifest.xml
remove_action('wp_head', 'wlwmanifest_link');
// 移除 RDS
remove_action( 'wp_head', 'rsd_link' ) ;
Greetings! Very helpful advice in this particular article! It is the little changes that will make the largest changes. Many thanks for sharing!