# s0md3v/arjun architecture

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

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

## Overview

##### Project Type & Purpose
- Arjun is an open-source parameter discovery tool for web applications.
- Its main purpose is to enumerate HTTP parameters using various techniques (brute-force based on large wordlists, heuristic extraction, external payloads, etc.) and support different HTTP request types (GET, POST, POST-JSON, POST-XML).
- The tool supports importing targets from various sources and exporting results in multiple formats (BurpSuite, text, JSON).

##### Key Components from the File Structure
- arjun/__main__.py – This serves as the entry point for execution when the tool is run.
- arjun/core/ – Contains the core business logic and supporting modules responsible for:
- Parameter discovery logic (e.g., anomaly.py, bruter.py, prompt.py)
- Configuration management (config.py)
- HTTP request handling (requester.py)
- Logging or error handling (error_handler.py)
- Exporting and importing capabilities (exporter.py and importer.py).
- arjun/plugins/ – Implements additional extraction methods from various external sources (e.g., commoncrawl.py, heuristic.py, otx.py, wayback.py, wl.py). This indicates a plugin-based architecture allowing extensibility.
- arjun/db/ – Contains wordlists and parameter dictionaries (files like large.txt, medium.txt, small.txt, special.json) which serve as the data backbone for brute-forcing parameters.
- Other files such as setup.py, .travis.yml, and CHANGELOG.md indicate packaging, continuous integration, and version tracking.

##### Relationships & Interactions
- The entry point (__main__.py) triggers and orchestrates the workflow.
- Core modules collaborate to process a target URL: configuration is loaded, HTTP requests are constructed by the requester, and responses are analyzed (using anomaly detection and brute-force routines).
- The plugin sub-system provides alternate or complementary methods for parameter extraction from external resources—each plugin interacts with the core discovery flow.
- Data flow from reading parameter wordlists (from the DB folder) feeds into the scanning process.
- Exporter and importer modules handle data input/output interfacing with third-party tools like BurpSuite or raw text/JSON files.
- Error handling and utility modules support logging, user feedback, and clean termination.

##### Architectural Patterns and Principles
- Modular Design: Separating the tool into core logic, plugins, and data sources allows independent development and easier testing.
- Extensibility: A plugin architecture lets the core functionality be extended with new extraction methods.
- Clear Separation of Concerns: Config, request handling, error management, and data export/import are encapsulated in their own modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry & Setup
    CLI["CLI Entry (__main__.py)"]:::interface

    %% Core Processing Modules
    subgraph "Core Processing Modules"
        subgraph "Configuration & Setup"
            CFG["Config (config.py)"]:::core
            ERR["Error Handling (error_handler.py)"]:::core
        end
        subgraph "HTTP Handling"
            REQ["HTTP Request Handler (requester.py)"]:::core
        end
        subgraph "Parameter Discovery"
            ANO["Anomaly Detection (anomaly.py)"]:::core
            BRU["Bruter (bruter.py)"]:::core
            PRO["Prompt (prompt.py)"]:::core
        end
        subgraph "Helper & Utilities"
            UTL["Utilities (utils.py)"]:::core
            COL["Colors (colors.py)"]:::core
        end
        subgraph "Data I/O"
            IMP["Importer (importer.py)"]:::core
            EXP["Exporter (exporter.py)"]:::core
        end
    end

    %% Plugin Management
    subgraph "Plugin Management"
        CC["CommonCrawl Plugin (commoncrawl.py)"]:::plugin
        HEU["Heuristic Plugin (heuristic.py)"]:::plugin
        OTX["OTX Plugin (otx.py)"]:::plugin
        WAY["Wayback Plugin (wayback.py)"]:::plugin
        WL["WL Plugin (wl.py)"]:::plugin
    end

    %% Data Sources
    subgraph "Data Sources"
        DB["Wordlists & Dictionaries (db)"]:::data
    end

    %% Intermediate Results Node
    RES["Discovery Results"]:::core

    %% Connections
    CLI --> CFG
    CLI --> ERR
    CFG --> REQ
    ERR --> REQ
    REQ --> ANO
    REQ --> BRU
    REQ --> PRO
    DB --> BRU
    CC --> BRU
    HEU --> BRU
    OTX --> BRU
    WAY --> BRU
    WL --> BRU
    ANO --> RES
    BRU --> RES
    PRO --> RES
    RES --> IMP
    RES --> EXP

    %% Support from Helper & Utilities (dashed lines)
    UTL --- REQ
    COL --- ANO

    %% Click Events
    click CLI "https://github.com/s0md3v/arjun/blob/master/arjun/__main__.py"
    click CFG "https://github.com/s0md3v/arjun/blob/master/arjun/core/config.py"
    click ERR "https://github.com/s0md3v/arjun/blob/master/arjun/core/error_handler.py"
    click REQ "https://github.com/s0md3v/arjun/blob/master/arjun/core/requester.py"
    click ANO "https://github.com/s0md3v/arjun/blob/master/arjun/core/anomaly.py"
    click BRU "https://github.com/s0md3v/arjun/blob/master/arjun/core/bruter.py"
    click PRO "https://github.com/s0md3v/arjun/blob/master/arjun/core/prompt.py"
    click UTL "https://github.com/s0md3v/arjun/blob/master/arjun/core/utils.py"
    click COL "https://github.com/s0md3v/arjun/blob/master/arjun/core/colors.py"
    click IMP "https://github.com/s0md3v/arjun/blob/master/arjun/core/importer.py"
    click EXP "https://github.com/s0md3v/arjun/blob/master/arjun/core/exporter.py"
    click CC "https://github.com/s0md3v/arjun/blob/master/arjun/plugins/commoncrawl.py"
    click HEU "https://github.com/s0md3v/arjun/blob/master/arjun/plugins/heuristic.py"
    click OTX "https://github.com/s0md3v/arjun/blob/master/arjun/plugins/otx.py"
    click WAY "https://github.com/s0md3v/arjun/blob/master/arjun/plugins/wayback.py"
    click WL "https://github.com/s0md3v/arjun/blob/master/arjun/plugins/wl.py"
    click DB "https://github.com/s0md3v/arjun/tree/master/arjun/db"

    %% Styles
    classDef interface fill:#fceabb,stroke:#e48a1a,stroke-width:2px;
    classDef core fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef plugin fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px;
    classDef data fill:#f8bbd0,stroke:#ad1457,stroke-width:2px;
```
