Remote BOF Runner is a Havoc extension framework for remote execution of Beacon Object Files (BOFs) using a PIC loader made with Crystal Palace.
A Havoc extension framework for remote execution of Beacon Object Files (BOFs) using a PIC loader made with Crystal Palace.
Remote BOF Runner enables secure execution of BOFs in arbitrary processes by leveraging the Crystal Palace PIC loader. This framework implements a sophisticated inter-process communication (IPC) mechanism through named pipes to transparently forward beacon output from injected processes back to the command and control (C2) server.
Ensure the extension is installed in the Havoc extensions directory:
YOUR_HAVOC_FOLDER + /data/extensions/
To compile the PIC loader, the following tools and libraries must be installed on your system:
For detailed setup instructions, refer to the WSL Setup Guide.
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
The BOF component is responsible for:
The PIC loader consists of:
┌───────────────────────────────────────────────────────────────────┐
│ 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 │
└───────────────────────────────────────────────────────────────────┘
The primary use case is executing BOFs in native .NET processes:
Why Direct CLR Loading in Beacon is Risky: Loading .NET assemblies directly in the beacon process is inherently unsafe and detectable:
A Possible Solution: Native .NET Process Injection: Instead of loading CLR into the beacon, we inject and execute our inline-execute-assembly BOF into a process that is already .NET-native:
// ❌ 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
This approach leverages the fact that executing .NET within a .NET process is indistinguishable from normal application behavior.
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"
Example Output:

⚠️ Important: This project is a Proof-of-Concept and does NOT prioritize OPSEC by default.
Both the BOF Injector and PIC Loader require significant hardening for adversary simulations:
This tool is provided for educational and authorized security testing purposes only. Unauthorized access to computer systems is illegal. Users are responsible for ensuring compliance with all applicable laws and regulations.