ZAP (formerly OWASP ZAP) is a free, open-source tool for finding vulnerabilities in web applications. This guide takes you from "what is it?" to running automated scans in a CI/CD pipeline, with the exact menu paths, commands and settings I use. It follows the order I'd recommend learning things in.

Only test applications you own or have written permission to test. Several features below (active scan, fuzzing, forced browse) send attack traffic.

1. What is ZAP?

  • A DAST (Dynamic Application Security Testing) tool: it attacks a running app the way a real attacker would.
  • Free, open source and cross-platform (Linux, Windows, macOS). Backed by the ZAP core team and supported by Checkmarx.
  • The name is now just "ZAP" (or "ZAP by Checkmarx"). It has not been an OWASP project since August 2023, so "OWASP ZAP" is the old name.
  • Needs Java 17 or higher (the macOS installer bundles Java). Runs as a desktop app, from the command line, as a Docker image, or in GitHub Actions.

Main features

FeatureWhat it does
Intercepting proxySits between your browser and the app so you can inspect and change traffic
SpiderAutomatically crawls the application to discover pages
Passive scanOnly examines requests and responses; no attacks
Active scanSends attack payloads to find real vulnerabilities
FuzzingSends many unexpected values to a parameter to find what scanners miss
ReportsHTML, JSON, XML, Markdown, PDF and SARIF, with remediation advice
Add-onsFree Marketplace extensions; you can also write your own
Dynamic SSL certificatesA generated root certificate lets ZAP intercept HTTPS

ZAP vs. SAST and SCA

SAST analyzes your source code and SCA analyzes your libraries. Both look at how the app was built, but neither attacks it. ZAP attacks the running app. Automated tools still can't find everything, so manual testing remains necessary.

The simple use case

  1. Authenticate to the target (manually through the proxy, or configure ZAP to do it).
  2. Explore the app: manually through the proxy, with one of ZAP's spiders, or by importing API definitions.
  3. Passive scan happens automatically while you explore.
  4. Active scan attacks the discovered pages and parameters.
  5. Report: review results in ZAP or export HTML/structured data.

2. Installing ZAP

  1. Install Java 17+ and check with java -version.
  2. Download the installer from zaproxy.org/download (Windows: the 64-bit .exe; there is no MSI).
  3. Run the installer and follow the steps.

Alternatives:

docker pull ghcr.io/zaproxy/zaproxy:stable
flatpak install flathub org.zaproxy.ZAP
snap install zaproxy --classic

3. Trusting the ZAP root certificate

Without this, your browser shows certificate warnings and ZAP can't read HTTPS traffic.

  1. ZAP: Tools → Options → Network → Server Certificates → Save, and pick a folder.
  2. Firefox: Settings → Privacy & Security → Certificates → View Certificates → Authorities → Import → tick "Trust this CA to identify websites".
  3. Edge / Chrome on Windows: double-click the file → Install Certificate → Current User → place in Trusted Root Certification Authorities.
  4. Chrome on Linux: Settings → search "certificates" → Manage certificates → import as a trusted authority.

4. Sending browser traffic through ZAP

Option A: the easy way (Manual Explore)

Quick Start tab → Manual Explore → enter the URL → pick a browser → Launch Browser. ZAP opens a browser that already uses ZAP as its proxy and already trusts its certificate. If the browser isn't found, set the path in Tools → Options → Selenium → Binaries.

Option B: manual proxy

Check the proxy address under Tools → Options → Network → Local Servers/Proxies (default localhost:8080; change the port if 8080 is busy). In Firefox: Settings → Network Settings → Manual proxy → HTTP Proxy 127.0.0.1, Port 8080, and tick "Also use this proxy for HTTPS".

On Windows, Edge and Chrome use the system proxy: Settings → Network & Internet → Proxy → Manual proxy setup. Turn it off after testing, or the whole PC keeps going through ZAP.

FoxyProxy

FoxyProxy is a Firefox extension that stores multiple proxy profiles so you don't edit network settings every time. Install it, then add a profile: title ZAP, IP 127.0.0.1, port 8080. Select it from the toolbar icon and traffic starts showing up in ZAP.

5. A practice target: Mutillidae

If you don't have an app of your own, Mutillidae is vulnerable on purpose. Run it only on a lab machine that can't be reached from outside.

  1. Install XAMPP (Apache, PHP, MySQL) from apachefriends.org.
  2. Copy the contents of Mutillidae's src folder into htdocs\mutillidae.
  3. Start Apache and MySQL, open http://localhost/mutillidae and click "setup/reset the DB" once.

6. Intercepting requests

ZAP is a man-in-the-middle proxy: every request and response passes through it, so you can stop, read and modify it first.

  • Break on everything: click the green dot (Set break on all requests and responses). Every message is trapped until you click Submit and step to next or Submit and continue.
  • Break on specific requests (better): right-click a URL in Sites/History → Break…, or use the Add a custom HTTP breakpoint button.

