# hrtywhy/bof-cobaltstrike architecture

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

- Interactive diagram: https://gitdiagram.com/hrtywhy/bof-cobaltstrike
- Repository: https://github.com/hrtywhy/bof-cobaltstrike

## Overview

##### Project type and purpose
- This is an open-source tooling repository: a curated collection of Cobalt Strike Beacon Object Files (BOFs) organized by function (enumeration, .NET assembly loaders, exploitation, miscellaneous).
- Its purpose is to serve as a one-stop index of standalone BOF plugins that can be loaded into Cobalt Strike for red-teaming or pentesting.

##### “architecture” from the README
- There is no traditional “frontend” or “backend” code here—just documentation pointing at external BOF modules.
- The core runtime is the Cobalt Strike Beacon, into which these BOF modules (compiled “.o” files) are loaded at runtime.
- Some modules invoke direct syscalls or patch in-memory (AMSI/ETW), others load .NET assemblies or use Aggressor scripts.

##### Main components
a. Cobalt Strike Beacon (central execution engine)
b. BOF Modules, grouped by category:
- Enumeration BOFs
- .NET Assembly Execution BOFs
- Exploitation & Injection BOFs
- Miscellaneous BOFs & Templates
c. External repositories (shown as “cloud” or “repository” nodes) hosting each BOF
d. Target Host OS / Process Model (Windows API / direct syscalls)
e. Optional loader wrappers (InlineExecute-Assembly, inject-assembly, Aggressor scripts)

##### Relationships and interactions
- BOF modules call into the Windows API or execute syscalls in the target process.
- .NET loaders inject or spin up a CLR AppDomain inside a native process.
- Aggressor scripts extend Beacon with colorized help or logging functions.

##### Architectural patterns & design principles
- Plugin architecture: BOFs are *pluggable* object files.
- Opaque execution: direct syscalls or in-memory patching for opsec.
- Categorization: grouping by capability (enumeration vs. exploitation).
- Decoupled delivery: documentation repo separate from actual BOF code repos.

##### Detailed capture of essential elements
- Flow “User Console → Beacon → [Select BOF] → Inject / Syscall → Target Process.”
- Special features on modules (e.g., “Direct Syscalls,” “In-Memory Patching,” “CLR Host”).
- With example commands (e.g., “whereami,” “FindModule amsi.dll,” “kerberoast SPN”).

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User Console"]:::user
    DocIndex["Documentation Index (README)"]:::repo
    Beacon["Cobalt Strike Beacon"]:::beacon

    subgraph "BOF Modules"
        Enum["Enumeration BOFs"]:::enum
        Net[".NET Assembly Execution BOFs"]:::net
        Exploit["Exploitation & Injection BOFs"]:::exploit
        Misc["Miscellaneous BOFs & Templates"]:::misc
    end

    RepoEnum["Repo (Enumeration)"]:::repo
    RepoNet["Repo (.NET)"]:::repo
    RepoExploit["Repo (Exploitation)"]:::repo
    RepoMisc["Repo (Miscellaneous)"]:::repo

    Target["Target Host OS (Windows API / Syscalls)"]:::target
    CLR["CLR AppDomain"]:::net
    Inject["Assembly Injection"]:::net

    User --> Beacon
    Beacon --> Enum
    Beacon --> Net
    Beacon --> Exploit
    Beacon --> Misc

    Enum -->|"loads from"| RepoEnum
    Net -->|"loads from"| RepoNet
    Exploit -->|"loads from"| RepoExploit
    Misc -->|"loads from"| RepoMisc

    DocIndex --> RepoEnum
    DocIndex --> RepoNet
    DocIndex --> RepoExploit
    DocIndex --> RepoMisc

    Net --> CLR
    Net --> Inject

    Enum -->|"Direct Syscalls"| Target
    Net -->|"CLR Host Calls"| Target
    Exploit -->|"In-Memory Patching"| Target
    Misc -->|"Syscalls / Utilities"| Target

    click DocIndex "https://github.com/hrtywhy/bof-cobaltstrike/blob/main/README.md"

    classDef user fill:#f9f,stroke:#333,stroke-width:1px
    classDef beacon fill:#ffa500,stroke:#333,stroke-width:1px
    classDef enum fill:#add8e6,stroke:#333,stroke-width:1px
    classDef net fill:#90ee90,stroke:#333,stroke-width:1px
    classDef exploit fill:#ffb6c1,stroke:#333,stroke-width:1px
    classDef misc fill:#ffffe0,stroke:#333,stroke-width:1px
    classDef repo fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef target fill:#dda0dd,stroke:#333,stroke-width:1px
```
