802.11 decryption: Long running captures
https://www.cs.toronto.edu/~arnold/427/15s/csc427/tools/aircrack/Aircrack.pdf (Slide#12)

802.11 decryption: Long running captures

Problem

Decrypting 802.11 packets using Wireshark is a beaten to death topic, I myself had written [1] more than a decade ago, so, nothing new there. It relies on having the security handshake (4-way handshake) configured (mainly for Nonces's: ANonce and SNonce) and PSK/Passphrase setup in the Decryption Keys widget.

But let's say you are running a SnS (Stress and Stability) test which is typically an overnight test, and to decrypt the packets for debugging you need to start right from the initial association which would be a very large capture. And if you only have a partial capture of the issue then standard decryption won't work. This article is about addressing this problem.

Solution

Apart from PSK/Passphrase, Wireshark also support importing TK (Temporal Key: Not to be confused with transient key), this removes the dependency of having a security handshake in the capture.

Now how do we get the TK for the initial capture, Wireshark stores the full SA (Security Association) internally along with the TK, but it doesn't have any way to export the TK information, I have raised a feature request for this [2]. If I get time I myself might work on that.

Till the feature is implemented, we can use aircrack-ng to get the TK from the initial handshake pcap.

Procedure

TK Extraction

  1. Collect the initial handshake pcap using Wireshark
  2. Extract the TK (put the passphrase in a file): aircrack-ng <pcap file> -w passphrase_file -e <ESSID>
  3. Check the Transient Key Output, it will be 4 lines as below, from that we need TK (Temporal key), see main figure taken from [3] (Slide#12) to understand the split (it's TEK in the picture, but TK is standard terminology), it's basically 3rd line (256-383 bits: 32-47 bytes).

Transient Key : 9F E2 1C A5 6D 2B 3F 89 1A E3 F1 5D C4 27 8E 5A
                D8 43 7C 92 1B 0F 6E C8 99 46 5A 3B 92 71 DF 3F
                3E 91 B5 6F 48 2C 95 A1 B3 1E C2 4F 0D 8A 1F 4D
                75 B6 AB 3C 09 F2 4D 21 54 8E 9F 73 D5 3C 60 77        

I was trying to find alternatives to this something like PSK calculator in [4], but couldn't find anything, please comment below if you find any such tools.

TK usage

  1. Capture the data without the security handshake
  2. Import the TK to Wireshark (without the spaces) Using Decryption keys widget under IEEE 802.11 protocol preferences
  3. Data will automatically be decrypted

Limitations

  1. Won't work if PTK rekeying or renewal is enabled, the same process should be repeated whenever PTK is changed
  2. TK's can impact performance as all TK's have to be tried for each packet till a match is found see 11.11.2.5 in [5].

#802.11 #wpa #wpa2 #ptk #gtk #handshake #stressattack #stabilitytesting #aircrackng #networksecurity #wireshark

References

  1. https://wire-less-comm.blogspot.com/2013/03/capturing-packets-secured-80211.html
  2. https://gitlab.com/wireshark/wireshark/-/issues/19613
  3. https://www.cs.toronto.edu/~arnold/427/15s/csc427/tools/aircrack/Aircrack.pdf
  4. https://www.wireshark.org/tools/wpa-psk.html
  5. https://www.wireshark.org/docs/wsug_html_chunked/Ch80211Keys.html

Thomas d'Otreppe de Bouvette

System & Network Engineer | InfoSec Trainer | DevOps | Open Source

10 个月

I haven't tested but I'm assuming extracting the handshake (and a few other necessary frames), then concatenating it with the PCAP being analyzed (handshake first, then PCAP being analyzed) should work as well

回复
Chaitanya Tata

Wi-Fi Consulting->engineer = self.employed

10 个月

Forgot to add the performance limitation, #2 is now added.

回复

要查看或添加评论,请登录

社区洞察

其他会员也浏览了