capture.pcap
http exchange
GET /login?next=/account HTTP/1.1
Host: example.com
Cookie: session=...

HTTP/1.1 302 Found
Location: /account
Set-Cookie: session=...; HttpOnly; Secure
Illustration · Signal
tool

ZAP: a free web application scanner and proxy

Finds common web vulnerabilities and lets you inspect and edit requests.

Curated by Signal · 10/5/2026

Original: zaproxy.org ↗License: Apache-2.0Repository ↗

What it is

ZAP (Zed Attack Proxy) sits between your browser and a website so you can inspect and modify traffic, and it can also run automated scans for common web vulnerabilities. The command-line tool is useful for running scans in scripts or CI pipelines. Use it only against applications you own or are authorized to test.

Running ZAP

# Start ZAP with its desktop GUI
zap.sh
 
# Start ZAP in daemon mode (headless, API only)
zap.sh -daemon -port 8080
 
# Start with a fixed API key
zap.sh -daemon -port 8080 -config api.key=myapikey123

Baseline scan (quick, passive, CI-friendly)

# Run the baseline scan against a target
zap-baseline.py -t https://example.com
 
# Save the report as HTML
zap-baseline.py -t https://example.com -r report.html
 
# Save the report as JSON
zap-baseline.py -t https://example.com -J report.json

Full scan (active, more thorough, slower)

# Run a full active scan
zap-full-scan.py -t https://example.com
 
# Full scan with a report and a minimum risk level
zap-full-scan.py -t https://example.com -r report.html -l WARN

API scan (for REST/SOAP/GraphQL APIs)

# Scan using an OpenAPI definition file
zap-api-scan.py -t openapi.json -f openapi
 
# Scan a live API endpoint
zap-api-scan.py -t https://api.example.com/openapi.json -f openapi

Using the ZAP API directly (via curl)

# Start a spider scan
curl "http://localhost:8080/JSON/spider/action/scan/?url=https://example.com"
 
# Check spider scan progress (0-100)
curl "http://localhost:8080/JSON/spider/view/status/"
 
# Start an active scan
curl "http://localhost:8080/JSON/ascan/action/scan/?url=https://example.com"
 
# Check active scan progress
curl "http://localhost:8080/JSON/ascan/view/status/"
 
# Get all alerts found so far
curl "http://localhost:8080/JSON/core/view/alerts/"

Authentication for scanning logged-in areas

# Set the authentication method for a context (form-based example)
curl "http://localhost:8080/JSON/authentication/action/setAuthenticationMethod/?contextId=1&authMethodName=formBasedAuthentication&authMethodConfigParams=loginUrl%3Dhttps%3A%2F%2Fexample.com%2Flogin"
 
# Set login credentials for a user
curl "http://localhost:8080/JSON/users/action/setAuthenticationCredentials/?contextId=1&userId=0&authCredentialsConfigParams=username%3Dtest%26password%3Dtest123"

Excluding parts of a site from scanning

# Exclude a URL pattern from the context
curl "http://localhost:8080/JSON/context/action/excludeFromContext/?contextName=Default&regex=.*logout.*"

Reports

# Generate an HTML report via the API
curl "http://localhost:8080/OTHER/core/other/htmlreport/" -o report.html
 
# Generate an XML report
curl "http://localhost:8080/OTHER/core/other/xmlreport/" -o report.xml

Typical CI workflow

# 1. Run a baseline scan as a fast sanity check
zap-baseline.py -t https://staging.example.com -r baseline.html
 
# 2. If that passes, run a fuller active scan before release
zap-full-scan.py -t https://staging.example.com -r full.html -l WARN
 
# 3. Fail the pipeline if WARN-level or higher issues are found
# (zap-full-scan.py exits non-zero based on -l threshold)

Curated summary. The original work belongs to its authors.

#webappsec#scanner
Related reading