Zum Inhalt springen
Skillpedia
Tests35k · #8377

testing-api-authentication-weaknesses

Was er macht

Dieses Tool prüft, ob die Authentifizierung einer API (also eines Systems, über das verschiedene Programme miteinander sprechen) schwach ist. Es sucht nach Fehlern, durch die Unbefugte auf Informationen zugreifen könnten.

Wann du ihn nutzt

  • ✓Bevor du eine neue API in den Live-Betrieb deployst.
  • ✓Um zu testen, ob schwache Passwörter akzeptiert werden.
  • ✓Um zu prüfen, ob sensible Informationen in URLs oder Logs auftauchen.

Link zum Skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-api-authentication-weaknesses/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-api-authentication-weaknesses/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Prüfe die Authentifizierungssicherheit meiner API.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Das Tool probiert verschiedene Methoden aus, um auf die API zuzugreifen, zum Beispiel gängige Passwörter oder ungültige Tokens. So findet es Sicherheitslücken.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Testing API Authentication Weaknesses

When to Use

  • Assessing REST API authentication mechanisms for bypass vulnerabilities before production deployment
  • Testing JWT token implementation for common weaknesses (none algorithm, key confusion, missing expiration)
  • Evaluating whether all API endpoints enforce authentication or if some are unintentionally exposed
  • Testing API key generation, storage, and rotation mechanisms for predictability or leakage
  • Validating session management including token expiration, revocation, and refresh token security

Do not use without written authorization. Authentication testing involves attempting to bypass security controls.

Prerequisites

  • Written authorization specifying target API and authentication mechanisms in scope
  • Valid test credentials for at least two user roles (regular user, admin)
  • Burp Suite Professional with JWT-related extensions (JSON Web Tokens, JWT Editor)
  • Python 3.10+ with requests, PyJWT, and jwt libraries
  • Wordlists for credential testing (SecLists authentication wordlists)
  • API documentation or OpenAPI specification

Workflow

Step 1: Authentication Mechanism Identification

import requests
import json

BASE_URL = "https://target-api.example.com/api/v1"

# Probe the API to identify authentication mechanisms
auth_indicators = {
    "jwt_bearer": False,
    "api_key_header": False,
    "api_key_query": False,
    "basic_auth": False,
    "oauth2": False,
    "session_cookie": False,
    "custom_token": False,
}

# Test 1: Check unauthenticated access
resp = requests.get(f"{BASE_URL}/users/me")
print(f"Unauthenticated: {resp.status_code}")
if resp.status_code == 200:
    print("[CRITICAL] Endpoint accessible without authentication")

# Test 2: Check WWW-Authenticate header
if "WWW-Authenticate" in resp.headers:
    scheme = resp.headers["WWW-Authenticate"]
    print(f"Auth scheme advertised: {scheme}")
    if "Bearer" in scheme:
        auth_indicators["jwt_bearer"] = True
    elif "Basic" in scheme:
        auth_indicators["basic_auth"] = True

# Test 3: Login and examine tokens
login_resp = requests.post(f"{BASE_URL}/auth/login",
    json={"username": "testuser@example.com", "password": "TestPass123!"})

if login_resp.status_code == 200:
    login_data = login_resp.json()
    # Check for JWT tokens
    for key in ["token", "access_token", "jwt", "id_token"]:
        if key in login_data:
            token = login_data[key]
            if token.count('.') == 2:
                auth_indicators["jwt_bearer"] = True
                print(f"JWT found in response field: {key}")
    # Check for refresh tokens
    for key in ["refresh_token", "refresh"]:
        if key in login_data:
            print(f"Refresh token found in field: {key}")
    # Check for session cookies
    for cookie in login_resp.cookies:
        print(f"Cookie set: {cookie.name} = {cookie.value[:20]}...")
        if "session" in cookie.name.lower():
            auth_indicators["session_cookie"] = True

print(f"\nAuthentication mechanisms detected: {[k for k,v in auth_indicators.items() if v]}")

Step 2: Unauthenticated Endpoint Discovery

# Test all endpoints without authentication
endpoints = [
    ("GET", "/users"),
    ("GET", "/users/me"),
    ("GET", "/users/1"),
    ("GET", "/admin/users"),
    ("GET", "/admin/settings"),
    ("GET", "/health"),
    ("GET", "/metrics"),
    ("GET", "/debug"),
    ("GET", "/actuator"),
    ("GET", "/actuator/env"),
    ("GET", "/swagger.json"),
    ("GET", "/api-docs"),
    ("GET", "/graphql"),
    ("POST", "/graphql"),
    ("GET", "/config"),
    ("GET", "/internal/status"),
    ("GET", "/.env"),
    ("GET", "/status"),
    ("GET", "/info"),
    ("GET", "/version"),
]

print("Unauthenticated Endpoint Scan:")
for method, path in endpoints:
    try:
        resp = requests.request(method, f"{BASE_URL}{path}", timeout=5)
        if resp.status_code not in (401, 403):
            content_preview = resp.text[:100] if resp.text else "empty"
            print(f"  [OPEN] {method} {path} -> {resp.status_code}: {content_preview}")
    except requests.exceptions.RequestException:
        pass

Step 3: JWT Token Analysis

import base64
import json
import hmac
import hashlib

def decode_jwt_parts(token):
    """Decode JWT header and payload without verification."""
    parts = token.split('.')
    if len(parts) != 3:
        return None, None

    def pad_base64(s):

…
Häufige Fragen

Brauche ich eine Erlaubnis, um dieses Tool zu nutzen?

Ja, du brauchst unbedingt eine schriftliche Genehmigung, bevor du eine API testest. Dabei versuchst du nämlich, Sicherheitsmechanismen zu umgehen.

Was ist Authentifizierung?

Das ist der Prozess, bei dem überprüft wird, ob ein Nutzer oder ein System tatsächlich das ist, wofür es sich ausgibt. Meist geschieht das mit Benutzername und Passwort oder einem speziellen Token.

Was sind „JWT-Tokens“?

Das sind digitale „Ausweise“, die zur Authentifizierung dienen. Das Tool prüft, ob sich diese Ausweise leicht fälschen oder stehlen lassen.

Details

Originalbeschreibung des Autors

Tests API authentication mechanisms for weaknesses including broken token validation, missing authentication on endpoints, weak password policies, credential stuffing susceptibility, token leakage in URLs or logs, and session management flaws. The tester evaluates JWT implementation, API key handling, OAuth flows, and session token entropy to identify authentication bypasses. Maps to OWASP API2:20

repo: mukul975/Anthropic-Cybersecurity-Skills

Beliebtheit

GitHub-Sterne
35k
Platz im Ranking
#8377
Lizenz
Apache-2.0
Aktualisiert
31.8.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills