
本项目是一个专为安全研究人员设计的自动化扫描工具。它通过分析目标网站的HTTP响应头及特定端点,智能识别其是否使用Next.js框架,并精确判断其版本是否受到CVE-2025-29927漏洞的影响。工具支持从命令行参数或文件批量读取URL,并可选地进行漏洞利用尝试,所有操作均可通过丰富的命令行选项进行精细控制。
puppeteer和yargs)。npm installpuppeteer默认会下载Chromium。如果你的系统中已有特定路径的Chromium/Chrome(例如/snap/bin/chromium),可以通过-c参数指定,以避免重复下载。工具通过命令行参数进行配置和调用。
扫描单个网站:
node index.js -u "https://example.com"从文件批量扫描URL(每行一个):
node index.js -f urls.txt启用详细输出模式,便于观察扫描过程:
node index.js -u "https://example.com" -v扫描并将检测到的易受攻击站点保存到结果文件:
node index.js -f targets.txt -o vulnerable_sites.json尝试利用漏洞(谨慎使用,请确保拥有测试授权):
node index.js -u "https://target-site.com" -a -w paths_wordlist.txt指定自定义浏览器路径并启用无头模式:
node index.js -u "https://example.com" -c "/usr/bin/google-chrome-stable" -t短参数 | 长参数 | 描述 |
|---|---|---|
|
| 待扫描的URL列表,用空格或逗号分隔。 |
|
| 包含URL列表的文件路径,每行一个URL。 |
|
| Chromium/Chrome可执行文件路径(默认: |
|
| 用于保存漏洞扫描结果的文件路径。 |
|
| 启用详细日志输出模式。 |
|
| 跟随HTTP重定向(可能导致误报)。 |
|
| 尝试对发现的潜在漏洞进行利用测试。 |
|
| 用于漏洞利用尝试的路径字典文件。 |
|
| 以无头模式启动Puppeteer浏览器。 |
|
| 测试失败时,尝试使用备用请求头格式。 |
|
| 显示帮助信息。 |
以下是项目中的关键代码片段,展示了参数解析、日志记录和核心检测逻辑。
此部分代码使用yargs库定义和解析所有命令行选项,并设置默认的URL列表。
const puppeteer = require('puppeteer');
const yargs = require('yargs');
const fs = require('fs');
const argv = yargs
.option('u', {
alias: 'urls',
description: 'List of URLs separated by space or comma',
type: 'string'
})
.option('f', {
alias: 'file',
description: 'A file with URLs, one for each line',
type: 'string'
})
.option('c', {
alias: 'chrome',
description: 'Chromium Path',
default: '/snap/bin/chromium',
type: 'string'
})
.option('o', {
alias: 'output',
description: 'Output file of vulnerable sites',
type: 'string'
})
.option('v', {
alias: 'verbose',
description: 'A small description of the process'
})
.option('r', {
alias: 'redirect',
description: 'Follow redirect (not recommended might lead to false positives)'
})
.option('a', {
alias: 'attack',
description: 'It will try to exploit the vulnerability'
})
.option('w', {
alias: 'wordlist',
description: 'A wordlist of paths'
})
.option('t', {
alias: 'headless',
description: 'If the t flag or headless flag is set, it will launch a headless puppeteer.',
})
.option('x', {
alias: 'headers',
description: 'It will try with middleware:middleware:middleware:middleware:middleware first; in case it fails. It will retry with src/middleware:src/middleware:src/middleware:src/middleware:src/middleware'
})
.help('help').alias('h', 'help').argv;
const WEBSITES = argv.u ? argv.u.split(/[\s,]+/).map(url => url.trim()) : argv.f ? fs.readFileSync(argv.f, 'utf8').split('\n').map(url => url.trim()).filter(Boolean) : [
'https://www.boxeurdesrues.com', 'https://www.sportsshoes.com/',
];一个条件式日志函数,仅在启用了详细输出(-v)时,将带颜色的消息打印到控制台。
const log = (message, colorCode='\x1b[0m') => {
if (argv.v) console.log(`${colorCode}${message}\x1b[0m`);
};一个常量数组,列出了针对CVE-2025-29927已修复的安全版本号,用于与检测到的版本进行比对。
const VERSIONS_PATCHED = ['15.2.3', '14.2.25', '13.5.9', '12.3.5'];6HFtX5dABrKlqXeO5PUv/9hUQdIGzBuLffwHXrPCx7A=
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。