# exploitdeveloperdil/blackhatops architecture

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

- Interactive diagram: https://gitdiagram.com/exploitdeveloperdil/blackhatops
- Repository: https://github.com/exploitdeveloperdil/blackhatops

## Overview

##### Project type and purpose
- This repository (“BlackHatOps”) is an open-source toolkit and educational sandbox for offensive security techniques. It bundles:
- A “Basic Concepts” folder with tutorial examples (socket programming, shellcode injection, reverse shells).
- A “Main Project” suite of standalone C tools (backdoor implant, keylogger header, port scanner, remote server, file slicing, etc.).
- Its primary purpose is to teach and demonstrate network-based exploits and payload delivery in controlled environments.

##### File structure
- Top-level:
- README.md – usage and legal disclaimer.
- “Basic Concepts” – subfolders each illustrating a low-level exploit or socket program.
- “Main Project” – the core deliverable tools.
- Under “Main Project”:
- backdoor.c – implantable payload or listener.
- server.c – control center for reverse shells or C2.
- port_scan.c – network reconnaissance utility.
- slice.c – file chunking/transfer helper.
- keylog.h – header for keylogging functionality, included by backdoor.c or server.c.
- No high-level build scripts or external services; each .c compiles into a separate binary.

##### README for additional insights
- The README outlines how to compile and disclaimers.

a. Main components
1. Attacker Workstation – where the toolkit runs.
2. Victim Host(s) – targets of exploits.
3. Toolkit Modules:
- Reconnaissance: port_scan
- Exploit Delivery: backdoor, reverse shell (shellcode from Basic Concepts)
- Persistence/Keylogging: keylog.h integrated into backdoor or server
- File Transfer: slice
4. C2 Server: server.c managing sessions from reverse shells.
5. Tutorial Snippets (Basic Concepts): collateral modules demonstrating raw socket/shellcode techniques.
b. Relationships & data flows
- Attacker invokes port_scan → scans network → identifies live/vulnerable hosts.
- Attacker crafts payload with backdoor.c (linked with keylog.h) or uses shellcode from Basic Concepts.
- Payload delivered to Victim Host (e.g., via social engineering).
- Victim Host establishes reverse shell back to C2 Server.
- C2 Server provides interactive shell, issues commands, can drop/upload files via slice.
- Basic Concepts modules feed into how payloads are constructed (socket_client ↔ socket_server).
c. Architectural patterns & design principles
- Modular CLI tools: each .c is a self-contained component.
- Layered approach: Reconnaissance → Exploitation → Command & Control → Post-Exploitation.
- Reuse of header (keylog.h) for cross-tool functionality.
- Separation between educational examples (“Basic Concepts”) and production-style tools (“Main Project”).
d. Technologies & libs
- Plain C, POSIX sockets (Linux/BSD) and Winsock (Windows example).
- Shellcode injection techniques (RPI, reverse shell).
- No external frameworks—everything is native C.

- Clear labels: name each component (e.g., “port_scan”, “backdoor”, “C2 Server”).
- Blue rectangles for reconnaissance tools.
- Red rectangles for exploit payloads.
- Green for C2 server and persistence modules.

##### Detailed capture of architecture
- Don’t just list files; show their runtime relationships and data flows.
- Files by functionality and map back to the kill chain (Recon → Weaponization → Delivery → C2 → Actions on Objective).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External entities
    Attacker["Attacker Workstation"]:::external
    Victim["Victim Host"]:::external

    %% Reconnaissance Layer
    subgraph "Reconnaissance"
        direction TB
        PortScan["port_scan"]:::recon
    end

    %% Weaponization & Delivery Layer
    subgraph "Weaponization & Delivery"
        direction TB
        Backdoor["backdoor"]:::exploit
        KeylogHeader["keylog.h"]:::persistence
    end

    %% Command & Control Layer
    subgraph "Command & Control"
        direction TB
        C2Server["server (C2 Server)"]:::c2
    end

    %% Post-Exploitation Layer
    subgraph "Post-Exploitation"
        direction TB
        Slice["slice"]:::post
    end

    %% Basic Concepts Tutorials
    subgraph "Basic Concepts (Tutorials)"
        direction TB
        SocketClientWin["client_socket_windows.c"]:::tutorial
        SocketServerLinux["socket_server_linux.c"]:::tutorial
        ReverseShell["reverse_shell.c"]:::tutorial
        ShellcodeExec["shellcode.c"]:::tutorial
        RPI["rpi.c"]:::tutorial
    end

    %% Data flows
    Attacker -->|invokes| PortScan
    PortScan -->|scans network| Victim
    Attacker -->|crafts payload| Backdoor
    KeylogHeader -.->|included in| Backdoor
    Backdoor -->|delivered to| Victim
    Victim -->|reverse shell connects| C2Server
    C2Server -->|issues commands & file transfer| Slice
    Slice -->|transfers files to/from| Victim

    %% Tutorial mappings (dashed)
    SocketClientWin -.-> PortScan
    SocketServerLinux -.-> PortScan
    ReverseShell -.-> Backdoor
    ShellcodeExec -.-> Backdoor
    RPI -.-> Backdoor

    %% Click Events
    click PortScan "https://github.com/exploitdeveloperdil/blackhatops/blob/main/Main Project/port_scan.c"
    click Backdoor "https://github.com/exploitdeveloperdil/blackhatops/blob/main/Main Project/backdoor.c"
    click C2Server "https://github.com/exploitdeveloperdil/blackhatops/blob/main/Main Project/server.c"
    click KeylogHeader "https://github.com/exploitdeveloperdil/blackhatops/blob/main/Main Project/keylog.h"
    click Slice "https://github.com/exploitdeveloperdil/blackhatops/blob/main/Main Project/slice.c"
    click SocketClientWin "https://github.com/exploitdeveloperdil/blackhatops/blob/main/Basic Concepts/Basic Socket Program/client_socket_windows.c"
    click SocketServerLinux "https://github.com/exploitdeveloperdil/blackhatops/blob/main/Basic Concepts/Basic Socket Program/socket_server_linux.c"
    click ReverseShell "https://github.com/exploitdeveloperdil/blackhatops/blob/main/Basic Concepts/Reverse Shell/reverse_shell.c"
    click ShellcodeExec "https://github.com/exploitdeveloperdil/blackhatops/blob/main/Basic Concepts/ShellCode Execution Program/shellcode.c"
    click RPI "https://github.com/exploitdeveloperdil/blackhatops/blob/main/Basic Concepts/Remote Process Injection - Shellcode/rpi.c"
    click README "https://github.com/exploitdeveloperdil/blackhatops/blob/main/README.md"
    click MainReadme "https://github.com/exploitdeveloperdil/blackhatops/blob/main/Main Project/README.md"

    %% Styles
    classDef external fill:#f2f2f2,stroke:#333,stroke-width:1px
    classDef recon fill:#cfe2f3,stroke:#0366d6,stroke-width:2px
    classDef exploit fill:#f8d7da,stroke:#d93025,stroke-width:2px
    classDef persistence fill:#d1e7dd,stroke:#198754,stroke-width:2px
    classDef c2 fill:#d1ecf1,stroke:#0d6efd,stroke-width:2px
    classDef post fill:#fff3cd,stroke:#f59e0b,stroke-width:2px
    classDef tutorial fill:#e2e3e5,stroke:#6c757d,stroke-width:1px,stroke-dasharray: 5 5
    class Attacker,Victim external
```
