W0rdPre$$的安全问题

昨晚整理博客插件,使用joplin撰写笔记时,发现了入侵的迹象——通过Wordfence查看攻击。

我第一感受是,真的有这么多“闲人“或机器人暴力破解吗?其中还有阿里云,在杭州。

关于xmlrpc.php

这个接口的作用在这个链接中说很清楚:

XML-RPC is a feature of WordPress that enables data to be transmitted, with HTTP acting as the transport mechanism and XML as the encoding mechanism. Since WordPress isn’t a self-enclosed system and occasionally needs to communicate with other systems, this was sought to handle that job.

What Is Xmlrpc.php in WordPress and Why You Should Disable It

黑客可通过这个接口,反复尝试账号及密码进行暴力破解并访问站点。

查看历史

通过Wordfence[ref]关于检测安全的插件有很多,我此处不一一列举[/ref]。查看被入侵的历史,入口为:Wordfence-Tools-LiveTraffic。

屏蔽之后的IP可在Firewall-blocking中找到。

防卫与解决

根据网友和搜索结果提供的解决方案:

  1. 完全禁用此接口:安装 Disable XML-RPC WP插件。
  2. 部分禁用此接口,可正常使用相关插件:添加代码,参考 链接1。
  3. 安装**Login Security Solutin**插件
  4. 启用WordPress二次验证

防卫:“正确”屏蔽IP/IP段

通过Whois域名查询[ref]:关于什么是Whois,我写在了我的笔记里[/ref],发现相应的地理位置,便于进行适当IP段的屏蔽:

有大量翻墙用户的梯子都是服务器段IP,这些翻墙用户就看不了

我说的是被屏蔽攻击我的那些-xmlrpc.php

那最好还是先查清楚IP,不要屏蔽IP段,因为你说不定就把某服务器的翻墙用户全屏蔽了

解决

我决定完全禁用xmlrpc.php。

安装插件前,先检测是否启用

参考链接1中给出了一个检测网址,如果您收到成功的消息,则说明已经启用:
https://xmlrpc.eritreo.it/

我的带了通过的结果,直接安装插件。

HTTP Response 503

在部分操作中,我访问我的站点与插件界面,被此安全工具阻止,看起来正是“别人攻击我”出现的页面,但无法确定。

img

我访问站点时被阻止的画面

点击提供的链接,其中关于屏蔽的描述段落:

The following instructions are for site owners. If you are trying to regain access to a site that you do not manage, please contact the site owner or access.

If you locked yourself out

Except xmlrpc.php attacks

撰写本文的时候已经安装了解决方案里的第一个完全禁用的插件,再次发现了其他的“攻击“:

wp-json/trx_addons/v2/get/sc_layout?sc=wp_insert_user&role=administrator&user_login…

但点进去是登陆页。

参考链接

Xmlrpc.php攻击

  1. What Is Xmlrpc.php in WordPress and Why You Should Disable It
  2. Blocking more WordPress xmlrpc.php attacks
  3. 利用xmlrpc.php对WordPress进行暴力破解攻击

Wordfence

  1. Troubleshooting
 wechat
产品北里,讲述产品和人性、涉及设计、技术和运营的公众号。
你们的赞赏是我更新的动力~