Skip to main content
Be Bitwise

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.
bash
# Install Burp Suite Community Edition
# Download from https://portswigger.net/burp/communitydownload
# Configure proxy: 127.0.0.1:8080
# Install CA certificate for HTTPS interception

The 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.

bash
# Install ZAP
# macOS
brew install --cask zap
# Docker (useful for CI/CD pipelines)
docker pull zaproxy/zap-stable

ZAP's API Scan script can pull in OpenAPI/Swagger definitions and hammer every documented endpoint automatically:

bash
# Run ZAP API scan against an OpenAPI specification
docker run -t zaproxy/zap-stable zap-api-scan.py \
-t https://target.example.com/openapi.json \
-f openapi
Choosing Between Burp and ZAP

Burp 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.

bash
# Fuzz API endpoints
ffuf -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 IDs
ffuf -u https://api.example.com/api/v1/users/FUZZ \
-w /usr/share/seclists/Fuzzing/4-digits-0000-9999.txt \
-mc 200

Nuclei: 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.

bash
# Install Nuclei
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
# Run API-specific templates
nuclei -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.

bash
# Run crAPI with Docker Compose
curl -o docker-compose.yml \
https://raw.githubusercontent.com/OWASP/crAPI/main/deploy/docker/docker-compose.yml
docker compose up -d
# Access at http://localhost:8888

VAmPI (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.

bash
# Run VAmPI
git clone https://github.com/erev0s/VAmPI.git
cd VAmPI
docker compose up -d

Wordlists: 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 wordlists
  • Discovery/Web-Content/common.txt - general path discovery
  • Fuzzing/ - numeric ranges, special characters, injection payloads
  • Usernames/ and Passwords/ - credential testing
bash
# Install SecLists
git clone https://github.com/danielmiessler/SecLists.git /opt/seclists

Putting 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.