xirtam2669/Shellph
GitHub: xirtam2669/Shellph
Shellph 是一款便携的命令行 shellcode 加密与混淆工具,支持多种加密算法、格式转换和多语言代码输出。
Stars: 15 | Forks: 5
# Shellph
Shellph 是一款便携的命令行工具,旨在自动化任意 shellcode 的加密与混淆。
# 功能
## 加密
* AES-CBC(128/192/256 位密钥,PKCS#7 填充)
* RC4
* XOR(重复密钥)
## 转换
* IPv4
* MAC Address
* UUID
## 输出格式
* Binary
* Hex
* String
* Array
## 支持的语言
* C
* Go
* Rust
* C#
* PowerShell
## 附加功能
* 计算给定输入文件的熵
# 安装
## 从源码构建
```
git clone https://github.com/xirtam2669/shellph.git
cd shellph
go build -o shellph ./cmd/shellph
```
## 使用 Go 安装
```
go install ./cmd/shellph
```
# 用法
```
shellph [options]
```
## 选项
| 简写 | 全称 | 描述 |
| ------ | -------------------------- | ------------------------------------ |
| `-f` | `--file` | 输入文件 |
| `-fmt` | `--input-format` | `raw` 或 `hex` |
| `-op` | `--operation` | 加密或转换操作 |
| `-of` | `--output-format` | `raw`、`hex`、`string` 或 `array` |
| `-ofl` | `--output-format-language` | `c`、`go`、`rust`、`csharp`、`powershell` |
| `-k` | `--key` | 加密密钥 |
| `-iv` | `--iv` | AES 初始化向量 |
| `-o` | `--outfile` | 输出文件名 |
| `-e` | `--entropy` | 计算输入文件的熵 |
# 操作
## 加密
```
aes
rc4
xor
```
## 转换
```
ipv4
mac
uuid
```
# 示例
## AES
```
shellph \
-f shellcode.bin \
-fmt raw \
-op aes \
-of array \
-ofl c
```
## RC4
```
shellph \
-f shellcode.bin \
-fmt raw \
-op rc4 \
-of string \
-ofl go
```
## XOR
```
shellph \
-f shellcode.bin \
-fmt raw \
-op xor \
-of array \
-ofl rust
```
## IPv4
```
shellph \
-f shellcode.bin \
-fmt raw \
-op ipv4 \
-of array \
-ofl powershell
```
生成
```
$encrypted = @(
"77.90.65.82",
"85.72.137.229",
"72.131.236.32",
)
```
## UUID
```
shellph \
-f shellcode.bin \
-fmt raw \
-op uuid \
-of string \
-ofl go
```
生成
```
var encrypted = "4d5a4152-5548-89e5-4883-ec204883e4f0
e8000000-005b-4881-c39f-610000ffd348
..."
```
# 输出语义
## 加密操作
操作:
* AES
* RC4
* XOR
### `-of string`
生成一个特定于语言的、包含加密字节的字符串变量。
示例:
```
var encrypted = "\x90\x90..."
```
### `-of array`
生成一个特定于语言的字节数组。
示例:
```
var encrypted = []byte{
0x90,
0x90,
}
```
## 转换操作
操作:
* IPv4
* MAC
* UUID
### `-of string`
生成一个特定于语言的多行字符串。
示例
```
var encrypted = "77.90.65.82
85.72.137.229
72.131.236.32
"
```
示例
```
$encrypted = @"
77.90.65.82
85.72.137.229
72.131.236.32
"@
```
### `-of array`
生成一个特定于语言的字符串数组。
示例
```
var encrypted = []string{
"77.90.65.82",
"85.72.137.229",
}
```
示例
```
$encrypted = @(
"77.90.65.82",
"85.72.137.229",
)
```
## 附加功能
计算:
* 计算熵
### `-e`
计算给定输入文件的 Shannon 熵。
示例
```
shellph \
-e \
-f program.exe
[+] Loading input from disk...
[+] Entropy of popup_test.bin: 5.9807
[+] Low entropy detected, likely unencrypted data.
```
# 默认密钥
除非被覆盖,否则将使用以下默认值。
| 参数 | 值 |
| --------- | ------------------ |
| AES Key | `1234567890123456` |
| AES IV | `1234567890123456` |
| RC4 Key | `1234567890123456` |
| XOR Key | `1234567890123456` |
覆盖方式:
```
-k
-iv
```
# 项目结构
```
.
├── cmd/
│ └── shellph/
├── internal/
│ ├── cryptoops/
│ ├── format/
│ ├── input/
│ └── transform/
├── testdata/
├── .github/
│ └── workflows/
├── .goreleaser.yaml
├── go.mod
├── README.md
└── LICENSE
```
# 许可证
MIT 许可证
# 联系方式与博客
电子邮件:ramessham@gmail.com
博客:https://vanilla-sec.com/
Shellph 是一款便携的命令行工具,旨在自动化任意 shellcode 的加密与混淆。
# 功能
## 加密
* AES-CBC(128/192/256 位密钥,PKCS#7 填充)
* RC4
* XOR(重复密钥)
## 转换
* IPv4
* MAC Address
* UUID
## 输出格式
* Binary
* Hex
* String
* Array
## 支持的语言
* C
* Go
* Rust
* C#
* PowerShell
## 附加功能
* 计算给定输入文件的熵
# 安装
## 从源码构建
```
git clone https://github.com/xirtam2669/shellph.git
cd shellph
go build -o shellph ./cmd/shellph
```
## 使用 Go 安装
```
go install ./cmd/shellph
```
# 用法
```
shellph [options]
```
## 选项
| 简写 | 全称 | 描述 |
| ------ | -------------------------- | ------------------------------------ |
| `-f` | `--file` | 输入文件 |
| `-fmt` | `--input-format` | `raw` 或 `hex` |
| `-op` | `--operation` | 加密或转换操作 |
| `-of` | `--output-format` | `raw`、`hex`、`string` 或 `array` |
| `-ofl` | `--output-format-language` | `c`、`go`、`rust`、`csharp`、`powershell` |
| `-k` | `--key` | 加密密钥 |
| `-iv` | `--iv` | AES 初始化向量 |
| `-o` | `--outfile` | 输出文件名 |
| `-e` | `--entropy` | 计算输入文件的熵 |
# 操作
## 加密
```
aes
rc4
xor
```
## 转换
```
ipv4
mac
uuid
```
# 示例
## AES
```
shellph \
-f shellcode.bin \
-fmt raw \
-op aes \
-of array \
-ofl c
```
## RC4
```
shellph \
-f shellcode.bin \
-fmt raw \
-op rc4 \
-of string \
-ofl go
```
## XOR
```
shellph \
-f shellcode.bin \
-fmt raw \
-op xor \
-of array \
-ofl rust
```
## IPv4
```
shellph \
-f shellcode.bin \
-fmt raw \
-op ipv4 \
-of array \
-ofl powershell
```
生成
```
$encrypted = @(
"77.90.65.82",
"85.72.137.229",
"72.131.236.32",
)
```
## UUID
```
shellph \
-f shellcode.bin \
-fmt raw \
-op uuid \
-of string \
-ofl go
```
生成
```
var encrypted = "4d5a4152-5548-89e5-4883-ec204883e4f0
e8000000-005b-4881-c39f-610000ffd348
..."
```
# 输出语义
## 加密操作
操作:
* AES
* RC4
* XOR
### `-of string`
生成一个特定于语言的、包含加密字节的字符串变量。
示例:
```
var encrypted = "\x90\x90..."
```
### `-of array`
生成一个特定于语言的字节数组。
示例:
```
var encrypted = []byte{
0x90,
0x90,
}
```
## 转换操作
操作:
* IPv4
* MAC
* UUID
### `-of string`
生成一个特定于语言的多行字符串。
示例
```
var encrypted = "77.90.65.82
85.72.137.229
72.131.236.32
"
```
示例
```
$encrypted = @"
77.90.65.82
85.72.137.229
72.131.236.32
"@
```
### `-of array`
生成一个特定于语言的字符串数组。
示例
```
var encrypted = []string{
"77.90.65.82",
"85.72.137.229",
}
```
示例
```
$encrypted = @(
"77.90.65.82",
"85.72.137.229",
)
```
## 附加功能
计算:
* 计算熵
### `-e`
计算给定输入文件的 Shannon 熵。
示例
```
shellph \
-e \
-f program.exe
[+] Loading input from disk...
[+] Entropy of popup_test.bin: 5.9807
[+] Low entropy detected, likely unencrypted data.
```
# 默认密钥
除非被覆盖,否则将使用以下默认值。
| 参数 | 值 |
| --------- | ------------------ |
| AES Key | `1234567890123456` |
| AES IV | `1234567890123456` |
| RC4 Key | `1234567890123456` |
| XOR Key | `1234567890123456` |
覆盖方式:
```
-k
-iv
```
# 项目结构
```
.
├── cmd/
│ └── shellph/
├── internal/
│ ├── cryptoops/
│ ├── format/
│ ├── input/
│ └── transform/
├── testdata/
├── .github/
│ └── workflows/
├── .goreleaser.yaml
├── go.mod
├── README.md
└── LICENSE
```
# 许可证
MIT 许可证
# 联系方式与博客
电子邮件:ramessham@gmail.com
博客:https://vanilla-sec.com/标签:DNS 反向解析, EVTX分析, Go, Ruby工具, Shellcode, 代码混淆, 技术调研, 日志审计