Pentesting a Site with OWASP ZAP

Started by fizzy1 reply50 views

Hi lads, here's a ez pentest tut

Get it from Hidden link: log in and reply to this thread to see it — or run the Docker image ghcr.io/zaproxy/zaproxy:stable if you don't want Java on your box.

1. Setup (5 min)

Launch ZAP. On first run choose "No, I do not want to persist this session" for throwaway work, or persist if you're running a multi-day engagement.

Then do the two things everyone forgets:

Options → Network → Local Servers/Proxies

Port: 8080 (or anything free)
Leave "Use reverse proxy" alone unless you actually have one
Options → HUD — turn it off if you find it noisy (many do, it overlays the browser viewport).

Options → Passive Scan Rules — set thresholds to Medium/High only at first. Default fires a wall of low-signal alerts that bury the real stuff.

Options → Active Scan Rules — leave at defaults for now, tune later.

Now point a browser at ZAP. Easiest is the built-in one:

Quick Start tab → "Manual Explore" → Launch Browser

That fires a preconfigured Firefox through the proxy. If you prefer your own:

Firefox: FoxyProxy → add 127.0.0.1:8080 for HTTP+HTTPS
Chrome: chrome --proxy-server="Hidden link: log in and reply to this thread to see it" (Chrome won't respect system proxy on its own)
Import ZAP's CA cert so HTTPS doesn't explode. Hidden link: log in and reply to this thread to see it in the proxied browser → download cert → import to browser trust store (Firefox: Settings → Certificates → Authorities → Import; Chrome uses the OS store on Windows/macOS).

2. Spider the target

Don't just click the scan button. Build a map first.

Right-click target in the Sites tree → Attack → Spider. Or the Spider tab, enter Hidden link: log in and reply to this thread to see it, Start.

If the app is JavaScript-heavy (SPA, React, Angular), the classic spider finds nothing because links only exist after JS executes. Use AJAX Spider instead — it drives a real browser. Sites tree → right-click → Attack → Ajax Spider.

While that runs, browse manually and exercise every feature: login, search, profile edit, file upload, filters, pagination, logout. Everything you touch lands in the Sites tree and gets scanned. Manual crawling is still the highest-value step — automated spiders miss auth-gated routes.

3. Handle the login

If the app has auth, ZAP needs to authenticate or you're scanning the public surface only.

Options → Authentication — set the site's auth method to Form-based. Configure the login URL, username/password field names, and a logged-in/logged-out indicator string.

Better: Context → Users — create a user with credentials, then in Options → Session Management enable cookie-based session handling and add your session cookie as a token.

Alternative quick hack: log in through the proxied browser manually, then ZAP → HTTP Sessions → Sites tree → right-click → Attack → "Use current session" (hold the session in memory). Works, but it rots when the session expires mid-scan.

4. Passive scan — read it before anything active

The passive scan already ran while you browsed. Look at the Alerts tab.

Passive findings are things visible in responses: missing CSP/HSTS, cookie without Secure/HttpOnly, banner leaks (Server:, X-Powered-By), directory listing, comments with credentials, CORS * on authenticated endpoints, clickjacking (no X-Frame-Options/frame-ancestors).

None of these break the app alone, but they're real report items and they hand you context for the active work. Fix nothing yet — just note them.

5. Active scan

Right-click target in Sites → Attack → Active Scan (or the Active Scan tab).

Pick a scan policy. Defaults are fine for a first pass, then make a custom one:

Scan Policy Manager → Duplicate "Default" → disable rules you don't care about (file-path traversal on a static site, etc.)
Keep SQLi, XSS (reflected/stored/DOM), SSRF, command injection, path traversal, LDAP/XPath, CRLF injection, XXE enabled
Set thread count under Options → Active Scan → Performance — 5–10 for a fragile app, 20–30 for something robust. Higher = faster = noisier and more likely to trip WAFs or DoS a weak box.

Watch the bars at the bottom. When it finishes, the Alerts tab fills.

6. Read alerts without getting lost

Sort by Risk (High/Medium/Low/Informational). For each hit, the Request/Response panes show the exact payload that fired.

A "High" is not automatically a finding. Before you write it up:

Replay the request (right-click → Resend / Ctrl+W) and confirm the response actually differs from a clean request
Check for false positives: reflected pingback bodies, generic 500s on every param, WAF block pages misread as results
Low-signal Highs are common — ZAP's SQLi rule trips on any param that changes response length, including cached copies.

7. Where ZAP gets thin (and what to do)

ZAP is decent at the classics and poor at modern web app logic. Manual work needed for:

Business logic — price manipulation, coupon reuse, negative quantities, step skipping in checkout. Nothing automates this.
IDOR / BOLA — grab a resource with your account, swap the ID, replay with a second account. ZAP won't spot it.
JWT bugs — alg:none, key confusion, weak HMAC secrets. Drop the token in jwt.io, tamper, replay.
GraphQL — ZAP's support is shallow. Use graphql-cop, introspection query, batched/single-field abuse.
Prototype pollution, desync/HTTP smuggling, cache poisoning — manual, or dedicated tools (smuggler, param-miner, hackvertor).
Race conditions — hammer with parallel Resend, not a scanner.
The one ZAP feature worth using anyway: Fuzzer
Find a param with a query string, right-click → Attack → Fuzz.

Select the payload position, then add Payloads:

Built-in lists for file names, directories
File payloads for your own wordlists
Script payloads (Fix_imported? no — Copy/randomext etc.)
Fuzzer is the honest fast path for directory/param brute force without leaving the tool.

8. A quick report

Report tab → Generate Report → HTML. Add your own exec summary on top. ZAP's raw output is machine-generated and reads like it — the value is in the request/response evidence, not the prose.

Concrete starting sequence

code

1. Set up proxy + CA cert, turn passive thresholds up
2. Manual browse every feature authenticated
3. Ajax Spider the whole tree
4. Read all passive alerts, note context
5. Active Scan with tuned policy, 10 threads
6. Triage every High/Medium by replay
7. Fuzzer on params, IDOR and logic by hand
8. Report with PoCs
Like2
this is gonna make me a hakkerlord tanks

You must log in or register to reply here.

Back to Tutorials