MKMithun2806/ShellCraft

GitHub: MKMithun2806/ShellCraft

ShellCraft是一款用于生成和监听混淆反向shell载荷的Go语言工具。

Stars: 1 | Forks: 0

# ShellCraft **反向shell有效载荷生成器 — 交互式、混淆、即用即装。** [![Go 版本](https://img.shields.io/github/go-mod/go-version/MKMithun2806/ShellCraft?style=flat-square&logo=go)](https://go.dev/) [![许可证](https://img.shields.io/github/license/MKMithun2806/ShellCraft?style=flat-square)](/LICENSE) [![最新版本](https://img.shields.io/github/v/release/MKMithun2806/ShellCraft?style=flat-square&logo=github)](https://github.com/MKMithun2806/ShellCraft/releases) [![构建](https://img.shields.io/github/actions/workflow/status/MKMithun2806/ShellCraft/release.yml?style=flat-square)](https://github.com/MKMithun2806/ShellCraft/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/MKMithun2806/ShellCraft?style=flat-square)](https://goreportcard.com/report/github.com/MKMithun2806/ShellCraft)
image ## ✨ 功能
**生成** - 交互式引导工作流程和CLI单行命令 - 自动IP检测 (`-i auto`) - Linux、Windows、macOS跨平台10+有效载荷类型 - PowerShell和Python混淆引擎(级别1-3) - 编码包装器:原始、URL、Base64 **生成后** - 每种有效载荷类型的AV/EDR绕过建议 - Shell升级命令(PTY、socat、stty) - HTTP交付方法(curl、wget、IEX、certutil) - C2框架加载器(Covenant、Sliver、Empire、Metasploit) - 剪贴板复制(xclip/xsel/pbcopy/clip) **🎛️ 监听器** - **内置Go监听器**(默认,无需外部工具) - 通过`golang.org/x/term`的PTY感知原始终端 - 箭头键、Tab、Ctrl+C、Ctrl+Z透明传输 - SIGWINCH调整大小处理 - 多连接管理,带交互式切换菜单 - `Ctrl+]`挂起会话并返回到连接菜单 - 适当的`nc -lvnp` / ncat替代品 — 只需`shellcraft listen 4444` - 仍然完全支持外部工具:`nc`、`socat`、`rlwrap`、`ncat` - 自动检测可用工具,彩色建议 **💾 持久性** - 有效载荷历史记录(最后20个,带时间戳) - 模板系统(保存/加载配置) - 自定义用户定义的有效载荷(持久化到磁盘) **🔧 内部** - 无外部依赖 — 纯Go stdlib - 清洁`Ctrl+C`处理 - 跨平台(Linux、macOS、Windows)
## 📦 安装
选项1 — 预构建的二进制文件(推荐) 从[发布页面](https://github.com/MKMithun2806/ShellCraft/releases)下载,然后: ``` chmod +x shellcraft-* ./shellcraft-* ```
选项2 — 快速安装脚本 ``` curl -sSL https://raw.githubusercontent.com/MKMithun2806/ShellCraft/main/install.sh | bash ```
选项3 — go install ``` go install github.com/MKMithun2806/ShellCraft/cmd/shellcraft@main ```
选项4 — 手动构建 ``` git clone https://github.com/MKMithun2806/ShellCraft.git cd ShellCraft go build -ldflags "-X main.Version=1.0.0" -o shellcraft ./cmd/shellcraft ```
## 🎮 使用 ### 交互式模式 ``` shellcraft ``` 按照提示配置IP、端口、有效载荷类型、编码和混淆。 ### 单行命令模式 ``` # 基础 shellcraft -i 10.10.10.10 -p 4444 -t python -e base64 # 带自动IP和混淆 shellcraft -i auto -p 4444 -t powershell -e b64 --obfs 2 --suggest ```
📋 完整CLI参考 #### 生成标志 | 标志 | 描述 | 示例 | |------|-------------|---------| | `-i` | 攻击者IP(自动检测为`auto`) | `-i 10.0.0.1` | | `-p` | 攻击者端口 | `-p 4444` | | `-t` | 有效载荷类型 | `-t powershell` | | `-e` | 编码:`raw`、`url`、`b64` | `-e b64` | | `-obfs` | 混淆级别0-3(PS & Python) | `-obfs 2` | #### 模板标志 | 标志 | 描述 | |------|-------------| | `-list` | 列出保存的模板 | | `-load ` | 加载并运行模板 | | `-save ` | 将当前配置保存为模板 | #### 额外输出标志 | 标志 | 描述 | |------|-------------| | `-suggest` | 显示AV/EDR绕过和shell升级提示 | | `-delivery` | 显示HTTP交付方法 | | `-c2` | 显示C2框架加载器 | #### 自定义有效载荷标志 | 标志 | 描述 | |------|-------------| | `-add-custom name:code[:type:os]` | 添加自定义有效载荷 | | `-list-custom` | 列出自定义有效载荷 | | `-delete-custom ` | 通过索引删除 |
### 子命令
🎧 监听器 默认监听器是**内置的Go TCP监听器** — 一个功能齐全的`nc -lvnp`替代品: ``` # 内置监听器(默认)——无需外部工具 shellcraft listen 4444 shellcraft listen -p 4444 shellcraft listener --port 9001 ``` 在交互式会话中: - **远程输出**以青色突出显示以提高可见性 - **箭头键、Tab、Ctrl+C、Ctrl+Z**自然工作(原始PTY模式) - **Ctrl+]**挂起会话并返回到连接菜单 - 在远程shell上输入`exit`以自动关闭连接 也完全支持外部工具,当您更喜欢它们时: ``` shellcraft listen 4444 nc shellcraft listen 4444 socat shellcraft listen 4444 rlwrap shellcraft listen 4444 ncat ```
有效载荷历史记录 ``` shellcraft history ``` 显示最后20个生成的有效载荷,包括时间戳、IP、端口、类型和编码器。
自定义有效载荷 ``` shellcraft custom-payload list shellcraft custom-payload add # interactive shellcraft custom-payload delete ``` 自定义有效载荷将自动合并到交互式有效载荷选择菜单中。
ℹ️ 版本 ``` shellcraft version ```
### 生成后菜单 在交互式生成有效载荷后,菜单允许您: | # | 操作 | |---|--------| | 1 | 将有效载荷复制到剪贴板 | | 2 | 保存为模板 | | 3 | 显示AV/EDR绕过和shell升级提示 | | 4 | 显示HTTP交付方法 | | 5 | 显示C2框架集成 | | 6 | 添加自定义有效载荷 | | 7 | 启动监听器(内置Go监听器,默认为PTY原始模式) | | 8 | 退出 | ## 🧪 有效载荷参考 | OS | 有效载荷 | 备注 | |----|---------|-------| | 🐧 Linux | Bash、NC FIFO、Python、PHP、Ruby、Perl | — | | 🪟 Windows | PowerShell(AMSI绕过)、CMD、MSHTA(VBScript)、Certutil加载器 | 包括签名规避 | | 🍏 macOS | Zsh 本地 | 本地 `ztcp` | ### 混淆级别 | 级别 | PowerShell | Python | |-------|------------|--------| | 0 | 无 | 无 | | 1 | 标记碎片关键字 | Base64执行包装器 | | 2 | 变量名随机化 | Base64执行包装器 | | 3 | 变量随机化 + 字符串连接 | Base64执行包装器 | ## 🗑️ 卸载脚本(删除所有shellcraft) ``` curl -sSL https://raw.githubusercontent.com/MKMithun2806/ShellCraft/main/uninstall.sh | bash ``` ## ⚠️ 声明
用Go制作  ·  无外部依赖
标签:AV绕过, C2框架, Covenant, DAST, EDR绕过, Empire, EVTX分析, FastAPI, Go 语言, HTTP投递, IPv6, ncat替代, PowerShell, pty, Python, Sliver, stty, 云资产清单, 交互式界面, 代码生成, 剪贴板操作, 反弹shell, 后门, 安全学习资源, 安全测试, 恶意软件, 恶意软件分析, 攻击性安全, 无后门, 日志审计, 混淆, 渗透测试工具, 特权提升, 终端模拟, 脚本语言, 自动化部署, 逆向工程, 零依赖, 高交互蜜罐