BamboozlEDR
repository·main·Indexed 42 days ago
https://github.com/olafhartong/bamboozledrA TUI-based ETW event generation tool used to simulate security telemetry for testing EDR and monitoring solutions. It supports a wide range of Windows ETW providers, including Microsoft-Windows-Antimalware, AMSI, and AppLocker, allowing researchers to simulate realistic threat activity, test detection capabilities, and perform high-performance stress testing via a dedicated Buffer Overflow mode.
What's inside BamboozlEDR
- BamboozlEDR is a comprehensive ETW (Event Tracing for Windows) event generation tool designed for testing and research. It uses a TUI (Text User Interface) to generate realistic security events across various Windows ETW providers. This allows developers and security researchers to test EDR (Endpoint Detection and Response) detection capabilities, log analysis systems, and security monitoring solutions by simulating realistic threat activity.
Event Generation Modes
mainBamboozlEDR provides several modes for generating events depending on your testing requirements:
- Single Events: Generate individual events for specific testing scenarios.
- Batch Events: Generate multiple events from predefined lists.
- BamboozlEDR: Execute multiple events simultaneously to test EDR confusion/noise handling.
- Buffer Overflow: Generate unlimited high-volume events from all providers simultaneously for stress testing.
- Custom Events: Generate events with custom parameters.
Configure Administrator-only features
mainWhile the application works with standard privileges, certain advanced features require Administrator privileges:
- ETW trace monitoring: Only available when running as administrator.
- NotMDE ETW Trace Monitor: Allows creating/managing external ETW trace sessions with the same providers used by Microsoft Defender for Endpoint (MDE).
Use Antimalware Events in Cobalt Strike
mainAfter compilation, follow these steps to use the tool within Cobalt Strike:
- Load the aggressor script: Use the
script-loadcommand pointing to the generated.cnafile in theoutput/directory. - Execute the command: Use the
antimalware_eventscommand followed by a mode integer.
Modes:
1: Ransom Detection Mode. Emits multiple ransomware-related threat detections (e.g.,Ransom:PowerShell/Roduk,Ransom:Win32/Blocker).2: Random Threat Mode. Emits a single random threat detection from a predefined pool (e.g.,Trojan:Win64/CobaltStrike.UFO!MTB).
# Load the script script-load output/antimalware_events.cna # Generate all ransom detection events antimalware_events 1 # Generate a single random threat detection antimalware_events 2- Load the aggressor script: Use the
Compile the Antimalware Events BOF
mainTo compile the Beacon Object File (BOF) and the accompanying Cobalt Strike aggressor script, run the provided batch script. This script automates the detection of Visual Studio and handles the compilation of the C source code into an object file, while also preparing the
.cnascript in the output directory.build_antimalware.batUse Buffer Overflow Mode for high-performance stress testing
mainThe Buffer Overflow mode is optimized for maximum throughput. It runs 6 concurrent providers simultaneously using several performance optimizations:
- Real-Time TUI Display: Shows live statistics (success/failure counts, total events, events per second) in a table.
- Pre-allocated GUID Pool: Uses a 100,000 GUID pool to avoid allocation overhead.
- Reduced String Conversions: Optimized UTF-16 encoding.
- Streamlined Event Generation: Minimal overhead event structures.
- Intelligent Logging: Logs are emitted every 1000 events to minimize performance impact.
- Cycle-Based Selection: Uses efficient data cycling instead of expensive random generation.
Use Buffer Overflow Mode for maximum throughput
mainBamboozlEDR includes a high-performance 'Buffer Overflow Mode'. When this mode is active:
- All ETW Providers are activated simultaneously.
- The application provides real-time statistics in the UI.
- It is designed for maximum throughput to test how security tools handle high volumes of ETW events.
To stop all functions while in this mode, press
ESC.How Buffer Overflow and Bamboozle modes work
mainBamboozlEDR provides two high-intensity modes for overwhelming EDR capabilities:
Buffer Overflow Mode
This is the maximum throughput mode. It initializes advanced performance optimizations and starts multiple infinite spam functions in parallel across many providers (Antimalware, LDAP, TCP/IP, WMI, AMSI, DPAPI, PowerShell, CodeIntegrity, and AppLocker). It also includes a real-time statistics updater.
Bamboozle Mode
This is a parallel spam mode. It executes a subset of high-impact spam attacks simultaneously (LDAP, TCP/IP, Antimalware, DPAPI, PowerShell, CodeIntegrity, and AppLocker) to hit provider capping limits at the same time.
In both modes, you can press ESC to stop all active spam functions and return to the main menu.
PowerShell Commandlet Event (ID 7937) data structure
mainWhen generating a PowerShell Commandlet event (ID 7937), the following three string fields are emitted as event data:
- ContextInfo: Metadata about the execution environment (e.g., Script Block ID, Engine Version, Host Name, Runspace ID).
- UserData: Information about the user or session context (e.g., User:
DOMAIN\admin, Elevation:Administrator, Logon Type:Interactive). - Payload: The actual command string being executed (e.g.,
Invoke-Mimikatz -Command '"sekurlsa::logonpasswords"').
PowerShell AMSI Event (ID 16385) data structure
mainWhen generating an AMSI event (ID 16385), the following two string fields are emitted as event data:
- Action: The AMSI operation being performed (e.g.,
AMSI_SCAN_STRING,AMSI_RESULT_DETECTED). - AmsiContext: The context in which AMSI is operating (e.g.,
PowerShell Script Block,Office VBA,Windows Script Host).
- Action: The AMSI operation being performed (e.g.,
Emit Cyber Events from JSON telemetry
mainThe
WriteCyberEventfunction allows for the emission of simulated Microsoft Defender for Endpoint (MDE) cyber events into an ETW trace session. It reads telemetry data from a local JSON file and converts it into ETW events using theMicrosoft.Windows.Sense.CyberEventsprovider.Requirements & Behavior:
- Input File: The function expects a JSON file located at
telemetry/sense-output.json. - Permissions: To successfully emit events into the trace session, the process must be running as
SYSTEM. - Provider Details: It uses the provider GUID
{cb2ff72d-d4e4-585d-33f9-f3a395c40be7}and the nameMicrosoft.Windows.Sense.CyberEvents. - Note: This implementation is intended for Proof of Concept (POC) and debugging; events emitted this way are not intended to show up in the MDE console.
- Input File: The function expects a JSON file located at
Generate DPAPI ETW events
mainThe
cmd/dpapi.gomodule provides functions to generate Windows Event Tracing for Windows (ETW) events specifically for theMicrosoft-Windows-Crypto-DPAPIprovider. This is used to simulate or test antimalware detection for DPAPI (Data Protection API) activities such as accessing private key properties or data.Available generation modes:
- Single/Specific Events: Emits a predefined set of DPAPI events (e.g.,
WriteDPAPIEvent). - Spam Mode: Generates a large burst of random DPAPI events (e.g., 501 events) to test high-volume logging or detection capabilities (
WriteSpamDPAPIEvent). - Infinite Mode: Continuously generates random DPAPI events until the user interrupts the process (e.g., by pressing Escape) (
WriteInfiniteDPAPIEvent).
All generated events target the
Microsoft-Windows-Crypto-DPAPIprovider with the following characteristics:- Event ID:
16385 - Task:
1(resolves toDPAPIDefInformationTaskMessage) - Keyword:
0x2000000000000040 - Channel:
16 - Level:
4(Information/Verbose)
- Single/Specific Events: Emits a predefined set of DPAPI events (e.g.,