psycore8/shencode
GitHub: psycore8/shencode
ShenCode 是一个用于开发、分析和测试 shellcode 的多功能框架,集成了编码、混淆、注入和 payload 生成等安全研究所需的完整工具链。
Stars: 4 | Forks: 0
tags:
- Label/Repo
title: ShenCode
Version: 1.0.0
Release:
# ShenCode

## 功能
ShenCode 是一个用于开发、分析和测试 shellcode 的框架。它支持以下操作模式:
- 参数模式
- `shencode core output -i file.raw -s inspect`
- [交互模式](https://psy8.dev/shencode/getting-started#interactive)
- `shencode$ load output`
- `shencode::core::output$`
- [任务模式](https://psy8.dev/shencode/core/task)
- 使用 `json` 在不同步骤中自动化模块
### 版本 1.0.0
#### 常规用法
查看 [ShenCode 文档](https://psy8.dev/shencode/)和[入门教程](https://psy8.dev/shencode/getting-started)以获取更多信息。
#### 模块
| 类别 | 描述 | 模块 |
| ----------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `core` | ShenCode 核心函数 | [download](https://psy8.dev/shencode/core/download) - [extract](https://psy8.dev/shencode/core/extract)- [inspect](https://psy8.dev/shencode/core/inspect) - [minidump](https://psy8.dev/shencode/core/minidump) - [output](https://psy8.dev/shencode/core/output) - [subproc](https://psy8.dev/shencode/core/subproc) - [task](https://psy8.dev/shencode/core/task) |
| `encoder` | Shellcode 编码器 | [alphanum](https://psy8.dev/shencode/encoder/alphanum) - [bytebert](https://psy8.dev/shencode/encoder/bytebert) - [byteswap](https://psy8.dev/shencode/encoder/byteswap)[^byteswap] - [multicoder](https://psy8.dev/shencode/encoder/multicoder) - [xor](https://psy8.dev/shencode/encoder/xor) - [xorchain](https://psy8.dev/shencode/encoder/xorchain) - [xorpoly](https://psy8.dev/shencode/encoder/xorpoly)[^xorpoly] |
| `inject` | 进程注入模块 | [dll](https://psy8.dev/shencode/inject/dll) - [injection](https://psy8.dev/shencode/inject/injection) - [linject](https://psy8.dev/shencode/inject/linject) - [ntinjection](https://psy8.dev/shencode/inject/ntinjection) - [psoverwrite](https://psy8.dev/shencode/inject/psoverwrite)[^psoverwrite] |
| `obfuscate` | Shellcode 混淆技术 | [feed](https://psy8.dev/shencode/obfuscate/feed)[^feed-dice] - [qrcode](https://psy8.dev/shencode/obfuscate/qrcode) - [rolhash](https://psy8.dev/shencode/obfuscate/rolhash) - [uuid](https://psy8.dev/shencode/obfuscate/uuid) |
| `payload` | 用于生成 payload 的模块 | [msfvenom](https://psy8.dev/shencode/payload/msfvenom) - [winexec](https://psy8.dev/shencode/payload/winexec) |
| `stager` | Stage 加载器 | [meterpreter](https://psy8.dev/shencode/stager/meterpreter) - [sliver](https://psy8.dev/shencode/stager/sliver) |
## 如何使用
##### 安装
```
git clone https://github.com/psycore8/shencode
cd shencode
python -m venv .venv
pip install .
shencode -h
```
使用以下命令来激活虚拟环境:
- Windows - `.venv\bin\activate`
- Linux - `source .venv/bin/activate`
## 发布说明
- `general` - 代码清理
- `general` - 通过 rich 实现改进了输出
- `general` - ShenCode 作为 Python 模块
- `core/inspect `- 将文件检查功能分离为一个模块,包括 html 导出
- `core/output` - 移除了 inspect
- `core/task` - 改进了 JSON scheme 以便更好地迭代和在一个文件中使用多个模块
- `obfuscate/uuid` - 添加了文件输出和反向函数
- `stager/meterpreter` - 修复了一些参数错误
- `stager/sliver` - 修复了数据类型错误和 os.name 实现
- `core/task` - 移除了已弃用的旧任务模块
- `general` - 更新了依赖项
- `general` - 修复了 setup.py 的语法 bug
- `general` - 修复了 banner bug
## 参考
- [字节交换](https://www.nosociety.de/en:it-security:blog:obfuscation_byteswapping)
- [内存解码器](https://www.nosociety.de/en:it-security:blog:obfuscation_polymorphic_in_memory_decoder)
- [函数名哈希](https://www.bordergate.co.uk/function-name-hashing/)
- [使用 python3 注入 Win32API](https://systemweakness.com/win32api-with-python3-part-iii-injection-6dd3c1b99c90)
- [Violent python:XOR 加密](https://samsclass.info/124/proj14/VPxor.htm)
- [如何在 python 中轻松加密文件](https://www.stackzero.net/how-to-easily-encrypt-file-in-python/)
[^byteswap]: [字节交换博客文章](https://www.nosociety.de/en:it-security:blog:obfuscation_byteswapping)
[^xorpoly]: [多态 XOR 解码器博客文章](https://www.nosociety.de/en:it-security:blog:obfuscation_polymorphic_in_memory_decoder)
[^psoverwrite]: [hasherezade](https://github.com/hasherezade/process_overwriting)
[^feed-dice]: [feed 使用 diceware 词表](https://github.com/ulif/diceware/blob/109df8b50720fd9ee60b414eecb4a097b3b2ba06/diceware/wordlists/wordlist_en_eff.txt)
标签:Shellcode, 云资产清单, 开发框架, 技术调研, 逆向工具, 逆向工程