ek0msUSB is an advanced BadUSB framework that provides complete command and control capabilities. The framework generates dynamic beacons, creates encoded payloads for multiple devices, and includes a web-based C2 interface for real-time beacon management.
This framework is designed for authorized security testing, educational purposes, and legitimate red team operations only. Users are solely responsible for ensuring they have proper authorization before deploying any payloads. The developer assumes no liability for misuse of this software. By using this framework, you acknowledge that you understand and accept full responsibility for your actions.
Clone or download the ek0msUSB framework to your local machine:
git clone https://github.com/ekomsSavior/ek0msUSB.git
cd ek0msUSB
Install required Python packages manually:
pip install flask pyngrok requests pyinstaller
For additional encoding capabilities (optional):
pip install ducktoolkit
ngrok authtoken YOUR_AUTH_TOKEN_HERE
ngrok version
Run the main controller in interactive mode:
python ek0msusb.py
Or use command-line mode:
python ek0msusb.py --interactive
When you start the framework, you'll see the main menu:
Option 2: Use localhost only (testing only)
Enter port number (default: 5000)
When the C2 server starts successfully, you'll see:
Open your web browser and navigate to the provided admin panel URL:
https://your-ngrok-url.ngrok.io/admin
Or if using localhost:
http://localhost:5000/admin
The admin panel provides:
- Real-time beacon monitoring
- Command execution interface
- Command result viewing
- Server status information
Advanced Beacon (command execution capabilities)
Select delivery method:
Hybrid (balanced)
Enter persistence name (default: WindowsUpdate)
After payload generation, the framework automatically encodes for multiple devices:
- Rubber Ducky (.bin files)
- Flipper Zero (.txt files)
- O.MG Cable (.txt files)
- Bash Bunny (.txt files)
Encoded files are saved in the "encoded_payloads" directory.
For command-line usage:
python ek0msusb.py --build --beacon-type stealth --c2-url https://your-c2.ngrok.io --output-file my_payload.txt
/adminBeacons automatically check in every 60 seconds and provide:
- System hostname
- Username and domain
- OS version and architecture
- IP address (through ngrok proxy)
whoami - Current user contextipconfig - Network configurationsysteminfo - System informationnet user - User accounts
Click "Send Command" to queue the command
The admin panel includes quick command buttons:
- Whoami (All) - Send to all active beacons
- IP Config (All) - Network info to all beacons
- System Info (All) - System details to all beacons
- Users (All) - User account info to all beacons
The C2 server automatically handles multiple concurrent beacons with unique identifiers based on hostname and username.
Commands are persistently queued until:
- Beacon retrieves and executes them
- Manual cleanup is performed
- Server restart
The web interface automatically refreshes every 30 seconds to show:
- New beacon check-ins
- Command execution results
- Updated beacon status
C2 Server Won't Start:
- Check if port 5000 is available
- Verify Python and Flask installation
- Ensure no other web servers are running on the same port
Ngrok Connection Issues:
- Verify ngrok authtoken is configured
- Check internet connectivity
- Ensure ngrok is not blocked by firewall
Payload Generation Fails:
- Verify PyInstaller is installed correctly
- Check that C2 server is running first
- Ensure sufficient disk space for compilation
Beacons Not Connecting:
- Verify payload uses correct C2 URL
- Check target machine has internet access
- Ensure no antivirus is blocking the beacon
Commands Not Executing:
- Verify beacon is active (green status)
- Check command syntax is correct
- Ensure beacon has necessary privileges
If you encounter issues, check the console output for detailed error messages.
The framework provides comprehensive logging during all operations.
❤ FOR AUTHORIZED TESTING ONLY ❤
// click a file to view source