# sultanbajamil/rat_build architecture

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

- Interactive diagram: https://gitdiagram.com/sultanbajamil/rat_build
- Repository: https://github.com/sultanbajamil/rat_build

## Overview

RAT_Build combines a browser-based relay dashboard with Windows remote-administration agents. The documented operator workflow is browser dashboard → relay → connected agent → command handling and response; the agent also provides screen/audio capture. The tree contains both the main agent and an improved packaged variant, whose startup excerpt explicitly orchestrates additional persistence and evasion services. Relationships are limited to shown calls and README statements; unsampled integration details are not inferred.

Main entry points: [`StealthRAT/Program.cs`](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Program.cs) (Agent startup), [`improved_project3/StealthRAT/Program.cs`](https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Program.cs) (Packaged startup), [`StealthRAT/Services/AuditLoggerService.cs`](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Services/AuditLoggerService.cs) (Action audit), [`improved_project3/StealthRAT/Models/ServerConfiguration.cs`](https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Models/ServerConfiguration.cs) (Agent configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_relay["Web relay"]
  node_webui["Web dashboard<br/>[app.js]"]
  node_relayserver["WebSocket relay<br/>[server.js]"]
end

subgraph group_agent["Agent control"]
  node_agentmain["Agent startup<br/>[Program.cs]"]
  node_commandservice["Command service<br/>[CommandService.cs]"]
  node_handlercontract["Handler contract<br/>[ICommandHandler.cs]"]
  node_improvedmain["Packaged startup<br/>[Program.cs]"]
end

subgraph group_capabilities["Endpoint capabilities"]
  node_filehandler["File access"]
  node_processhandler["Process launch"]
  node_powerhandler["Power controls"]
  node_inputhandler["Input controls"]
  node_uicontroller["UI controls"]
  node_uimanager["UI manager<br/>[UIManager.cs]"]
  node_screen["Screen capture"]
  node_audio["Audio capture"]
end

subgraph group_resilience["Agent resilience"]
  node_persistence["Persistence service"]
  node_antidetection["Anti-detection"]
  node_lockdown["Lockdown bypass"]
  node_networkevasion["Network evasion"]
end

subgraph group_support["Shared services"]
  node_audit["Action audit"]
  node_config["Agent configuration"]
end

node_operator(("Dashboard operator"))

node_operator -->|"uses"| node_webui
node_webui -->|"sends commands"| node_relayserver
node_relayserver -.->|"relays traffic"| node_agentmain
node_agentmain -->|"starts"| node_commandservice
node_agentmain -->|"starts"| node_screen
node_agentmain -->|"starts"| node_audio
node_commandservice -->|"dispatches"| node_handlercontract
node_agentmain -->|"registers"| node_filehandler
node_agentmain -->|"registers"| node_processhandler
node_agentmain -->|"registers"| node_powerhandler
node_uicontroller -->|"calls"| node_uimanager
node_filehandler -->|"logs actions"| node_audit
node_processhandler -->|"logs actions"| node_audit
node_powerhandler -->|"logs actions"| node_audit
node_improvedmain -->|"enables"| node_persistence
node_improvedmain -->|"starts"| node_antidetection
node_improvedmain -->|"enables"| node_lockdown
node_improvedmain -->|"starts"| node_networkevasion
node_inputhandler -->|"reads settings"| node_config
node_screen -.->|"reads settings"| node_config
node_audio -.->|"reads settings"| node_config

click node_webui "https://github.com/sultanbajamil/rat_build/blob/main/dashboard/public/app.js"
click node_relayserver "https://github.com/sultanbajamil/rat_build/blob/main/dashboard/server.js"
click node_agentmain "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Program.cs"
click node_commandservice "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Services/CommandService.cs"
click node_handlercontract "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Interfaces/ICommandHandler.cs"
click node_filehandler "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Handlers/FileAccessHandler.cs"
click node_processhandler "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Handlers/LaunchProcessHandler.cs"
click node_powerhandler "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Handlers/SystemPowerHandler.cs"
click node_inputhandler "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Handlers/InputControlHandlers.cs"
click node_uicontroller "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Handlers/UIControlHandlers.cs"
click node_uimanager "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Utilities/UIManager.cs"
click node_screen "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Services/ScreenCaptureService.cs"
click node_audio "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Services/AudioCaptureService.cs"
click node_audit "https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Services/AuditLoggerService.cs"
click node_improvedmain "https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Program.cs"
click node_config "https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Models/ServerConfiguration.cs"
click node_persistence "https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Services/PersistenceService.cs"
click node_antidetection "https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Services/AntiDetectionService.cs"
click node_lockdown "https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Services/LockdownBypassService.cs"
click node_networkevasion "https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Services/NetworkEvasionService.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webui,node_relayserver toneBlue
class node_agentmain,node_commandservice,node_handlercontract,node_improvedmain toneAmber
class node_filehandler,node_processhandler,node_powerhandler,node_inputhandler,node_uicontroller,node_uimanager,node_screen,node_audio toneMint
class node_persistence,node_antidetection,node_lockdown,node_networkevasion toneRose
class node_audit,node_config,node_operator toneIndigo
```

## Components

### Web relay

- [Web dashboard](https://github.com/sultanbajamil/rat_build/blob/main/dashboard/public/app.js): `dashboard/public/app.js`
- [WebSocket relay](https://github.com/sultanbajamil/rat_build/blob/main/dashboard/server.js): `dashboard/server.js`

### Agent control

- [Agent startup](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Program.cs): `StealthRAT/Program.cs`
- [Command service](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Services/CommandService.cs): `StealthRAT/Services/CommandService.cs`
- [Handler contract](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Interfaces/ICommandHandler.cs): `StealthRAT/Interfaces/ICommandHandler.cs`
- [Packaged startup](https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Program.cs): `improved_project3/StealthRAT/Program.cs`

### Endpoint capabilities

- [File access](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Handlers/FileAccessHandler.cs): `StealthRAT/Handlers/FileAccessHandler.cs`
- [Process launch](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Handlers/LaunchProcessHandler.cs): `StealthRAT/Handlers/LaunchProcessHandler.cs`
- [Power controls](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Handlers/SystemPowerHandler.cs): `StealthRAT/Handlers/SystemPowerHandler.cs`
- [Input controls](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Handlers/InputControlHandlers.cs): `StealthRAT/Handlers/InputControlHandlers.cs`
- [UI controls](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Handlers/UIControlHandlers.cs): `StealthRAT/Handlers/UIControlHandlers.cs`
- [UI manager](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Utilities/UIManager.cs): `StealthRAT/Utilities/UIManager.cs`
- [Screen capture](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Services/ScreenCaptureService.cs): `StealthRAT/Services/ScreenCaptureService.cs`
- [Audio capture](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Services/AudioCaptureService.cs): `StealthRAT/Services/AudioCaptureService.cs`

### Agent resilience

- [Persistence service](https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Services/PersistenceService.cs): `improved_project3/StealthRAT/Services/PersistenceService.cs`
- [Anti-detection](https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Services/AntiDetectionService.cs): `improved_project3/StealthRAT/Services/AntiDetectionService.cs`
- [Lockdown bypass](https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Services/LockdownBypassService.cs): `improved_project3/StealthRAT/Services/LockdownBypassService.cs`
- [Network evasion](https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Services/NetworkEvasionService.cs): `improved_project3/StealthRAT/Services/NetworkEvasionService.cs`

### Shared services

- [Action audit](https://github.com/sultanbajamil/rat_build/blob/main/StealthRAT/Services/AuditLoggerService.cs): `StealthRAT/Services/AuditLoggerService.cs`
- [Agent configuration](https://github.com/sultanbajamil/rat_build/blob/main/improved_project3/StealthRAT/Models/ServerConfiguration.cs): `improved_project3/StealthRAT/Models/ServerConfiguration.cs`

### Other components

- **Dashboard operator**

## Connections

- Dashboard operator → Web dashboard: uses (evidence: `README.md`)
- Web dashboard → WebSocket relay: sends commands (evidence: `README.md`)
- WebSocket relay → Agent startup: relays traffic (evidence: `README.md`)
- Agent startup → Command service: starts (evidence: `StealthRAT/Program.cs`)
- Agent startup → Screen capture: starts (evidence: `StealthRAT/Program.cs`)
- Agent startup → Audio capture: starts (evidence: `StealthRAT/Program.cs`)
- Command service → Handler contract: dispatches (evidence: `StealthRAT/Services/CommandService.cs`)
- Agent startup → File access: registers (evidence: `StealthRAT/Program.cs`)
- Agent startup → Process launch: registers (evidence: `StealthRAT/Program.cs`)
- Agent startup → Power controls: registers (evidence: `StealthRAT/Program.cs`)
- UI controls → UI manager: calls (evidence: `StealthRAT/Handlers/UIControlHandlers.cs`)
- File access → Action audit: logs actions (evidence: `StealthRAT/Handlers/FileAccessHandler.cs`)
- Process launch → Action audit: logs actions (evidence: `StealthRAT/Handlers/LaunchProcessHandler.cs`)
- Power controls → Action audit: logs actions (evidence: `StealthRAT/Handlers/SystemPowerHandler.cs`)
- Packaged startup → Persistence service: enables (evidence: `improved_project3/StealthRAT/Program.cs`)
- Packaged startup → Anti-detection: starts (evidence: `improved_project3/StealthRAT/Program.cs`)
- Packaged startup → Lockdown bypass: enables (evidence: `improved_project3/StealthRAT/Program.cs`)
- Packaged startup → Network evasion: starts (evidence: `improved_project3/StealthRAT/Program.cs`)
- Input controls → Agent configuration: reads settings
- Screen capture → Agent configuration: reads settings
- Audio capture → Agent configuration: reads settings
