# fluxionnetwork/fluxion architecture

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

- Interactive diagram: https://gitdiagram.com/fluxionnetwork/fluxion
- Repository: https://github.com/fluxionnetwork/fluxion

## Overview

##### Project type and purpose
- Fluxion is an open-source security auditing and social-engineering tool for executing MITM WPA/WPA2 attacks (phishing).
- It is a purely script-based CLI application (Bash) that orchestrates external wireless-attack utilities (aircrack-ng suite, hostapd, dnsmasq, iptables, etc.) and serves a captive-portal web interface to capture WPA keys.

##### File structure
- Top-level components:
– fluxion.sh: the main orchestrator
– bin/arch: packaging script for Arch Linux
– docs/man, misc: documentation & helper scripts
– language/: localization files for user prompts
– lib/: shared utility modules (ArrayUtils, IOUtils, InstallerUtils, SandboxUtils, InterfaceUtils, etc.)
– lib/installer: multiple package‐manager installers (apt, yum, pacman, etc.)
– attacks/: modular attack definitions
· Handshake Snooper: capture handshake
· Captive Portal: fake AP + web server + DNS + deauth jammer
– scripts/: smaller helper scripts (debug, diagnostics, preferences)
– preferences/: user’s stored configuration
- Patterns: modular, pluggable attacks under attacks/, shared helpers under lib/, single CLI entrypoint.

##### README
- Describes attack workflow:
1. Scan network
2. Handshake Snooper → capture handshake
3. Captive Portal → spawn rogue AP, DNS server, web server, deauth jammer
4. Validate submitted keys against captured handshake; log correct key
- Lists external dependencies: Kali Linux, Linux networking tools, aircrack-ng, hostapd, dnsmasq, etc.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interaction
    User["User"]:::external
    User -->|"invokes"| CLI

    %% Core Orchestration Layer
    subgraph "Core Orchestration"
        CLI["CLI Orchestrator\n(fluxion.sh)"]:::core
        ModuleLoader["Module Loader / Localization"]:::core
        Utils["Utility Library\n(lib/)"]:::utils
        Installer["Installer Module\n(lib/installer)"]:::utils
        Sandbox["Sandbox & Env Utils\n(lib/SandboxUtils.sh)"]:::utils
    end

    %% Attack Modules
    subgraph "Attack Modules"
        HS["Handshake Snooper Module"]:::attack
        CP["Captive Portal Module"]:::attack
    end

    %% External Tools & Network Services
    subgraph "External Tools & Network"
        Airodump["airodump-ng\n(handshake capture)"]:::external
        APMgmt["AP Management\n(airbase-ng, hostapd)"]:::external
        DnsService["DNS Redirect Service\n(dnsmasq)"]:::service
        WebSrv["Captive-Portal Web Server\n(PHP/Python)"]:::service
        Jammer["Jammer Process\n(aireplay-ng)"]:::external
    end

    %% Data Stores & Config
    subgraph "Data Stores & Config"
        HandshakeFile["Handshake File Store"]:::storage
        Logs["Key Logs"]:::storage
        Preferences["User Preferences"]:::storage
    end

    %% Core flows
    CLI -->|"load modules"| ModuleLoader
    CLI -->|"calls utilities"| Utils
    CLI -->|"checks/install deps"| Installer
    CLI -->|"setup sandbox"| Sandbox

    %% Attack invocation
    CLI -->|"select attack"| HS
    CLI -->|"select attack"| CP
    ModuleLoader --> HS
    ModuleLoader --> CP
    Utils --> HS
    Utils --> CP

    %% Handshake Snooper Flow
    HS -->|"1. start monitor"| Airodump
    Airodump -->|"–write handshake.cap"| HandshakeFile
    HandshakeFile -.->|"2. artifact"| HS

    %% Captive Portal Flow
    CP -->|"spawn AP"| APMgmt
    CP -->|"start DNS"| DnsService
    CP -->|"launch web server"| WebSrv
    CP -->|"start deauth"| Jammer

    WebSrv -->|"credentials submission"| Utils
    Utils -->|"validate vs handshake"| HandshakeFile
    Utils -->|"log correct key"| Logs
    Logs -.->|"teardown"| CLI

    %% Preferences
    CLI --> Preferences

    %% Click Events
    click CLI "https://github.com/fluxionnetwork/fluxion/blob/master/fluxion.sh"
    click ModuleLoader "https://github.com/fluxionnetwork/fluxion/tree/master/language/"
    click Utils "https://github.com/fluxionnetwork/fluxion/tree/master/lib/"
    click Installer "https://github.com/fluxionnetwork/fluxion/blob/master/lib/installer/InstallerUtils.sh"
    click Sandbox "https://github.com/fluxionnetwork/fluxion/blob/master/lib/SandboxUtils.sh"
    click HS "https://github.com/fluxionnetwork/fluxion/blob/master/attacks/Handshake Snooper/attack.sh"
    click CP "https://github.com/fluxionnetwork/fluxion/blob/master/attacks/Captive Portal/attack.sh"
    click Airodump "https://github.com/fluxionnetwork/fluxion/blob/master/lib/ap/airbase-ng.sh"
    click APMgmt "https://github.com/fluxionnetwork/fluxion/blob/master/lib/ap/hostapd.sh"
    click DnsService "https://github.com/fluxionnetwork/fluxion/blob/master/attacks/Captive Portal/attack.sh"
    click WebSrv "https://github.com/fluxionnetwork/fluxion/blob/master/attacks/Captive Portal/lib/authenticator.php"
    click Jammer "https://github.com/fluxionnetwork/fluxion/blob/master/attacks/Captive Portal/deauth-ng.py"
    click Preferences "https://github.com/fluxionnetwork/fluxion/tree/master/preferences/"
    
    %% Styles
    classDef core fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef attack fill:#d4edda,stroke:#333,stroke-width:1px
    classDef external fill:#fff3cd,stroke:#333,stroke-width:1px
    classDef utils fill:#e2e3e5,stroke:#333,stroke-width:1px
    classDef service fill:#f8d7da,stroke:#333,stroke-width:1px
    classDef storage fill:#e2e3e5,stroke:#333,stroke-width:1px
    classDef external external
    class User external
```
