REST API Attack Surface and Reconnaissance
You'll learn: How to systematically discover and map REST API endpoints to understand what an attacker might target.
What Is API Reconnaissance?
Before attacking an API, you need to know what exists. REST API reconnaissance is the process of identifying all available endpoints, their methods (GET, POST, PUT, DELETE), expected parameters, and authentication requirements. Think of it like scouting a building's entrances, exits, and locked doors before attempting entry—you need a blueprint first.
APIs expose functionality through endpoints (URL paths like /api/users or /api/orders/123). Each endpoint represents part of the attack surface—a potential entry point for exploitation.
How to Map the Attack Surface
1. Documentation Review
Many APIs have Swagger/OpenAPI documentation or developer portals. These reveal:
- All available endpoints and HTTP methods
- Required and optional parameters
- Authentication schemes
- Data formats and validation rules
2. Traffic Analysis
Intercept legitimate API requests using a proxy tool to observe:
- Actual endpoint URLs being called
- Request/response structures
- Headers revealing API versioning or technologies
- Hidden or undocumented parameters
3. REST Convention Patterns
REST APIs follow predictable patterns. If you find /api/users/123, test:
/api/users(list all users)/api/admins(similar resource)/api/users/123/orders(nested resources)- Different HTTP methods (GET vs DELETE vs PUT)
4. Fuzzing and Discovery
Probe for endpoints using common resource names: /api/admin, /api/config, /api/internal, /api/v1, /api/v2.
Why This Matters
Understanding the full API surface reveals forgotten endpoints, version differences, and privileged operations attackers can exploit—often before testing individual vulnerabilities like injection or broken authentication.
Key Takeaway: Thorough API reconnaissance—through documentation, traffic analysis, and pattern-based discovery—reveals the complete attack surface before exploitation begins.