BamboozlEDR

repository·main·Indexed 42 days ago

https://github.com/olafhartong/bamboozledr

A 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.

Tokens
12.8K
Snippets
40
Records
72
Agent score
54%

What's inside BamboozlEDR

  1. Overview of BamboozlEDR

    main
    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.
  2. Event Generation Modes

    main

    BamboozlEDR 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.
  3. Configure Administrator-only features

    main

    While 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).
  4. Use Antimalware Events in Cobalt Strike

    main

    After compilation, follow these steps to use the tool within Cobalt Strike:

    1. Load the aggressor script: Use the script-load command pointing to the generated .cna file in the output/ directory.
    2. Execute the command: Use the antimalware_events command 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
  5. Compile the Antimalware Events BOF

    main

    To 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 .cna script in the output directory.

    build_antimalware.bat
  6. Use Buffer Overflow Mode for high-performance stress testing

    main

    The 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.
  7. Use Buffer Overflow Mode for maximum throughput

    main

    BamboozlEDR 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.

  8. How Buffer Overflow and Bamboozle modes work

    main

    BamboozlEDR 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.

  9. PowerShell Commandlet Event (ID 7937) data structure

    main

    When generating a PowerShell Commandlet event (ID 7937), the following three string fields are emitted as event data:

    1. ContextInfo: Metadata about the execution environment (e.g., Script Block ID, Engine Version, Host Name, Runspace ID).
    2. UserData: Information about the user or session context (e.g., User: DOMAIN\admin, Elevation: Administrator, Logon Type: Interactive).
    3. Payload: The actual command string being executed (e.g., Invoke-Mimikatz -Command '"sekurlsa::logonpasswords"').
  10. PowerShell AMSI Event (ID 16385) data structure

    main

    When generating an AMSI event (ID 16385), the following two string fields are emitted as event data:

    1. Action: The AMSI operation being performed (e.g., AMSI_SCAN_STRING, AMSI_RESULT_DETECTED).
    2. AmsiContext: The context in which AMSI is operating (e.g., PowerShell Script Block, Office VBA, Windows Script Host).
  11. Emit Cyber Events from JSON telemetry

    main

    The WriteCyberEvent function 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 the Microsoft.Windows.Sense.CyberEvents provider.

    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 name Microsoft.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.
  12. Generate DPAPI ETW events

    main

    The cmd/dpapi.go module provides functions to generate Windows Event Tracing for Windows (ETW) events specifically for the Microsoft-Windows-Crypto-DPAPI provider. 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-DPAPI provider with the following characteristics:

    • Event ID: 16385
    • Task: 1 (resolves to DPAPIDefInformationTaskMessage)
    • Keyword: 0x2000000000000040
    • Channel: 16
    • Level: 4 (Information/Verbose)