Setting Up an API Testing Lab
API Security Fundamentals · API Security track
5 min read
In this module
Building Your Testing Environment
Before you can test APIs for vulnerabilities, you need two things: tools to intercept and manipulate requests, and deliberately broken targets to practise on. This lesson walks through getting both.
All testing must happen against systems you own or have explicit permission to poke at. The vulnerable applications listed here are built for learning and belong on your laptop or in an isolated environment, nowhere else.
Burp Suite: The Intercepting Proxy
Burp Suite is the workhorse of API security testing. It sits between your client and the target API, intercepting every request and response so you can inspect, modify, and replay them at will.
Essential Configuration
After installing Burp Suite Community Edition, point your browser or HTTP client at the proxy on 127.0.0.1:8080. For HTTPS traffic, you'll need to install Burp's CA certificate so it can decrypt TLS connections.
The features that matter most for API testing:
- Proxy: intercept requests in real time, modify them on the way through, and inspect responses.
- Repeater: grab any captured request, tweak it by hand, and resend. You'll live here during manual testing — swapping IDs, switching tokens, prodding parameters.
- Intruder: automate attacks by substituting payloads into specific positions inside a request. Handy for ID enumeration, credential stuffing, and fuzzing.
- Scanner (Pro only): automated vulnerability scanning with API-aware checks.
# Install Burp Suite Community Edition# Download from https://portswigger.net/burp/communitydownload# Configure proxy: 127.0.0.1:8080# Install CA certificate for HTTPS interceptionThe BApp Store stocks extensions that add API-specific functionality. The standouts: JSON Beautifier, JWT Editor, and Autorize (for authorisation testing).
OWASP ZAP: The Open-Source Alternative
OWASP ZAP (Zed Attack Proxy) covers similar interception ground to Burp Suite, but it's fully free and open-source. It really shines at CI/CD integration and automated scanning.
# Install ZAP# macOSbrew install --cask zap
# Docker (useful for CI/CD pipelines)docker pull zaproxy/zap-stableZAP's API Scan script can pull in OpenAPI/Swagger definitions and hammer every documented endpoint automatically:
# Run ZAP API scan against an OpenAPI specificationdocker run -t zaproxy/zap-stable zap-api-scan.py \ -t https://target.example.com/openapi.json \ -f openapiBurp Suite excels at manual testing with its Repeater and Intruder tools. ZAP excels at automated scanning and CI/CD integration. Most professional testers use both: Burp for manual exploration and ZAP for automated coverage.
Command-Line Tools
ffuf: Fast Fuzzing
ffuf is a fast web fuzzer written in Go. It treats the FUZZ keyword as a placeholder, swapping it for each line of your wordlist in turn.
# Fuzz API endpointsffuf -u https://api.example.com/api/v1/FUZZ \ -w /usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt \ -mc 200,201,301,403
# Fuzz object IDsffuf -u https://api.example.com/api/v1/users/FUZZ \ -w /usr/share/seclists/Fuzzing/4-digits-0000-9999.txt \ -mc 200Nuclei: Template-Based Scanning
Nuclei is a template-based vulnerability scanner. Each YAML template describes a specific check, and the community maintains a library running into the thousands.
# Install Nucleigo install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
# Run API-specific templatesnuclei -u https://api.example.com -t http/exposures/ -t http/misconfiguration/Templates cover exposed API documentation, default credentials, known CVEs, and security misconfigurations. You can also roll your own for application-specific checks.
Vulnerable API Targets
OWASP crAPI (Completely Ridiculous API)
crAPI is purpose-built to demonstrate the OWASP API Security Top 10. It simulates a car-themed application stuffed with vulnerable endpoints covering BOLA, broken authentication, excessive data exposure, rate-limiting failures, and BFLA.
# Run crAPI with Docker Composecurl -o docker-compose.yml \ https://raw.githubusercontent.com/OWASP/crAPI/main/deploy/docker/docker-compose.ymldocker compose up -d# Access at http://localhost:8888VAmPI (Vulnerable API)
VAmPI is a lightweight vulnerable REST API built on Flask. It zeroes in on core API vulnerabilities and is much simpler to spin up than crAPI, which makes it great for drilling on specific vulnerability classes.
# Run VAmPIgit clone https://github.com/erev0s/VAmPI.gitcd VAmPIdocker compose up -dWordlists: SecLists
SecLists is the standard pile of wordlists for security testing. For API work, the lists you'll reach for most often are:
Discovery/Web-Content/api/- API endpoint wordlistsDiscovery/Web-Content/common.txt- general path discoveryFuzzing/- numeric ranges, special characters, injection payloadsUsernames/andPasswords/- credential testing
# Install SecListsgit clone https://github.com/danielmiessler/SecLists.git /opt/seclistsPutting It Together
A typical testing setup flows like this:
Your browser or HTTP client sends traffic through Burp or ZAP, which logs and intercepts the lot. For automated checks, ffuf and Nuclei talk to the target directly. The vulnerable API applications run locally in Docker, giving you a safe sandpit to practise in with zero legal risk.
With the lab in place, the next module digs into specific vulnerability classes, starting with the most common one of all: Broken Object Level Authorisation.