Exposed Werkzeug/Flask interactive debugger — reach the /console, and reconstruct or brute the debugger PIN to unlock an in-browser Python shell for RCE. Tier 1 (RCE honors the authorization gate). Use when a Flask/Werkzeug app shows the debugger traceback or /console is reachable.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Werkzeug Debugger?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-werkzeug-debugger)
---
name: werkzeug-debugger
description: Exposed Werkzeug/Flask interactive debugger — reach the /console, and reconstruct or brute the debugger PIN to unlock an in-browser Python shell for RCE. Tier 1 (RCE honors the authorization gate). Use when a Flask/Werkzeug app shows the debugger traceback or /console is reachable.
---
# Werkzeug / Flask Debugger Console RCE (PIN bypass)
Flask apps run with `debug=True` expose Werkzeug's interactive traceback. Its `/console` evaluates Python in the server process — PIN-protected since Werkzeug 0.11, but the PIN is derivable from server metadata an attacker can often leak.
## Trigger phrases
`werkzeug, flask debugger, werkzeug console, debugger pin, __debugger__, flask rce, app_debug, interactive traceback`
## Method
1. **Detect:** error pages with the Werkzeug traceback UI, `Server: Werkzeug/x Python/y`, `/console` returns the debugger, `?__debugger__=yes&cmd=resource&f=debugger.js`. Trigger an exception to surface the interactive traceback.
2. **Try console directly:** older/no-PIN configs give an open Python prompt → run `__import__('os').popen('id').read()`.
3. **Reconstruct the PIN** (Werkzeug PIN = hash of): `username` (process owner, e.g. from `/etc/passwd` or error leak), `modname` (`flask.app`), app class name (`Flask`/`DispatchingApp`), `getattr(app,'__file__',...)` abspath of `app.py`, and the MAC address as decimal (`/sys/class/net/<if>/address`) + machine-id (`/etc/machine-id` + `/proc/self/cgroup` first line, or `/etc/boot_id`). Leak these via a chained **LFI/path traversal/SSRF/`/proc` read**, then compute the PIN with the Werkzeug algorithm (public generator scripts). Note Werkzeug ≥2.0 switched the hash to SHA-1 — match the target's version.
4. **Unlock & exec:** submit the computed PIN on `/console`, then run Python → OS commands. Prove with a benign `id`/OAST, not a persistent shell.
## Modern / rare techniques
- **No PIN leak? Pair with any file-read primitive:** `php`/template LFI, actuator/heapdump, `/proc/self/environ`, SSRF-to-file (`file://`), or a traceback that already discloses the username and app path.
- **MAC/machine-id gotchas:** containers reuse predictable machine-ids; MAC may be `02:42:*` (Docker) → narrows brute space.
- The debugger also leaks source and local variables in tracebacks even before console access — report that as info disclosure if PIN not obtained.
## Bypass / evasion
Older Werkzeug (<0.11) has no PIN. If version differs, use the matching PIN algorithm (MD5 vs SHA-1). `${CLAUDE_PLUGIN_ROOT}/payloads/waf-bypass.md` not usually needed (direct endpoint).
## Escalation / chaining
Console RCE → reverse shell → `linux-privesc`; read secrets/`.env`/DB creds → `database-enumeration`, `cloud-pentest` (IMDS). Needs a leak primitive → chain `web-ssrf`/LFI/`deep-web-recon`.
## Backend & tooling
Preferred Kali path (native / WSL+Kali / Kali-SSH / Kali-MCP / HexStrike / Metasploit-MCP) or headless browser to drive `/console`. Public Werkzeug PIN generator for the computed hash. Burp for leak chaining. See `zazy-orchestrator`.
## Verification (background, before reporting)
Confirm code exec with a benign command and an OAST callback; reproduce the PIN computation deterministically. Report true positives only.
## Evidence
Screenshot/response of the debugger, the leaked PIN ingredients + source of each, the computed PIN, and a benign command result. Remediation: never run `debug=True`/Werkzeug debugger in production; set `PIN_DISABLED`? no — disable debug entirely, serve via WSGI (gunicorn/uWSGI), restrict `/console`.