A shellcode encryption and obfuscation toolkit written in Go-Lang.
Shellph is a portable command-line utility designed to automate encryption and obfuscation of arbitrary shellcode.
- AES-CBC (128/192/256-bit keys, PKCS#7 padding)
- RC4
- XOR (repeating key)
- IPv4
- MAC Address
- UUID
- Binary
- Hex
- String
- Array
- C
- Go
- Rust
- C#
- PowerShell
- Calculate Entropy of a given input file
git clone https://github.com/xirtam2669/shellph.git
cd shellph
go build -o shellph ./cmd/shellphgo install ./cmd/shellphshellph [options]
| Short | Long | Description |
|---|---|---|
-f |
--file |
Input file |
-fmt |
--input-format |
raw or hex |
-op |
--operation |
Encryption or transformation operation |
-of |
--output-format |
raw, hex, string, or array |
-ofl |
--output-format-language |
c, go, rust, csharp, powershell |
-k |
--key |
Encryption key |
-iv |
--iv |
AES initialization vector |
-o |
--outfile |
Output filename |
-e |
--entropy |
Calculate entropy of input file |
aes
rc4
xor
ipv4
mac
uuid
shellph \
-f shellcode.bin \
-fmt raw \
-op aes \
-of array \
-ofl cshellph \
-f shellcode.bin \
-fmt raw \
-op rc4 \
-of string \
-ofl goshellph \
-f shellcode.bin \
-fmt raw \
-op xor \
-of array \
-ofl rustshellph \
-f shellcode.bin \
-fmt raw \
-op ipv4 \
-of array \
-ofl powershellProduces
$encrypted = @(
"77.90.65.82",
"85.72.137.229",
"72.131.236.32",
)shellph \
-f shellcode.bin \
-fmt raw \
-op uuid \
-of string \
-ofl goProduces
var encrypted = "4d5a4152-5548-89e5-4883-ec204883e4f0
e8000000-005b-4881-c39f-610000ffd348
..."Operations:
- AES
- RC4
- XOR
Produces a language-specific string variable containing the encrypted bytes.
Example (Go):
var encrypted = "\x90\x90..."Produces a language-specific byte array.
Example (Go):
var encrypted = []byte{
0x90,
0x90,
}Operations:
- IPv4
- MAC
- UUID
Produces a language-specific multiline string.
Example (Go)
var encrypted = "77.90.65.82
85.72.137.229
72.131.236.32
"Example (PowerShell)
$encrypted = @"
77.90.65.82
85.72.137.229
72.131.236.32
"@Produces a language-specific array of strings.
Example (Go)
var encrypted = []string{
"77.90.65.82",
"85.72.137.229",
}Example (PowerShell)
$encrypted = @(
"77.90.65.82",
"85.72.137.229",
)Calculations:
- Calculate entropy
Calculates Shannon entropy for a given input file.
Example
shellph \
-e \
-f program.exe
[+] Loading input from disk...
[+] Entropy of popup_test.bin: 5.9807
[+] Low entropy detected, likely unencrypted data.Unless overridden, the following defaults are used.
| Parameter | Value |
|---|---|
| AES Key | 1234567890123456 |
| AES IV | 1234567890123456 |
| RC4 Key | 1234567890123456 |
| XOR Key | 1234567890123456 |
Override them with:
-k
-iv
.
├── cmd/
│ └── shellph/
├── internal/
│ ├── cryptoops/
│ ├── format/
│ ├── input/
│ └── transform/
├── testdata/
├── .github/
│ └── workflows/
├── .goreleaser.yaml
├── go.mod
├── README.md
└── LICENSE
MIT License
Email: ramessham@gmail.com Blog: https://vanilla-sec.com/
