Aller au contenu
Skillpedia
Sécurité5.4k · #14931

hunt-shadow-api

Ce qu’il fait

Cette compétence recherche des versions d'API cachées ou obsolètes, et compare leurs règles de sécurité avec celles de la version actuelle. Elle s'adresse aux tests autorisés des API qui ont de nombreuses versions ou des points d'accès oubliés.

Quand l’utiliser

  • ✓Quand une application utilise des chemins d'API versionnés, comme v1 et v2, qui pourraient être actifs tous les deux.
  • ✓Quand la documentation de l'API ou le paquet de l'application mentionne d'anciens points d'accès.
  • ✓Quand plusieurs spécifications d'API existent et que leurs versions ne correspondent pas.

Lien du skill

https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-shadow-api/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/elementalsouls/Claude-BugHunter/blob/main/skills/hunt-shadow-api/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Notre API a des chemins v1 et v2. Peux-tu vérifier si l'ancienne v1 applique toujours les mêmes règles de connexion, dans le cadre de notre test autorisé ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent teste les chemins et en-têtes de version courants, rassemble les spécifications disponibles, puis compare la manière dont les anciennes et les nouvelles versions traitent la même action. Il signale les vraies différences de sécurité.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

OWASP API9 — Improper Inventory Management (Shadow / Zombie APIs)

As an API evolves, old versions and internal/staging routes routinely stay reachable without receiving the same security fixes as the current version — because nobody tracks that they still exist. The bug is rarely in one endpoint; it's in the delta between what an old version enforces and what the current version enforces on the same operation.

When to use

Trigger when:

  • Versioned paths are visible (/v1/, /v2/, /api/2023-01-01/) or Accept/X-API-Version headers are in play.
  • A changelog, release notes, or deprecation notice references removed/old API behavior.
  • A mobile APK/IPA (via apk-redteam-pipeline / ios-redteam-pipeline) hardcodes endpoints that look like an older backend version than the current web app calls.
  • Multiple OpenAPI/Swagger specs are discoverable, or info.version in one spec implies others exist.

DO NOT use for single-version APIs with no version history — there's nothing to diff; go straight to hunt-api-misconfig for direct exploitation of the one surface that exists.


Stage 1 — Enumerate the Full Version Surface

# Path-based versioning
for v in v1 v2 v3 v4 beta alpha internal legacy old 2022-01-01 2023-01-01 2024-01-01; do
  curl -s -o /dev/null -w "%{http_code} /api/$v/\n" "https://$TARGET/api/$v/"
done

# Header-based versioning
curl -s -H "X-API-Version: 1" https://$TARGET/api/users
curl -s -H "Accept: application/vnd.company.v1+json" https://$TARGET/api/users

# Subdomain-based versioning
for sub in api api-v1 api-v2 apiv1 apiv2 legacy-api old-api internal-api staging-api; do
  curl -s -o /dev/null -w "%{http_code} $sub\n" "https://$sub.$TARGET/"
done

A 200/401/403 on an old version path (anything but 404/connection-refused) means the version is still live and worth carrying into Stage 3, even if it demands auth.


Stage 2 — Pull Every Reachable Spec, Not Just the Linked One

for path in openapi.json swagger.json v1/swagger.json v2/swagger.json v3/api-docs \
            api-docs.json swagger/v1/swagger.json .well-known/openapi.json; do
  curl -s -o /dev/null -w "%{http_code} /$path\n" "https://$TARGET/$path"
done

# Wayback Machine — a DEPRECATED version's spec often stays indexed after the live link is removed
curl -s "http://web.archive.org/cdx/search/cdx?url=$TARGET/*swagger*&output=json&collapse=urlkey"
curl -s "http://web.archive.org/cdx/search/cdx?url=$TARGET/*openapi*&output=json&collapse=urlkey"

When more than one spec resolves (a current one and an archived/old one), diff the endpoint inventories directly:

jq -r '.paths | keys[]' v1-swagger.json | sort > /tmp/v1_paths.txt
jq -r '.paths | keys[]' v2-swagger.json | sort > /tmp/v2_paths.txt
comm -23 /tmp/v1_paths.txt /tmp/v2_paths.txt   # in v1 only — candidates for "still live but forgotten"

For every path in that diff, confirm it's still reachable against the v1 base URL. A route documented only in the old spec that still returns something other than 404 is a zombie- endpoint candidate — carry it into Stage 3.


Stage 3 — Behavioral Diff Between Old and Current Version

For each operation that exists in both versions, compare security-relevant behavior, not response shape. Response shape differences are Informational; behavioral security regressions are the finding.

  • Auth strength. Does the old version accept no token, an expired token, or a lower- privilege token that the current version rejects?
    curl -s -H "Authorization: Bearer $EXPIRED_TOKEN" https://$TARGET/api/v1/users/me -w '\n%{http_code}\n'
    curl -s -H "Authorization: Bearer $EXPIRED_TOKEN" https://$TARGET/api/v2/users/me -w '\n%{http_code}\n'
    
  • Rate limiting. Burst the same number of requests against both versions' equivalent endpoint; a missing 429 on the old version means rate-limiting was added later and never backported.
  • Input validation. Send the identical injection/oversized/malformed payload to both; the old version accepting what the new one rejects means hardening happened forward-only — chain into whichever injection class the payload targets (hunt-sqli, hunt-idor, etc.).
  • Field exposure. Does the old version's response body include fields — internal IDs, other users' data, internal notes, PII — that the current version has since redacted?

Stage 4 — Deprecated / Internal Routes Never Referenced by the Current UI

  • Gre
Questions fréquentes

Qu'appelle-t-on les API zombies ?

Ce sont d'anciennes versions d'API, ou des versions internes, qui restent accessibles mais ne sont plus maintenues.

Faut-il plusieurs versions ?

Oui. La compétence s'adresse aux API qui ont un historique de versions. Une API à version unique se teste mieux avec une compétence API générale.

Peut-elle utiliser des spécifications archivées ?

Oui. La compétence indique que certaines spécifications peuvent être retrouvées dans les archives du web.

Détails

Description originale de l’auteur

Hunt shadow / zombie / undocumented API surface (OWASP API9 Improper Inventory Management) — enumerate the full API version history (v1/v2/beta/legacy paths, header- and subdomain-based versioning), pull and diff every reachable OpenAPI/Swagger spec (including ones only findable via the Wayback Machine), and behaviorally diff old vs. current versions for auth/rate-limit/validation regressions rather than just response-shape differences. Distinct from hunt-api-misconfig, which owns exploitation once you have a spec or endpoint (mass assignment, JWT, OData, Swagger-chain attacks); distinct from

repo: elementalsouls/Claude-BugHunter

Popularité

Étoiles GitHub
5.4k
Position au classement
#14931
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires