Learn API Security Testing: From Zero to API Penetration Testing Master

Goal: Deeply understand API security vulnerabilities, testing methodologies, and exploitation techniques—from basic authentication flaws to advanced injection attacks. You will learn to identify OWASP API Top 10 vulnerabilities, exploit broken authentication and authorization (BOLA/BFLA), perform JWT attacks, conduct NoSQL and SQL injection against APIs, test GraphQL endpoints, and build secure APIs that resist these attacks. By the end, you’ll be able to conduct professional API security assessments and build resilient APIs.

Introduction

APIs (Application Programming Interfaces) are the connective tissue of the modern internet, powering everything from mobile apps and microservices to IoT devices and B2B integrations. However, this ubiquity has made them the #1 attack vector for web applications.

In this guide, you will move beyond traditional web security (XSS, CSRF) to master the unique challenges of API security. You will build your own testing tools, analyze vulnerable applications, and learn the mindset of an API hacker.

What You Will Build: You will create a comprehensive API Security Testing Arsenal consisting of 20 specialized tools and scripts—from a BOLA hunter and JWT cracker to a full-featured API reconnaissance framework.

The API Security Landscape

Traditional Web App                    Modern API-First Architecture
┌─────────────────────┐               ┌─────────────────────────────────┐
│   Browser ──► Web   │               │  Mobile App ──┐                │
│   Server (HTML)     │               │               │                │
│                     │               │  Web SPA ─────┼───► API ──► DB │
└─────────────────────┘               │               │    Gateway     │
                                      │  IoT Device ──┤                │
Single attack surface                 │               │                │
(mostly server-side rendering)        │  Partner ─────┘                │
                                      └─────────────────────────────────┘
                                      Multiple attack surfaces, same API
                                      Client-side logic, rich data exposure

How to Use This Guide

  1. Read the Theory Primer First: The “Mini-Book” section below covers the deep concepts you need. Don’t skip it—API security is subtle, and understanding the why is as important as the how.
  2. Build the Projects in Order: The projects are sequenced to build your skills layer by layer.
  3. Focus on the “Core Question”: Each project answers a specific conceptual question. Ensure you can answer it before moving on.
  4. Use the “Definition of Done”: Don’t just copy code. Verify your tools work against real vulnerable targets (like OWASP crAPI or Juice Shop).

Prerequisites & Background Knowledge

Essential Prerequisites (Must Have)

  • HTTP Fundamentals: Methods (GET, POST, PUT, DELETE), Headers, Status Codes (2xx, 4xx, 5xx).
  • Data Formats: JSON (structure, parsing) and XML.
  • REST API Concepts: Resources, endpoints, statelessness.
  • Command Line Basics: Comfortable with curl, wget, and basic scripting (Python/Bash).
  • Basic Scripting: Ability to write Python scripts using the requests library.

Helpful But Not Required

  • OAuth 2.0 / OIDC: Basic understanding of flows (Authorization Code, Client Credentials).
  • GraphQL: Basic query syntax.
  • Database Knowledge: SQL and NoSQL (MongoDB) basics.
  • Docker: For running vulnerable lab environments.

Self-Assessment Questions

  1. Can you explain the difference between Authentication (who you are) and Authorization (what you can do)?
  2. Can you decode a JWT and explain its three parts?
  3. Can you use curl to send a POST request with a JSON body and a custom header?
  4. Do you know what an IDOR (Insecure Direct Object Reference) is? (Hint: It’s the old name for BOLA).

Development Environment Setup

  • OS: Linux (Kali/Ubuntu), macOS, or Windows (WSL2).
  • Languages: Python 3.x (primary), Node.js (for some targets).
  • Tools:
    • Burp Suite Community/Pro: The industry standard proxy.
    • Postman: For legitimate API interaction and testing.
    • OWASP ZAP: Free alternative to Burp.
    • Docker: To run vulnerable apps like OWASP crAPI.
  • Python Libraries: requests, jwt, colorama.

Time Investment

  • Theory Primer: 4-6 hours
  • Projects: 4-40 hours each (depending on depth)
  • Total Mastery: 3-6 months of consistent study and practice.

Important Reality Check

WARNING: This guide teaches offensive security techniques. NEVER test APIs you do not own or have explicit written permission to test. Unauthorized testing is illegal and unethical. Use these skills to secure your own applications or in authorized engagements (bug bounties, pentests).


Big Picture / Mental Model

The API Attack Pipeline

   1. Reconnaissance        2. Authentication       3. Authorization       4. Exploitation
   ┌────────────────┐       ┌────────────────┐      ┌────────────────┐     ┌────────────────┐
   │ Find Endpoints │       │ Bypass Auth    │      │ Escalate Privs │     │ Inject/Abuse   │
   │                │       │                │      │                │     │                │
   │ - Fuzzing      │──────►│ - Weak JWTs    │─────►│ - BOLA (IDOR)  │────►│ - Injection    │
   │ - Docs (OpenAPI│       │ - OAuth Flaws  │      │ - BFLA         │     │ - Mass Assign  │
   │ - Mobile Apps  │       │ - Cred Stuffing│      │ - BOPLA        │     │ - DoS          │
   └────────────────┘       └────────────────┘      └────────────────┘     └────────────────┘
           │                        │                       │                      │
           ▼                        ▼                       ▼                      ▼
    Map the Surface          Gain Access             Access Data            Compromise System

Theory Primer (Mini-Book)

Chapter 1: The OWASP API Security Top 10 (2023)

Fundamentals The OWASP API Security Top 10 is the standard awareness document for the most critical security risks to APIs. It differs significantly from the standard Web Top 10 because APIs expose underlying logic and data differently than traditional web apps.

Deep Dive In 2023, OWASP updated the list to reflect modern threats. The most notable shift is the focus on authorization (BOLA, BFLA, BOPLA) and the consumption of APIs.

  1. API1:2023 Broken Object Level Authorization (BOLA): The “King” of API vulnerabilities. Attackers manipulate IDs to access other users’ objects.
  2. API2:2023 Broken Authentication: Weaknesses in how the API verifies identity (e.g., weak JWT secrets, no rate limiting on login).
  3. API3:2023 Broken Object Property Level Authorization (BOPLA): Combines “Excessive Data Exposure” and “Mass Assignment”. Attackers can read private fields or update restricted fields.
  4. API4:2023 Unrestricted Resource Consumption: DoS attacks, but also business logic abuse (e.g., sending 1000 SMS messages).
  5. API5:2023 Broken Function Level Authorization (BFLA): Regular users accessing admin functions.
  6. API6:2023 Unrestricted Access to Sensitive Business Flows: Abusing the business logic (e.g., buying all tickets, scalping).
  7. API7:2023 Server Side Request Forgery (SSRF): Tricking the API into making requests to internal systems.
  8. API8:2023 Security Misconfiguration: Default settings, verbose error messages, missing headers.
  9. API9:2023 Improper Inventory Management: Shadow APIs, zombie APIs, deprecated versions.
  10. API10:2023 Unsafe Consumption of APIs: Trusting data from third-party APIs blindly.

Key Insight: Authorization is the hardest problem in APIs. Authentication (who you are) is often handled by libraries, but Authorization (what you can do to this specific object) requires custom logic in every endpoint.


Chapter 2: Broken Object Level Authorization (BOLA)

Fundamentals BOLA (formerly IDOR) occurs when an API endpoint exposes a reference to an object (like an ID) but fails to validate that the authenticated user has permission to access that specific object.

Deep Dive Imagine an endpoint GET /api/invoices/1001.

  • Scenario: User A (ID: 50) requests invoice 1001. The system checks “Is User A logged in?”. Yes. It returns the invoice.
  • The Flaw: The system should have checked “Does Invoice 1001 belong to User A?”.
  • The Attack: User A changes the ID to 1002, 1003, etc., and downloads everyone’s invoices.

Mental Model

User A (ID: 50) ───► GET /invoices/1002 ───► API ───► DB (Invoice 1002 belongs to User B)
                                              │
                                              ▼
                                     [Check: Is User A logged in?] -> YES
                                     [Check: Does User A own 1002?] -> MISSING!
                                              │
                                              ▼
                                     Returns Invoice 1002 (DATA LEAK)

Real-World Application: The Peloton breach allowed unauthenticated users to request account data for any user ID, exposing private data of millions.


Chapter 3: Broken Function Level Authorization (BFLA)

Fundamentals BFLA is about actions rather than data. It happens when a user with low privileges (e.g., “User”) can execute functions reserved for higher privileges (e.g., “Admin”).

Deep Dive APIs often rely on the client (UI) to hide admin buttons. However, the API endpoints still exist and often lack checks.

  • Scenario: The UI hides the “Delete User” button for regular users.
  • The Attack: The attacker guesses or finds DELETE /api/users/55 and sends the request directly. If the API only checks “Is the user logged in?” but not “Is the user an Admin?”, the attack succeeds.

Difference from BOLA:

  • BOLA: Can I see User B’s data? (Horizontal)
  • BFLA: Can I do Admin things? (Vertical)

Chapter 4: Broken Object Property Level Authorization (BOPLA)

Fundamentals This category merges two previous risks: Mass Assignment (writing too much) and Excessive Data Exposure (reading too much).

Deep Dive

  1. Mass Assignment: An API takes a JSON object and binds it directly to a database model.
    • Attack: POST /register { "username": "hacker", "password": "123", "role": "admin" }. If the API blindly binds “role”, the attacker becomes an admin.
  2. Excessive Data Exposure: The API returns the full database object, relying on the UI to filter it.
    • Attack: GET /users/me returns { "id": 1, "username": "bob", "password_hash": "x8s7...", "ssn": "..." }. The UI only shows the username, but the attacker sees everything in the JSON response.

Chapter 5: JWT Security & Attacks

Fundamentals JSON Web Tokens (JWTs) are the standard for stateless API authentication. They consist of three parts: Header, Payload, and Signature, separated by dots.

Deep Dive The security of a JWT relies entirely on the Signature.

  • Structure: Base64(Header).Base64(Payload).Signature
  • The “None” Algorithm: Attackers change the header to {"alg": "none"} and remove the signature. If the backend supports this (for debugging), it accepts the forged token.
  • Weak Secrets: If the signing secret is weak (e.g., “secret123”), attackers can brute-force it offline and forge their own tokens.
  • Algorithm Confusion: Attackers change the header alg from RS256 (Asymmetric) to HS256 (Symmetric) and sign the token with the public key (which they can download). The server, expecting an RSA key but tricked into HMAC, uses its public key as the secret key to verify, which succeeds.

Mental Model

Attacker ──► [Header: alg=none] . [Payload: admin=true] . [Empty Sig] ──► API
                                                                           │
                                                                           ▼
                                                                  [Is alg supported?] -> YES
                                                                  [Verify Sig?] -> SKIPPED (due to none)
                                                                           │
                                                                           ▼
                                                                    Welcome, Admin!

Chapter 6: GraphQL Security

Fundamentals GraphQL allows clients to ask for exactly the data they need. This flexibility shifts control to the client, creating new attack vectors.

Deep Dive

  1. Introspection: By default, GraphQL allows you to query __schema to get the entire API definition (types, queries, mutations). This is perfect documentation for attackers.
  2. DoS / Query Depth: Attackers can craft deeply nested queries: query { user { posts { comments { author { posts { ... } } } } } }. This can exhaust server resources.
  3. Batching: Sending 1000 queries in a single HTTP request to bypass rate limits or brute force credentials.

Glossary

  • BOLA: Broken Object Level Authorization. Accessing data you don’t own.
  • BFLA: Broken Function Level Authorization. Performing actions you’re not allowed to do.
  • BOPLA: Broken Object Property Level Authorization. Reading/Writing fields you shouldn’t.
  • JWT: JSON Web Token. Stateless authentication token.
  • IDOR: Insecure Direct Object Reference. Older term for BOLA.
  • Mass Assignment: Binding client input directly to internal code variables/objects.
  • Shadow API: An API endpoint that is deployed but undocumented and often unmaintained.
  • Zombie API: A deprecated API version that is still accessible.
  • Rate Limiting: Controlling the number of requests a client can make.
  • SSRF: Server-Side Request Forgery. Making the server send requests to other servers.

Why API Security Matters

Context & Evolution

  • 2000s: SOAP APIs. Heavy, complex, but had built-in security (WS-Security).
  • 2010s: REST APIs & Microservices. Lightweight, JSON-based. Security became an afterthought or “handled by the gateway”.
  • 2020s: API-First & GraphQL. APIs are the product. Attack surface exploded.

The Stats (2024/2025)

  • 99% of organizations experienced API security incidents in the last 12 months (Salt Security, 2025).
  • 95% of API attacks target authenticated endpoints. Just logging in isn’t enough.
  • BOLA remains the #1 vulnerability, accounting for ~30-40% of severe breaches.

Why it matters: APIs expose the “crown jewels” (PII, financial data) directly. A single BOLA flaw can leak an entire database, bypassing all frontend security controls.


Concept Summary Table

Concept Criticality Key Attack Vector Prevention
BOLA Critical ID Manipulation Check ownership on every access
BFLA High Forced Browsing / Method Manipulation Role-based access control (RBAC)
BOPLA High Mass Assignment / Data Exposure Schema validation, DTOs
Broken Auth Critical Credential Stuffing / Token Theft MFA, Rate Limiting, Strong Tokens
Injection High SQLi / NoSQLi in params Input Validation, Parameterized Queries
Improper Assets Medium Shadow / Zombie APIs Inventory management, Gateway enforcement

Project-to-Concept Map

Project Concepts Applied
1. API Recon Enumeration, Shadow APIs, Fuzzing
2. BOLA Hunter BOLA, IDOR, Authorization Logic
3. JWT Toolkit Cryptography, Broken Auth, Token Forgery
4. GraphQL Explorer Introspection, Schema Analysis
5. NoSQL Injection Injection, Database Security
6. Rate Limit Bypass Resource Consumption, Header Manipulation
7. Mass Assignment BOPLA, Object Binding
8. BFLA Scanner Privilege Escalation, RBAC
9. OAuth Attacks OAuth 2.0, Redirects, CSRF
10. SSRF Network Security, Internal Scanning

Deep Dive Reading by Concept

Concept Book & Chapter
API Recon Hacking APIs (Corey Ball) - Ch 1-4
Authentication Web Application Hacker’s Handbook - Ch 6
Authorization (BOLA/BFLA) Hacking APIs - Ch 7-8
JWT Security Hacking APIs - Ch 9
GraphQL Black Hat GraphQL (Nick Aleks) - Ch 1-3
Injection Bug Bounty Bootcamp (Vickie Li) - Ch 14 (NoSQL)

Quick Start (First 48 Hours)

  1. Hour 0-2: Read the “Theory Primer” and “Glossary”.
  2. Hour 2-4: Set up your lab (Burp Suite, Postman, Python).
  3. Hour 4-8: Complete Project 1: API Reconnaissance Lab.
  4. Hour 8-12: Complete Project 2: BOLA Hunter.
  5. Hour 12+: Pick a vulnerable target (e.g., OWASP crAPI) and use your new tools against it.

Path A: The Breaker (Pentester)

  • Focus: Recon -> BOLA -> Injection -> Auth -> Capstone
  • Projects: 1, 2, 5, 14, 3, 9, 16, 20

Path B: The Builder (Developer)

  • Focus: Auth -> BOLA/BFLA -> Mass Assignment -> GraphQL -> Misconfig
  • Projects: 3, 2, 8, 7, 4, 13, 19

Path C: The Specialist (Advanced)

  • Focus: JWT -> OAuth -> GraphQL -> SSRF -> Fuzzing
  • Projects: 3, 9, 4, 13, 10, 11

Success Metrics

  • Knowledge: You can explain the OWASP API Top 10 without looking them up.
  • Skill: You can write a script to automate the detection of a BOLA vulnerability.
  • Outcome: You have a GitHub repository with 10+ custom API security tools.
  • Mastery: You can find a vulnerability in a “hardened” practice target (like PortSwigger labs) using your own tools.

Project Overview Table

# Project Difficulty Time Core Focus
1 API Reconnaissance Lab Level 2 Weekend Endpoint discovery
2 BOLA Hunter Level 2 Weekend Broken object authorization
3 JWT Attack Toolkit Level 3 1-2 weeks Token manipulation
4 GraphQL Introspection Explorer Level 2 Weekend Schema extraction
5 NoSQL Injection Playground Level 3 1-2 weeks MongoDB injection
6 Rate Limit Bypass Techniques Level 3 1 week Brute force enablement
7 Mass Assignment Exploiter Level 3 1 week Property-level auth
8 BFLA Privilege Escalation Level 3 1-2 weeks Function-level auth
9 OAuth 2.0 Flow Attacks Level 4 2-3 weeks Token theft
10 SSRF via API Endpoints Level 3 1-2 weeks Internal scanning
11 API Fuzzing Framework Level 4 2-3 weeks Parameter discovery
12 Postman Security Collection Level 2 Weekend Excessive data exposure
13 GraphQL DoS via Nested Queries Level 3 1 week Resource exhaustion
14 SQL Injection in REST APIs Level 3 1-2 weeks Classic injection
15 API Key Leakage Scanner Level 3 1 week Credential exposure
16 Broken Authentication Suite Level 4 2-3 weeks Auth bypass
17 Business Logic Flaw Hunter Level 4 2-3 weeks Flow abuse
18 API Versioning Vulnerabilities Level 3 1 week Shadow APIs
19 Security Misconfiguration Audit Level 3 1 week Default settings
20 Capstone: Full API Pentest Level 5 3-4 weeks Complete assessment

Project List

Project 1: API Reconnaissance Lab

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Go, Bash
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: Level 2: Micro-SaaS / Pro Tool
  • Difficulty: Level 2: Intermediate
  • Knowledge Area: API Enumeration, Reconnaissance
  • Software or Tool: Burp Suite, ffuf, Arjun
  • Main Book: “Hacking APIs” by Corey Ball

What you’ll build: A comprehensive API reconnaissance toolkit that discovers endpoints, parameters, and API versions.

Why it teaches API security: Reconnaissance is the foundation of any security assessment. You can’t attack what you can’t find.

Core challenges you’ll face:

  • Discovering hidden endpoints → Wordlist selection and fuzzing techniques
  • Finding undocumented parameters → Parameter brute-forcing
  • Identifying API versions → Version enumeration and shadow API discovery
  • Mapping authentication requirements → Auth flow analysis

Key Concepts:

  • API Enumeration: “Hacking APIs” Ch. 4 - Corey Ball
  • Fuzzing Techniques: “Bug Bounty Bootcamp” Ch. 5 - Vickie Li
  • Parameter Discovery: OWASP Testing Guide - Input Validation

Difficulty: Intermediate Time estimate: Weekend Prerequisites: HTTP fundamentals, curl/Postman usage, basic scripting


Real World Outcome

You’ll have a Python script that takes an API base URL and produces a comprehensive report:

$ python api_recon.py --url https://api.target.com/v1

╔══════════════════════════════════════════════════════════════════╗
║                    API Reconnaissance Report                      ║
╠══════════════════════════════════════════════════════════════════╣
║ Base URL: https://api.target.com/v1                              ║
║ Discovered: 47 endpoints, 12 require auth, 3 shadow versions    ║
╠══════════════════════════════════════════════════════════════════╣
║ ENDPOINTS FOUND:                                                  ║
║ [200] GET  /users           - Requires: Bearer Token              ║
║ [200] GET  /users/{id}      - Requires: Bearer Token              ║
║ [403] GET  /admin/users     - Requires: Admin Role                ║
║ [200] POST /auth/login      - No Auth                             ║
║ [200] POST /auth/register   - No Auth                             ║
║ [404] GET  /internal/debug  - Hidden endpoint (found via fuzzing) ║
╠══════════════════════════════════════════════════════════════════╣
║ SHADOW APIs (older versions still accessible):                    ║
║ [200] GET  /v0/users        - DEPRECATED but accessible!          ║
║ [200] GET  /beta/users      - Beta version exposed                ║
╠══════════════════════════════════════════════════════════════════╣
║ PARAMETERS DISCOVERED:                                            ║
║ /users: ?limit, ?offset, ?sort, ?filter, ?include_deleted         ║
║ /search: ?q, ?type, ?admin_override (SUSPICIOUS!)                 ║
╚══════════════════════════════════════════════════════════════════╝

The Core Question You’re Answering

“How do I systematically discover every attack surface an API exposes, including hidden endpoints, parameters, and deprecated versions?”

Before testing for vulnerabilities, you must know what exists. APIs often have undocumented endpoints, debug routes, and older versions that remain accessible.


Concepts You Must Understand First

Stop and research these before coding:

  1. HTTP Methods and REST Conventions
    • What methods are typically used for CRUD operations?
    • How do RESTful APIs typically structure their endpoints?
    • What headers reveal information about the API?
    • Book Reference: “Web Application Hacker’s Handbook” Ch. 3
  2. Wordlist Selection
    • What makes a good API endpoint wordlist?
    • How do you customize wordlists for specific technologies?
    • Book Reference: “Bug Bounty Bootcamp” Ch. 5
  3. Response Analysis
    • What do different status codes reveal?
    • How do you detect rate limiting vs blocking?
    • Book Reference: “Hacking APIs” Ch. 4

Questions to Guide Your Design

Before implementing, think through these:

  1. Endpoint Discovery
    • How will you handle different response codes (200, 301, 401, 403, 404, 500)?
    • How will you detect if an endpoint exists but requires authentication?
    • How will you identify API versioning patterns?
  2. Performance
    • How will you implement concurrent requests without triggering WAF?
    • How will you respect rate limits while maximizing coverage?
  3. Output
    • What information is most useful for the next phase of testing?
    • How will you categorize endpoints by risk level?

Thinking Exercise

Map an API’s Attack Surface

Before coding, manually explore an API:

Target: A public API you have permission to test (e.g., your own)

1. Use browser DevTools to capture API calls
2. Document each endpoint, method, and parameter
3. Try accessing /v0/, /v2/, /beta/, /internal/ versions
4. Look for patterns in endpoint naming

Questions while mapping:
- Are there endpoints that don't require authentication?
- Are there endpoints that return more data than the UI shows?
- Can you access other users' data by changing IDs?

The Interview Questions They’ll Ask

  1. “How do you discover API endpoints that aren’t documented?”
  2. “What’s the difference between API versioning vulnerabilities and deprecated endpoints?”
  3. “How do you avoid detection while enumerating an API?”
  4. “What tools do you use for API reconnaissance and why?”
  5. “How do you prioritize which endpoints to test first?”

Hints in Layers

Hint 1: Start with common patterns Begin with standard REST patterns: /api, /v1, /users, /admin, /internal, /debug

Hint 2: Analyze responses carefully A 401 means the endpoint exists but requires auth. A 403 might mean you found an admin endpoint.

Hint 3: Use technology-specific wordlists If you detect Express.js, use Node-specific endpoints. If Django, use Django patterns.

Hint 4: Implement smart concurrency Use asyncio or concurrent.futures with rate limiting to maximize speed without triggering blocks.


Books That Will Help

Topic Book Chapter
API enumeration “Hacking APIs” by Corey Ball Ch. 4
Fuzzing techniques “Bug Bounty Bootcamp” by Vickie Li Ch. 5
HTTP fundamentals “Web Application Hacker’s Handbook” Ch. 3

Common Pitfalls & Debugging

Problem: Getting blocked by WAF

  • Root cause: Too many requests too fast
  • Fix: Implement delays, rotate user-agents, use proxies
  • Quick test: Check if response changes to 403 or contains WAF signature

Problem: Missing endpoints

  • Root cause: Wordlist doesn’t match API naming convention
  • Fix: Analyze known endpoints and generate custom wordlist
  • Quick test: Manually try variations of known endpoint patterns

Learning Milestones

  1. First milestone: You can fuzz an API and find 10+ endpoints
  2. Second milestone: You can detect authentication requirements and shadow APIs
  3. Final milestone: You produce a comprehensive attack surface map in under 30 minutes

Project 2: BOLA (Broken Object Level Authorization) Hunter

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: JavaScript, Ruby
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: Level 3: Service & Support Model
  • Difficulty: Level 2: Intermediate
  • Knowledge Area: Authorization Testing
  • Software or Tool: Burp Suite, custom scripts
  • Main Book: “Hacking APIs” by Corey Ball

What you’ll build: An automated tool to detect BOLA vulnerabilities by testing object ID manipulation.

Why it teaches API security: BOLA represents 40% of all API attacks. If you master this, you’ve mastered the most common vulnerability.

Core challenges you’ll face:

  • Identifying object references → URL path, query params, request body
  • Generating valid test IDs → Sequential, UUID, encoded formats
  • Detecting successful access → Response comparison
  • Handling authentication contexts → Testing as different users

Real World Outcome

$ python bola_hunter.py --target https://api.example.com --token $USER_TOKEN

╔═══════════════════════════════════════════════════════════════════╗
║                    BOLA Vulnerability Scanner                      ║
╠═══════════════════════════════════════════════════════════════════╣
║ Target: https://api.example.com                                    ║
║ Auth: Bearer token for user_id=1234                                ║
╠═══════════════════════════════════════════════════════════════════╣
║ VULNERABILITIES FOUND:                                             ║
║                                                                    ║
║ [CRITICAL] GET /api/users/5678/profile                            ║
║   ├── Your user_id: 1234                                          ║
║   ├── Accessed user_id: 5678                                      ║
║   └── Response: 200 OK with full profile data                     ║
║                                                                    ║
║ [CRITICAL] GET /api/orders/9999                                   ║
║   ├── Your user_id: 1234                                          ║
║   ├── Accessed order belongs to: user_id=5678                     ║
║   └── Response: Contains PII (address, phone, payment)            ║
║                                                                    ║
║ [MEDIUM] GET /api/documents/abc123                                ║
║   ├── Expected: 403 Forbidden                                     ║
║   └── Actual: 200 OK (empty response - possible side channel)     ║
╠═══════════════════════════════════════════════════════════════════╣
║ Summary: 2 Critical, 1 Medium, 47 endpoints tested                ║
╚═══════════════════════════════════════════════════════════════════╝

The Core Question You’re Answering

“Can I access, modify, or delete objects that belong to other users by simply changing an ID?”

BOLA is devastatingly simple: the API trusts the client-supplied ID without verifying the user’s authorization to access that specific object.


Concepts You Must Understand First

  1. Object Level Authorization
    • What’s the difference between authentication and authorization?
    • How should APIs verify object ownership?
    • Book Reference: “Hacking APIs” Ch. 7
  2. ID Formats
    • Sequential integers vs UUIDs vs encoded IDs
    • How to predict or enumerate IDs
    • Book Reference: “Web Application Hacker’s Handbook” Ch. 8

Questions to Guide Your Design

  1. Detection Logic
    • How do you determine if a response contains another user’s data?
    • How do you handle encrypted or encoded IDs?
    • How do you distinguish between “not found” and “not authorized”?
  2. Test Coverage
    • Which HTTP methods should you test (GET, PUT, DELETE)?
    • Should you test nested resources (e.g., /users/1/orders/2)?

The Interview Questions They’ll Ask

  1. “What is BOLA and why is it the #1 API vulnerability?”
  2. “How do you test for BOLA when IDs are UUIDs?”
  3. “What’s the difference between horizontal and vertical privilege escalation?”
  4. “How would you fix a BOLA vulnerability in production?”
  5. “Can BOLA exist in GraphQL APIs?”

Hints in Layers

Hint 1: Create two test accounts Login as user A, capture requests, replace user A’s IDs with user B’s IDs.

Hint 2: Test all HTTP methods GET might be protected but PUT/DELETE might not be.

Hint 3: Check nested resources /users/1/documents/5 - verify ownership at both levels.

Hint 4: Look for indirect references Some APIs use indirect references like /me/orders that resolve to user-specific data.


Project 3: JWT Attack Toolkit

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Go, Node.js
  • Coolness Level: Level 5: Pure Magic
  • Business Potential: Level 3: Service & Support Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Token Security, Cryptography
  • Software or Tool: jwt_tool, custom scripts
  • Main Book: “Pentesting JWT” by PortSwigger

What you’ll build: A comprehensive JWT attack toolkit that implements all known JWT vulnerabilities.

Why it teaches API security: JWTs are ubiquitous in modern APIs. Understanding their weaknesses is essential for any API security tester.

Core challenges you’ll face:

  • Decoding and encoding JWTs → Base64URL handling
  • None algorithm attack → Signature bypass
  • Algorithm confusion (RS256 to HS256) → Key confusion
  • Weak secret brute-forcing → Key recovery
  • JWK header injection → Self-signed tokens

Real World Outcome

$ python jwt_toolkit.py --token "eyJhbGc..." --attack all

╔════════════════════════════════════════════════════════════════════╗
║                        JWT Attack Toolkit                          ║
╠════════════════════════════════════════════════════════════════════╣
║ Token Analysis:                                                    ║
║ ├── Algorithm: HS256                                               ║
║ ├── Claims: sub=user_123, role=user, exp=1704067200               ║
║ └── Expiration: 2024-01-01 00:00:00 (EXPIRED!)                    ║
╠════════════════════════════════════════════════════════════════════╣
║ Attack Results:                                                    ║
║                                                                    ║
║ [VULNERABLE] None Algorithm Attack                                 ║
│   ├── Modified token: eyJhbGciOiJub25lIiw...                      ║
│   ├── Server response: 200 OK                                      ║
│   └── Token accepted without signature!                            ║
║                                                                    ║
║ [VULNERABLE] Weak Secret                                           ║
│   ├── Cracked secret: "password123"                               ║
│   ├── Method: Dictionary attack (rockyou.txt)                     ║
│   └── Time: 2.3 seconds                                           ║
║                                                                    ║
║ [NOT VULNERABLE] Algorithm Confusion                               ║
│   └── Server enforces algorithm verification                       ║
║                                                                    ║
║ Forged Admin Token (using cracked secret):                         ║
║ eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyXzEyMyIs     ║
║ InJvbGUiOiJhZG1pbiIsImV4cCI6MTc2NzIyNTYwMH0.Xj7kL...               ║
╚════════════════════════════════════════════════════════════════════╝

The Core Question You’re Answering

“How can I bypass JWT-based authentication by exploiting weaknesses in the token generation, verification, or secret management?”

JWTs seem secure because they’re signed, but implementation flaws can completely undermine that security.


Concepts You Must Understand First

  1. JWT Structure
    • Header, payload, signature
    • Base64URL encoding
    • Book Reference: “Serious Cryptography” Ch. 14
  2. Signing Algorithms
    • HMAC (symmetric) vs RSA (asymmetric)
    • Why algorithm confusion works
    • Book Reference: PortSwigger JWT labs
  3. Common Vulnerabilities
    • None algorithm, weak secrets, key confusion
    • Book Reference: “Pentesting JWT” (online resource)

The Interview Questions They’ll Ask

  1. “Explain the JWT structure and what each part contains.”
  2. “What is the ‘none’ algorithm attack and how do you prevent it?”
  3. “How does the RS256 to HS256 algorithm confusion attack work?”
  4. “What makes a JWT secret ‘weak’ and how would you crack it?”
  5. “What’s the difference between JWT, JWS, and JWE?”

Project 4: GraphQL Introspection Explorer

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: JavaScript, Go
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: Level 2: Micro-SaaS / Pro Tool
  • Difficulty: Level 2: Intermediate
  • Knowledge Area: GraphQL Security
  • Software or Tool: GraphQL Voyager, Burp Suite
  • Main Book: “Black Hat GraphQL” by Nick Aleks

What you’ll build: A GraphQL schema extraction and vulnerability analysis tool.

Why it teaches API security: GraphQL’s introspection feature exposes the entire API schema, making it a goldmine for attackers.

Core challenges you’ll face:

  • Schema extraction via introspection → Query construction
  • Detecting disabled introspection → Bypass techniques
  • Identifying sensitive fields → Pattern matching
  • Finding authorization gaps → Field-level testing

Real World Outcome

$ python graphql_explorer.py --endpoint https://api.target.com/graphql

╔════════════════════════════════════════════════════════════════════╗
║                    GraphQL Schema Analysis                         ║
╠════════════════════════════════════════════════════════════════════╣
║ Endpoint: https://api.target.com/graphql                          ║
║ Introspection: ENABLED                                             ║
╠════════════════════════════════════════════════════════════════════╣
║ TYPES DISCOVERED: 47                                               ║
║ QUERIES: 12                                                        ║
║ MUTATIONS: 8                                                       ║
║ SUBSCRIPTIONS: 3                                                   ║
╠════════════════════════════════════════════════════════════════════╣
║ SENSITIVE FIELDS DETECTED:                                         ║
║                                                                    ║
║ [HIGH] User.password (String)                                      ║
║ [HIGH] User.ssn (String)                                          ║
║ [MEDIUM] User.email (String)                                       ║
║ [MEDIUM] Order.paymentDetails (PaymentInfo)                        ║
╠════════════════════════════════════════════════════════════════════╣
║ AUTHORIZATION ISSUES:                                              ║
║                                                                    ║
║ [CRITICAL] Query: allUsers - No authentication required            ║
║ [CRITICAL] Mutation: deleteUser(id: ID!) - No role check          ║
║ [HIGH] User.creditCards - Nested access without owner check        ║
╠════════════════════════════════════════════════════════════════════╣
║ Schema exported to: graphql_schema.json                            ║
║ Visual map exported to: schema_map.html                            ║
╚════════════════════════════════════════════════════════════════════╝

The Core Question You’re Answering

“How do I extract a complete GraphQL schema and identify authorization weaknesses at the field level?”

GraphQL’s flexibility is also its weakness—introspection often exposes the entire API structure.


Project 5: NoSQL Injection Playground

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: JavaScript
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: Level 3: Service & Support Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Injection Attacks
  • Software or Tool: NoSQLMap, Burp Suite
  • Main Book: “Bug Bounty Bootcamp” by Vickie Li

What you’ll build: A NoSQL injection testing framework for MongoDB-based APIs.

Why it teaches API security: Modern APIs often use MongoDB. NoSQL injection is different from SQL injection but equally dangerous.

Core challenges you’ll face:

  • Operator injection ($ne, $gt, $regex) → Bypassing auth
  • JavaScript injection ($where) → Code execution
  • Blind injection techniques → Data extraction
  • Detection and exploitation → Automated testing

Real World Outcome

$ python nosql_injector.py --url "https://api.target.com/login" --method POST

╔════════════════════════════════════════════════════════════════════╗
║                    NoSQL Injection Scanner                         ║
╠════════════════════════════════════════════════════════════════════╣
║ Target: https://api.target.com/login                              ║
║ Method: POST                                                       ║
╠════════════════════════════════════════════════════════════════════╣
║ VULNERABILITIES FOUND:                                             ║
║                                                                    ║
║ [CRITICAL] Authentication Bypass via $ne operator                  ║
│   ├── Payload: {"username":"admin","password":{"$ne":""}}         ║
│   ├── Response: 200 OK - Logged in as admin                       ║
│   └── Impact: Complete authentication bypass                       ║
║                                                                    ║
║ [HIGH] Data Extraction via $regex                                  ║
│   ├── Payload: {"username":{"$regex":"^a"}}                       ║
│   ├── Response: Different responses for matching/non-matching     ║
│   └── Impact: Enumerate usernames character by character          ║
║                                                                    ║
║ [CRITICAL] JavaScript Injection via $where                         ║
│   ├── Payload: {"$where":"sleep(5000)"}                           ║
│   ├── Response: 5 second delay detected                           ║
│   └── Impact: DoS, potential RCE                                   ║
╚════════════════════════════════════════════════════════════════════╝

Project 6: Rate Limit Bypass Techniques

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Go
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: Level 2: Micro-SaaS / Pro Tool
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Rate Limiting, Brute Force
  • Software or Tool: Burp Suite Intruder
  • Main Book: “Bug Bounty Bootcamp” by Vickie Li

What you’ll build: A toolkit to detect and bypass rate limiting mechanisms.

Why it teaches API security: Rate limits are the primary defense against brute force. Understanding bypasses is crucial.

Core challenges you’ll face:

  • Detecting rate limit implementation → Response analysis
  • Header manipulation (X-Forwarded-For, X-Real-IP) → IP spoofing
  • Case variation and encoding → Input normalization bypass
  • Concurrent request racing → Time-based bypasses

Real World Outcome

$ python rate_bypass.py --target https://api.target.com/login

╔════════════════════════════════════════════════════════════════════╗
║                    Rate Limit Bypass Scanner                       ║
╠════════════════════════════════════════════════════════════════════╣
║ Target: https://api.target.com/login                              ║
║ Baseline: 429 after 10 requests/minute                            ║
╠════════════════════════════════════════════════════════════════════╣
║ BYPASS TECHNIQUES TESTED:                                          ║
║                                                                    ║
║ [SUCCESS] X-Forwarded-For Header Rotation                          ║
│   ├── Technique: Rotate IP in X-Forwarded-For header              ║
│   ├── Result: Unlimited requests with different IPs               ║
│   └── Requests achieved: 1000+ without blocking                    ║
║                                                                    ║
║ [SUCCESS] Case Variation                                           ║
│   ├── Technique: admin@email.com vs Admin@email.com               ║
│   ├── Result: Each variation gets separate rate limit             ║
│   └── Effective multiplier: 4x                                     ║
║                                                                    ║
║ [FAILED] Unicode Normalization                                     ║
│   └── Server properly normalizes Unicode                           ║
║                                                                    ║
║ Recommended Attack Strategy:                                       ║
║ Combine X-Forwarded-For rotation with case variation               ║
║ Effective brute force rate: 40,000 attempts/minute                ║
╚════════════════════════════════════════════════════════════════════╝

Project 7: Mass Assignment Exploiter

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: JavaScript
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: Level 3: Service & Support Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Object Property Authorization
  • Software or Tool: Burp Suite, Arjun
  • Main Book: “Hacking APIs” by Corey Ball

What you’ll build: A tool to discover and exploit mass assignment vulnerabilities (Broken Object Property Level Authorization).

Why it teaches API security: APIs often expose more fields than intended, allowing attackers to modify sensitive properties.

Core challenges you’ll face:

  • Discovering hidden parameters → Fuzzing
  • Identifying writable properties → PUT/PATCH testing
  • Privilege escalation via properties → Role manipulation
  • Detecting framework-specific patterns → Technology identification

Real World Outcome

$ python mass_assignment.py --target https://api.target.com/users/me

╔════════════════════════════════════════════════════════════════════╗
║                    Mass Assignment Scanner                         ║
╠════════════════════════════════════════════════════════════════════╣
║ Target: https://api.target.com/users/me                           ║
║ Method: PUT (Update profile)                                       ║
╠════════════════════════════════════════════════════════════════════╣
║ HIDDEN PROPERTIES DISCOVERED:                                      ║
║                                                                    ║
║ [CRITICAL] "role" - Writable!                                      ║
│   ├── Original: "role": "user"                                    ║
│   ├── Modified: "role": "admin"                                   ║
│   ├── Response: 200 OK - Role changed!                            ║
│   └── Impact: Privilege escalation to admin                        ║
║                                                                    ║
║ [HIGH] "is_verified" - Writable!                                   ║
│   ├── Original: "is_verified": false                              ║
│   ├── Modified: "is_verified": true                               ║
│   └── Impact: Bypass email verification                            ║
║                                                                    ║
║ [MEDIUM] "created_at" - Writable!                                  ║
│   └── Impact: Data integrity issues                                ║
║                                                                    ║
║ Properties NOT writable (properly protected):                      ║
║ - id, password_hash, api_key                                       ║
╚════════════════════════════════════════════════════════════════════╝

Project 8: BFLA (Broken Function Level Authorization) Privilege Escalation

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Go
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: Level 3: Service & Support Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Authorization, Privilege Escalation
  • Software or Tool: Burp Suite
  • Main Book: “Web Application Hacker’s Handbook”

What you’ll build: A tool to discover and exploit function-level authorization vulnerabilities.

Why it teaches API security: BFLA allows regular users to access admin functions—different from BOLA which is about accessing other users’ data.

Core challenges you’ll face:

  • Discovering admin endpoints → Fuzzing and wordlists
  • Bypassing function-level checks → Header/parameter manipulation
  • Method override attacks → X-HTTP-Method-Override
  • Endpoint naming pattern analysis → Admin function detection

Real World Outcome

$ python bfla_scanner.py --base https://api.target.com --user-token $USER_TOKEN

╔════════════════════════════════════════════════════════════════════╗
║                    BFLA Privilege Escalation Scanner               ║
╠════════════════════════════════════════════════════════════════════╣
║ Testing with: Regular user token                                   ║
╠════════════════════════════════════════════════════════════════════╣
║ ADMIN FUNCTIONS ACCESSIBLE TO REGULAR USER:                        ║
║                                                                    ║
║ [CRITICAL] DELETE /api/admin/users/{id}                           ║
│   ├── Expected: 403 Forbidden                                     ║
│   ├── Actual: 200 OK - User deleted!                              ║
│   └── Impact: Any user can delete any account                      ║
║                                                                    ║
║ [CRITICAL] POST /api/admin/config                                  ║
│   ├── Expected: 403 Forbidden                                     ║
│   ├── Actual: 200 OK - Config updated                             ║
│   └── Impact: Modify application settings                          ║
║                                                                    ║
║ [HIGH] GET /api/admin/logs                                         ║
│   ├── Expected: 403 Forbidden                                     ║
│   ├── Actual: 200 OK - Full audit logs                            ║
│   └── Impact: Information disclosure                               ║
╚════════════════════════════════════════════════════════════════════╝

Project 9: OAuth 2.0 Flow Attacks

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: JavaScript
  • Coolness Level: Level 5: Pure Magic
  • Business Potential: Level 3: Service & Support Model
  • Difficulty: Level 4: Expert
  • Knowledge Area: OAuth, Authentication
  • Software or Tool: Burp Suite, Custom scripts
  • Main Book: “OAuth 2.0 in Action” by Justin Richer

What you’ll build: A comprehensive OAuth 2.0 vulnerability testing toolkit.

Why it teaches API security: OAuth is complex and often misconfigured. Understanding its attack surface is essential.

Core challenges you’ll face:

  • Redirect URI manipulation → Open redirect to token theft
  • CSRF in OAuth flows → State parameter bypass
  • Token leakage → Referer header exploitation
  • Scope expansion attacks → Privilege escalation

Real World Outcome

$ python oauth_attacker.py --auth-url https://auth.target.com/authorize

╔════════════════════════════════════════════════════════════════════╗
║                    OAuth 2.0 Vulnerability Scanner                 ║
╠════════════════════════════════════════════════════════════════════╣
║ VULNERABILITIES FOUND:                                             ║
║                                                                    ║
║ [CRITICAL] Open Redirect in redirect_uri                          ║
│   ├── Original: https://app.target.com/callback                   ║
│   ├── Injected: https://evil.com/steal                            ║
│   ├── Result: Redirect accepted!                                   ║
│   └── Impact: Steal authorization codes                            ║
║                                                                    ║
║ [HIGH] Missing State Parameter Validation                          ║
│   ├── State: Removed from request                                 ║
│   ├── Result: Flow completed without state                        ║
│   └── Impact: CSRF attacks possible                                ║
║                                                                    ║
║ [MEDIUM] Token in URL Fragment                                     ║
│   ├── Implicit flow detected                                      ║
│   └── Impact: Token may leak via Referer header                    ║
╚════════════════════════════════════════════════════════════════════╝

Project 10: SSRF via API Endpoints

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Go
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: Level 3: Service & Support Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: SSRF, Internal Network
  • Software or Tool: Burp Collaborator, custom scripts
  • Main Book: “Web Application Hacker’s Handbook”

What you’ll build: An SSRF detection and exploitation toolkit for API endpoints.

Why it teaches API security: APIs that fetch external resources are prime SSRF targets, allowing internal network access.

Core challenges you’ll face:

  • Identifying SSRF-prone endpoints → URL parameters, webhooks
  • Bypass techniques → DNS rebinding, URL parsing
  • Cloud metadata access → AWS/GCP/Azure endpoints
  • Internal service enumeration → Port scanning via SSRF

Project 11: API Fuzzing Framework

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Go, Rust
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: Level 4: Open Core Infrastructure
  • Difficulty: Level 4: Expert
  • Knowledge Area: Fuzzing, Parameter Discovery
  • Software or Tool: ffuf, custom framework
  • Main Book: “The Fuzzing Book” (online)

What you’ll build: A custom API fuzzing framework that discovers vulnerabilities through intelligent input generation.

Why it teaches API security: Fuzzing finds vulnerabilities that manual testing misses.

Real World Outcome

$ python api_fuzzer.py --url https://api.target.com/v1/user --method POST

[CRASH] 500 Internal Server Error
  Payload: {"username": "A" * 10000}
  Potential: Buffer Overflow / DoS

[VULNERABLE] 200 OK (Unexpected)
  Payload: {"id": -1}
  Potential: Integer Underflow / Logic Error

The Core Question You’re Answering

“How can I automate the discovery of edge cases and unhandled exceptions by sending malformed data?”

Concepts You Must Understand First

  1. Fuzzing Types: Mutation vs Generation based.
  2. Input Vectors: Headers, Path, Query, Body.

Definition of Done

  • Tool generates random and mutated inputs based on a schema.
  • Tool monitors response codes and response times.
  • Tool logs any 500 errors or timeouts.

Project 12: Postman Security Collection for Excessive Data Exposure

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: JavaScript (Postman)
  • Alternative Programming Languages: Python
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: Level 2: Micro-SaaS / Pro Tool
  • Difficulty: Level 2: Intermediate
  • Knowledge Area: Data Exposure, API Testing
  • Software or Tool: Postman
  • Main Book: “Hacking APIs” by Corey Ball

What you’ll build: A Postman collection with automated tests for excessive data exposure vulnerabilities.

Why it teaches API security: APIs often return more data than the UI displays. This project teaches you to find that hidden data.

Real World Outcome

A Postman Collection that runs automatically in CI/CD and flags if a response contains PII patterns (SSN, Email, Credit Card) in fields that shouldn’t have them.

The Core Question You’re Answering

“How can I use standard developer tools to automate security checks for data leaks?”

Definition of Done

  • Collection includes tests for PII regex patterns.
  • Tests fail if sensitive data is found in non-sensitive endpoints.
  • Collection can be run via Newman (CLI).

Project 13: GraphQL DoS via Nested Queries

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: JavaScript
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: Level 2: Micro-SaaS / Pro Tool
  • Difficulty: Level 3: Advanced
  • Knowledge Area: GraphQL, DoS
  • Software or Tool: Custom scripts
  • Main Book: “Black Hat GraphQL”

What you’ll build: A tool to test GraphQL APIs for denial of service via nested queries and batching.

Why it teaches API security: GraphQL’s flexibility creates unique DoS opportunities not present in REST APIs.

Real World Outcome

$ python graphql_dos.py --url https://api.target.com/graphql

[VULNERABLE] Deep Nesting
  Query Depth: 1000
  Server Response Time: 15.4s (DoS Potential)

The Core Question You’re Answering

“How deep can I nest a query before the server crashes or times out?”

Definition of Done

  • Tool generates recursive queries (user { posts { author { ... } } }).
  • Tool measures server response time.
  • Tool identifies the breaking point depth.

Project 14: SQL Injection in REST APIs

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Go
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: Level 3: Service & Support Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: SQL Injection
  • Software or Tool: sqlmap, Burp Suite
  • Main Book: “Web Application Hacker’s Handbook”

What you’ll build: A SQL injection testing framework specifically designed for JSON/REST APIs.

Why it teaches API security: SQL injection in APIs differs from traditional form-based injection.

Real World Outcome

A script that injects payloads into JSON values and URL parameters, detecting SQL errors or boolean-based differences.

The Core Question You’re Answering

“Does the API sanitize input even when it’s wrapped in a JSON object?”

Definition of Done

  • Tool supports JSON injection ({"id": "1' OR 1=1--"}).
  • Tool detects SQL syntax errors in JSON responses.

Project 15: API Key Leakage Scanner

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Go
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: Level 3: Service & Support Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Credential Exposure
  • Software or Tool: trufflehog, gitleaks
  • Main Book: “Bug Bounty Bootcamp”

What you’ll build: A scanner that finds exposed API keys in JavaScript files, mobile apps, and version control.

Why it teaches API security: API keys are frequently exposed in client-side code and repositories.

Real World Outcome

A tool that scans a URL or directory and outputs found secrets with their type (e.g., “Stripe API Key”, “AWS Access Key”).

The Core Question You’re Answering

“Are developers accidentally committing secrets to client-side code or public repositories?”

Definition of Done

  • Tool uses regex to find common key formats.
  • Tool validates found keys (optional).
  • Tool scans JS files linked in a webpage.

Project 16: Broken Authentication Suite

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Go
  • Coolness Level: Level 4: Hardcore Tech Flex
  • Business Potential: Level 3: Service & Support Model
  • Difficulty: Level 4: Expert
  • Knowledge Area: Authentication
  • Software or Tool: Burp Suite, custom scripts
  • Main Book: “Web Application Hacker’s Handbook”

What you’ll build: A comprehensive authentication testing suite covering all common auth vulnerabilities.

Why it teaches API security: Authentication is the gateway. If it fails, everything fails.

Real World Outcome

A suite that tests for:

  1. Credential Stuffing (Rate Limit check)
  2. Weak Password Policy
  3. Session Fixation

The Core Question You’re Answering

“Can I brute force accounts or bypass login controls due to weak implementation?”

Definition of Done

  • Tool attempts login with common passwords.
  • Tool checks if account lockout triggers.
  • Tool verifies if session tokens change after login.

Project 17: Business Logic Flaw Hunter

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: JavaScript
  • Coolness Level: Level 5: Pure Magic
  • Business Potential: Level 4: Open Core Infrastructure
  • Difficulty: Level 4: Expert
  • Knowledge Area: Business Logic, Flow Analysis
  • Software or Tool: Burp Suite, custom scripts
  • Main Book: “Hacking APIs” by Corey Ball

What you’ll build: A methodology and toolkit for finding business logic vulnerabilities in APIs.

Why it teaches API security: Business logic flaws can’t be found by automated scanners. This teaches you to think like an attacker.

Real World Outcome

Scripts that test specific logic flaws:

  • Buying items for negative prices ({"price": -10}).
  • Applying the same coupon code multiple times.
  • Skipping steps in a workflow (Payment -> Shipping).

The Core Question You’re Answering

“Does the API trust the client to perform business calculations or enforce workflow order?”

Definition of Done

  • Tool sends negative values for quantities/prices.
  • Tool attempts to access Step 3 endpoints without completing Step 2.

Project 18: API Versioning Vulnerabilities

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Bash
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: Level 2: Micro-SaaS / Pro Tool
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Shadow APIs, Inventory Management
  • Software or Tool: Custom scripts, ffuf
  • Main Book: “Hacking APIs”

What you’ll build: A scanner that finds deprecated API versions and shadow endpoints.

Why it teaches API security: Old API versions often lack security controls present in current versions.

Real World Outcome

A scanner that takes a known endpoint /v2/users and checks for /v1/users, /v0/users, /mobile/users.

The Core Question You’re Answering

“Are old, insecure versions of the API still online and accessible?”

Definition of Done

  • Tool permutes version numbers in URLs.
  • Tool checks if older versions return 200 OK.
  • Tool compares response headers of different versions.

Project 19: Security Misconfiguration Audit

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Go
  • Coolness Level: Level 3: Genuinely Clever
  • Business Potential: Level 3: Service & Support Model
  • Difficulty: Level 3: Advanced
  • Knowledge Area: Configuration Security
  • Software or Tool: Custom scripts, Burp Suite
  • Main Book: “Web Application Hacker’s Handbook”

What you’ll build: An automated audit tool for common API security misconfigurations.

Why it teaches API security: Misconfiguration is often the easiest path to exploitation.

Real World Outcome

A report listing:

  • Missing security headers (HSTS, CSP).
  • Verbose error messages (Stack traces).
  • Enabled HTTP methods (TRACE, TRACK).

The Core Question You’re Answering

“Is the API leaking internal details via error messages or default settings?”

Definition of Done

  • Tool checks for security headers.
  • Tool triggers errors (malformed JSON) and checks for stack traces.
  • Tool checks for CORS misconfigurations.

Project 20: Capstone - Full API Penetration Test

  • File: API_SECURITY_TESTING_MASTERY.md
  • Main Programming Language: Python
  • Alternative Programming Languages: Multiple
  • Coolness Level: Level 5: Pure Magic
  • Business Potential: Level 4: Open Core Infrastructure
  • Difficulty: Level 5: Master
  • Knowledge Area: Complete API Security
  • Software or Tool: All tools from previous projects
  • Main Book: “Hacking APIs” by Corey Ball

What you’ll build: A complete API penetration testing methodology and report for a target API.

Why it teaches API security: This integrates everything you’ve learned into a professional engagement.

Real World Outcome

╔════════════════════════════════════════════════════════════════════╗
║            FULL API PENETRATION TEST REPORT                        ║
║            Target: api.vulnerable-corp.com                         ║
╠════════════════════════════════════════════════════════════════════╣
║ EXECUTIVE SUMMARY                                                  ║
║ ─────────────────                                                  ║
║ Critical: 4  |  High: 7  |  Medium: 12  |  Low: 8  |  Info: 15    ║
║                                                                    ║
║ Overall Risk Rating: CRITICAL                                      ║
║                                                                    ║
║ TOP FINDINGS:                                                      ║
║ 1. [CRITICAL] BOLA - Access any user's data                       ║
║ 2. [CRITICAL] JWT None Algorithm - Complete auth bypass            ║
║ 3. [CRITICAL] NoSQL Injection - Database compromise                ║
║ 4. [CRITICAL] BFLA - Admin functions accessible to users           ║
║                                                                    ║
║ TESTED COMPONENTS:                                                 ║
║ ✓ Authentication (JWT, OAuth)                                      ║
║ ✓ Authorization (BOLA, BFLA, Object Properties)                   ║
║ ✓ Injection (SQL, NoSQL, Command)                                 ║
║ ✓ Rate Limiting                                                    ║
║ ✓ GraphQL Security                                                 ║
║ ✓ Business Logic                                                   ║
║ ✓ Configuration Security                                           ║
║                                                                    ║
║ Full report: api_pentest_report.pdf (47 pages)                     ║
╚════════════════════════════════════════════════════════════════════╝

The Core Question You’re Answering

“Can I chain these vulnerabilities to compromise the entire system?”

Definition of Done

  • Perform a full assessment on a target (e.g., OWASP crAPI).
  • Document findings with reproduction steps.
  • Write a professional report with risk ratings and remediation advice.

Summary

This learning path covers API security testing through 20 hands-on projects. You will move from simple reconnaissance to complex authorization attacks and injection techniques. By building these tools yourself, you will understand the vulnerabilities at a code level, making you a far more effective security professional than someone who just runs automated scanners.

Final Advice: Always test responsibly. The skills you learn here are powerful. Use them to make the internet safer.


Additional Resources

Standards and Documentation

Books

  • “Hacking APIs” by Corey Ball
  • “Black Hat GraphQL” by Nick Aleks
  • “Web Application Hacker’s Handbook” by Stuttard & Pinto
  • “Bug Bounty Bootcamp” by Vickie Li

Practice Labs

  • OWASP crAPI (Completely Ridiculous API)
  • DVWS (Damn Vulnerable Web Services)
  • VAmPI (Vulnerable API)
  • Juice Shop API

Tools

  • Burp Suite Professional
  • Postman
  • jwt_tool
  • NoSQLMap
  • Arjun
  • ffuf