Wireshark пароль от вайфая

HackWare.ru

Этичный хакинг и тестирование на проникновение, информационная безопасность

Как в Wireshark расшифровать Wi-Fi трафик

Расшифровка WPA трафика в Wireshark

Начнём с теории, чтобы понять, почему процесс расшифровки Wi-Fi трафика в Wireshark требует некоторых усилий и почему нельзя просто расшифровать любой захваченный Wi-Fi трафик даже если есть пароль от Точки Доступа.

При передаче по Wi-Fi трафик шифруется с использованием PTK (Pairwise transient key — можно перевести как Парный переходной ключ). При этом PTK является динамичным, то есть создаётся заново для каждого нового соединения. Таким образом получается, что Wi-Fi трафик для каждого соединения в одной и той же Точке Доступа зашифрован разными PTK, причём даже для одного Клиента после переподключения PTK меняется. Для вычисления PTK необходимы данные из четырёх этапного рукопожатия, а также пароль от Wi-Fi сети (на самом деле нужна ещё и другая информация, например имя (SSID) сети, но получение этих данных не является проблемой).

Главное, что нужно понять: для расшифровки Wi-Fi трафика необходимо четырёх этапное рукопожатие. Причём не любое, а именно то, которое произошло для передачи того трафика, который нужно расшифровать. Но для использования захваченного рукопожатия необходим пароль от Wi-Fi сети.

Итак, чтобы расшифровать Wi-Fi трафик нужны:

1) рукопожатие, произошедшее между Клиентом и Точкой доступа непосредственно перед обменом расшифровываемой информацией

2) пароль для подключения к Точке Доступа

Далее будет показано два примера захвата Wi-Fi трафика и его расшифровки. Первый захват данных выполнен с помощью Airodump-ng, а затем беспроводной трафик будет расшифрован в Wireshark. Во втором примере данные будут захвачены и расшифрованы с использованием только Wireshark.

Захват Wi-Fi трафика в Airodump-ng

Чтобы данные были пригодны для расшифровки, нужно чтобы Wi-Fi карта не переключала каналы, а выполняла захват информации на одном канале, на котором работает целевая Точка Доступа. Поэтому начнём со сбора информации о целевой точки доступа.

Смотрим имена беспроводных интерфейсов:

Переводим ИНТЕРФЕЙС в режим монитора командами вида:

sudo ip link set ИНТЕРФЕЙС down sudo iw ИНТЕРФЕЙС set monitor control sudo ip link set ИНТЕРФЕЙС up

Запускаем airodump-ng командой вида:

sudo airodump-ng ИНТЕРФЕЙС

Например, я хочу захватить и расшифровать трафик для Точки Доступа Paangoon_2G, которая работает на 9 канале.

Тогда мне нужно перезапустить airodump-ng командой вида:

sudo airodump-ng ИНТЕРФЕЙС --channel КАНАЛ --write ИМЯ_ФАЙЛА

Надпись WPA handshake говорит о том, что было захвачено четырёх этапное рукопожатие. Это означает что:

  • теперь мы сможем расшифровать Wi-Fi данные (если у нас есть ключ от Wi-Fi сети)
  • мы сможем расшифровать данные только для конкретного клиента (с которым было совершено рукопожатие)
  • мы сможем расшифровать данные, которые были отправлены только после этого захваченного рукопожатия

Расшифровка Wi-Fi трафика в Wireshark

Открываем файл захвата в Wireshark. В исходном виде трафик выглядит примерно так:

То есть без расшифровки мы видим только MAC-адреса участников передачи данных, пакеты некоторых видов, а также пакеты с данными — полезная нагрузка в которых зашифрована.

Читайте также:  Ps4 can connect to wifi

Перед расшифровкой убедимся, что имеется хендшейк, иначе продолжать нет смысла:

Перед расшифровкой нам нужно сделать некоторые изменения в настройках протокола IEEE 802.11.

Перейдите в EditPreferences, раскройте секцию protocol и выберите IEEE 802.11. Настройки должны быть такими:

Когда у вас будут такие же настройки, как и на предыдущем скриншоте, нажмите на кнопку Edit рядом с надписью Decryption Keys (для добавления WEP/WPA ключа):

