# y-lebid/mini-web-scanner architecture

> Architecture diagram of the GitHub repository y-lebid/mini-web-scanner, 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/y-lebid/mini-web-scanner
- Repository: https://github.com/y-lebid/mini-web-scanner

## Overview

Mini Web Vulnerability Scanner is a single-file Python CLI for auditing a user-supplied website. Its main workflow normalizes the target URL, checks security headers, then probes common sensitive paths if the header request succeeds; it displays results and optionally writes JSON or text reports. The graph separates the two scan stages, shared request-header behavior, terminal interaction, and reporting. All implementation nodes point to scanner.py; relationships are supported by its excerpt, while the README documents the report formats and major scan capabilities.

Main entry points: [`scanner.py`](https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py) (Scan workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflow"]
  node_main["Scan workflow<br/>[scanner.py]"]
  node_banner["Startup banner<br/>[scanner.py]"]
  node_url["URL normalization<br/>[scanner.py]"]
  node_terminal["Terminal output<br/>[scanner.py]"]
end

subgraph group_scans["Security scans"]
  node_headers["Header analysis<br/>[scanner.py]"]
  node_files["Sensitive path scan<br/>[scanner.py]"]
  node_agents["Random User-Agent<br/>[scanner.py]"]
end

subgraph group_reports["Results and reports"]
  node_choice["Save choice prompt<br/>[scanner.py]"]
  node_json["JSON report<br/>[scanner.py]"]
  node_text["Text report<br/>[scanner.py]"]
end

node_user(("Operator"))
node_target(("Target website"))

node_user -->|"provides URL"| node_main
node_main -->|"displays"| node_banner
node_main -->|"normalizes"| node_url
node_main -->|"checks headers"| node_headers
node_main -->|"prints results"| node_terminal
node_main -->|"scans on success"| node_files
node_headers -->|"gets headers"| node_agents
node_files -->|"gets headers"| node_agents
node_headers -->|"requests headers"| node_target
node_files -->|"probes paths"| node_target
node_main -->|"asks save choice"| node_choice
node_user -->|"selects format"| node_choice
node_main -->|"writes when selected"| node_json
node_main -->|"writes when selected"| node_text

click node_main "https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py"
click node_banner "https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py"
click node_url "https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py"
click node_terminal "https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py"
click node_headers "https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py"
click node_files "https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py"
click node_agents "https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py"
click node_choice "https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py"
click node_json "https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py"
click node_text "https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.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_main,node_banner,node_url,node_terminal toneBlue
class node_headers,node_files,node_agents toneAmber
class node_choice,node_json,node_text toneMint
class node_user,node_target toneIndigo
```

## Components

### CLI workflow

- [Scan workflow](https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py): `scanner.py`
- [Startup banner](https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py): `scanner.py`
- [URL normalization](https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py): `scanner.py`
- [Terminal output](https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py): `scanner.py`

### Security scans

- [Header analysis](https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py): `scanner.py`
- [Sensitive path scan](https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py): `scanner.py`
- [Random User-Agent](https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py): `scanner.py`

### Results and reports

- [Save choice prompt](https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py): `scanner.py`
- [JSON report](https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py): `scanner.py`
- [Text report](https://github.com/y-lebid/mini-web-scanner/blob/master/scanner.py): `scanner.py`

### Other components

- **Operator**
- **Target website**

## Connections

- Operator → Scan workflow: provides URL (evidence: `scanner.py`)
- Scan workflow → Startup banner: displays (evidence: `scanner.py`)
- Scan workflow → URL normalization: normalizes (evidence: `scanner.py`)
- Scan workflow → Header analysis: checks headers (evidence: `scanner.py`)
- Scan workflow → Terminal output: prints results (evidence: `scanner.py`)
- Scan workflow → Sensitive path scan: scans on success (evidence: `scanner.py`)
- Header analysis → Random User-Agent: gets headers (evidence: `scanner.py`)
- Sensitive path scan → Random User-Agent: gets headers (evidence: `scanner.py`)
- Header analysis → Target website: requests headers (evidence: `scanner.py`)
- Sensitive path scan → Target website: probes paths (evidence: `scanner.py`)
- Scan workflow → Save choice prompt: asks save choice (evidence: `scanner.py`)
- Operator → Save choice prompt: selects format (evidence: `scanner.py`)
- Scan workflow → JSON report: writes when selected (evidence: `scanner.py`)
- Scan workflow → Text report: writes when selected (evidence: `scanner.py`)
