在 AWS 中收到自己 wordpress 的服务器,经常入侵别人的服务器。
经过很长时间的排查,发现是 xmlrpc.php 的问题。
我是 nginx 所以,我只需要添加
1 | location ~* ^/xmlrpc.php$ { |
即可。
可以通过以下方式测试修复:
1 | curl -Is 域名或者ip/xmlrpc.php | grep 'HTTP' | grep 'HTTP' | awk '{print $2}' |
如果结果返回 405
,则文件仍然不安全。
如果结果返回为 403
或 404
,则文件现已受到保护
ps: 域名是 http://thlm.com
或者 https://thlm.com
这样