ZerBea/hcxtools
GitHub: ZerBea/hcxtools
将 WiFi 抓包文件转换为 Hashcat 和 John the Ripper 兼容的哈希格式,用于 WPA/WPA2 密码审计和破解。
Stars: 2330 | Forks: 432
# hcxtools
一小套工具,用于将捕获文件中的数据包转换为哈希文件,以供 Hashcat 或 John the Ripper 使用。
这些工具与 Hashcat 和 John the Ripper 100% 兼容,并得到 Hashcat 认可。
## 简要说明
hcxtools 的主要目的是通过分析哈希值来检测自身 WiFi 网络中的薄弱点。
因此,将转储文件转换为 WPA-PBKDF2-PMKID+EAPOL 哈希文件,允许用户检查 WLAN-KEY 或 PMK 是否未加密传输。
或者,将“未清理的”转储文件 (pcapng, pcap, cap) 上传 [此处](https://wpa-sec.stanev.org/?submit),通过使用常见字典或弱密码生成算法,来查明你的 AP 或 CLIENT 是否存在漏洞。
* 支持 Hashcat hash-modes:4800, 5500, 2200x, 16100, 250x (已弃用) 和 1680x (已弃用)。
* 支持 John the Ripper hash-modes:WPAPSK-PMK, PBKDF2-HMAC-SHA1, chap, netntlm 和 tacacs-plus。
* 支持 gzip (.gz) 单文件压缩。
Hashcat 模式 22000 概述。- (https://hashcat.net/wiki/doku.php?id=cracking_wpawpa2)
Hashcat 论坛的 **atom** 发布的旧但仍适用的文章,涵盖了使用 PMKID 对 WPA/WPA2 的新攻击。- (https://hashcat.net/forum/thread-7717.html)
Hashcat 论坛的 **atom** 发布的 Hashcat 模式 22000 文章。- (https://hashcat.net/forum/thread-10253.html)
**不支持:** Windows OS, macOS, Android, 模拟器或包装器!
## hcxtools 不能做什么?
* 它们不破解 WPA PSK 相关哈希。(使用 Hashcat 或 JtR 来恢复 PSK。)
* 它们不破解 WEP。(改用 aircrack-ng 套件。)
* 它们不破解 WPS。(改用 Reaver 或 Bully。)
* 它们不解密加密流量。(使用 tshark 或 Wireshark 来执行此操作。)
## 详细说明
| Tool | Description |
| -------------- | ---------------------------------------------------------------------------------------------------------------------- |
| hcxpcapngtool | 将原始捕获文件转换为 Hashcat 和 JtR 可读格式的工具。 |
| hcxhashtool | 基于用户输入从 HC22000 文件中过滤哈希的工具。 |
| hcxpmktool | 计算和验证 PSK 和/或 PMK 的工具。 |
| hcxpottool | 处理 hashcat 的 pot 文件的 ASCII 格式和多种 UTF 格式的工具。 |
| hcxpsktool | 从哈希文件或用户输入获取弱 PSK 候选词的工具。 |
| hcxeiutool | 准备 hcxpcapngtool 的 -E -I -U 输出以供 Hashcat + 规则 或 JtR + 规则 使用的工具。 |
| hcxwltool | 基于混合字典计算 Hashcat 和 JtR 候选词的工具。 |
| hcxhash2cap | 将哈希文件 (PMKID&EAPOL, PMKID, EAPOL-hccapx, EAPOL-hccap, WPAPSK-john) 转换为 cap 的工具。 |
| wlancap2wpasec | 将多个 (gzip 压缩的) pcapng, pcap 和 cap 文件上传到 https://wpa-sec.stanev.org 的工具 |
| whoismac | 显示供应商信息和/或下载 oui 参考列表的工具。 |
## 工作流程
hcxdumptool -> hcxpcapngtool -> hcxhashtool (附加 hcxpsktool/hcxeiutool) -> hashcat 或 JtR
## 安装指南
在大多数发行版中,可以通过包管理器安装 hcxtools。
如果你决定编译最新的 git head,请确保你的发行版已更新到最新版本,并确保已安装所有头文件和依赖项!
### 克隆仓库
```
git clone https://github.com/ZerBea/hcxtools.git
cd hcxtools
```
### 编译并安装
```
make -j $(nproc)
```
安装到 `/usr/bin`:
```
make install (as super user)
```
或者安装到 `/usr/local/bin`:
```
make install PREFIX=/usr/local (as super user)
```
## 要求
你可能以为我会推荐每个人都使用 hcxdumptool/hcxtools。但事实是,不建议没有经验的用户或新手使用 hcxdumptool/hcxtools。
如果你总体上不熟悉 Linux,或者你不具备“要求”部分中提到的至少基础知识,那么 hcxdumptool/hcxtools 可能不适合你。
但是,如果你具备这些知识,这个工具可以创造奇迹。
* 无线电技术知识。
* 电磁波工程知识。
* 详细的 802.11 协议知识。
* 详细的密钥派生函数知识。
* 详细的 NMEA 0183 协议知识。
* 详细的 Linux 知识
* 操作系统:Linux (推荐:kernel >= 6.4,强制:kernel >= 5.10)
* 推荐:Arch Linux (笔记本电脑和台式机系统),OpenWRT (小型系统如 Raspberry Pi,WiFi 路由器)
* 推荐 gcc >= 13 (不支持已弃用的版本:https://gcc.gnu.org/)
* 已安装 libopenssl (>= 3.0) 和 openssl-dev
* 已安装 librt 和 librt-dev。(默认情况下应已安装。)
* 已安装 zlib 和 zlib-dev。(用于 gzip 压缩的 cap/pcap/pcapng 文件。)
* 已安装 libcurl (>= 7.56) 和 curl-dev。(由 whoismac 和 wlancap2wpasec 使用。)
* 已安装 pkg-config。
* 确保 hcxpcapngtool 的版本始终与 hcxdumptool 的版本匹配
**如果你决定编译最新的 git head,请确保你的发行版已更新到最新版本!**
## 实用脚本
| Script | Description |
| ------------ | -------------------------------------------------------- |
| piwritecard | 恢复 SD 卡的示例脚本 |
| piwreadcard | 备份 SD 卡的示例脚本 |
| hcxgrep.py | 基于正则表达式从 m22000 hashline/hccapx/pmkid 文件中提取记录 |
## 注意
* 大多数输出文件将附加到现有文件中 (pcapng, pcap, cap 文件除外)。
* 建议使用哈希模式 22000 (22001) 而不是已弃用的哈希模式 2500 (2501) 和 16800 (16801)。
* hcxtools 设计为分析工具。这意味着默认情况下会转换所有内容,必须过滤掉不需要的信息!
**警告:** 不要合并转储文件!这会破坏由自定义块分配的哈希值!
* 工具不执行 NONCE 纠错!如果发生数据包丢失,你将得到错误的 PTK。
* 此分支与 Hashcat 和 John the Ripper 仓库保持非常紧密的同步。
## 位掩码消息对字段 (hcxpcapngtool)
bits 0-2
000 = M1+M2, EAPOL from M2 (challenge - ANONCE from M1)
001 = M1+M4, EAPOL from M4 (authorized) - usable if M4 NONCE is not zeroed and using option --all
010 = M2+M3, EAPOL from M2 (authorized - ANONCE from M3)
011 = M2+M3, EAPOL from M3 (authorized) - only with option --all
100 = M3+M4, EAPOL from M3 (authorized) - only with option --all
101 = M3+M4, EAPOL from M4 (authorized) - usable if M4 NONCE is not zeroed and using option --all
3: reserved
4: ap-less attack (set to 1) - no nonce-error-corrections necessary
5: LE router detected (set to 1) - nonce-error-corrections only for LE necessary
6: BE router detected (set to 1) - nonce-error-corrections only for BE necessary
7: not replaycount checked (set to 1) - replaycount not checked, nonce-error-corrections definitely necessary
## 警告
你可能以为我会推荐每个人都使用 hcxdumptool/hcxtools。但事实是,不建议没有经验的用户或新手使用 hcxdumptool/hcxtools。
如果你总体上不熟悉 Linux,或者你不具备“要求”部分中提到的至少基础知识,那么 hcxdumptool/hcxtools 可能不适合你。
但是,如果你具备这些知识,hcxdumptool/hcxtools 可以为你创造奇迹。
整个工具包 (hcxdumptool 和 hcxtools) 设计为分析工具包。
## 有用的链接
https://pcapng.com/
https://www.kernel.org/doc/html/latest/
https://www.kernel.org/doc/html/latest/bpf/index.html
https://www.freecodecamp.org/news/the-linux-commands-handbook/
https://en.wikipedia.org/wiki/Wpa2
https://en.wikipedia.org/wiki/802.11_Frame_Types
https://en.wikipedia.org/wiki/IEEE_802.11i-2004
标签:Bitdefender, DNS枚举, Hashcat, hcxtools, John the Ripper, pcap处理, PMKID攻击, WiFi破解, WPA/WPA2, 代码生成, 哈希转换, 安全测试工具, 客户端加密, 客户端加密, 密码审计, 渗透测试工具, 离线破解, 网络安全工具, 网络抓包