/BokuLoader

Cobalt Strike User-Defined Reflective Loader written in Assembly & C for advanced evasion capabilities. By: @0xBoku & @s4ntiago_p

Primary LanguageC

BokuLoader - Cobalt Strike Reflective Loader

Cobalt Strike User-Defined Reflective Loader written in Assembly & C for advanced evasion capabilities.

Project Contributors: Bobby Cooke & Santiago Pecin

Features

Feature Description
BEACON_RDLL_SIZE 100K BokuLoader uses the increased reserved size in Beacon for a larger User Defined Reflective Loader. This increases the initial beacon size to 100kb (5kb default). BokuLoader will work out of the box when generating raw unstaged shellcode. BokuLoader will not work out of the box with the default Cobalt Strike Artifact kit. A custom artifact kit must be loaded, which increases the stagesize to 412256 within build.sh of the artifact kit.
x86 Support @Santiago Pecin - New 32bit loader with WOW64 support, 32bit Halos&HellsGate, code optimizations & bug fixes!
Direct Syscalls HellsGate & HalosGate direct syscaller, replaced allot of ASM stubs, code refactor, and ~500 bytes smaller. Credit to @SEKTOR7net the jedi HalosGate creator & @smelly__vx & @am0nsec Creators/Publishers of the Hells Gate technique!
AMSI & ETW bypasses AMSI & ETW bypasses baked into reflective loader. Can disable by commenting #define BYPASS line when compiling. Credit to @mariuszbit for the awesome idea. Credit to @_xpn_ + @offsectraining + @ajpc500 for their research and code
Custom xGetProcAddress Resolve APIs natively, without using the GetProcAddres() WINAPI
Malleable PE Support @Santiago Pecin - Added support for loader options directly from the configured Cobalt Strike Malleable C2 profile. Options supported are stomppe,obfuscate,userwx, and sleep_mask
FREE_HEADERS Loader will not copy headers over to beacon. Decommits the first memory page which would normally hold the headers.
STOMP_HEADERS If stomppe: true in Cobalt Strike Malleable Profile is set, then the loader will stomp out the PE header
userwx: false The Reflective loader writes beacon with Read & Write permissions and after resolving Beacons Import Table & Relocations, changes the .TEXT code section of Beacon to Read & Execute permissions

Usage

  1. Start the Cobalt Strike Team Server.
  2. Connect to the CS Team Server using the CS GUI client.
  3. Ensure mingw GCC is installed. (MacOS & Linux supported)
  4. If generating RAW payloads, skip this step. This step is for native artifact support.
  • Download the Cobalt Strike Artifact Kit.
  • Set the stagesize to 412256 within build.sh of the artifact kit.
  • Build the Artifacts.
  • Load the Artifact Aggressor script via the Script Manager within the CS GUI client.
  1. Import the BokuLoader.cna Aggressor script via the Script Manager.
  2. Generate a beacon payload (Attacks -> Packages -> Windows Executable (S))

Credits / References

Reflective Loader

HalosGate SysCaller

  • Reenz0h from @SEKTOR7net
    • Most of the C techniques I use are from Reenz0h's awesome courses and blogs
    • Best classes for malware development out there.
    • Creator of the halos gate technique. His work was the motivation for this work.
    • Sektor7 HalosGate Blog

HellsGate Syscaller

Cobalt Strike User Defined Reflective Loader

Great Resource for learning Intel ASM

ETW and AMSI Bypass

Implementing ASM in C Code with GCC

Cobalt Strike C2 Profile Generator