How nvisosecurity/cobaltwhispers works
Project type and purpose
• CobaltWhispers is an open-source Red Team tool (an Aggressor script plus Beacon Object Files) for the Cobalt Strike framework.
• It delivers inject-and-persist functionality via a collection of small C “plugins” (Beacon Object Files) that use direct syscalls to evade EDR/AV.
• The tool has three functional domains: Injection, Persistence, and Kernel-mode Drivers.
File structure
• Top‐level artifacts:
• CobaltWhispers.cna – the Aggressor script that loads and dispatches BOFs in Cobalt Strike.
• src/Makefile – orchestrates build of each C module into a Beacon Object File via mingw-w64, SysWhispers2, InlineWhispers2.
• src/Drivers – driver-based capabilities (DisableDSE, Intercept, UnloadDriver).
• src/Injection – user-mode injection techniques (CreateRemoteThread, MapViewOfSection, SpawnProcess, QueueUserAPC, TransactedHollowing, PhantomDLLHollowing).
• src/Persistence – registry and scheduled-task–based persistence techniques.
• Each feature folder contains:
• A .c file – logic for that technique
• beacon.h/helpers.h – Beacon API glue and shared helpers
• syscalls-asm.h, syscalls.[ch] – direct-syscalls stubs generated by SysWhispers2/InlineWhispers2.
README for additional insights
• Dependencies: mingw-w64, make, Python3, SysWhispers2, InlineWhispers2.
• Build flow:
1) SysWhispers2 → export minimal syscall stubs for required NT APIs.
2) InlineWhispers2 → package stubbed code for beacon usage.
3) Makefile → compiles each module into a .o/.cna for Cobalt Strike Beacon.
• Runtime flow: built BOFs are loaded by CobaltWhispers.cna into a Beacon session, invoked via Aggressor commands, invoke syscalls to perform injection/persistence/driver tasks.
Diagramming recommendations
• Blue for build-time tools & processes.
• Orange for module groups (Injection, Persistence, Drivers).
• Green for runtime platforms (Beacon, Windows).
• Gray for external items (EDR/AV, vulnerable driver).
Essential details
• Split between code generation (SysWhispers2 → stubs) and code compilation (Make → BOFs).
• How CobaltWhispers.cna orchestrates BOF dispatch.
• Direct syscall bypass mechanism as a highlighted path to the Windows kernel.
• Modules under Injection/Persistence/Drivers to illustrate modularity and extensibility.