使用 wireshark 分析加密 802.11 数据
- 查看 wifi 频段
- 配置 monitor
$ sudo ifconfig wlx1cbfce3fa407 down $ sudo iwconfig wlx1cbfce3fa407 mode monitor $ sudo ifconfig wlx1cbfce3fa407 up $ sudo iwconfig wlx1cbfce3fa407 channel 3 $ sudo wireshark
基于 monitor 模式,使用 wireshark 抓取空中包时,只能分析到 802.11 协议层,更底层被加密,此时可以使用 wireshark 来完成解密
设置如下
编辑 -> 首选项 -> protocols -> IEEE 802.11
- 勾选
Enable decryption - 编辑
Decryption keys- 加密
wep时,格式为十六进制 ASCII,例如123456为31:32:33:34:35:36 - 加密
WPA时WPA-PWD格式为PWD:BSSID,例如123456为123456:testWPA-PSK格式为PSK,PSK可以在 wpa-psk 计算出来
- 加密
设置之后,可以看到被 802.11 封装的协议
os:ubuntu18.04wireshark:2.6.8
貌似不是很稳定,重新打开 wireshark 有时不能解密删除 ~/.config/wireshark 之后重新来过才行
使用 WPA-PSK 解密
本质原因是需要获取到 full four EAPOL handshakes,在 wireshark 中使用 eapol.keydes.type == 2 检查是否收到