# epsylon/ufonet architecture

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

- Interactive diagram: https://gitdiagram.com/epsylon/ufonet
- Repository: https://github.com/epsylon/ufonet

## Overview

##### Main Components
- Core Engine: At the heart of UFONet lies the core module (core/main.py), which likely acts as the entry point and orchestrator.
- Botnet Files/Data: The “botnet” directory contains several text files that likely provide lists or instructions for botnet operations.
- Tools: Under core/tools, various helper modules (e.g., crypter.py, inspector.py, ufoscan.py) support additional functionality such as encryption and scanning.
- Web GUI/Interface: With files like core/webgui.py and a range of JavaScript (JS) assets in core/js (including cluster and leaflet libraries) plus image assets, there is a clear separation for user interface functionality.
- Data and Maps: The “data” folder holds configuration and runtime text files (like globalnet.txt, grid.txt, etc.) and the “maps” folder contains GeoIP and location data files, likely for geolocation functionalities integrated into the UI.
- Documentation: The “docs” directory holds licenses, FAQs, and various READMEs, indicating clear separation for supporting documents.

##### Relationships and Interactions
- The Core Engine initializes the system, loads configuration files (from the data directory), and then dispatches commands to the proper subcomponents.
- Attack Modules are “plug-in” components invoked by the core engine when a particular attack mode is chosen.
- The Botnet files provide data for orchestrating distributed attack vectors, interfacing with the modules within the core.
- The Web GUI module (using both Python and JavaScript components) serves as an interface between the operator and the core functionality.
- The Tools provide auxiliary functionality (e.g., encryption, scanning), and they may be called by either the core engine or the attack modules.
- The Maps and clustering libraries (using Leaflet and MarkerCluster JS libraries) support geo-distribution mapping of nodes or targets; information likely flows between core (or botnet) and the UI.

##### Architectural Patterns/Design Principles
- Modularity: Each attack or supportive tool resides in its own module, making it easy to extend functionalities.
- Separation of Concerns: The system clearly separates core engine operations, attack logic (mods), presentation (webgui and JS assets), and external data (botnet, data, maps).
- Pluggable Architecture: With a wide range of modules available under mods and tools, the system supports pluggable techniques.
- Decentralized/P2P Communication: The README highlights a P2P and cryptographic design aimed at enabling direct client/server connections without a central node.

##### Relevant Technologies and Frameworks
- Python is the primary language, with scripts in the core/ directory orchestrating app logic.
- JavaScript libraries such as Leaflet, Raphael, and the MarkerCluster plugin are used for web-based mapping and data visualization.
- External databases or file-based configurations (text files in botnet and data directories) are used instead of a conventional relational database.
- Cryptographic libraries (as indicated by the installation instructions using python3-cryptography and pycryptodomex) ensure secure operations.
- The inclusion of a web GUI indicates probable use of lightweight web servers and asynchronous loading of assets like CSS and JavaScript.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Operator"]:::operator
    B["Web GUI/User Interface"]:::ui
    B2["JS Assets"]:::ui
    C["Core Engine"]:::core
    D["Attack Modules"]:::modules
    E["Supporting Tools"]:::tools
    F["Botnet Files/Data"]:::data
    G["Data/Configuration Sources"]:::data
    H["GeoIP/Maps Components"]:::maps
    I["Documentation"]:::docs

    %% Relationships
    A -->|"sendscommands"| B
    B -->|"relayscommands"| C
    B -->|"manages"| B2
    C -->|"invokes"| D
    C -->|"calls"| E
    G -->|"loadsconfig"| C
    F -->|"providesbotinfo"| C
    H -->|"providesgeodata"| C
    I ---|"supports"| C
    C -->|"P2P/Encrypted"| F

    %% Click Events
    click C "https://github.com/epsylon/ufonet/blob/master/core/main.py"
    click D "https://github.com/epsylon/ufonet/tree/master/core/mods/"
    click E "https://github.com/epsylon/ufonet/tree/master/core/tools/"
    click F "https://github.com/epsylon/ufonet/tree/master/botnet/"
    click B "https://github.com/epsylon/ufonet/blob/master/core/webgui.py"
    click B2 "https://github.com/epsylon/ufonet/tree/master/core/js/"
    click G "https://github.com/epsylon/ufonet/tree/master/data/"
    click H "https://github.com/epsylon/ufonet/tree/master/maps/"
    click I "https://github.com/epsylon/ufonet/tree/master/docs/"

    %% Styles
    classDef operator fill:#f4d03f,stroke:#333,stroke-width:2px;
    classDef ui fill:#fad7a0,stroke:#333,stroke-width:2px;
    classDef core fill:#aed6f1,stroke:#333,stroke-width:2px;
    classDef modules fill:#d5f5e3,stroke:#333,stroke-width:2px;
    classDef tools fill:#e8daef,stroke:#333,stroke-width:2px;
    classDef data fill:#fcf3cf,stroke:#333,stroke-width:2px;
    classDef maps fill:#d6eaf8,stroke:#333,stroke-width:2px;
    classDef docs fill:#f5b7b1,stroke:#333,stroke-width:2px;
```
