# oaksat/dictionary-attack-demo architecture

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

- Interactive diagram: https://gitdiagram.com/oaksat/dictionary-attack-demo
- Repository: https://github.com/oaksat/dictionary-attack-demo

## Overview

This educational Flask demo exposes a vulnerable login API and two ways to try candidate passwords: a command-line script that sends HTTP requests, and a live server-side visual demo that streams results. The browser login page and welcome page are rendered by Flask. The credential store is a hard-coded in-memory mock. The live demo’s templates were not sampled, so their client-side behavior and any links between pages are not represented; documented capabilities and visible server-side calls inform the graph.

Main entry points: [`app/app.py`](https://github.com/oaksat/dictionary-attack-demo/blob/main/app/app.py) (Flask routes), [`demo.py`](https://github.com/oaksat/dictionary-attack-demo/blob/main/demo.py) (CLI attack), [`pass_strings.txt`](https://github.com/oaksat/dictionary-attack-demo/blob/main/pass_strings.txt) (Password list), [`app/templates/login.html`](https://github.com/oaksat/dictionary-attack-demo/blob/main/app/templates/login.html) (Login page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_login_page["Login page<br/>[login.html]"]
  node_welcome_page["Welcome page<br/>[welcome.html]"]
end

subgraph group_service["Login service"]
  node_flask_routes["Flask routes<br/>[app.py]"]
  node_login_api["Login API<br/>[app.py]"]
  node_credentials[("Mock credentials<br/>[app.py]")]
end

subgraph group_attacks["Attack demonstrations"]
  node_cli_attack["CLI attack<br/>[demo.py]"]
  node_live_attack["Live attack<br/>[app.py]"]
  node_password_list["Password list<br/>[pass_strings.txt]"]
end

node_visitor(("Visitor"))
node_browser(("Browser"))
node_http_service{{"Local HTTP service"}}

node_visitor -->|"uses"| node_browser
node_browser -->|"requests pages"| node_flask_routes
node_flask_routes -->|"renders"| node_login_page
node_flask_routes -->|"renders"| node_welcome_page
node_browser -.->|"submits login"| node_login_api
node_login_api -->|"checks credentials"| node_credentials
node_cli_attack -->|"loads candidates"| node_password_list
node_cli_attack -->|"posts attempts"| node_http_service
node_http_service -->|"routes requests"| node_login_api
node_live_attack -->|"reads candidates"| node_password_list
node_live_attack -->|"checks candidates"| node_credentials
node_flask_routes -->|"starts attack"| node_live_attack
node_live_attack -->|"streams results"| node_browser

click node_login_page "https://github.com/oaksat/dictionary-attack-demo/blob/main/app/templates/login.html"
click node_welcome_page "https://github.com/oaksat/dictionary-attack-demo/blob/main/app/templates/welcome.html"
click node_flask_routes "https://github.com/oaksat/dictionary-attack-demo/blob/main/app/app.py"
click node_login_api "https://github.com/oaksat/dictionary-attack-demo/blob/main/app/app.py"
click node_credentials "https://github.com/oaksat/dictionary-attack-demo/blob/main/app/app.py"
click node_cli_attack "https://github.com/oaksat/dictionary-attack-demo/blob/main/demo.py"
click node_live_attack "https://github.com/oaksat/dictionary-attack-demo/blob/main/app/app.py"
click node_password_list "https://github.com/oaksat/dictionary-attack-demo/blob/main/pass_strings.txt"

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_login_page,node_welcome_page,node_browser toneBlue
class node_flask_routes,node_login_api,node_credentials toneAmber
class node_cli_attack,node_live_attack,node_password_list toneMint
class node_visitor,node_http_service toneIndigo
```

## Components

### Web interface

- [Login page](https://github.com/oaksat/dictionary-attack-demo/blob/main/app/templates/login.html): `app/templates/login.html`
- [Welcome page](https://github.com/oaksat/dictionary-attack-demo/blob/main/app/templates/welcome.html): `app/templates/welcome.html`

### Login service

- [Flask routes](https://github.com/oaksat/dictionary-attack-demo/blob/main/app/app.py): `app/app.py`
- [Login API](https://github.com/oaksat/dictionary-attack-demo/blob/main/app/app.py): `app/app.py`
- [Mock credentials](https://github.com/oaksat/dictionary-attack-demo/blob/main/app/app.py): `app/app.py`

### Attack demonstrations

- [CLI attack](https://github.com/oaksat/dictionary-attack-demo/blob/main/demo.py): `demo.py`
- [Live attack](https://github.com/oaksat/dictionary-attack-demo/blob/main/app/app.py): `app/app.py`
- [Password list](https://github.com/oaksat/dictionary-attack-demo/blob/main/pass_strings.txt): `pass_strings.txt`

### Other components

- **Visitor**
- **Browser**
- **Local HTTP service**

## Connections

- Visitor → Browser: uses (evidence: `README.md`)
- Browser → Flask routes: requests pages (evidence: `README.md`)
- Flask routes → Login page: renders (evidence: `app/app.py`)
- Flask routes → Welcome page: renders (evidence: `app/app.py`)
- Browser → Login API: submits login
- Login API → Mock credentials: checks credentials (evidence: `app/app.py`)
- CLI attack → Password list: loads candidates (evidence: `demo.py`)
- CLI attack → Local HTTP service: posts attempts (evidence: `demo.py`)
- Local HTTP service → Login API: routes requests (evidence: `README.md`)
- Live attack → Password list: reads candidates (evidence: `app/app.py`)
- Live attack → Mock credentials: checks candidates (evidence: `app/app.py`)
- Flask routes → Live attack: starts attack (evidence: `app/app.py`)
- Live attack → Browser: streams results (evidence: `app/app.py`)
