mcpField
H
hunt-information-disclosure

hunt-information-disclosure

github.com/uphiago安全1.3k41 次安装8 周前更新
代码仓库

关于 hunt-information-disclosure

用于排查 Web 信息泄露的安全技能,涵盖错误信息、Source Map、暴露文件、调试端点和响应差异。帮助安全测试人员验证泄露内容,并评估其对后续漏洞测试的价值。

主要功能

  1. 01检查错误中的内部信息
  2. 02查找暴露的 Source Map 和文件
  3. 03通过响应差异测试枚举
  4. 04识别版本与技术栈
  5. 05指导泄露验证与漏洞关联

适用场景

  1. 01检查应用返回的详细错误
  2. 02排查生产资源中的 Source Map
  3. 03测试 API 是否可枚举用户或对象
  4. 04评估泄露版本对漏洞研究的帮助

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/uphiago/recon-skills --skill hunt-information-disclosure

安装后在 Claude Code 中输入/hunt-information-disclosure确认已加载。

详细介绍

信息泄露排查

排查堆栈跟踪、调试端点、版本化路径发现、源映射以及差分预言机导致的信息暴露。每种信息泄露都会放大其他漏洞的影响——版本号可用于定位 CVE,服务器路径可用于 LFI,架构泄露可导致绕过身份验证,错误消息则会暴露内部基础设施。

适用场景

  • 应用返回包含堆栈跟踪、文件路径或 SQL 片段的详细错误消息。
  • 源映射(.js.map)被部署到生产环境。
  • 版本化静态资源会暴露框架/CMS 版本。
  • API 响应会因对象是否存在而不同(通过状态码、长度或时间进行用户枚举)。
  • 调试端点、运行状况检查或状态页会暴露内部状态。

快速检测

# Trigger errors on common paths
for path in "/nonexistent" "/%00" "/.." "/error" "/debug"; do
  curl --max-time 30 --connect-timeout 10 -sk "https://target.com$path" | grep -iE "stack|trace|exception|error|warning|debug|line [0-9]+" | head -5
done

操作流程

阶段 1 — 错误与异常泄露
# Trigger errors with malformed input
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/api/users?id='"
curl --max-time 30 --connect-timeout 10 -sk -X POST "https://target.com/api/login" -d '{"username":null}'
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/search?q=%00"

# Check response for sensitive data
# Stack traces → file paths, line numbers, framework version
# SQL errors → table names, column names, DB type
# Deserialization errors → class names, serialization format
# Template errors → template paths, engine type

# Fuzz for debug endpoints
for path in "/debug" "/__debug__" "/debugbar" "/_debug_toolbar" "/.well-known/debug" \
            "/actuator" "/actuator/info" "/actuator/env" "/actuator/health"; do
  curl --max-time 30 --connect-timeout 10 -sk "https://target.com$path" -w "\n%{http_code} — $path\n" -o /dev/null
done
阶段 2 — DVCS 与配置文件发现
# Git, SVN, Mercurial exposure
for path in "/.git/HEAD" "/.git/config" "/.svn/entries" "/.hg/store/"; do
  curl --max-time 30 --connect-timeout 10 -sk "https://target.com$path" -w "%{http_code} — $path\n" -o /dev/null
done

# Config and env files
for pattern in ".env" ".env.local" ".env.production" ".env.staging" \
               "config.json" "config.yml" "settings.py" "settings.php" \
               "wp-config.php" "web.config" "app.config"; do
  curl --max-time 30 --connect-timeout 10 -sk "https://target.com/$pattern" -w "%{http_code} — $pattern\n" -o /dev/null
done

# Backup files
for pattern in "backup.zip" "backup.sql" "dump.sql" "db.sql" \
               "database.sql" "export.sql" "site.tar.gz" "backup.tar.gz"; do
  curl --max-time 30 --connect-timeout 10 -sk "https://target.com/$pattern" -w "%{http_code} — $pattern\n" -o /dev/null
done
阶段 3 — 源映射利用
# Find .js.map files
curl --max-time 30 --connect-timeout 10 -sk "https://target.com" | grep -Eo '[^"\s]+\.js\.map' | sort -u

# Download and extract
wget "https://target.com/static/app.js.map"
node -e "
const m=require('./app.js.map');
m.sources.forEach((s,i)=>require('fs').writeFileSync(s.split('/').pop(),m.sourcesContent[i]));
console.log('Extracted '+m.sources.length+' files');
"

# Look for NEXT_PUBLIC env vars in extracted source
grep -r "NEXT_PUBLIC_" extracted_files/ | cut -d= -f1 | sort -u
阶段 4 — 差分预言机
# User enumeration via status code
for id in {1..50}; do
  curl --max-time 30 --connect-timeout 10 -sk "https://target.com/api/users/$id" -w "$id — %{http_code}\n" -o /dev/null
done

# Object existence via response size
for id in {1..100}; do
  size=$(curl --max-time 30 --connect-timeout 10 -sk "https://target.com/api/orders/$id" -w "%{size_download}" -o /dev/null)
  echo "$id — $size bytes"
done | awk '$2 > 100 {print "EXISTS: "$0}'

# Timing oracle for blind enumeration
for id in {1..50}; do
  time curl --max-time 30 --connect-timeout 10 -sk "https://target.com/api/users/$id" -o /dev/null -w "%{time_total}s $id\n"
done | sort -rn

# ETag/304 oracle
for id in {1..10}; do
  etag=$(curl --max-time 30 --connect-timeout 10 -skI "https://target.com/api/users/$id" | grep -i etag)
  echo "$id: $etag"
done
阶段 5 — 版本与技术发现
# Framework version from static assets
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/static/admin/css/base.css" | head -5
curl --max-time 30 --connect-timeout 10 -sk "https://target.com" | grep -Eo '(?:Django|Laravel|Rails|Express|Next\.js|Nuxt)[\s/]*v?[0-9.]+'

# Package manager lock files
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/composer.lock" | jq -r '.packages[] | select(.version) | "\(.name)@\(.version)"' 2>/dev/null
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/package-lock.json" | jq -r '.packages | to_entries[] | "\(.key)@\(.value.version)"' 2>/dev/null
curl --max-time 30 --connect-timeout 10 -sk "https://target.com/yarn.lock" | head -30
阶段 6 — 串联信息泄露

每种信息泄露类型都能为其他攻击向量提供线索:

泄露信息可串联至
框架版本查询 CVE 数据库
服务器路径LFI 路径遍历
内部 IPSSRF 目标
API 架构通过未公开端点绕过身份验证
依赖项版本供应链漏洞
NEXT_PUBLIC 变量访问 API 密钥/Supabase/Firebase
SQL 错误确认 SQL 注入 + 确定数据库类型

注意事项

  • 并非每条错误消息都可被利用。 只显示通用“发生错误”页面且没有详细信息,不构成发现。
  • 源映射可能为空或已被剥离。 报告前请验证提取的内容。
  • 差分预言机具有统计性质。 报告前至少用 3 个样本进行确认。
  • .git 暴露必须包含实际仓库数据,而不能仅仅是某个路径返回 HTTP 200。 全匹配 SPA 可能会对 /.git/HEAD 返回 200,却并未提供 Git 数据。
  • 单独披露版本通常只有 LOW 严重性。 将其串联起来——版本 → CVE → 漏洞利用。

验证

  1. 错误消息包含可用于采取行动的内部数据(文件路径、SQL 查询、框架版本)。
  2. 源映射提取出的是真实源文件,且包含可识别的代码(而不只是 webpack 引导代码)。
  3. 差分预言机能稳定地区分存在与不存在的资源。
  4. 报告前将该信息泄露与其他漏洞串联——单独的信息泄露很少达到严重级别。
  5. 对于配置文件:泄露的数据必须包含凭据、API 密钥或连接字符串(而不只是通用配置)。

相关技能

  • source-leak-hunt — 专门排查 .env、.git 和配置文件泄露。
  • js-secrets-extraction — 从 JavaScript 包中提取 API 密钥和令牌。
  • error-log-mining — 排查泄露凭据和查询信息的 PHP 错误日志。
  • web-enumeration — 发现会暴露敏感端点的路径。

评论

支持 Markdown