Breaking on everything is noisy because every image and script stops. A custom breakpoint matches only what you define:

FieldMeaning
LocationURL, Request Header, Request Body, Response Header or Response Body
MatchContains (plain text) or Regex
StringThe text or regex to find, e.g. login
Inverse / Ignore caseBreak on non-matches / case-insensitive match

Example: tamper with a login request. Log in once so the request appears in History → right-click it → Break… → Location URL, Match Contains, String login. Submit the form again, edit a parameter, hidden field or disabled field in the Break tab, then click Submit and continue. This bypasses client-side (JavaScript) validation so you can see what the server really accepts.

7. Finding content: spiders and forced browse

Traditional Spider

Starts from seed URLs, parses HTML, follows every link recursively. Run it from Sites → right-click target → Attack → Spider…, choose the starting point, context, user, and whether to recurse.

The spider follows every link, including logout and delete. Exclude those URLs from your Context.

Client Spider (and the retired AJAX Spider)

The traditional spider reads HTML only, so single-page apps (React, Angular, Vue) look almost empty to it. Since July 2026 the Client Spider (from the Client Side Integration add-on) is ZAP's recommended crawler for JavaScript-heavy apps. The AJAX Spider is being retired (removed from weekly/nightly releases in August 2026, still on the Marketplace). Use the Client Spider for new work, and run it together with the traditional spider since each finds URLs the other misses.

SpiderSpeedBest for
TraditionalFastServer-rendered sites
Client SpiderSlower (runs a browser)Modern JavaScript apps
AJAX SpiderSlowerLegacy; being retired

Forced Browse

Brute-forces paths nothing links to (/admin, /backup.zip) using a wordlist. Right-click the site → Attack → Forced Browse, choose a wordlist (Directory List add-ons from the Marketplace) and press play. It sends thousands of requests, so use it only with permission.

Importing API definitions

Spiders can't find REST/SOAP/GraphQL endpoints that no page links to. Import the definition instead (OpenAPI, GraphQL, SOAP/WSDL, Postman, or a plain URL list via the Import menu). From the command line:

zap.sh -cmd -openapiurl https://target.example.com/openapi.json

8. Contexts, scope and modes

A Context groups the URLs of one application, defined by regexes. The Scope is the set of URLs you are testing, and by default nothing is in Scope.

Create one: Sites tab → right-click the target → Include in Context → New Context, then double-click it:

Include in Context:  https://target.example.com.*
Exclude from Context: .*logout.*

The regex must match the full URL, hence the trailing .*. Excluding logout keeps scanners from ending your session.

ModeWhat is allowed
SafeNo potentially dangerous operations (no spidering, active scan, fuzzing, forced browse, breaking, resending)
ProtectedDangerous actions only on URLs in Scope. Recommended default.
StandardAnything on any URL
ATTACKNew in-scope URLs are actively scanned as soon as they're discovered
Habit worth building: before you start, persist the session (File → Persist Session), set Protected mode and add the target to a Context. That way you can't accidentally attack a site you didn't mean to.

9. Passive scanning

ZAP passively scans every request and response in a background thread. It never modifies traffic, so it's safe anywhere. Example rules: application errors (HTTP 500), cookies without SameSite or HttpOnly, cross-domain script inclusion, and information disclosure in URLs or HTML comments.

  • Tune rules: Tools → Options → Passive Scan Rules (threshold Off/Low/Medium/High).
  • Under Passive Scanner you can restrict scanning to in-scope messages, include fuzzer traffic, and cap alerts per rule and body size.
  • The eye icon in the footer shows the passive scan queue draining as you browse.

10. Active scanning and scan policies

Active scanning attacks the app with known techniques: SQL injection, XSS, command and code injection, directory browsing, .htaccess leaks and more. It can't find logic flaws such as broken access control, so combine it with manual testing.

Start one: right-click a URL → Attack → Active Scan.

Scan policies

A policy defines which rules run, how many requests are made and how readily issues are flagged. To build a focused one: Analyse → Scan Policy Manager → Add, name it (e.g. "XSS test"), set every category's threshold to Off, then switch only Injection → Cross Site Scripting to Medium. Choose that policy when starting the scan; it finishes much faster.

Rate-limited targets: in Tools → Options → Active Scan, set Concurrent scanning threads per host to 1 and Delay when scanning to about 150 ms. Otherwise the server answers many requests with 429 Too Many Requests, and the mix of real and 429 responses produces false alerts (for example a bogus SQL injection).

ATTACK mode automates this: switch the toolbar mode to ATTACK and every new in-scope URL is scanned immediately. It sends a huge number of requests and can create, change or delete data, so use it only on test environments.

11. Fuzzing and the Request Editor

Fuzzer

  1. Right-click a request → Attack → Fuzz… (or Ctrl+Alt+F).
  2. In Fuzz Locations, highlight the value to replace (e.g. the username) and click Add….
  3. Add a payload (File wordlist, Strings, Numberzz ranges, Regex, Script). Optionally add processors (URL encode, hash, prefix/suffix).
  4. Set threads and delay in Options (lower for fragile targets), then Start Fuzzer.
  5. Sort results by Code or Size to spot responses that differ from the rest.
Fuzzing a login form can lock accounts or trigger alarms. Use test accounts and limit threads.

Manual Request Editor

Select a message and press Ctrl+M (or Tools → Manual Request Editor), edit it, then Send (Alt+Enter). Typical uses:

  • Change id=1 to id=2 to test for IDOR (broken access control).
  • Replay a request without the session cookie, or with another user's cookie, to test authorization.
  • Change GET to POST/PUT/DELETE to see what the server allows.

12. Authenticated scanning

An unauthenticated scan only sees public pages. For a form-based login with cookies:

  1. Create a Context for the app.
  2. Session Properties → Session Management → Cookie-based.
  3. Log in through ZAP with a test account so the login request is in History.
  4. Right-click the login request → Flag as Context → Form-based Auth Login Request.
  5. Select text that only appears when logged in (e.g. "Logout") → right-click → Flag as Context → Logged in Indicator.
  6. Session Properties → Users: add one user per role you want to test.
  7. Choose that user in the Spider and Active Scan dialogs.

Other methods exist for JSON logins, HTTP/NTLM, script-based flows and browser-based SSO. Always use dedicated test accounts, never real users.

13. Alerts and reports

Each alert has a Risk (High, Medium, Low, Informational) and a Confidence (False Positive, Low, Medium, High, User Confirmed). Triage high risk with high confidence first, then verify manually. Scanners produce false positives, so check the request, response and evidence. Real examples: a "Spring4Shell" alert on an app with no Java, and an "SQL Injection" alert whose only evidence was a 429 response. Mark these via right-click → Edit Alert… → Confidence: False Positive, or use the Alert Filters add-on for future scans.

Generate a report from Report → Generate Report…. Popular templates:

TemplateId
Modern HTMLmodern
Traditional HTMLtraditional-html
Traditional HTML + requests/responsestraditional-html-plus
High Level Reporthigh-level-report
Traditional JSON / XML / Markdown / PDFtraditional-json, traditional-xml, traditional-md, traditional-pdf
SARIF (code-scanning tools)sarif-json
The Modern template and every "-plus" template include full requests and responses, including cookies, tickets and tokens. Use Traditional HTML for reports you share, and include only your own site.

After fixing issues, the Retest add-on re-checks previously reported alerts.

14. Command line, Docker and the API

Command line

zap.sh -version
zap.sh -cmd -addonupdate
zap.sh -newsession /home/user/zap/mysession
zap.sh -cmd -quickurl https://target.example.com -quickout /tmp/zap-report.html -quickprogress
zap.sh -daemon -host 127.0.0.1 -port 8080 -config api.key=CHANGE_ME

-cmd runs a task and exits; -daemon runs headless for API use. Windows uses zap.bat.

Docker scan scripts

ScriptWhat it doesUse for
zap-baseline.pyShort spider, then passive rules onlyEvery build; safe on most environments
zap-full-scan.pySpider plus full active scanStaging/test systems you own
zap-api-scan.pyImports an OpenAPI/SOAP/GraphQL definition and actively scans itAPIs
# Baseline (passive) scan, HTML + JSON reports to the current folder
docker run --rm -v $(pwd):/zap/wrk/:rw -t ghcr.io/zaproxy/zaproxy:stable \
  zap-baseline.py -t https://staging.example.com -r report.html -J report.json

# Full scan (active attacks: only systems you own)
docker run --rm -v $(pwd):/zap/wrk/:rw -t ghcr.io/zaproxy/zaproxy:stable \
  zap-full-scan.py -t https://staging.example.com -r full.html

# API scan from an OpenAPI definition
docker run --rm -v $(pwd):/zap/wrk/:rw -t ghcr.io/zaproxy/zaproxy:stable \
  zap-api-scan.py -t https://staging.example.com/openapi.json -f openapi -r api.html

The -v $(pwd):/zap/wrk/:rw mount is required because the scripts read and write files in /zap/wrk. To scan an app on your own machine, use --network host on Linux, or the hostname host.docker.internal on Windows and macOS. The :bare image is minimal and does not include these scripts.

OptionMeaning
-tTarget URL (or API definition)
-r / -J / -x / -wHTML / JSON / XML / Markdown report
-c / -gUse / generate a rule config file (IGNORE, WARN, FAIL per rule)
-mMinutes the spider runs (baseline)
-IDon't fail the run because of warnings
-z "options"Pass ZAP options, e.g. -z "-config key=value"

Exit codes: 0 success, 1 a FAIL rule triggered, 2 at least one warning, 3 the scan itself failed.

The REST API

KEY=CHANGE_ME; ZAP=http://127.0.0.1:8080; T=https://staging.example.com
curl "$ZAP/JSON/spider/action/scan/?url=$T&apikey=$KEY"
curl "$ZAP/JSON/ascan/action/scan/?url=$T&apikey=$KEY"
curl "$ZAP/JSON/core/view/alerts/?baseurl=$T&apikey=$KEY"

Never disable the API key on a machine others can reach.

15. Automation Framework

The recommended way to automate ZAP: a YAML plan of ordered jobs that lives in version control and can express contexts, authentication and reports that the packaged scans can't.

env:
  contexts:
    - name: "target"
      urls: ["https://staging.example.com"]
      includePaths: ["https://staging.example.com.*"]
      excludePaths: [".*logout.*"]
  parameters:
    failOnError: true
    progressToStdout: true
jobs:
  - type: passiveScan-config
  - type: spider
    parameters:
      context: "target"
      maxDuration: 5
  - type: passiveScan-wait
    parameters:
      maxDuration: 5
  - type: activeScan
    parameters:
      context: "target"
      maxRuleDurationInMins: 5
  - type: report
    parameters:
      template: "traditional-html"
      reportDir: "/zap/wrk"
      reportFile: "zap-report"
docker run --rm -v $(pwd):/zap/wrk/:rw ghcr.io/zaproxy/zaproxy:stable \
  zap.sh -cmd -autorun /zap/wrk/plan.yaml

Run zap.sh -cmd -autogenmax plan.yaml to see every parameter of every job for your ZAP version. For modern apps, use the spiderClient job.

16. ZAP in GitHub Actions

Run the baseline scan on every pull request (fast, no attacks), API scans against APIs you own, and full active scans on a schedule against staging only.

name: zap-baseline
on: [pull_request]
jobs:
  zap:
    runs-on: ubuntu-latest
    steps:
      - name: ZAP baseline scan
        run: |
          mkdir -p zap-out && chmod a+w zap-out
          docker run --rm -v "$PWD/zap-out":/zap/wrk/:rw \
            ghcr.io/zaproxy/zaproxy:stable zap-baseline.py \
            -t https://staging.example.com -r report.html -J report.json
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: zap-report
          path: zap-out

ZAP also publishes ready-made actions (zaproxy/action-baseline, action-full-scan, action-api-scan); pin each to the latest release tag on its Marketplace page. Use a rules file (-c) to choose which rules fail the build.

17. Add-ons and the HUD

Open the Marketplace with the Manage Add-ons toolbar button. Everything there is free and open source. Add-ons worth knowing: Fuzzer and FuzzDB, Forced Browse with Directory List, OpenAPI / GraphQL / SOAP / Postman Support, Authentication Helper, Client Side Integration, Automation Framework, Replacer, Requester, Retest, Script Console, OAST Support and The HUD (ZAP controls as an overlay inside the browser).

18. Workflow checklist

  1. Get written permission; use a test environment where possible.
  2. Start ZAP, persist the session, set Protected mode.
  3. Create the Context; include the target, exclude logout/delete URLs.
  4. Configure authentication, session management and users; verify with a logged-in indicator.
  5. Explore manually, then spider (traditional + Client), import API definitions, forced browse if allowed.
  6. Review passive alerts, then run an active scan with a suitable policy as each user.
  7. Fuzz and tamper (breakpoints, Request Editor) on logins, payments and access control.
  8. Generate the report, fix, then Retest.

19. Troubleshooting

ProblemLikely causeFix
ZAP won't start / Java errorJava older than 17Install Java 17+, check java -version
Certificate warningsRoot cert not trustedSave it under Server Certificates and import it in the browser
No traffic in ZAPProxy off or wrong portCheck Local Servers/Proxies and browser/FoxyProxy settings
"Browser not found"ZAP can't locate itTools → Options → Selenium → Binaries
Scan finds nothing after loginNo logged-in indicator, or logout URL was hitCheck Session Properties and exclude logout
Can't spider, scan or breakSafe mode, or target outside Scope in Protected modeAdd the target to a Context or change mode
Docker report missingFolder not mounted or not writableUse -v $(pwd):/zap/wrk/:rw and fix permissions

Wrapping up

ZAP's real strength is that one tool covers the whole range: a one-click scan for beginners, a manual proxy for deep testing, and a scriptable engine for CI/CD. Start with Manual Explore and passive scanning, add contexts and authentication, and only then move to active scans and automation. And remember: automated scanners won't catch broken access control or business-logic flaws, so keep testing manually.

References