# s0md3v/bolt architecture

> Architecture diagram of the GitHub repository s0md3v/bolt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/s0md3v/bolt
- Repository: https://github.com/s0md3v/bolt

## Overview

Bolt is a command-line CSRF scanner. Its main workflow crawls a target, evaluates discovered forms and tokens, compares tokens for replay or similarity signals, observes token generation under concurrent requests, actively probes protection, and analyzes token randomness. The CLI coordinates the scan; crawling, HTTP access, form parsing, and token-analysis helpers provide internal layers. Several phase relationships are documented in the README, while source excerpts show selected helper calls; unsampled implementation details are not inferred.

Main entry points: [`bolt.py`](https://github.com/s0md3v/bolt/blob/master/bolt.py) (Scan coordinator), [`core/photon.py`](https://github.com/s0md3v/bolt/blob/master/core/photon.py) (Site crawling), [`core/requester.py`](https://github.com/s0md3v/bolt/blob/master/core/requester.py) (HTTP requests), [`core/evaluate.py`](https://github.com/s0md3v/bolt/blob/master/core/evaluate.py) (Form evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scan["Scan workflow"]
  node_cli["Scan coordinator<br/>[bolt.py]"]
  node_crawlstage["Site crawling<br/>[photon.py]"]
  node_evaluation["Form evaluation<br/>[evaluate.py]"]
  node_comparison["Token comparison<br/>[bolt.py]"]
  node_observation["Token observation<br/>[bolt.py]"]
  node_active["Active protection tests<br/>[bolt.py]"]
  node_analysis["Randomness analysis<br/>[entropy.py]"]
end

subgraph group_crawl["Crawling and forms"]
  node_http["HTTP requests<br/>[requester.py]"]
  node_formparser["HTML form parser<br/>[zetanize.py]"]
  node_formdata["Test form data<br/>[datanize.py]"]
end

subgraph group_checks["Token checks"]
  node_tokenedit["Token mutation<br/>[tweaker.py]"]
  node_tokenpatterns["Hash patterns<br/>[hashes.json]"]
end

subgraph group_support["Shared support"]
  node_tokenconfig["Token rules<br/>[config.py]"]
  node_helpers["Token utilities<br/>[utils.py]"]
  node_prompt["Header input<br/>[prompt.py]"]
  node_crawlutils["Crawl URL helpers<br/>[utils.py]"]
end

node_user(("Scanner user"))
node_target(("Target website"))

node_user -->|"starts scan"| node_cli
node_cli -->|"crawls target"| node_crawlstage
node_crawlstage -->|"requests pages"| node_target
node_crawlstage -->|"fetches pages"| node_http
node_crawlstage -->|"parses forms"| node_formparser
node_crawlstage -->|"normalizes URLs"| node_crawlutils
node_cli -->|"evaluates forms"| node_evaluation
node_cli -->|"compares tokens"| node_comparison
node_comparison -->|"matches patterns"| node_tokenpatterns
node_cli -->|"observes generation"| node_observation
node_cli -->|"tests protection"| node_active
node_active -->|"prepares form data"| node_formdata
node_active -->|"mutates tokens"| node_tokenedit
node_active -->|"submits probes"| node_http
node_cli -->|"analyzes tokens"| node_analysis
node_formparser -->|"parses responses"| node_target
node_formdata -->|"uses token rules"| node_tokenconfig
node_evaluation -->|"checks strength"| node_helpers
node_tokenedit -->|"uses token pattern"| node_tokenconfig
node_http -->|"sends requests"| node_target
node_prompt -->|"supplies headers"| node_cli

click node_cli "https://github.com/s0md3v/bolt/blob/master/bolt.py"
click node_crawlstage "https://github.com/s0md3v/bolt/blob/master/core/photon.py"
click node_evaluation "https://github.com/s0md3v/bolt/blob/master/core/evaluate.py"
click node_comparison "https://github.com/s0md3v/bolt/blob/master/bolt.py"
click node_observation "https://github.com/s0md3v/bolt/blob/master/bolt.py"
click node_active "https://github.com/s0md3v/bolt/blob/master/bolt.py"
click node_analysis "https://github.com/s0md3v/bolt/blob/master/core/entropy.py"
click node_http "https://github.com/s0md3v/bolt/blob/master/core/requester.py"
click node_formparser "https://github.com/s0md3v/bolt/blob/master/core/zetanize.py"
click node_formdata "https://github.com/s0md3v/bolt/blob/master/core/datanize.py"
click node_tokenedit "https://github.com/s0md3v/bolt/blob/master/core/tweaker.py"
click node_tokenpatterns "https://github.com/s0md3v/bolt/blob/master/db/hashes.json"
click node_tokenconfig "https://github.com/s0md3v/bolt/blob/master/core/config.py"
click node_helpers "https://github.com/s0md3v/bolt/blob/master/core/utils.py"
click node_prompt "https://github.com/s0md3v/bolt/blob/master/core/prompt.py"
click node_crawlutils "https://github.com/s0md3v/bolt/blob/master/core/utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_crawlstage,node_evaluation,node_comparison,node_observation,node_active,node_analysis,node_user toneBlue
class node_http,node_formparser,node_formdata toneAmber
class node_tokenedit,node_tokenpatterns toneMint
class node_tokenconfig,node_helpers,node_prompt,node_crawlutils toneRose
class node_target toneIndigo
```

## Components

### Scan workflow

- [Scan coordinator](https://github.com/s0md3v/bolt/blob/master/bolt.py): `bolt.py`
- [Site crawling](https://github.com/s0md3v/bolt/blob/master/core/photon.py): `core/photon.py`
- [Form evaluation](https://github.com/s0md3v/bolt/blob/master/core/evaluate.py): `core/evaluate.py`
- [Token comparison](https://github.com/s0md3v/bolt/blob/master/bolt.py): `bolt.py`
- [Token observation](https://github.com/s0md3v/bolt/blob/master/bolt.py): `bolt.py`
- [Active protection tests](https://github.com/s0md3v/bolt/blob/master/bolt.py): `bolt.py`
- [Randomness analysis](https://github.com/s0md3v/bolt/blob/master/core/entropy.py): `core/entropy.py`

### Crawling and forms

- [HTTP requests](https://github.com/s0md3v/bolt/blob/master/core/requester.py): `core/requester.py`
- [HTML form parser](https://github.com/s0md3v/bolt/blob/master/core/zetanize.py): `core/zetanize.py`
- [Test form data](https://github.com/s0md3v/bolt/blob/master/core/datanize.py): `core/datanize.py`

### Token checks

- [Token mutation](https://github.com/s0md3v/bolt/blob/master/core/tweaker.py): `core/tweaker.py`
- [Hash patterns](https://github.com/s0md3v/bolt/blob/master/db/hashes.json): `db/hashes.json`

### Shared support

- [Token rules](https://github.com/s0md3v/bolt/blob/master/core/config.py): `core/config.py`
- [Token utilities](https://github.com/s0md3v/bolt/blob/master/core/utils.py): `core/utils.py`
- [Header input](https://github.com/s0md3v/bolt/blob/master/core/prompt.py): `core/prompt.py`
- [Crawl URL helpers](https://github.com/s0md3v/bolt/blob/master/core/utils.py): `core/utils.py`

### Other components

- **Scanner user**
- **Target website**

## Connections

- Scanner user → Scan coordinator: starts scan (evidence: `README.md`)
- Scan coordinator → Site crawling: crawls target (evidence: `README.md`)
- Site crawling → Target website: requests pages (evidence: `core/photon.py`)
- Site crawling → HTTP requests: fetches pages (evidence: `core/photon.py`)
- Site crawling → HTML form parser: parses forms (evidence: `core/photon.py`)
- Site crawling → Crawl URL helpers: normalizes URLs (evidence: `core/photon.py`)
- Scan coordinator → Form evaluation: evaluates forms (evidence: `README.md`)
- Scan coordinator → Token comparison: compares tokens (evidence: `README.md`)
- Token comparison → Hash patterns: matches patterns (evidence: `bolt.py`)
- Scan coordinator → Token observation: observes generation (evidence: `README.md`)
- Scan coordinator → Active protection tests: tests protection (evidence: `README.md`)
- Active protection tests → Test form data: prepares form data (evidence: `bolt.py`)
- Active protection tests → Token mutation: mutates tokens (evidence: `bolt.py`)
- Active protection tests → HTTP requests: submits probes (evidence: `bolt.py`)
- Scan coordinator → Randomness analysis: analyzes tokens (evidence: `README.md`)
- HTML form parser → Target website: parses responses
- Test form data → Token rules: uses token rules (evidence: `core/datanize.py`)
- Form evaluation → Token utilities: checks strength (evidence: `core/evaluate.py`)
- Token mutation → Token rules: uses token pattern (evidence: `core/tweaker.py`)
- HTTP requests → Target website: sends requests (evidence: `core/requester.py`)
- Header input → Scan coordinator: supplies headers (evidence: `bolt.py`)
