galact-byte/galact-Skills / skills/hunt-cache-poisoning
hunt-cache-poisoning
Verified在授权渗透测试中挖掘 Web 缓存投毒与缓存欺骗(web cache poisoning / cache deception)。当目标前有缓存层(CDN/反代/Varnish)且缓存键未覆盖某些影响响应的输入(unkeyed header/参数/解析差异)时使用——典型场景:X-Forwarded-Host 反射进响应被缓存、unkeyed 参数、缓存键规范化差异、静态扩展名欺骗缓存私有页。适用目标类型 Web / CDN。触发场景包括用户说"测下缓存投毒""X-Forwarded-Host 能不能毒缓存""缓存欺骗看一下""unkeyed 输入有没有"。输出:投毒/欺骗可行性 + 被缓存证据的 finding(含 killed 记录)。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.2 KB |
| evidence/.gitkeep | other | 0 B |
| reference.md | markdown | 2.8 KB |
| tools/common.py | script | 2.8 KB |
| tools/hunt_cache.py | script | 3.4 KB |
| tools/recon.sh | script | 2.5 KB |
| tools/validate.sh | script | 4.0 KB |
tools/validate.sh
View on GitHub#!/usr/bin/env bash
# hunt-* 通用 validate:对候选过 7-Question Gate、留证、产出 finding 报告。
# schema 无关:适配各 hunt_*.py 产出的不同候选字段。
# 用法: bash tools/validate.sh candidates.json
# 输出: evidence/<n>.req/.resp(有可重放 URL 时); report/candidates.md
set -euo pipefail
PYBIN="$(command -v python3 || command -v python || true)"; [[ -z "$PYBIN" ]] && { echo "需要 python3/python" >&2; exit 3; }
CAND="${1:-candidates.json}"
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
CAND_PATH="$ROOT/$CAND"; [[ -f "$CAND_PATH" ]] || CAND_PATH="$CAND"
if [[ ! -f "$CAND_PATH" ]]; then
echo "找不到候选文件: $CAND ;先跑 hunt_*.py" >&2; exit 2
fi
mkdir -p "$ROOT/evidence" "$ROOT/report"
"$PYBIN" - "$CAND_PATH" "$ROOT" <<'PY'
import json, sys, os, subprocess
cand_path, root = sys.argv[1], sys.argv[2]
data = json.load(open(cand_path, encoding="utf-8"))
cands = data.get("candidates", [])
ev = os.path.join(root, "evidence")
rep = os.path.join(root, "report", "candidates.md")
GATE = ["scope 内?", "服务端行为?", "客观信号?", "越权/破坏边界?",
"可复现?", "留存证据?", "影响可陈述?"]
def has_signal(c):
# 各 hunt 工具用 signal / suspected_* / slow 等标记;有任一"正向"信号即视为待判
if c.get("suspected_desync") or c.get("suspected"):
return True
sig = c.get("signal")
return bool(sig) and sig not in (["无明显信号"], ["无明显时序差"])
def scalars(c):
return {k: v for k, v in c.items() if isinstance(v, (str, int, float, bool))}
lines = ["# hunt finding 报告", "",
"目标: %s" % data.get("target"),
"候选总数: %d" % len(cands), "",
"> 每条须过 7-Question Gate,任一 NO 记 killed。confirmed 项须有 evidence/ 证据。", ""]
pending = killed = 0
for i, c in enumerate(cands):
sig = has_signal(c)
stem = "%s_%d" % (str(c.get("variant") or c.get("family") or "cand"), i)
# 有可重放 URL 的(如注入类)重放取证;时序类把候选原样存证
ev_note = "无(无信号)"
if sig:
purl = c.get("probe_url")
open(os.path.join(ev, stem + ".cand.json"), "w", encoding="utf-8").write(
json.dumps(c, ensure_ascii=False, indent=1))
ev_note = "evidence/%s.cand.json" % stem
if purl:
try:
p = subprocess.run(["curl", "-sS", "-i", "--max-time", "8", purl],
capture_output=True, text=True, timeout=12)
open(os.path.join(ev, stem + ".resp"), "w", encoding="utf-8").write(
(p.stdout or "") + "\n---STDERR---\n" + (p.stderr or ""))
ev_note += " + %s.resp" % stem
except Exception as e:
open(os.path.join(ev, stem + ".resp"), "w", encoding="utf-8").write("replay error: %s" % e)
lines.append("### [%s] %s" % (stem, c.get("label") or c.get("variant") or c.get("family") or ""))
lines.append("- Severity: <人工定级>")
lines.append("- Asset: %s" % (c.get("endpoint") or c.get("host") or data.get("target")))
lines.append("- Detail: %s" % json.dumps(scalars(c), ensure_ascii=False))
lines.append("- Signal: %s" % ", ".join(c.get("signal", []) or ["-"]))
lines.append("- Impact: <人工补>")
lines.append("- Evidence: %s" % ev_note)
lines.append("- 7-Gate: %s → 逐问 YES/NO" % " | ".join("Q%d:%s" % (n+1, q) for n, q in enumerate(GATE)))
if sig:
lines.append("- Status: confirmed?(人工过 Gate 第 1/4/7 问后定)"); pending += 1
else:
lines.append("- Status: killed(Q3 无客观信号)"); killed += 1
lines.append("")
lines.insert(5, "统计: 待人工判定 %d / 自动 killed %d" % (pending, killed))
os.makedirs(os.path.dirname(rep), exist_ok=True)
open(rep, "w", encoding="utf-8").write("\n".join(lines))
print("[validate] 报告 -> %s(%d 待判, %d killed)" % (rep, pending, killed), file=sys.stderr)
PY
echo "[validate] 完成。人工按 7-Question Gate 复核 report/candidates.md" >&2
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |