"Practising web app pentesting with AI on OWASP Juice Shop"
How to practise web application testing with an AI agent on a local OWASP Juice Shop — recon, ffuf content discovery, an injection finding with sqlmap, XSS and broken access control — what the agent is good at, and where it misleads you.
· 7 min read

The best way to find out whether an AI agent helps you test web applications is to use one on a target built to be attacked. OWASP Juice Shop is the standard choice: a deliberately insecure modern web shop with a scoreboard of challenges covering most of the OWASP Top 10. Run locally, it's a target where the scope is "everything," nothing real can break, and you can check the agent's claims against a known answer.
This walkthrough covers one pass through the usual phases — recon, content discovery, injection, XSS and broken access control — with notes on what the agent did well and where it led us astray. It stays at the level of method and tooling; for the specific solutions, Juice Shop has its own companion guide, and working them out is the point.
Everything here runs against a lab on your own machine. The same commands pointed at a site you don't own, or outside a program's scope, are an attack. When you move from the lab to real targets, start with the bug-bounty workflow, which covers encoding scope and rate limits.
Set up the lab
Juice Shop ships as a container. Bind it to loopback so nothing else on your network can reach it:
docker run --rm -p 127.0.0.1:3000:3000 bkimminich/juice-shop
Then open http://127.0.0.1:3000. If you use caveira, /lab start juice-shop does the same thing — it starts the container with the port bound to 127.0.0.1 — and /lab start dvwa and /lab start webgoat start the other two classic practice targets; /lab stop <name> removes them and their data.
Before the agent does anything, write the rules into the project instructions (CLAUDE.md, AGENTS.md or CAVEIRA.md):
The only target is http://127.0.0.1:3000, a local OWASP Juice Shop. Never send traffic to any other host. Keep notes in notes.md: every request that mattered, what it showed, and whether a finding is confirmed or only suspected.
It sounds excessive for a lab. It's practice for the habit that matters on a real engagement: the agent only knows the scope you give it.
Recon: let the agent read the app
Juice Shop is a single-page Angular app talking to a REST API, which is typical of modern targets. Most of what you need to know is in the JavaScript bundle and the API traffic. Two ways to collect it:
- Through a proxy. Browse the app through Burp Suite or mitmproxy, click through every feature, and export the history. The agent reads it and lists every endpoint, parameter and auth header it sees.
- From the bundle. Download the main JavaScript and have the agent extract API paths and route names from it. Minified code is no obstacle for a model; it's one of the things it's best at (more on reading bundled JS).
A useful prompt:
From proxy.har and main.js, build an endpoint map in notes.md: method, path, parameters, whether it needs auth. Flag anything that looks like an admin feature, a search, a file upload or an object ID in the URL.
This is where the agent saves the most time. A list of fifty endpoints with the five suspicious ones flagged takes it a minute.
Content discovery with ffuf
Not everything is linked from the UI. ffuf finds paths by trying a wordlist:
ffuf -u http://127.0.0.1:3000/FUZZ -w /usr/share/seclists/Discovery/Web-Content/common.txt \
-mc 200,301,302,401,403 -fs 0 -o ffuf.json -of json
A wrinkle Juice Shop shows nicely: a single-page app often returns the same HTML shell with status 200 for any unknown path, so every word "hits." Have the agent read ffuf.json, notice that most results share one response size, and rerun with -fs set to that size to filter them out. That's a good test of whether it's reading the output or just reporting it.
Even on a lab, get used to adding -rate and -t limits; on a real target they're not optional.
Injection: finding it, then confirming with sqlmap
The endpoint map from recon points at candidates: anything that takes user input and plausibly reaches a database — search, login, lookups by ID. The agent is useful here in two ways. It reads error responses carefully (a database error leaking through an API response is a strong hint), and it proposes which parameters are worth testing and why.
Once you have a candidate, sqlmap confirms it methodically. Point it at the lab URL and the parameter you suspect, and let it do the work:
sqlmap -u "http://127.0.0.1:3000/<endpoint>?<param>=test" -p <param> --batch
For requests that need a session or a JSON body, save the request from your proxy to a file and pass it with -r request.txt. Have the agent read sqlmap's output and explain what it found, in plain words, in the notes. On a real engagement you'd also cap the risk and level settings to what the rules of engagement allow; sqlmap's defaults are deliberately conservative.
Where the agent misleads: it over-calls injection. A 500 error on a weird character is a lead, not a finding. Make it show the evidence — the differing responses, or sqlmap's confirmation — before anything goes in the notes as confirmed.
Cross-site scripting
Juice Shop has several XSS challenges, reflected and stored. The method generalises: find where your input comes back into a page, work out the context it lands in (HTML body, an attribute, a script block, a framework template), and test whether the app encodes it correctly for that context.
The agent is good at the tedious parts: listing every input that's reflected, reading the surrounding markup or Angular template to identify the context, and explaining which encoding would be needed there. It's also good at reading a Content-Security-Policy header and saying what it would and wouldn't block. Let it reason about context; confirm in a real browser that the behaviour is what it claims.
Where it misleads: models confuse "my input appears in the response" with "my input executes." A string reflected inside a properly encoded attribute isn't XSS. Ask for the evidence from the rendered page, not the raw response.
Broken access control
Access control bugs are where an agent helps least with tooling and most with bookkeeping. The method is simple: register two users, perform every action as user A, then replay the same requests as user B — or with no session at all — and compare. Object IDs in URLs and bodies (baskets, orders, addresses, feedback) are the usual place to look, along with admin features the UI hides but the API still serves.
Have the agent keep a table: endpoint, user A's response, user B's response, unauthenticated response. It's methodical and it doesn't get bored, which is exactly what this testing needs. On a real target, this is also the class of bug where you must use only your own test accounts and never touch real users' data.
Where the agent helps, and where it doesn't
What it's genuinely good at:
- Reading. Proxy history, JS bundles, error messages, tool output — faster and more completely than you.
- Variations. Given one request, it writes the twenty variations worth trying, each with a reason.
- Notes. Keeping a clean record of what was tried, what it showed, and what's confirmed. On a real engagement, this becomes the report.
Where it misleads:
- Confidence without evidence. It reports suspected bugs as found. Make "confirmed" require a request and response.
- Forgetting the scope. Left alone, an agent will follow a link to an external host. On the lab, that's harmless; that's why you practise the scope rule here.
- Speed. It will raise thread counts and drop rate limits to "go faster." Set them yourself.
Which AI tool to use
For web app testing specifically, the useful AI tools fall into three groups (compared in depth here):
- AI inside your proxy. Burp AT puts an agent inside Burp Suite, where your traffic already is.
- A coding agent with a shell. Claude Code, Codex, OpenCode or caveira run ffuf, sqlmap and curl directly and read the output. Mainstream assistants often handle lab work fine but can refuse or hedge on offensive steps (what to do about that).
- Frameworks and tool servers. PentestGPT and HexStrike AI add structure or tools to an agent (the architecture choice).
caveira is a coding agent built for this kind of work: its backend serves uncensored, abliterated open-weight models, it ships a web-app-testing skill, the /lab command starts Juice Shop, DVWA and WebGoat on loopback, and its optional Docker box has ffuf, sqlmap, nmap and a headless browser behind mitmproxy, so the agent can browse the lab and read the captured traffic itself. Whatever you use, get the workflow right on Juice Shop first, then DVWA and WebGoat, before you point any of it at a real program.