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/recon.sh
View on GitHub#!/usr/bin/env bash
# hunt-cache-poisoning recon:枚举相关入口参数。
# 用法: bash tools/recon.sh <target> [--scope-only]
# 输出: evidence/scope.txt ; recon/endpoints.json
set -euo pipefail
PYBIN="$(command -v python3 || command -v python || true)"; [[ -z "$PYBIN" ]] && { echo "需要 python3/python" >&2; exit 3; }
TARGET="${1:-}"; MODE="${2:-full}"
[[ -z "$TARGET" ]] && { echo "用法: bash tools/recon.sh <target> [--scope-only]" >&2; exit 2; }
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
mkdir -p "$ROOT/evidence" "$ROOT/recon"
SCOPE="$ROOT/evidence/scope.txt"
if [[ ! -f "$SCOPE" ]]; then
cat > "$SCOPE" <<EOF
# hunt-cache-poisoning 授权 scope(开工前人工填写并确认)
target: $TARGET
in_scope:
out_of_scope:
oast_domain: # 带外回连域名(需要时)
authorized_by: # 授权人/工单号
EOF
echo "[recon] 已生成 scope 模板: $SCOPE —— 填写确认授权后再继续" >&2
fi
[[ "$MODE" == "--scope-only" ]] && { echo "[recon] scope-only 完成,未发请求" >&2; exit 0; }
PAGE="$ROOT/recon/page.html"
curl -sS --max-time 15 -L "$TARGET" -o "$PAGE" || echo "[recon] 目标抓取失败,继续" >&2
touch "$PAGE"
KEYWORDS='url|path|lang|region|host|callback|utm|ref|cb|version|theme|debug|forwarded'
"$PYBIN" - "$TARGET" "$PAGE" "$KEYWORDS" "$ROOT/recon/endpoints.json" <<'PY'
import re, sys, json
target, page_path, kw, out = sys.argv[1:5]
try: html = open(page_path, encoding="utf-8", errors="ignore").read()
except OSError: html = ""
names = set(re.findall(r'(?:name|id)\s*=\s*["\']([^"\']+)["\']', html, re.I))
for m in re.finditer(r'[?&]([a-zA-Z_][\w\-]*)=', html): names.add(m.group(1))
forms = len(re.findall(r'<form', html, re.I))
uploads = bool(re.search(r'type\s*=\s*["\']?file', html, re.I))
kwre = re.compile(kw, re.I)
hits = sorted(n for n in names if kwre.search(n))
eps = [{"url": target, "param": n, "method": "GET", "controllable": True,
"note": "启发式命中,需人工确认落点"} for n in hits]
if not eps:
eps = [{"url": target, "param": None, "controllable": False,
"note": "未自动命中相关参数;人工排查 API/表单/上传/头部输入"}]
json.dump({"target": target, "forms": forms, "has_upload": uploads, "endpoints": eps},
open(out, "w", encoding="utf-8"), ensure_ascii=False, indent=1)
print("[recon] 候选入口 %d(forms=%d upload=%s)-> %s"
% (len([e for e in eps if e['controllable']]), forms, uploads, out), file=sys.stderr)
PY
echo "[recon] 下一步: 见 SKILL.md 的 hunt 阶段命令" >&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 |