Нажмите кнопку Создать. В открывшемся окне в поле Key type выберите wpa-pwd, введите пароль от Wi-Fi сети, а через двоеточие имя (SSID) сети и нажмите ОК.

Например, в моём случае пароль 00001777, а имя сети Paangoon_2G, тогда я ввожу:

Нажмите кнопку Применить:

Теперь там видны DNS, HTTP запросы и ответы, а также другие сетевые пакеты.

Если захвачен трафик не только для данной сети, но и для других сетей, работающих на этом же канале, либо для данной сети но других клиентов, для которых не захвачены рукопожатия, то этот трафик не будет расшифрован.

Захват Wi-Fi в Wireshark

Трафик Wi-Fi можно захватить непосредственно в Wireshark. Но нам предварительно нужно переключить Wi-Fi карту на тот же канал, на котором работает целевая Точка Доступа. Это делается командами вида:

sudo ip link set ИНТЕРФЕЙС down sudo iw ИНТЕРФЕЙС set monitor control sudo ip link set ИНТЕРФЕЙС up sudo iw dev ИНТЕРФЕЙС set channel КАНАЛ

В этих командах нужно слова ИНТЕРФЕЙС и КАНАЛ заменить на действительные данные.

Когда интерфейс переключён на нужный канал, в Wireshark найдите этот интерфейс, в его свойствах поставьте галочку Capture packets in monitor mode. Затем начните захват данных:

Последующая расшифровка выполняется точно таким же образом, как показано выше.

Заключение

Для расшифровки WEP Wi-Fi трафика достаточно знать только пароль. Но ТД с WEP уже практически не встречаются.

Источник

How to Decrypt 802.11

Wireshark can decrypt WEP and WPA/WPA2/WPA3 in pre-shared (or personal) mode. WPA/WPA2 enterprise mode decryption works also since Wireshark 2.0, with some limitations.

You can add decryption keys using Wireshark’s 802.11 preferences or by using the wireless toolbar. Up to 64 keys are supported.

Adding Keys: IEEE 802.11 Preferences

Go to Edit->Preferences->Protocols->IEEE 802.11. You should see a window that looks like this:

IEEE-80211-Preferences.png

Click on the «Edit…» button next to «Decryption Keys» to add keys. You should see a window that looks like this:

Selecting-key-type.png

When you click the + button to add a new key, there are three key types you can choose from: wep, wpa-pwd, and wpa-psk:

  • wep The key must be provided as a string of hexadecimal numbers, with or without colons, and will be parsed as a WEP key.
 0102030405060708090a0b0c0d

You can optionally omit the colon and SSID, and Wireshark will try to decrypt packets using the last-seen SSID. This may not work for captures taken in busy environments, since the last-seen SSID may not be correct.

 0102030405060708091011. 6061626364

KeyExamples.png

Adding Keys: Wireless Toolbar

If you are using the Windows version of Wireshark and you have an AirPcap adapter you can add decryption keys using the wireless toolbar. If the toolbar isn’t visible, you can show it by selecting View->Wireless Toolbar. Click on the Decryption Keys… button on the toolbar:

Читайте также:  Нетис подключить вай фай

dot11-wireless-toolbar.png

This will open the decryption key managment window. As shown in the window you can select between three decryption modes: None, Wireshark, and Driver:

dot11-key-management.png

Selecting None disables decryption. Selecting Wireshark uses Wireshark’s built-in decryption features. Driver will pass the keys on to the AirPcap adapter so that 802.11 traffic is decrypted before it’s passed on to Wireshark. Driver mode only supports WEP keys.

Gotchas

Along with decryption keys there are other preference settings that affect decryption.

  • Make sure Enable decryption is selected.
  • You may have to toggle Assume Packets Have FCS and Ignore the Protection bit depending on how your 802.11 driver delivers frames.

The WPA passphrase and SSID preferences let you encode non-printable or otherwise troublesome characters using URI-style percent escapes, e.g. %20 for a space. As a result you have to escape the percent characters themselves using %25.

WPA and WPA2 use keys derived from an EAPOL handshake, which occurs when a machine joins a Wi-Fi network, to encrypt traffic. Unless all four handshake packets are present for the session you’re trying to decrypt, Wireshark won’t be able to decrypt the traffic. You can use the display filter eapol to locate EAPOL packets in your capture.

In order to capture the handshake for a machine, you will need to force the machine to (re-)join the network while the capture is in progress. One way to do this is to put the machine to sleep (for smartphones and tablets, «turning off» the machine puts it to sleep) before you start the capture, start the capture, and then wake the machine up. You will need to do this for all machines whose traffic you want to see.

WPA and WPA2 use individual keys for each device. Older versions of Wireshark may only be able to use the most recently calculated session key to decrypt all packets. Therefore, when several devices have attached to the network while the trace was running, the packet overview shows all packets decoded, but in the detailed packet view, only packets of the last device that activated ciphering are properly deciphered. Newer Wireshark versions are able to handle up to 256 associations and should be able to decode any packets all the time. Nevertheless, decoding can still fail if there are too many associations. Filtering out only the relevant packets (e.g. with «wlan.addr») and saving into a new file should get decryption working in all cases. Wireshark only frees used associations when editing keys or when it’s closed. So you may try that when decoding fails for unknown reasons. This also allows you to decode files without any eapol packets in it, as long as Wireshark did see the eapol packets for this communication in another capture after the last start and key edit. If decoding suddenly stops working make sure the needed eapol packetes are still in it.

WPA/WPA2 Enterprise/Rekeys

As long as you can somehow extract the PMK from either the client or the Radius Server and configure the key (as PSK) all supported Wireshark versions will decode the traffic just fine up to the first eapol rekey.

Читайте также:  Забыла пароль от ростелекома вай фай

Eapol rekey is often enabled for WPA/WPA2 enterprise and will change the used encryption key similar to the procedure for the initial connect, but it can also be configured and used for pre-shared (personal) mode. Wireshark 2.0 (v1.99.6rc0-454-g1439eb6 or newer) is needed if you want decode packets after a rekey.

WPA3 Per-Connection Decryption

In WPA3, a different PMK is used for each connection in order to achieve forward secrecy. Capturing the 4-way handshake and knowing the network password is not enough to decrypt packets; you must obtain the PMK from either the client or access point (typically by enabling logging in wpa_supplicant or hostapd with the -d -K flags) and use this as the decryption key in Wireshark. Even then, the decryption will only work for packets between that client and access point, not for all devices on that network.

See more discussion on the mailing list and forum.

Examples

The file SampleCaptures/wpa-Induction.pcap has WPA traffic encrypted using the password «Induction» and SSID «Coherer».

The file SampleCaptures/wpa-eap-tls.pcap.gz has a EAP-TLS handshake and rekeys included. The PMK’s you can use as PSK’s to decode it are: a5001e18e0b3f792278825bc3abff72d7021d7c157b600470ef730e2490835d4 79258f6ceeecedd3482b92deaabdb675f09bcb4003ef5074f5ddb10a94ebe00a 23a9ee58c7810546ae3e7509fda9f97435778d689e53a54891c56d02f18ca162

Источник

How to decrypt 802.11 ( WLAN / Wireless ) encrypted packets using Wireshark?

♦ If we are sure that all EAPOL packets are there in capture but we do not see EAPOL packets as EAPOL under protocol. EAPOL frames are shown as “802.11” under protocol column. The possible reasons are

◘ Something went wrong with Wireshark settings we might have done recently. Do check that.

◘ Uninstall Wireshark and install Wireshark again with “Remove my settings” option is ticked.

Wireshark password file:

We have seen one file path in step “g”. This is the text file to store security information and password for Wireshark.

Its looks like this

Conclusion:

Now we know how to decrypt all basic 802.11 security types frame with different methods. This helps us debugging any WLAN issue while testing.

Keep in mind that different Wireshark version has different style of taking input for decryption windows but all are quite simple and straight forward to understand. We have used 3.4.2 version for the article.

♥♥ you have any doubts or query please let me know in comment section or send mail at feedback@wifisharks.com.♥♥

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to share on Skype (Opens in new window)
  • Click to print (Opens in new window)

Источник

Оцените статью
Adblock
detector