# mandal-suman/mandora architecture

> Architecture diagram of the GitHub repository mandal-suman/mandora, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mandal-suman/mandora
- Repository: https://github.com/mandal-suman/mandora

## Overview

##### Project Type & Purpose
- MANDORA is a standalone CLI tool for directory bruteforcing and WAF detection.
- It’s not a web app or service; it’s a command-line Python application that reads wordlists, scans a target URL up to four levels deep, detects WAFs, and writes results to disk.

##### Key Components
- **CLI (mandora.py):** User interface for entering target URL and scan depth, orchestrates the scan.
- **Core Modules (core/scanner.py & core/waf_detector.py):**
- `waf_detector` wraps the `wafw00f` library to detect Web Application Firewalls.
- `scanner` reads the wordlist and issues HTTP requests to discover directories.
- **Wordlist Data (wordlists/wordlists.txt):** Source of directory names to test.
- **Output Store (output/…):** Filesystem directories and text files capturing scan results and summary.
- **External Service:** The target web server (HTTP) and the `wafw00f` detection engine.

##### Relationships & Data Flow
1. **CLI** invokes → **WAF Detector** (queries `wafw00f`)
2. **CLI** then invokes → **Scanner** (reads wordlist, issues HTTP requests to target)
3. **Scanner** writes → **Output** folder structure
4. **Scanner** and **WAF Detector** both interact with the **External Target** (HTTP endpoint)

##### Emphasize
- Clear component labels

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Internal CLI
    CLI["CLI (mandora.py)"]:::internal

    %% Core Modules
    subgraph Core ["Core Modules"]
        direction TB
        Detector["WAF Detector"]:::internal
        Scanner["Scanner"]:::internal
    end
    style Core stroke-dasharray:5,5

    %% Data Sources and Outputs
    Wordlist[(Wordlist)]:::data
    Output[(Output Directory)]:::data

    %% External Entities
    ExternalTarget["Target Server (HTTP)"]:::external
    Wafw00f["wafw00f Engine"]:::external

    %% Relationships
    CLI -->|"invoke detection"| Detector
    CLI -->|"invoke scanning"| Scanner
    Detector -->|"query detection"| Wafw00f
    Detector -->|"HTTP request"| ExternalTarget
    Scanner -->|"Read wordlist"| Wordlist
    Scanner -->|"HTTP requests"| ExternalTarget
    Scanner -->|"Write results"| Output

    %% Click Events
    click CLI "https://github.com/mandal-suman/mandora/blob/main/mandora.py"
    click Scanner "https://github.com/mandal-suman/mandora/blob/main/core/scanner.py"
    click Detector "https://github.com/mandal-suman/mandora/blob/main/core/waf_detector.py"
    click Wordlist "https://github.com/mandal-suman/mandora/blob/main/wordlists/wordlists.txt"

    %% Styles
    classDef internal fill:#cfe2ff,stroke:#084b8a,stroke-width:1px
    classDef data fill:#d1e7dd,stroke:#0f5132,stroke-width:1px,stroke-dasharray: 2 2
    classDef external fill:#f8d7da,stroke:#842029,stroke-width:1px,stroke-dasharray: 2 2
```
