krumoist/jsreaper
GitHub: krumoist/jsreaper
一款面向渗透测试的 JS 安全扫描器,能自动爬取目标站点的所有 JavaScript 文件并从中提取密钥、漏洞、端点和安全情报。
Stars: 0 | Forks: 0
# jsreaper
面向渗透测试人员和红队成员的 JS 密钥扫描器。爬取目标站点,提取所有可找到的 JS 文件,并扫描密钥、存在漏洞的库、安全问题、暴露的端点等内容。
## 可发现的内容
- **密钥** - 200+ 服务的 API 密钥、令牌、凭证(AWS、GCP、Azure、Stripe、GitHub、OpenAI、Slack 等)
- **安全问题** - XSS 注入点、SQLi、原型污染、开放重定向、命令注入、SSTI、路径遍历、不安全反序列化
- **存在漏洞的库** - 25+ 个库,包含 CVE 映射、CVSS 评分和修复版本
- **端点** - API 路由、GraphQL、WebSocket、管理面板、S3 存储桶、无服务器函数、tRPC
- **情报信息** - 邮箱、子域名、云存储桶、AWS 账户 ID、JWT 载荷、内部主机名、功能开关
## 安装
```
git clone https://github.com/krumoist/jsreaper
cd jsreaper
pip install -r requirements.txt
```
## 使用方法
基础用法:
```
python jsreaper.py https://target.com
```
增强模式:
```
python jsreaper.py https://target.com \
--depth 3 --threads 20 \
--entropy --deobfuscate \
--intel --graphql --nested-scan \
--validate \
--output report.html --output-format html
```
隐蔽模式:
```
python jsreaper.py https://target.com --profile profiles/stealth.json
```
激进模式:
```
python jsreaper.py https://target.com --profile profiles/aggressive.json
```
CI/CD 配合 SARIF:
```
python jsreaper.py https://target.com \
--profile profiles/ci.json \
--output findings.sarif \
--exit-code critical
```
Slack 告警:
```
python jsreaper.py https://target.com \
--notify-slack https://hooks.slack.com/services/... \
--notify-severity critical
```
WAF 绕过:
```
python jsreaper.py https://target.com \
--waf-bypass --rotate-ua --spoof-ip \
--proxy http://127.0.0.1:8080
```
## v4 新功能
- 异步优先的爬虫,支持多线程 JS 抓取
- 60+ 服务类别的 400+ 种模式
- `.map` 源映射文件获取与扫描
- 针对真实 API 的密钥实时验证(AWS、GitHub、Stripe、Slack、SendGrid、OpenAI、HuggingFace、NPM)
- GraphQL 端点发现与内省
- webpack/vite 分块枚举
- WAF 绕过引擎 - 轮换 UA、IP 欺骗、自适应退避、CF 绕过
- 扫描配置文件(隐蔽 / 激进 / CI)
- 自包含的 HTML 报告,支持严重级别过滤
- Slack、Discord、Telegram 通知
- SARIF 2.1.0 输出
- 保存和恢复扫描
- JS 反混淆(eval、atob、hex、unicode、charcode 数组、字符串拼接)
- Shannon 熵检测,用于识别未识别的高熵字符串
## 所有参数
```
scan:
--depth N crawler depth (default: 2)
--threads N concurrent threads (default: 10)
--timeout N request timeout seconds (default: 15)
--max-js N max JS files to scan (default: 500)
--delay F base delay between requests
--jitter F random jitter on top of delay (default: 0.3)
--profile PATH scan profile JSON
--resume PATH save/resume scan state
features:
--entropy enable entropy detection
--entropy-threshold F threshold (default: 4.2)
--deobfuscate try to deobfuscate JS before scanning
--validate live-test secrets against real APIs
--intel pull OSINT via urlscan, crt.sh, wayback, otx
--graphql probe GraphQL endpoints
--nested-scan scan JS URLs found inside discovered endpoints
--enumerate-chunks enumerate webpack/vite chunks via HEAD requests
--no-sourcemaps skip .map file fetching
--no-security skip security checks
--no-vuln-libs skip vulnerable lib checks
--no-extraction skip endpoint/intel extraction
filtering:
--severity LEVEL min severity: critical|high|medium|low
--min-confidence N min confidence score 0-100
waf/evasion:
--waf-bypass full WAF bypass mode
--rotate-ua rotate user agent each request
--spoof-ip add X-Forwarded-For spoof headers
--cf-bypass Cloudflare bypass headers
--proxy URL HTTP/HTTPS proxy
--no-ssl-verify skip TLS verification
--header KEY: VAL custom header (repeatable)
--cookies STRING cookie string
output:
--output-format FMT text|json|csv|sarif|html|markdown (default: text)
--output FILE write to file
--no-banner skip banner
--show-context show code context around findings
--no-color no ANSI colors
--list-patterns list all patterns and exit
notifications:
--notify-slack URL Slack webhook
--notify-discord URL Discord webhook
--notify-telegram-token T Telegram bot token
--notify-telegram-chat ID Telegram chat ID
--notify-severity LEVEL min severity to notify (default: high)
ci/cd:
--exit-code MODE none|findings|critical (default: findings)
```
## 模式列表
运行 `python jsreaper.py --list-patterns` 可列出全部 400+ 种模式。
涵盖:AWS、GCP、Azure、GitHub、GitLab、Stripe、PayPal、Adyen、Razorpay、Slack、Discord、Telegram、SendGrid、Mailgun、Mailchimp、Resend、Brevo、Twilio、Vonage、OpenAI、Anthropic、HuggingFace、Groq、Replicate、Together AI、Mistral、Cohere、Perplexity、Pinecone、Weaviate、Qdrant、NPM、Doppler、CircleCI、Travis CI、HashiCorp Vault、Terraform、Vercel、Railway、Render、Fly.io、Netlify、Heroku、DigitalOcean、Supabase、PlanetScale、Neon、Upstash、MongoDB、Redis、Snowflake、Databricks、Sentry、Datadog、New Relic、Shopify、Mapbox、Algolia、Elastic、HubSpot、Salesforce、Zendesk、Linear、Auth0、Okta、Clerk、Stytch、WalletConnect、Infura、Alchemy、Binance、Cloudflare、RSA/EC/SSH 私钥、JWT 等。
## 法律声明
仅在你已获得明确授权的系统上使用。你需对本工具的使用方式负责。
## 许可证
MIT
标签:API密钥检测, AWS密钥, AWS账户ID, Azure密钥, CISA项目, Cloud Buckets, CVE漏洞, DeepSeek, DevOps安全, DevSecOps, GCP密钥, GitHub Token, GPT, GraphQL端点, jsreaper, JS安全分析, JS扫描器, JS文件爬取, JWT解析, OpenAI密钥, Python爬虫, S3存储桶, SARIF输出, Slack通知, SSTI, Talos规则, Token发现, tRPC, WAF绕过, WebSocket端点, Web安全, XSS检测, 上游代理, 不安全反序列化, 主动扫描, 云安全监控, 云计算安全, 内部主机发现, 凭证泄露, 原型污染, 去混淆, 反混淆技术, 命令注入, 多线程扫描, 威胁情报, 子域名枚举, 密码管理, 密钥泄露, 开发者工具, 开放重定向, 异步爬虫, 插件系统, 数据隔离, 文档安全, 服务器无服务安全, 源码映射分析, 漏洞管理, 熵值分析, 特性开关, 电子邮件收集, 秘密扫描, 秘密管理, 系统安全, 红队侦察, 自动化渗透, 蓝队分析, 路径遍历, 输入验证, 逆向工具, 零日检测, 静态分析