# pr0xy-8l4d3/evilrat architecture

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

- Interactive diagram: https://gitdiagram.com/pr0xy-8l4d3/evilrat
- Repository: https://github.com/pr0xy-8l4d3/evilrat

## Overview

##### Project type and purpose
- EvilRAT is an open-source offensive‐security tool (a Remote Access Trojan generator) intended to produce an “undetectable” Windows 10/11 payload.
- Key indicators: the README calls it a “payload,” usage involves running install.sh and EvilRAT.sh, and the small file tree shows build scripts, a module, and an output folder.

##### File structure
- Top level:
- EvilRAT.sh  – main Bash script that drives payload generation and C2 configuration
- install.sh – environment bootstrap (installs dependencies like Ruby, PowerShell modules, etc.)
- README.md
- module/psbase.rb – Ruby module that contains core logic for generating or encoding a PowerShell‐based payload
- output/blank.txt – placeholder for generated payload(s)
- No frontend/backend directories—this is a CLI tool with a simple pipeline.

##### README for additional insights
- Usage: git clone → install.sh → EvilRAT.sh → interactive prompts

a. Main components:
1) Attacker’s Build Environment
– Git repository
– install.sh (installs Ruby, PowerShell prerequisites)
– EvilRAT.sh (Bash orchestration)
– module/psbase.rb (payload generation logic)
– output folder (where payload artifacts are dropped)
2) Payload Artifact
– A .ps1 or .exe file (PowerShell script or compiled stub)
3) Victim Machine
– Runs the delivered payload
– Establishes a reverse shell or C2 channel back to attacker
4) C2 Server / Listener
– netcat, Metasploit handler, or custom listener accepting incoming connections

b. Relationships & data flows:
1) Attacker runs install.sh → sets up dependencies.
2) Attacker runs EvilRAT.sh → loads module/psbase.rb → generates payload → writes it to output/.
3) Attacker exfiltrates or delivers output/payload to victim (email, USB, spear‐phishing).
4) Victim executes payload → payload connects back to attacker’s C2 server.
5) C2 server interacts with victim agent (commands, file transfer).

c. Architectural patterns & design principles:
– Modularization: shell scripts orchestrate high-level workflow, Ruby module encapsulates payload logic.
– Pipeline / build‐artifact pattern: input (repo + scripts) → processing (psbase logic) → output (payload).
– Separation of concerns: install, build, deliver, and C2 are distinct phases.

d. Key technologies/frameworks:
– Bash (EvilRAT.sh, install.sh)
– Ruby (module/psbase.rb)
– PowerShell (payload content for Windows 10/11)
– C2 listener (netcat/Meterpreter, external to this repo)

##### Final advice
- Be exhaustive: list every script, module, and external dependency.
- 4 phases (install → build → deliver → runtime).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Build Environment
    subgraph "Build Environment"
        Repo["Git Repository"]:::build
        Doc["README.md"]:::build
        Install["install.sh (Bootstrap Script)"]:::build
        EvilRAT["EvilRAT.sh (Orchestration Script)"]:::build
        PsBase["psbase.rb (Payload Module)"]:::build
    end

    %% Artifact / Delivery
    subgraph "Artifact & Delivery"
        OutputDir["output/ (Artifacts Directory)"]:::artifact
        Blank["blank.txt (Placeholder Payload)"]:::artifact
        Delivery["Delivery Channel"]:::artifact
    end

    %% Runtime Environment
    subgraph "Runtime Environment"
        Victim["Victim Machine"]:::runtime
        C2["C2 Listener"]:::runtime
    end

    %% Connections
    Repo -->|"clone repository"| Doc
    Doc -->|"guides usage"| Install
    Install -->|"setup dependencies"| EvilRAT
    EvilRAT -->|"loads module"| PsBase
    PsBase -->|"generates payload"| OutputDir
    OutputDir -->|"includes template"| Blank
    OutputDir -->|"artifact .ps1/.exe"| Delivery
    Delivery -->|"delivers payload"| Victim
    Victim -->|"reverse shell (TCP)"| C2

    %% Click Events
    click Install "https://github.com/pr0xy-8l4d3/evilrat/blob/master/./install.sh"
    click EvilRAT "https://github.com/pr0xy-8l4d3/evilrat/blob/master/./EvilRAT.sh"
    click PsBase "https://github.com/pr0xy-8l4d3/evilrat/blob/master/./module/psbase.rb"
    click OutputDir "https://github.com/pr0xy-8l4d3/evilrat/tree/master/./output/"
    click Blank "https://github.com/pr0xy-8l4d3/evilrat/blob/master/./output/blank.txt"
    click Doc "https://github.com/pr0xy-8l4d3/evilrat/blob/master/./README.md"

    %% Styles
    classDef build fill:#D0E6FF,stroke:#000,stroke-width:1px;
    classDef artifact fill:#DFFFD0,stroke:#000,stroke-width:1px;
    classDef runtime fill:#FFD0D0,stroke:#000,stroke-width:1px;
```
