ek0msUSB: When Your USB Drive Has More Backdoors Than IKEA (And The Manual To Use Them)
Look, we've all been there. You get physical access to a target and suddenly realize your fancy USB attack needs more setup than a dating profile. Enter ek0msUSB - the "why didn't I think of that?" BadUSB framework that makes C2 operations as easy as stealing cookies from the breakroom (but way more illegal without authorization, please don't do that).
Architecture Overview: The Nerd Stuff (That Makes It Work)
ek0msUSB is what happens when Python, PowerShell, and pure mischief have a baby. It's built on that classic "will this work?" energy that defines all great red team tools, but with a solid, modular architecture under the hood.
Core Components (The Avengers of Backdoors):
-Payload Builder: Makes BadUSB scripts that would make the Rubber Ducky jealous.
-Beacon Generator: Creates polymorphic, compiled beacons so stealthy they probably have a side gig as ninjas.
-C2 Server: Your very own Flask-based mission control, now with 100% more ngrok.
-Auto-Encoder: Because who has time to manually convert between 15 different device formats?
The "Burrow First, Then Act" Philosophy: Why This Actually Works
Most BadUSBs have the entire payload baked in. Ours is different, and that's its superpower.
ek0ms Way (Staged): The USB script is tiny. It just establishes persistence (the "burrow") and then calls back to your C2 (the "act") for instructions.
The Other Way (Monolithic): The USB contains the entire malicious payload from the start.
Why my way is better for evading EDR:
Smaller Initial Footprint: The initial script is just a few lines for persistence and a callback. It's too small and generic to trigger most static detection.
Bypasses Static Scans: The real malicious tool (like a keylogger or reverse shell) is never on the USB. It's delivered live from your C2 server, so it never sits on the disk to be scanned by a scheduled antivirus check.
Dynamic & Fresh: If one payload gets detected, you just replace it on your C2 server. No need to rebuild your physical USBs.
Technical Deep Dive: The Wizard Behind the Curtain
Payload Generation - Where the Magic Happens
The payload builder uses a template system to create scripts tailored to your operational needs. It focuses on "Living-off-the-Land" (LotL) techniques to blend in.
How we avoid getting caught - "Living-off-the-Land" (translation: we're digital squatters)
- Reflective DLL loading via PowerShell (no disk writes)
- AMSI bypass techniques to disable script scanning
- Leveraging trusted Windows processes (LOLBins)
Persistence methods (so many we should call it "that one ex who won't leave")
- Scheduled Task Creation (heavily monitored but reliable)
- Registry Run Key Installation (HKCU for user-level access)
- Startup Folder Deployment (simple and effective)
Beacons - Your Digital Homing Pigeons
These aren't simple scripts; they're compiled Python executables (.exe) generated on-the-fly by your server.
Simple Beacon: The "hey I'm here!" wave. Basic system info, 60-second check-ins. Great for debugging.
Stealth Beacon: The subtle nod across a crowded room. No console window, extended check-ins (120s), reduced footprint.
Advanced Beacon: The "I brought snacks and can take over your entire system" package. Full command execution, result exfiltration, and interactive C2 control.
C2 Server - Your New Bestie
The Flask-based server does all the heavy lifting while you sip coffee. It's your mission control.
RESTful API Endpoints (The Conduit)
POST /beacon # Your implant calls home here
GET /commands/ # Beacon asks "any orders?"
POST /results # Beacon sends back the loot
GET /admin # Your web-based dashboard to rule them all
Integrated ngrok tunneling provides instant, anonymous C2 channels without you needing to configure port forwarding.
Usage Workflow: From Zero to Hero in 5 Steps
Let's walk through it. This is where the theory becomes practice.
Step 1: Setup & Installation
git clone https://github.com/ekomsSavior/ek0msUSB.git
cd ek0msUSB
pip install flask pyngrok requests pyinstaller
ngrok authtoken YOUR_AUTH_TOKEN # Get this from ngrok's dashboard
Step 2: Fire Up Your C2 Server
python ek0msusb.py
Select option 2: "Start C2 Server"
Choose ngrok tunneling for real operations.
NOTE THE C2 URL that ngrok provides! You'll need this next.
Step 3: Build Your "Burrowing" Payload
This is the script that goes on the USB. Its only job is to persist and call home.
Back in the main menu
python ek0msusb.py
Select option 1: "Build BadUSB Payload"
Choose your beacon type (Stealth is a good start).
Paste the C2 URL from Step 2 when prompted.
Select your persistence method.
Step 4: Encode for Your Hardware
The framework automatically encodes your payload for your device of choice:
Rubber Ducky (.bin)
Flipper Zero (.txt)
O.MG Cable (.txt)
Bash Bunny (.txt)
Arduino (.ino) coming soon
Flash the generated file to your device.
Step 5: Deploy and Conquer
Deploy: Plug the device into the target system. Wait for the lights to do their thing.
Establishment: Wait ~45 seconds for the beacon to call home.
Command & Control: Open your C2 web dashboard (http://"yourNGROK"/admin), see your active beacon, and start sending commands.
For the Blue Teamers Reading This (I See You)
Yes, you can catch this. Here's what to look for, building on our chat:
The Noisy Bit: Look for PowerShell spawning schtasks.exe or making unusual Registry edits. This is the "burrowing."
The Call Home: Watch for new, regular HTTP/HTTPS connections to .ngrok.io domains or other unknown services.
The Payload: The final stage is the beacon.exe. Look for unknown processes making network connections.
Mitigations:
Application whitelisting (AppLocker/WDAC).
PowerShell Constrained Language Mode.
Network monitoring for beacon-like behavior (regular, periodic callouts).
The Bottom Line
ek0msUSB is like finding out your badUSB drive secretly had a PhD in psychological warfare this whole time. I took that fancy "burrow first, then act" mojo - you know, the stuff that actually makes EDR systems question their life choices - and made it as easy as ordering pizza.
Think of it as your new favorite multi-tool that actually works. Whether you're a seasoned operator tired of duct-taping three different frameworks together, or just leveling up from basic payloads, this is your "aha!" moment. That beautiful gap between knowing advanced tradecraft and actually executing it? Consider it bridged.
Your badUSB, omgCABLE, flipper zero or BASHbunny just evolved from a simple payload dropper to a persistent threat platform. The method is proven, the tools are ready, and honestly? The look on your face when that first beacon checks in is going to be priceless.
Now go make some magic happen.
Legal disclaimer: This is for authorized testing only. The author is not responsible for you getting fired, arrested, or yelled at by a security team. Please be cool.
availabe on : https://ekomssavi0r.dev, https://churchofmalware.org, https://github.com/ekomsSavior/ek0msUSB, ek0ms.onion: fsv46pzkusigadeqaedwyteogxtyf2pvywypodxk45yc7pft4mz2jcqd.onion