此仓库包含针对 CVE-2022-24434 的概念验证(PoC),该漏洞影响 Dicer npm 包。
PoC 目标版本: 0.3.1(确保使用的 dicer 代码版本确为 v0.3.1)
请确保目录结构如下:
.
├── dicer/ # Cloned Dicer repo (must be v0.3.1)
├── server.js # Vulnerable server script
└── dicer_poc.js # Exploit PoC script
git clone https://github.com/mscdex/dicer.git
cd dicer
# fetch tags and switch to v0.3.1 (tag name may be "v0.3.1" or "0.3.1")
git fetch --all --tags
# try the tag checkout (if tag is 'v0.3.1')
git checkout tags/v0.3.1 -b poc-0.3.1 || git checkout tags/0.3.1 -b poc-0.3.1
npm install # install dicer repo dependencies if needed
cd ..
选项 B — 安装 0.3.1 版本的包(如果你更倾向于使用 npm 而不是克隆仓库) 如果你不想克隆完整仓库,可以创建一个包含特定版本的本地 node_modules:
mkdir tmp_project && cd tmp_project
npm init -y
npm install [email protected]
# copy the installed package folder node_modules/dicer into the parent folder as 'dicer'
cp -R node_modules/dicer ../dicer
cd ..
rm -rf tmp_project
重要提示:该 PoC 旨在针对本项目根目录下的 dicer 源代码文件夹运行。请确保根目录中名为 dicer 的文件夹对应 0.3.1 版本。
└── poc/
├── dicer/ # Cloned Dicer repo (must be v0.3.1)
├── server.js # Vulnerable server script (place here)
└── dicer_poc.js # Exploit PoC script (place here)
▶️ 运行 PoC 启动存在漏洞的服务器:
node server.js
在另一个终端中运行漏洞利用 PoC:
node dicer_poc.js
🧩 备注 该 PoC 依赖于 dicer v0.3.1 中存在的行为。使用更新或已修补的版本可能无法复现该问题。
如果你克隆了仓库却找不到相应标签,请检查 git tag 以列出可用标签。如果没有 0.3.1 标签,请使用上面的 npm 安装方法,并确认 dicer/ 内的 package.json 显示版本为 0.3.1。
⚠️ 免责声明 此仓库仅用于教育和研究目的。 未经明确授权,请勿将此 PoC 用于任何系统。 作者不对任何滥用或由此造成的损害负责。