Skip to content

通过知识获得解放,通过技术获得自由

Menu
  • 专题目录
  • 液压相关
    • 液压技术
    • 液压相邻技术
    • 液压应用
  • 计算机相关
    • 计算机和软件
    • 网络和网站技术
  • 哲学
  • 关于本站
Menu

WordPress禁用XML-RPC接口服务[0]

Posted on 2023年11月14日 by

本文被lnmp加固替代

虽然之前说了可以通过修改WordPress后台登录地址来让网站变得更安全.
但是还是会有很多人通过攻击XML-RPC服务让你的WordPress网站瘫痪.
控制大量的IP不停的访问WordPress的xmlrpc.php文件,造成服务器瘫痪,或者网站没什么访问量但是内存与CPU占用却超高.

  • WordPress XML-RPC服务介绍

XML-RPC 是 WordPress 用于第三方客户端(如 WordPress iPhone 和安卓客户端,Windows Live Writer 等)的 API 接口,还可以用于 pingbacks 和 trackbacks 端口,作为站点之间的通讯桥梁。WordPress 源代码中已经包含了完整的 RPC 服务端代码,它支持对文章,媒体,留言,分类,选项等等各方面数据的管理。
简单说,你只要了解 XML-RPC 协议,可以使用 XML-RPC 对你的 WordPress 博客的各个方面进行操作,也就是说可以使用 XML-RPC 做 WordPress 的客户端。
在 WordPress 3.5 版本之前,XML-RPC 服务一直默认是的被禁用的,因为它会造成安全漏洞,比如垃圾留言和 Trackback Spam 等。但是 将改变这个设置。因为WordPress 开发团队的努力,这一安全隐患被修正,所以 WordPress 索性默认将其开启,并且不在后台提供关闭选。并且 WordPress 更新到 3.5 之后,数据库中的 “enable_xmlrpc” 选项字段也将被删除,这样即使你在之前把 XML-RPC 设置为关闭,到了 WordPress 3.5 之后,也将开启。大多数网站应该都没有用到这个功能吧.但是不要直接删除WordPress根目录的xmlrpc.php,否则它会让你的wordpress网站发生莫名的错误。

  • 处理措施

关闭WordPress 禁用XML-RPC服务,通过functions.php禁用XML-RPC服务,打开当前WordPress主题开发的functions.php文件,在<?php下面的?>前面添加如下代码:

//WordPress禁用XML-RPC接口服务
add_filter('xmlrpc_enabled', '__return_false');

 

  • 验证

采用wordpress应用程序登录网站,在输入用户名和密码时,会出现错误代码:GENERIC_ERROR,而无法登录。

参考资料:
https://www.wpyi.com/wordpress-xmlrpc.html

欢迎回来

希望本站对你有所帮助!

如有疑问请联系info@fanlog.org
2023 年 11 月
一二三四五六日
 12345
6789101112
13141516171819
20212223242526
27282930 
« 6 月    

AI辅助 (17)

© 2025 | Powered by Superbs Personal Blog theme
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT