mcpField
H
hunt-dispatch

hunt-dispatch

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

关于 hunt-dispatch

为 `/hunt` 加载技能的调度器,根据红队或 WAPT 模式及红队主机指纹选择安全测试技能。它会排序并限制加载数量、预检灰盒凭据,随后交还控制权,不执行探测。

主要功能

  1. 01按红队或 WAPT 模式分配技能
  2. 02指纹识别主机以选择平台技能
  3. 03按优先级筛选,最多加载八项
  4. 04预检灰盒凭据与权限
  5. 05输出确定性的技能分类清单

适用场景

  1. 01为红队行动准备技能集
  2. 02为黑盒或灰盒测试加载 WAPT 技能
  3. 03根据多主机指纹结果分配平台技能
  4. 04在认证测试前检查凭据

安装

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

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

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

详细介绍

hunt-dispatch

/hunt 的技能集加载器。一个概念(要加载哪些技能),一个位置。

调用约定:

hunt-dispatch mode=redteam
hunt-dispatch mode=wapt box=blackbox
hunt-dispatch mode=wapt box=greybox

步骤 1 — 指纹识别(仅限红队)

对每个在线主机进行指纹识别,而不只是顶级域名。对于多主机 / 通配符目标,平台技能路由必须依据所有 Banner,而不能只依据一个主机。

使用 -L(跟随重定向)——身份提供商和 CDN 信号 (login.microsoftonline.com、okta、auth0、CDN Banner)通常位于 30x 重定向之后,因此不跟随重定向的 curl -s --max-time 30 --connect-timeout 10I 会悄无声息地漏掉这些匹配项。提取 响应头和落地页 HTML(__NEXT_DATA__、VIEWSTATE、 laravel_session、Ignition、框架标记都在响应正文中,而非响应头中)。

HOSTS="$TARGET"
if [ -f "recon/$TARGET/live-hosts.txt" ]; then
  HOSTS=$(cat "recon/$TARGET/live-hosts.txt")
fi
for H in $HOSTS; do
  echo "=== $H ==="
  # -L follow redirects, -D - dump headers, -o body; cap body to keep context small
  curl --max-time 30 --connect-timeout 10 -sSL -D - -o /tmp/fp_body "https://$H" 2>/dev/null | tr -d '\r'
  # surface body-only platform markers
  grep -aoE '__NEXT_DATA__|/_next/|VIEWSTATE|rO0[AB]|laravel_session|Ignition|Telescope|Whitelabel|/actuator|application/grpc|socket\.io|swagger|\.js\.map' \
    /tmp/fp_body | sort -u
done
rm -f /tmp/fp_body

如果 live-hosts.txt 不存在,循环仍会针对 $TARGET 运行一次。 记录每个信号来自哪个主机——在主机 B 上匹配到的平台技能,并不意味着主机 A 也运行同一技术栈。

查找以下信号 → 平台技能映射:

okta.com | auth0.com | pingidentity         →  okta-attack
login.microsoftonline.com | outlook | sts   →  m365-entra-attack
pulse | fortinet | ivanti | citrix          →  enterprise-vpn-attack
vsphere | vcenter | :9443                   →  vmware-vcenter-attack
amazonaws | azure | googleapis | gcp        →  cloud-iam-deep
github.com/<org>/                           →  supply-chain-attack-recon
.apk | play.google.com                      →  apk-redteam-pipeline
MongoDB | mongoose | CouchDB | Redis        →  hunt-nosqli
?page= | ?file= | ?path= | php wrapper      →  hunt-lfi
rO0A | VIEWSTATE | rememberMe cookie        →  hunt-deserialization
Access-Control-Allow-Origin header          →  hunt-cors
/forgot-password | /reset | X-Forwarded    →  hunt-host-header
?redirect= | ?next= | ?return= | ?url=     →  hunt-open-redirect
OTP | /verify | /2fa | no-rate-limit        →  hunt-brute-force
Set-Cookie session | PHPSESSID              →  hunt-session
Active Directory | LDAP | OpenLDAP | ADFS  →  hunt-ldap
__NEXT_DATA__ | /_next/ | buildId           →  hunt-nextjs
X-Powered-By: Express | Node.js | .js stack →  hunt-nodejs
postMessage | dangerouslySetInnerHTML        →  hunt-dom
WebSocket | ws:// | socket.io               →  hunt-websocket
gRPC | :50051 | application/grpc            →  hunt-grpc
laravel_session | Ignition | Telescope       →  hunt-laravel
X-Application-Context | Whitelabel | /actuator → hunt-springboot
:6443 | :10250 | :2379 | kubectl            →  hunt-k8s
.github/workflows | Jenkins | GitLab CI     →  hunt-cicd
.js.map | swagger.json | /.env              →  hunt-source-leak
HSTS missing | SPF | DMARC | AXFR           →  hunt-tls-network
冲突处理与加载上限

真实目标几乎总是会同时返回多个信号——例如,单个主机可能同时显示 Cloudflare(CDN)+ login.microsoftonline.com(重定向)+ __NEXT_DATA__ (Next.js 前端)+ amazonaws(源站)。盲目加载所有匹配项可能会拉入 20 多个技能,撑爆上下文窗口,让高信号技能淹没在噪声中。请遵循以下优先级并设置上限:

优先级顺序(先加载最高层级,到达上限后停止):

tier 1  identity / SSO fabric    okta-attack, m365-entra-attack
        (own the auth boundary — highest blast radius if compromised)
tier 2  perimeter appliances     enterprise-vpn-attack, vmware-vcenter-attack
        (pre-auth RCE / direct internal foothold)
tier 3  cloud / IAM              cloud-iam-deep, hunt-cloud-misconfig
        (credential → lateral movement)
tier 4  app framework / stack    hunt-nextjs, hunt-nodejs, hunt-laravel,
        hunt-springboot, hunt-aspnet, hunt-sharepoint
tier 5  protocol / class signals hunt-nosqli, hunt-lfi, hunt-deserialization,
        hunt-cors, hunt-host-header, hunt-open-redirect, hunt-grpc,
        hunt-websocket, hunt-dom, hunt-k8s, hunt-cicd, hunt-source-leak,
        hunt-tls-network, hunt-ldap, hunt-brute-force, hunt-session

加载预算:平台技能最多加载 8 个。 如果匹配项超过 8 个,保留层级最高的 8 个,其余全部丢弃;在分类区块的 deferred: 下列出被丢弃的技能,以便之后按需加载。

去重规则(避免为同一证据加载两个技能):

  • CDN Banner 单独出现(Cloudflare/Akamai/Fastly)不算平台匹配——它识别的是边缘节点,而非应用。不要因此加载技能;记录该信号,供 hunt-cache-poison / hunt-http-smuggling 使用,这些技能已包含在模式集合中。
  • 响应头 / 源站中的 amazonaws / azure / googleapis → cloud-iam-deep。 同一字符串若作为泄露密钥 / JSON 出现在 JS Bundle 或 APK 中 → 仍加载 cloud-iam-deep,但将其标记为有效凭据线索(优先级更高,对于该主机,层级 3 升为层级 1)。
  • 同一主机上同时出现框架标记(__NEXT_DATA__、laravel_session)和通用类别 信号(?redirect=、Access-Control-Allow-Origin)→ 加载框架技能(层级 4),只有预算有余时才保留类别技能;WAPT/redteam 模式集合已无条件加载常见类别技能。

步骤 2 — 加载技能集

通过 Skill CLI 按顺序调用每个技能。

mode=redteam

始终加载(优先加载):

redteam-mindset
mid-engagement-ir-detection

平台技能(第二个加载,根据步骤 1 的指纹匹配结果决定是否加载):

okta-attack
m365-entra-attack
enterprise-vpn-attack
vmware-vcenter-attack
cloud-iam-deep
supply-chain-attack-recon
apk-redteam-pipeline

高影响力的 hunt-* 集合(第三个加载):

hunt-rce
hunt-sqli
hunt-ssrf
hunt-ato
hunt-auth-bypass
hunt-saml
hunt-oauth
hunt-mfa-bypass
hunt-file-upload
hunt-http-smuggling
hunt-cloud-misconfig
hunt-sharepoint
hunt-aspnet

报告格式:redteam-report-template(subject / observations / description / impact / recommendation / poc)。

mode=wapt

始终启用:

bb-methodology
security-arsenal
triage-validation

完整的 hunt-* 系列(涵盖所有 OWASP 相关内容):

hunt-xss             hunt-sqli            hunt-ssrf            hunt-idor
hunt-csrf            hunt-xxe             hunt-rce             hunt-graphql
hunt-oauth           hunt-saml            hunt-mfa-bypass      hunt-auth-bypass
hunt-ato             hunt-file-upload     hunt-business-logic  hunt-race-condition
hunt-llm-ai          hunt-api-misconfig   hunt-ssti            hunt-cache-poison
hunt-http-smuggling  hunt-subdomain       hunt-cloud-misconfig hunt-misc
hunt-aspnet          hunt-sharepoint      hunt-ntlm-info
hunt-lfi             hunt-nosqli          hunt-deserialization
hunt-cors            hunt-host-header     hunt-open-redirect
hunt-brute-force     hunt-session         hunt-ldap
hunt-nextjs          hunt-nodejs          hunt-dom
hunt-websocket       hunt-grpc            hunt-laravel
hunt-springboot      hunt-k8s             hunt-cicd
hunt-source-leak     hunt-tls-network

报告格式:report-writing(如果目标位于 bugcrowd 上,则使用 bugcrowd-reporting)。

box=greybox:凭据已由 /hunt 获取,可在会话记忆中使用。

在验证凭据之前,不要对已认证的 hunt-* 系列进行并行测试。 /hunt 只会提示输入并存储凭据(commands/hunt.md)——不会确认凭据是否有效。使用失效、受 MFA 限制或角色不匹配的凭据运行所有已认证测试,会浪费整个运行过程,并得出错误的“无认证攻击面”结论。请先运行一次低成本的认证预检:

# session-cookie creds: one authenticated GET against an identity echo endpoint
curl -sS -m 12 -b "$SESSION_COOKIE" "https://$TARGET/api/me" -w '\n%{http_code}\n'
#   200 + your username/email  → live session, role visible in body
#   401/403                    → dead or insufficient — STOP, re-auth

# bearer/JWT creds: same probe with Authorization
curl --max-time 30 --connect-timeout 10 -sS -H "Authorization: Bearer ***" \
  "https://$TARGET/api/me" -w '\n%{http_code}\n'

# raw user/pass: drive the real login flow once, capture Set-Cookie, then echo
#   watch for an MFA / step-up challenge in the response — if present, the creds
#   alone do not yield an authenticated session (see memory: operator-capability)

确认预检结果满足以下三项,并将其记录下来,供 hunt-* 技能使用:

  1. 有效 — 认证探测返回 200,而不是 401/403。
  2. 角色/权限 — /api/me(或等效接口)的响应正文显示预期的角色/租户/作用域。IDOR 和授权测试需要一个已知基线身份;未被察觉的管理员或只读凭据会扭曲所有授权测试结果。
  3. 未受 MFA 限制 — 登录没有停在 2fa/step-up 挑战处。如果停在此处,你持有的是凭据,而非会话——默认采用最低能力,并在声称已通过认证获得访问权限前向操作人员确认。

如果预检失败,请勿悄悄以黑盒方式继续——应提示“灰盒凭据未通过验证(HTTP {code} / MFA 挑战)”,以便操作人员重新提供凭据。只有预检通过后,才将已验证的会话应用于每项已认证测试。

步骤 3 — 输出分类信息(在会话开始时执行一次)

输出一个确定性区块。纯文本、小写、以冒号分隔,不添加装饰。

mode=redteam
loaded for red team: {N} skills
  mindset:    redteam-mindset
  platform:   {fingerprint-matched skills (<=8, tier order), or "none detected"}
  deferred:   {platform skills past the 8-cap, or omit line if none}
  auth:       hunt-ato, hunt-auth-bypass, hunt-saml, hunt-oauth, hunt-mfa-bypass
  inj:        hunt-rce, hunt-sqli, hunt-ssrf, hunt-file-upload
  infra:      hunt-http-smuggling, hunt-cloud-misconfig
  stack:      hunt-sharepoint, hunt-aspnet
  ir:         mid-engagement-ir-detection
