How knowbe4/frieren-dast-ai works
Purpose and Entry Points
Frieren DAST-AI is a Python dynamic application security testing system: an HTTPS MITM proxy captures traffic, runs passive analysis, queues in-scope targets for active AI-guided testing, and presents findings through a local dashboard. Primary CLI entry is dast/cli.py; runtime composition is centered on dast/proxy/runner.py and dast/orchestrator.py. An optional Electron launcher starts the same backend from desktop/main.js.
Proxy, Capture, and Dashboard Boundary
The proxy terminates/intercepts HTTPS using a local CA, applies scope/bypass policy, and captures request/response history. The dashboard server exposes the UI and API/WebSocket-facing control plane; the browser UI is static JavaScript rather than a separate application backend.
• dast/proxy/proxy_server.py
• dast/proxy/cert_authority.py
• dast/proxy/dashboard_server.py
Captured traffic and scan state are held by proxy/session-layer stores, creating the boundary between live interception, manual tools (Repeater/Intruder), saved sessions, and scan execution.
• dast/proxy/intercept_store.py
• dast/proxy/session_store.py
• dast/proxy/scan_queue_state.py
Scan Pipeline and Orchestration
The main control flow is: intercepted in-scope traffic → passive scan and queue → orchestration/coordinator → selected active agents → validated findings → dashboard/report consumers. The attack engine executes requests/probes with concurrency and host safety controls, while the orchestrator coordinates lifecycle and result handling.
• dast/orchestrator.py
• dast/attack/engine.py
• dast/ai/coordinator.py
Passive checks are data-driven YAML rules, allowing security coverage additions without scanner-code changes. Active payload seeds and vulnerability knowledge are similarly separated from agent logic.
• dast/plugins/passive_scanner.py
• dast/passive_rules/
• dast/payloads/loader.py
AI Decision and Safety Layer
The coordinator uses a provider abstraction to plan agent selection, generate/adapt payloads, classify probes, analyze responses, and filter false positives. Provider support includes AWS Bedrock, Anthropic, and OpenAI-compatible APIs. Prompt safety and red-team validation are explicit gates around model-driven actions/findings.
• dast/ai/providers.py
• dast/ai/bedrock_client.py
• dast/ai/red_team.py
Vulnerability Agents
Specialized agents implement vulnerability-class probing, generally operating in parallel for an endpoint under coordinator selection. Coverage spans injection, authorization/session flaws, SSRF/file access, secrets, LLM endpoints, GraphQL, and framework-specific testing. Shared payload filtering and response-difference logic support consistent evidence decisions.
• dast/agents/xss_agent.py
• dast/agents/sqli_agent.py
• dast/agents/ssrf_agent.py
Discovery, Browser, and Application Context
Discovery expands the target model through crawling, JavaScript analysis, fingerprinting, OpenAPI probing, and traffic graph construction. Playwright-backed browser contexts support authenticated/manual browsing and browser-required confirmations. The resulting application/threat/service context feeds planning and cross-host testing.
• dast/discovery/engine.py
• dast/discovery/traffic_graph.py
• dast/browser/context_pool.py
External Interaction, Persistence, and Outputs
OOB testing integrates Interactsh; HackerOne material can be parsed, safety-checked, validated, and turned into evidence. Sessions persist locally under the user home directory, while findings can be exported, including SARIF. Runtime dependencies include Python, Playwright/Chromium, optional Electron/Node.js, and configured LLM/cloud credentials.
• dast/utils/interactsh.py
• dast/hackerone/validator.py
• dast/report/sarif.py
Main entry points: orchestrator.py Scan orchestrator · coordinator.py AI coordinator · runner.py Proxy runner · session_store.py Capture & session state
Components 22
Runtime & Control
- CLI
dast/cli.py - Electron launcher · Starts the same Python backend.
desktop/main.js - Proxy runner
dast/proxy/runner.py
Proxy & Dashboard
- HTTPS MITM proxy · Applies scope and bypass policy while capturing traffic.
dast/proxy/proxy_server.py - Local certificate authority
dast/proxy/cert_authority.py - Dashboard server
dast/proxy/dashboard_server.py - Capture & session state · Shared history, saved sessions, and scan queue state.
dast/proxy/session_store.py
Scan Pipeline
- Passive scanner
dast/plugins/passive_scanner.py - Passive rules · Data-driven passive security coverage.
- Scan orchestrator · Coordinates queued scans and result handling.
dast/orchestrator.py - Attack engine · Enforces concurrency and host safety controls.
dast/attack/engine.py - Payload knowledge
dast/payloads/loader.py - Vulnerability agents · Parallel XSS, SQLi, SSRF, and other vulnerability-class testing.
dast/agents/xss_agent.py
AI Decision Layer
- AI coordinator · Plans agents and analyzes probe results.
dast/ai/coordinator.py - LLM providers · Supports Bedrock, Anthropic, and OpenAI-compatible APIs.
dast/ai/providers.py - Prompt safety gate · Gates model-driven actions and findings.
dast/ai/red_team.py
Discovery & Context
- Discovery engine · Crawls, analyzes JavaScript, fingerprints, and probes APIs.
dast/discovery/engine.py - Application traffic graph
dast/discovery/traffic_graph.py - Browser contexts · Supports authenticated and browser-required flows.
dast/browser/context_pool.py
External & Outputs
- Interactsh
dast/utils/interactsh.py - SARIF export
dast/report/sarif.py - HackerOne validator · Safety-checks imported HackerOne material.
dast/hackerone/validator.py
Connections 26
- CLI → Proxy runner: starts
- Electron launcher → Proxy runner: starts backend
- Proxy runner → HTTPS MITM proxy: runs
- Proxy runner → Dashboard server: serves
- HTTPS MITM proxy → Local certificate authority: uses for HTTPS interception
- HTTPS MITM proxy → Capture & session state: captures traffic
- Dashboard server → Capture & session state: controls and reads
- Capture & session state → Passive scanner: in-scope traffic
- Passive rules → Passive scanner: defines checks
- Passive scanner → Scan orchestrator: queues targets
- Capture & session state → Scan orchestrator: scan state
- Scan orchestrator → AI coordinator: requests plan
- Discovery engine → Application traffic graph: builds
- Browser contexts → Discovery engine: authenticated browsing
- Application traffic graph → AI coordinator: application context
- AI coordinator → LLM providers: model decisions
- AI coordinator → Prompt safety gate: validates AI actions
- Prompt safety gate → Vulnerability agents: approved probe plan
- AI coordinator → Vulnerability agents: selects agents
- Payload knowledge → Vulnerability agents: payload seeds
- Vulnerability agents → Attack engine: executes probes
- Attack engine → Interactsh: OOB callbacks
- Attack engine → Scan orchestrator: validated results
- Scan orchestrator → Dashboard server: findings and progress
- Scan orchestrator → SARIF export: exports findings
- HackerOne validator → Scan orchestrator: validated evidence