Remote BOF Runner ist ein Erweiterungsframework für Havoc zur Remote-Ausführung von Beacon Object Files (BOFs) mithilfe eines mit Crystal Palace erstellten PIC-Loaders.
Ein Havoc-Erweiterungsframework für die Remote-Ausführung von Beacon Object Files (BOFs) unter Verwendung eines mit Crystal Palace erstellten PIC-Loaders.
Remote BOF Runner ermöglicht die sichere Ausführung von BOFs in beliebigen Prozessen durch Nutzung des Crystal Palace PIC-Loaders. Dieses Framework implementiert einen ausgeklügelten Interprozesskommunikations- (IPC-) Mechanismus über Named Pipes, um Beacon-Ausgaben aus injizierten Prozessen transparent an den Command-and-Control-Server (C2) zurückzuleiten.
Stellen Sie sicher, dass die Erweiterung im Havoc-Erweiterungsverzeichnis installiert ist:
YOUR_HAVOC_FOLDER + /data/extensions/
Um den PIC-Loader zu kompilieren, müssen die folgenden Werkzeuge und Bibliotheken auf Ihrem System installiert sein:
Ausführliche Installationsanweisungen finden Sie im WSL-Einrichtungsleitfaden.
sudo apt-get update
sudo apt-get install mingw-w64
sudo apt-get install make
sudo apt-get install openjdk-11-jdk
sudo apt-get install zip
Die BOF-Komponente ist verantwortlich für:
Der PIC-Loader besteht aus:
┌───────────────────────────────────────────────────────────────────┐
│ 1. Beacon Process (Havoc) │
│ ├─ Execute BOF Injector │
│ ├─ Create dummy process (suspended) │
│ ├─ Inject PIC Loader + Remote BOF │
│ └─ Create IPC named pipe │
└────────────┬──────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────┐
│ 2. PIC Loader Execution │
│ ├─ Crystal Palace loader │
│ ├─ Performs BSS section allocation │
│ ├─ Initializes UI context (for .NET compatibility) │
│ └─ Hooks beacon functions (BeaconPrintf, BeaconOutput, etc.) │
└────────────┬──────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────┐
│ 3. Remote BOF Execution │
│ ├─ Execute target BOF (whoami, ipconfig, etc.) │
│ ├─ BOF calls hooked beacon functions │
│ ├─ Hooked functions redirect output to IPC pipe │
│ └─ Output accumulates in beacon process via pipe │
└────────────┬──────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────────────┐
│ 4. Output Collection & Transmission │
│ ├─ Beacon waits for remote process termination │
│ ├─ Accumulates all output from IPC pipe │
│ ├─ Aggregates fragmented messages (8KB buffer) │
│ ├─ Filters protocol delimiters (@START@, @END@) │
│ └─ Transmits consolidated output to Team Server │
└───────────────────────────────────────────────────────────────────┘
Der primäre Anwendungsfall ist die Ausführung von BOFs in nativen .NET-Prozessen:
Warum direktes CLR-Laden im Beacon riskant ist: Das direkte Laden von .NET-Assemblies im Beacon-Prozess ist von Natur aus unsicher und erkennbar:
Eine mögliche Lösung: Native .NET-Prozessinjektion: Anstatt die CLR in den Beacon zu laden, injizieren wir unseren Inline-Execute-Assembly-BOF in einen Prozess, der bereits .NET-nativ ist:
// ❌ DETECTABLE: Direct execution in beacon
beacon.exe (native) → load ClrCreateInstance → load .NET assembly → EDR ALERT
// ✅ STEALTHY: Execution in native .NET process
dotnet.exe (native .NET) → inject BOF → inline-execute-assembly →
execute .NET assembly in already-CLR context → normal behavior
Dieser Ansatz nutzt die Tatsache, dass die Ausführung von .NET innerhalb eines .NET-Prozesses nicht von normalem Anwendungsverhalten zu unterscheiden ist.
remote-bof-runner whoami
remote-bof-runner ipconfig
remote-bof-runner cacls C:\Windows\System32
remote-bof-runner reg-query DC01 HKLM SYSTEM\CurrentControlSet
remote-bof-runner reg-query HKLM SYSTEM\CurrentControlSet\Control\Lsa
remote-bof-runner reg-query HKLM SYSTEM\CurrentControlSet\Control\Lsa RunAsPPL
remote-bof-runner execute-assembly --dotnetassembly "/Payloads/Rubeus.exe" --assemblyargs "triage"
Beispielausgabe:

⚠️ Wichtig: Dieses Projekt ist ein Proof-of-Concept und priorisiert NICHT standardmäßig OPSEC.
Sowohl der BOF-Injektor als auch der PIC-Loader erfordern eine erhebliche Härtung für Angreifersimulationen: