DVWA lab integration
This document is the audit and how-to for making DVWA (Damn Vulnerable Web Application) a first-class training and regression target for Fissure.
The capability audit below started from a hypothetical Python MCP
proxy-toolkit design (a parallel package tree
mcp_proxy/proxy, mcp_proxy/intruder, and so
on). Fissure is a native C99 tool that already implements almost all of
that engine surface. So this integration does not rebuild the engine: it
adds the DVWA-specific pieces (a local lab, a ready-made login config, a
headless authenticated-scan flag, a regression runner) and maps the rest
onto features Fissure already has. DVWA is intentionally vulnerable;
every workflow here is local, loopback, and authorized only.
DVWA was the first lab target. The lab has since grown into a
labelled corpus of local vulnerable targets in the same
lab/<id>/ shape (Juice Shop, Mutillidae, bWAPP,
VAmPI, DVGA, crAPI, DVWS, WebGoat, OWASP Benchmark, and a Vulhub CVE
runner), driven by the generic runner lab/run-target.sh and
scored by lab/score.py; see lab/README.md and
16_VULNERABLE_TARGET_LAB.md
for the targets and the remaining rollout.
1. Capability audit vs Fissure
Each DVWA-workflow capability mapped to how Fissure satisfies it. "Exists" means the capability was already in Fissure; "Added" means this integration adds it; "Non-goal" means it is intentionally out of scope for a native offline-first tool.
| Capability | Status | In Fissure |
|---|---|---|
| Launch/connect a local DVWA | Added | lab/dvwa/ Docker compose + HTTPS gateway +
gen-certs.sh |
| Configure DVWA automatically | Added | run.sh resets the DB via setup.php; README documents
it |
| Authenticate to DVWA | Added | resources/login/dvwa.json (login-config authenticated
scan) |
| Set DVWA security levels | Added | the login config's security.php step; run.sh sets each
level |
| Crawl DVWA modules | Exists | crawler + Target view + Import API + Discover |
| Capture all HTTP traffic | Exists | intercepting proxy + history + cross-tool Logger |
| Replay via a Repeater | Exists | Repeater (tabs, Inspector, send history, Pin/Diff) |
| Run Intruder-like payload tests | Exists | Intruder (sniper/battering ram/pitchfork/clusterbomb, grep, reflection) |
| Run passive scanner checks | Exists | native passive suite (headers/cookies/banner/secrets/CORS/DOM-XSS), live on proxy |
| Run active scanner checks | Exists | active checks (XSS, SQLi error/boolean/time, LFI, command injection) across insertion points |
| Compare behavior across levels | Exists/Added | cross-role site-map diff (Snapshot/Compare roles); the level matrix
here + run.sh per-level reports |
| Generate structured findings | Exists | FISSURE_FINDING (severity, confidence, CWE, evidence, remediation) |
| Export reports | Exists | Markdown, HTML, JSON, CSV, SARIF, issue XML (the burp
format) |
| CI/regression target | Added | headless fissure scan --login + run.sh;
the exit-code contract is fissure scan --fail-on |
A typical MCP/agent tool surface mapped to Fissure drivers:
| Agent tool | Fissure equivalent |
|---|---|
dvwa_lab.start / .stop /
.reset |
lab/dvwa/ compose + run.sh (docker compose
up/down, setup.php reset) |
dvwa.login, dvwa.set_security_level |
resources/login/dvwa.json via --login or
the Settings Login config |
proxy.capture.start,
proxy.history.search |
the proxy + scope + Global Search + the Logger |
repeater.send |
the Repeater, or POST /api/request on the control
API |
intruder.run |
the Intruder view (positions/modes/payloads/grep/rate) |
scanner.passive.run,
scanner.active.run |
the scanner; fissure scan and
POST /api/scan / /api/scans |
report.generate |
the Report view and fissure report / the control-API
report |
The standard proxy/scanner data model already exists: the
HttpExchange maps to the proxy flow (now with a per-flow comment and
highlight), and the Finding maps to FISSURE_FINDING one-to-one. The MCP
surface is the existing control API and the bridge/ MCP
server (see docs/11_CONTROL_API.md), so an MCP host drives
send_request, start_scan,
get_scan_status, and get_scan_findings. This
integration adds an optional login object to
start_scan (POST /api/scans), so the
dvwa.login + scanner.active.run combination,
an authenticated scan, now runs over MCP/HTTP and not only the CLI.
Concrete HTTP and MCP command examples are in section 6a.
Non-goals (consistent with Fissure's scope):
- A DNS/CIDR "lab-mode" kill switch that refuses public IPs. Fissure
already gates active work behind the scope allowlist, the
safe/aggressive toggle, and the authorization banner; keep the scope set
to the DVWA host. Binding the lab to
127.0.0.1(the compose does) is the network-side control.
A headless browser and screenshots are no longer non-goals: the
.deb and AppImage bundle the Fissure Browser (a Chromium
fetched by packaging/fetch-chromium.sh; a system
Chrome/Chromium also works, and is what the Windows build uses), driven
over CDP. It powers DOM-XSS execution proof
(POST /api/domprobe, POST /api/dominvader),
headless SPA route discovery during a scan
(fissure scan --crawl-spa), a real-browser login
(POST /api/browserlogin), and recon screenshots
(POST /api/screenshot, listed by
GET /api/screenshots). Screenshots are a separate
visual-triage artifact saved under
<config>/screenshots/, not embedded in the report:
the per-finding HTTP request/response evidence remains the primary,
stronger evidence.
2. Reaching the lab
lab/dvwa/docker-compose.yml runs DVWA on
127.0.0.1:4280 (direct HTTP, for headless scanning) and an
nginx HTTPS gateway on 127.0.0.1:8443 (for the
browser-through-proxy path). See lab/dvwa/README.md for
start/reset/stop and the certificate step. Default credentials are
admin / password.
3. Authenticated scan
DVWA gates every module behind a login and a security-level cookie.
Fissure's login config replays exactly that flow.
resources/login/dvwa.json:
- GET
/login.phpand extract theuser_tokenhidden field (regex). - POST the credentials with that token (sets
PHPSESSID). - GET
/security.phpand extract a freshuser_token. - POST
security=lowwith that token (sets thesecuritycookie). - verify: GET
/index.phpcontains "Welcome".
The resulting cookie jar (session plus security level) is carried on
every scan request. Change the base URL and the single
security=low field for another target or level.
Headless:
./fissure scan http://127.0.0.1:4280/ --active --aggressive \
--login resources/login/dvwa.json --format markdown -o dvwa-low.md--login <config.json> (added for this integration)
replays the login before the scan and aborts with exit code 2 if the
session cannot be established, a clear authentication-failed exit code.
In the GUI, set the Login config in Settings instead.
4. Module map
DVWA's modules and how Fissure exercises each. Paths are under
/vulnerabilities/.
| Module | Path | Fissure approach |
|---|---|---|
| Brute Force | /brute/ |
Intruder pitchfork over username/password; grep the success/fail markers; the Sequencer is not needed here |
| Command Injection | /exec/ |
active command-injection check (safe marker / time-based); or
Intruder with an echo MARKER family |
| CSRF | /csrf/ |
passive missing-anti-CSRF-token detection; Repeater replay without/with a stale token; the CSRF PoC generator |
| File Inclusion | /fi/ |
active path-traversal / LFI check (root❌ and php://filter markers) |
| File Upload | /upload/ |
multipart-aware Repeater/Intruder; upload a harmless
echo marker then GET it back |
| Insecure CAPTCHA | /captcha/ |
Repeater multi-step replay of the final step (business-logic bypass); manual-assist |
| SQL Injection | /sqli/ |
active error-based SQLi + the Comparer for row-count diffs |
| Blind SQL Injection | /sqli_blind/ |
active boolean-based (stable-baseline diff) and time-based SQLi |
| Weak Session IDs | /weak_id/ |
collect tokens, analyze with the Sequencer (entropy / monobit / chi-square) |
| DOM XSS | /xss_d/ |
passive DOM-XSS sink heuristic; reflected-marker detection; dalfox plugin for depth |
| Reflected XSS | /xss_r/ |
active reflected-XSS check + the Intruder payload-reflection column |
| Stored XSS | /xss_s/ |
submit a marker via Repeater, refetch the list page, confirm the persisted marker |
| CSP Bypass | /csp/ |
passive CSP weakness detection (unsafe-inline/eval, wildcard, missing object-src) |
| JavaScript | /javascript/ |
capture the JS, replay the request with server-side-invalid values, compare acceptance |
Checks a stock DVWA cannot exercise (validated against the nearest
applicable target instead, per the project's end-to-end rule): the
reverse-proxy / auth-header authentication-bypass check
(fissure_checks_active_authbypass,
POST /api/authbypass, MCP authbypass, "Test
auth bypass" context action) needs a backend that trusts a forwarded
identity header (X-WEBAUTH-USER, X-Remote-User, X-Forwarded-For, ...);
DVWA is not fronted by such a reverse proxy, so it has no positive to
find. It is validated end to end - driven (control API) and skill-driven
(MCP bridge) - against a nearest-applicable mock backend that denies
anonymous requests but honors a forged X-WEBAUTH-USER,
producing a Fissure report under
reports/dvwa_<DATE_TIME>/. This is the same
nearest-applicable-target treatment used for cloud-metadata SSRF and
single-server request smuggling.
GUI-chrome work is validated against DVWA the same way, minus the leg
that cannot exist. The site-map graph's per-depth auto-fit columns (drag
an edge to pin one column, Ctrl+wheel to spread, "Fit columns" to reset,
double-click a node to focus a subtree) are column preferences, which
CLAUDE.md exempts from the control-API + MCP parity rule, so no MCP tool
drives a column width and the skill cannot exercise one. The direct leg
is a real DVWA crawl captured through the headless shot flags
(--selftest-scan <url> --selftest-graph --selftest-shot,
plus --selftest-graph-focus <url> for the focused
mode), and the agent leg validates what the agent path CAN see of the
same model: a control-API scan of the same seed plus
GET /api/surface and GET /api/report. Both
legs and their screenshots are recorded in that run's
reports/dvwa_<DATE_TIME>/VALIDATION.md.
5. Security-level strategy
DVWA exposes each module at four levels: low,
medium, high, impossible. The
value of testing all four is not only detecting a bug at
low, it is proving the finding weakens or disappears at
impossible, which measures the scanner's precision (its
false-positive control). Expected direction (a baseline, not an oracle;
exact results vary by DVWA version):
| Module | low | medium | high | impossible |
|---|---|---|---|---|
| Brute Force | expected | possible | possible | reduced/denied |
| Command Injection | expected | possible | harder | not expected |
| CSRF | expected | possible | possible | not expected |
| File Inclusion | expected | possible | harder | not expected |
| File Upload | expected | possible | harder | not expected |
| Insecure CAPTCHA | expected | possible | possible | not expected |
| SQL Injection | expected | possible | harder | not expected |
| Blind SQL Injection | expected | possible | harder | not expected |
| Weak Session IDs | expected | expected | possible | not expected |
| DOM XSS | expected | possible | harder | not expected |
| Reflected XSS | expected | possible | harder | not expected |
| Stored XSS | expected | possible | harder | not expected |
| CSP Bypass | expected | possible | possible | not expected |
| JavaScript | expected | possible | possible | not expected |
6. Regression run
lab/dvwa/run.sh generates the HTTPS-gateway certs when
missing (so the nginx sidecar does not crash-loop on a first run),
starts the lab, and runs an authenticated active scan at each level,
writing Markdown + JSON reports (plus a score.md /
score.json summary scored against
lab/dvwa/expected_findings.json) under the repo-root
reports/dvwa_<YYYYMMDD_HHMMSS>/ (override with
OUT=). run.sh is a thin wrapper over
lab/run-target.sh dvwa and accepts only its flags:
--drive cli|api (drive the scans through the CLI, the
default, or the control API) and --no-score. It generates a
per-level login config from resources/login/dvwa.json
(substituting the base URL and the security level), and
resets the DVWA database before every scan (not just once at startup):
an aggressive scan degrades DVWA's session/security state, so a fresh
reset keeps each scan's authenticated login reliable.
run.sh takes no --fail-on: that is a
fissure scan report option. For a CI gate, run the scan
directly with it, so the scan exits 1 when it raises a finding at or
above that severity:
./fissure scan http://127.0.0.1:4280/ --active --aggressive \
--login resources/login/dvwa.json --format json -o dvwa-low.json \
--fail-on highand compare the per-level reports (or the score.json the
runner writes) to assert that impossible drops the findings
low produced. See docs/11_CONTROL_API.md to
drive the same flow over the control API or the MCP bridge instead of
the CLI.
6a. Driving the lab over HTTP and MCP
The whole flow can run over the control API (plain HTTP) or the MCP
bridge instead of the CLI. Enable the control API (Settings, or
fissure serve), then send the token on every route except
status. The authenticated scan uses the async job API's optional
login field (the sync POST /api/scan is
unauthenticated). The login value is the login-config
object inline; use the contents of
resources/login/dvwa.json.
Over HTTP (curl)
TOKEN=<from Settings or fissure serve --api-key>
API=http://127.0.0.1:8777
# health (no token)
curl -s $API/api/status
# authenticated active scan of DVWA; returns {"job_id":...}. The full login body
# is in docs/11_CONTROL_API.md (Authenticated scans) and resources/login/dvwa.json.
job=$(curl -s -H "X-API-Key: $TOKEN" -H "Content-Type: application/json" \
-d @scan-body.json $API/api/scans | grep -o '"job_id":"[^"]*"' | cut -d'"' -f4)
# poll progress, then read the findings once "status":"done"
curl -s -H "X-API-Key: $TOKEN" $API/api/scans/$job
curl -s -H "X-API-Key: $TOKEN" $API/api/scans/$job/findings
# walk one module by hand: send a single request through the engine
curl -s -H "X-API-Key: $TOKEN" -H "Content-Type: application/json" \
-d '{"url":"http://127.0.0.1:4280/vulnerabilities/sqli/?id=1&Submit=Submit","headers":"Cookie: PHPSESSID=<sess>; security=low"}' \
$API/api/request
where scan-body.json is
{"url":"http://127.0.0.1:4280/","active":true,"login":{...dvwa.json...}}.
Over MCP (the bridge)
Register the bridge once (docs/11_CONTROL_API.md), then
an MCP host calls the tools directly. start_scan takes an
optional login object:
start_scan(url="http://127.0.0.1:4280/", active=True, login=<dvwa.json contents>)
get_scan_status(job_id) # poll until status == "done" (or "error")
get_scan_findings(job_id) # the findings once done
send_request(url="http://127.0.0.1:4280/vulnerabilities/xss_r/?name=<marker>")
If the login cannot establish a session the job reports
"status":"error", so an agent can tell an authentication
failure from a scan result. This is the dvwa.login +
scanner.active.run MCP surface, satisfied by the existing
control API plus the login field.
6b. Purple-team runs against the lab (DVWA has a real IDS)
DVWA ships PHPIDS, which makes the lab the right target for exercising purple-team mode (see 15_PURPLE_TEAM.md): the run then has both halves of the question, an access log that records everything and an intrusion detector that alerts on some of it.
- Log in, set the security level, and turn PHPIDS on for the session:
GET /security.php?phpids=on(it is per PHP session, so use the same cookie the scan will carry).security.phpreports "PHPIDS is currently: enabled". - Note where the two logs stand, so only this run's lines are
imported:
docker exec fissure-lab-dvwa sh -c 'wc -l < /var/log/apache2/access.log'anddocker exec fissure-lab-dvwa sh -c ': > /var/www/html/external/phpids/0.6/lib/IDS/tmp/phpids_log.txt'. purple_op startwith a run name, scan with the session cookie, then import the access-log slice assource=apache kind=logand the PHPIDS log assource=phpids kind=alert, reconcile, and read the coverage table. A large slice is imported in chunks: the control API caps a request at 64 KB.
Two lab-specific notes worth keeping:
- The PHPIDS log lives at
/var/www/html/external/phpids/0.6/lib/IDS/tmp/phpids_log.txtinside the container. It is CSV with an ISO-8601 timestamp and a percent-encoded URI, and it records request PARAMETERS rather than headers, so a probe's correlation marker never appears in it: those lines are matched on the payload and the path, which is exactly the fallback the reconciler exists for. - DVWA's PHPIDS page carries a "Clear Log" control, and DVWA clears
the log whenever
clear_logis merely present in the query. Fissure now refuses that control on both the crawl and the audit path (it is a control that destroys the owner's record of the test, which this project never touches), but a lab operator poking atids_log.phpby hand will still empty the log and see a run come back with no alerts.
7. Testing
The DVWA-facing Fissure code is covered without a live container:
tests/test_dvwa.cdrives the shippedresources/login/dvwa.jsonagainst a mock DVWA loopback (login page with auser_token, credential POST, the security.php step, and the verify), asserting the four-step login runs and the session plus security cookie land in the jar.tests/test_cli.cexercisesfissure scan --login(a valid config authenticates then scans; an unreadable config aborts with exit 2).tests/test_login.ccovers the login engine (regex/header/JSON extraction and verify).tests/test_control.ccovers the authenticated async scan over the control API (aloginobject whose verify passes against the target lets the job reachdone; a malformed login config is rejected with 400).
A full live-DVWA regression needs Docker and is run with
lab/dvwa/run.sh, not the unit suite.
8. Safety
DVWA is intentionally vulnerable. The lab binds to
127.0.0.1 only; never expose it. Keep the scope allowlist
set to the DVWA host so Fissure refuses out-of-scope active work. Use
only harmless marker payloads (an echo marker, a benign XSS
marker), never destructive commands, and keep the request budget and
rate limits in place. Never point the active checks or
run.sh at a third-party host.
9. The second lab target: lab/lfi (log poisoning)
DVWA covers most of Fissure, but it cannot exercise one chain: log
poisoning through its file-inclusion page
(fissure_logpoison, the LFI-to-RCE route). DVWA's Apache
access log is 0640 root:adm and its PHP worker runs as
www-data, so the include can never read it. Measured, so
the negative is on record rather than assumed:
$ docker exec fissure-lab-dvwa su -s /bin/sh www-data -c "head -c 20 /var/log/apache2/access.log"
head: cannot open '/var/log/apache2/access.log' for reading: Permission denied
DVWA logpoison: {'count': 0, 'included': False, 'executed': False, 'tried': 19}
That is a realistic hardening and exactly why the probe walks many
candidates instead of assuming one, but the POSITIVE path needs the
other common configuration: a log the web user can read, which is what
plenty of real deployments and effectively every CTF box look like.
lab/lfi is that configuration and nothing else. See
lab/lfi/README.md for how to run it and how to drive both stages.
One thing that lab teaches, and that applies to any real engagement:
the execution stage proves itself with a callback FROM the target, so
the collector has to be reachable from the target. On bridge networking
the container's 127.0.0.1 is its own loopback, and a host
firewall commonly blocks the docker bridge, so the callback goes nowhere
and the chain looks broken when it is not. lab/lfi runs on
the host network for that reason; against a remote target, use a
collector the target can reach (the hosted OAST).