# manisso/fsociety architecture

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

- Interactive diagram: https://gitdiagram.com/manisso/fsociety
- Repository: https://github.com/manisso/fsociety

## Overview

##### Project type and purpose
- This is a CLI-based penetration-testing framework aggregator (“Fsociety Hacking Tools Pack”) written in Python 2.7.
- It provides a unified menu (fsociety.py) to launch dozens of third-party security tools (nmap, sqlmap, Reaver, etc.).
- It can be installed via install.sh, packaged as a Snap, or run inside Docker (Dockerfile + docker-compose.yml).

##### File structure
- Top-level scripts
- fsociety.py – the main menu/CLI entry point
- fsociety.cfg – configuration file (settings, tool paths)
- install.sh / update.sh / uninstall – installation lifecycle scripts
- Containerization/packaging
- Dockerfile + docker-compose.yml – build and run inside a container
- snap/snapcraft.yaml – Snap package metadata
- Documentation
- docs/ – static site (HTML/CSS/fonts) for project docs
- CI and contribution
- CODE_OF_CONDUCT.md, CONTRIBUTING.md, ISSUE_TEMPLATE.md
- LICENSE, .gitignore

##### README for additional insights
- Lists categories of tools (Information-Gathering, Password Attacks, Wireless, Exploitation, etc.)
- Describes install options (native, Termux, Docker, Snap)
- No internal database or web API – strictly a CLI wrapper for external binaries

##### Main components
a. User Interface Layer
- Terminal / Shell
- fsociety.py (CLI menu & input parser)
b. Configuration Layer
- fsociety.cfg (loads settings: tool paths, flags)
- Environment variables (optional overrides)
c. Dispatcher / Core Logic
- Menu engine (select category → tool module)
- Tool wrappers (Python modules or inline calls that invoke external commands)
d. External Tools Layer
- Third-party executables: nmap, sqlmap, reaver, etc.
- System dependencies (Python 2.7 runtime)
e. Packaging & Deployment
- Native installer (install.sh script)
- Docker container (Dockerfile → image, docker-compose.yml)
- Snap package (snapcraft.yaml)
f. Documentation Site (auxiliary)
- docs/index.html + static assets

##### Relationships and interactions
- User → (enters commands) → fsociety.py
- fsociety.py → (reads) → fsociety.cfg
- fsociety.py → (invokes) → dispatcher/core logic
- Dispatcher → (spawns) → tool wrappers (Python subprocess)
- Tool wrappers → (executes) → external tool binaries → (returns) → stdout/stderr
- fsociety.py → (formats & displays) → results in terminal
- Installer scripts → (copy files, set permissions, configure environment) → Local host
- Dockerfile → (builds) → Container image embedding code + Python runtime
- Snapcraft.yaml → (packages) → Snap

##### Architectural patterns and design principles
- Modular design: CLI core separated from tool wrappers
- Adapter/Facade pattern: each external tool accessed via a uniform interface
- Single responsibility: installer scripts handle installation, Dockerfile handles containerization, Snapcraft handles packaging
- Configuration-driven: fsociety.cfg abstracts tool paths & flags

- Clear, textual labels (fsociety.py, fsociety.cfg, install.sh, Dockerfile, snapcraft.yaml)
- Arrowheads on each connector to denote invocation or data flow
- Notes on runtime environment (Python 2.7 interpreter, OS support: Linux, macOS, Windows, Android/Termux)

##### Detail without over-splitting
- Every deployment path (native, Docker, Snap)
- Installer scripts as orchestrators that invoke filesystem changes and dependencies

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    User["User (Terminal)"]:::external
    CLI["fsociety.py\n(CLI Entry Point)"]:::logical
    CFG["fsociety.cfg"]:::logical

    User -->|"enters commands"| CLI
    CLI -->|"reads config"| CFG

    %% Core Logic and Dispatcher
    Dispatcher["Dispatcher / Core Logic\n(Menu Engine & Tool Wrappers)"]:::logical
    CLI -->|"invokes"| Dispatcher

    %% Tools Library Cluster
    subgraph "Tools Library" 
        direction TB
        IG["Information-Gathering Tools\n(nmap, etc.)"]:::external
        PA["Password Attack Tools\n(sqlmap, etc.)"]:::external
        WIRE["Wireless Tools\n(reaver, etc.)"]:::external
        EXP["Exploitation Tools\n(...)"]:::external
    end
    Dispatcher -->|"spawns subprocess"| IG
    Dispatcher -->|"spawns subprocess"| PA
    Dispatcher -->|"spawns subprocess"| WIRE
    Dispatcher -->|"spawns subprocess"| EXP
    IG -->|"stdout/stderr"| Dispatcher
    PA -->|"stdout/stderr"| Dispatcher
    WIRE -->|"stdout/stderr"| Dispatcher
    EXP -->|"stdout/stderr"| Dispatcher
    Dispatcher -->|"formats & displays"| CLI

    %% Packaging & Deployment
    subgraph "Packaging & Deployment"
        direction TB
        Native["Native Installer Scripts"]:::deployment
        Docker["Docker Container"]:::deployment
        Snap["Snap Package"]:::deployment

        Native --> install["install.sh"]:::deployment
        Native --> update["update.sh"]:::deployment
        Native --> uninstall["uninstall"]:::deployment

        Docker --> dockerfile["Dockerfile"]:::deployment
        Docker --> compose["docker-compose.yml"]:::deployment

        Snap --> snapcraft["snap/snapcraft.yaml"]:::deployment
    end
    Native -->|"installs on host"| CLI
    Docker -->|"builds image"| CLI
    Snap -->|"packages"| CLI

    %% Documentation Site
    subgraph "Documentation" 
        direction TB
        DocIndex["docs/index.html"]:::docs
        DocCSS["docs/css/style.css"]:::docs
        DocFonts["docs/fonts/"]:::docs
        DocFav["docs/favicon/"]:::docs
    end

    %% CI and Contribution
    subgraph "CI & Contribution" 
        direction TB
        CodeConduct["CODE_OF_CONDUCT.md"]:::ci
        Contrib["CONTRIBUTING.md"]:::ci
        Issue["ISSUE_TEMPLATE.md"]:::ci
        License["LICENSE"]:::ci
        GitIgnore[".gitignore"]:::ci
        Readme["README.md"]:::ci
    end

    %% Runtime Environment Note
    Env["Python 2.7 Runtime\n(OS: Linux, macOS, Windows, Termux)"]:::note
    CLI --> Env
    Dispatcher --> Env

    %% Legend / Notes omitted for brevity

    %% Click Events
    click CLI "https://github.com/manisso/fsociety/blob/master/fsociety.py"
    click CFG "https://github.com/manisso/fsociety/blob/master/fsociety.cfg"
    click install "https://github.com/manisso/fsociety/blob/master/install.sh"
    click update "https://github.com/manisso/fsociety/blob/master/update.sh"
    click uninstall "https://github.com/manisso/fsociety/tree/master/uninstall"
    click dockerfile "https://github.com/manisso/fsociety/tree/master/Dockerfile"
    click compose "https://github.com/manisso/fsociety/blob/master/docker-compose.yml"
    click snapcraft "https://github.com/manisso/fsociety/blob/master/snap/snapcraft.yaml"
    click DocIndex "https://github.com/manisso/fsociety/blob/master/docs/index.html"
    click DocCSS "https://github.com/manisso/fsociety/blob/master/docs/css/style.css"
    click DocFonts "https://github.com/manisso/fsociety/tree/master/docs/fonts/"
    click DocFav "https://github.com/manisso/fsociety/tree/master/docs/favicon/"
    click CodeConduct "https://github.com/manisso/fsociety/blob/master/CODE_OF_CONDUCT.md"
    click Contrib "https://github.com/manisso/fsociety/blob/master/CONTRIBUTING.md"
    click Issue "https://github.com/manisso/fsociety/blob/master/ISSUE_TEMPLATE.md"
    click License "https://github.com/manisso/fsociety/tree/master/LICENSE"
    click GitIgnore "https://github.com/manisso/fsociety/blob/master/.gitignore"
    click Readme "https://github.com/manisso/fsociety/blob/master/README.md"

    %% Styles
    classDef logical fill:#cfe2f3,stroke:#08457e,color:#08457e;
    classDef external fill:#d9ead3,stroke:#38761d,color:#38761d;
    classDef deployment fill:#f9cb9c,stroke:#bf9000,color:#bf9000;
    classDef docs fill:#ececec,stroke:#a6a6a6,color:#666666;
    classDef ci fill:#f4cccc,stroke:#cc0000,color:#cc0000;
    classDef note fill:#f3f3f3,stroke:#888888,color:#000000;
```