mode=wapt
loaded for wapt ({blackbox|greybox}): {N} skills
  inj:        hunt-xss, hunt-sqli, hunt-ssrf, hunt-rce, hunt-xxe, hunt-ssti, hunt-file-upload
  authz:      hunt-idor, hunt-auth-bypass, hunt-ato
  auth:       hunt-oauth, hunt-saml, hunt-mfa-bypass
  api:        hunt-graphql, hunt-api-misconfig
  logic:      hunt-business-logic, hunt-race-condition
  infra:      hunt-http-smuggling, hunt-cache-poison
  recon:      hunt-subdomain
  cloud:      hunt-cloud-misconfig
  ai:         hunt-llm-ai
  stack:      hunt-aspnet, hunt-sharepoint, hunt-ntlm-info
  misc:       hunt-misc, hunt-csrf
  reporting:  bb-methodology, security-arsenal, triage-validation

步骤 4 — 将控制权交还给 /hunt

输出分类信息后,将控制权交还给 /hunt,以执行步骤 3(同级委派)和步骤 4(主动测试)。此处不要运行探测——此技能只负责加载上下文。

隐私

绝不回显、记录或持久化:

  • SOW / 工作范围说明 / 委托函的内容
  • 灰盒凭据(由 /hunt 保存在会话记忆中,绝不写入磁盘)
  • 用户级记忆中的客户端标识符

验证

  1. Hunt 分类检查 — 确认分发分类完整:
    grep -c "hunt-" SKILL.md && echo "PASS: hunt-* references present" || echo "FAIL"
    
  2. 技术指纹模式 — 确认指纹信号存在:
    grep -q "X-Powered-By\|Set-Cookie\|wp-json\|GraphQL" SKILL.md && echo "PASS: fingerprint signals present" || echo "FAIL"
    

所有测试都会验证分发就绪状态。


常见问题

  • 平台分类错误 — 将 React 应用误判为 Next.js,或将 Django 应用误判为 Flask,会导致加载错误的 hunt-* 技能。务必通过多个指纹信号进行验证。
  • 范围确认前就进行分发 — 在确认目标属于范围内资产之前加载 hunt-* 技能,会在范围外资产上浪费时间。
  • 分类过度 — 有些应用无法明确归入单一类别。多技术栈应用(React 前端 + Django API)需要加载两套技能。
  • 根据标头推断框架版本 — X-Powered-By 可能被伪造或移除。请结合 JS bundle 分析、Cookie 名称和错误页面特征进行交叉验证。

相关技能与工作流

  • bb-methodology — 在 PART 0 模式确认完成时。工作流基本组件:bb-methodology 确认项目类型(红队、WAPT 还是漏洞赏金);答案会直接用于调用此技能时的 mode=redteam / mode=wapt。
  • redteam-mindset + mid-engagement-ir-detection — 加载 mode=redteam 时。工作流基本组件:这些是常驻技能,由红队流程的第 2 步首先加载,然后才加载任何平台技能或 hunt-* 技能。
  • okta-attack / m365-entra-attack / enterprise-vpn-attack / vmware-vcenter-attack / cloud-iam-deep / supply-chain-attack-recon / apk-redteam-pipeline — 指纹信号匹配时。工作流基本组件:第 1 步使用 curl 对 recon/<target>/live-hosts.txt 进行指纹扫描,将 banner / 域名信号映射到一个或多个平台技能。
  • hunt-rce / hunt-sqli / hunt-ssrf / hunt-ato / *所有其他 hunt- 技能** — 输出特定模式的技能集时。工作流基本组件:此技能负责加载;它会列出 hunt-* 技能,但不会运行探测——实际的漏洞猎查会在第 4 步将控制权交还给 /hunt` 后进行。
  • report-writing 与 redteam-report-template — 分类法输出指定报告格式时。工作流基本组件:mode=wapt 以 report-writing 作为交付格式收尾;mode=redteam 则以 redteam-report-template 收尾。

评论

支持 Markdown