- Deauthentication attack using Kali Linux
- 1 | What is a Deauth Attack ?
- 2 | Why would one attack a network in that way?
- 3 | How to Deauth
- Step 1 | Fire up Kali and open up a Terminal
- Step 2 | Setting wireless adapter in monitor mode with airmon-ng
- Step 3 | Searching for Victims with airodump-ng
- Step 4 | Specific Targeting for better information gathering
- Step 5 | Deauthenticating Device from the network
- 4 | Prevent the attack and take the necessary precautions
- Инструменты Kali Linux
- Список инструментов для тестирования на проникновение и их описание
- Aireplay-ng
- Описание Aireplay-ng
- Использование атак
- Справка по Aireplay-ng
- Руководство по Aireplay-ng
- Фрагментация или Chopchop (отбивная котлета)
- Примеры запуска Aireplay-ng
- Установка Aireplay-ng
- Установка в другие операционные системы
Deauthentication attack using Kali Linux
Hello Duthcode Hackers, this is how i am going to be calling you from now on. In this article i am going to be talking about a hack attack called deauthentication.
In my humble opinion, when a hacker learns about a new attack, he or she has the obligation to also learn how to prevent it. So, this is not going to be a simple how to, this article will be divided in 4 parts:
- | What is a Deauth Attack
- | Why would you want to attack in that way
- | How to do it
- | How to prevent the attack and take the necessary precautions
Feel free to skip steps of course.
1 | What is a Deauth Attack ?
Deauthentication attack is a type of denial of service attack that targets communication between a user ( or all users ) and a Wi-Fi access point.
This attack sends disassociate packets to one or more clients which are currently associated with a particular access point. Of course, this attack is totally useless if there are no associated wireless client or no fake authentications.
The cool thing about this attack is that even in 2019 where all networks are using a WPA2 encryption you can still easily deauth anything or anyone without even being inside the network!
- Why does a deauth attack work on WPA2 despite encryption?
- The use of encryption in 802.11 is limited to data payloads only. Encryption does not apply to the 802.11 frame headers, and cannot do so as key elements of 802.11 headers are necessary for normal operations of 802.11 traffic.
Since 802.11 management frames largely work by setting information in the headers, management frames are not encrypted and as such are easily spoofed.
To prevent deauthentication/disassociation attacks, the IEEE implemented the 802.11w amendment to 802.11. This provides a mechanism to help prevent the spoofing of management frames, but both client and infrastructure need to support it (and have it enabled) for it to function. (source)
- The use of encryption in 802.11 is limited to data payloads only. Encryption does not apply to the 802.11 frame headers, and cannot do so as key elements of 802.11 headers are necessary for normal operations of 802.11 traffic.
2 | Why would one attack a network in that way?
A deauth attack is, most of the times, a step of a greater attack! Hackers usually need to deauth a user off of a network so they can:
- Capture WPA/WPA2 4-Way Handshakes by forcing a user to reconnect to the network
- Force users to connect to their own Rogue access point (search : Evil Twin Attack)
- Force users to connect to a Captive Portal
I will be writing articles and tutorials demonstrating every single one of the aforementioned attacks so stay tuned.
You can also deauth users in your network for way simpler reasons, like:
- Kick a sibling or a friend off the network just because they are slowing your connection down
- Frustrate people and laugh
- example, let’s say your best friend is a waiter, and he takes his orders from customers with a PDA connected to the Cafe’s Wi-Fi connection, deauth his PDA and drive him mad. (You didn’t read that from me).
Ok, enough with the Theory! Practice!
3 | How to Deauth
For this attack we need a tool called aircrack-ng, aircrack-ng is more of a suite actually containing many tools to assess Wi-Fi network security, I have a list of the aircrack tools in my Introduction to Kali Linux article, tool #5.
Since aircrack-ng suite comes pre-installed inside the Kali Linux Distribution, the whole tutorial is on Kali Linux, if you don’t have Kali installed on your computer or on a Virtual Machine take a look at my Kali Linux bootable USB — A Hacker’s Swiss army knife article and get ready!
Ok! one last thing, since we are talking about sending packets we will need a wireless adapter both able to work in monitor mode and be a packet injector!
- What is Monitor Mode? | For listening and Capturing
- Monitor mode allows you to capture data sent and received by wireless devices and networks nearby. Without it you can not see which devices are active and what is happening inside the network.
- What is Packet Injection? | For transmitting and Attacking
- Packet injection allows you to craft and inject or send data to wireless devices and networks nearby. Without it you can not intercept or manipulate any activity from within the network.
My favourite wireless adapter, and the one I’ll be using for this tutorial, is Alfa AWUSO36NH High Gain USB Wireless G / N Long-Rang WiFi Network Adapter , it has never failed me thus far.
DANGER : 2020 Update, Tp Link Adapters have been updated to the V2 (Version 2) and they don’t work with Kali anymore! So go ALFA!
Step 1 | Fire up Kali and open up a Terminal
By typing ifconfig and the enter key on your terminal you get the following output :
At the eth0 section in my ifconfig output you see that i have inet 10.0.2.15, this is because i am running Kali Linux on a Virtual Machine and i have it connected on a nat network. Don’t worry about it, you do not even have to care!
All YOU have to care about is the wlan0 section that is your wireless adapter and as you can see mine in not even connected to a network.
Now, if we type to our terminal iwconfig and execute it we see:
Mode : managed, our first goal is to put our wireless adapter on monitor mode.
Step 2 | Setting wireless adapter in monitor mode with airmon-ng
By running the airmon-ng start wlan0 (or whatever your adapter is called, it could be wlan1 or wlan2) you are setting your adapter to monitor mode! Check out the output :
See the above iwconfig result. Mode:Monitor and the name is wlan0mon! You are ready to go.
Step 3 | Searching for Victims with airodump-ng
Run on your terminal => airodump-ng wlan0mon
You will get a bunch of different access points with a lot of info you don’t understand! Let’s break them down.
- BSSID | MAC address of the access point. In the Client section, a BSSID of “(not associated)” means that the client is not associated with any AP. In this unassociated state, it is searching for an AP to connect with.
- PWR | Signal level reported by the card. Its signification depends on the driver, but as the signal gets higher you get closer to the AP or the station. If the BSSID PWR is -1, then the driver doesn’t support signal level reporting. If the PWR is -1 for a limited number of stations then this is for a packet which came from the AP to the client but the client transmissions are out of range for your card. Meaning you are hearing only 1/2 of the communication. If all clients have PWR as -1 then the driver doesn’t support signal level reporting.
- Beacons | Number of announcements packets sent by the AP. Each access point sends about ten beacons per second at the lowest rate (1M), so they can usually be picked up from very far.
- # Data | Number of captured data packets (if WEP, unique IV count), including data broadcast packets.
- #/s | Number of data packets per second measure over the last 10 seconds.
- CH | Channel number (taken from beacon packets).
Note: sometimes packets from other channels are captured even if airodump-ng is not hopping, because of radio interference. - MB | Maximum speed supported by the AP. If MB = 11, it’s 802.11b, if MB = 22 it’s 802.11b+ and higher rates are 802.11g. The dot (after 54 above) indicates short preamble is supported. Displays “e” following the MB speed value if the network has QoS enabled.
- ENC | Encryption algorithm in use. OPN = no encryption,“WEP?” = WEP or higher (not enough data to choose between WEP and WPA/WPA2), WEP (without the question mark) indicates static or dynamic WEP, and WPA or WPA2 if TKIP or CCMP is present.
- CIPHER | The cipher detected. One of CCMP, WRAP, TKIP, WEP, WEP40, or WEP104. Not mandatory, but TKIP is typically used with WPA and CCMP is typically used with WPA2. WEP40 is displayed when the key index is greater then 0. The standard states that the index can be 0-3 for 40bit and should be 0 for 104 bit.
- AUTH | The authentication protocol used. One of MGT (WPA/WPA2 using a separate authentication server), SKA (shared key for WEP), PSK (pre-shared key for WPA/WPA2), or OPN (open for WEP).
- ESSID | Shows the wireless network name. The so-called “SSID”, which can be empty if SSID hiding is activated. In this case, airodump-ng will try to recover the SSID from probe responses and association requests.
My target is me. TP-LINK_AP_4CE8! I am highlighting me because i am trying very hard not to break any laws, so should you!
Step 4 | Specific Targeting for better information gathering
Now that we know all that we need to know about our target we have to find any devices connected to the network, to do that we run the following command.
The commands structure is airodump-ng -d «target’s BSSID» -c «target’s channel number» «wireless adapter monitor mode name»
In our case the full command is:
Now we are monitoring SPECIFICALLY our target, and not many targets in general. Also we can see that there are two devices currently inside the network, one of which is my phone!
Step 5 | Deauthenticating Device from the network
This is our final command!
- -0 means deauthentication.
- 0 is the number of deauths to send 0 means send them continuously, you can send 10 if you want the target to disconnect and reconnect.
- -a 50:C7:BF:DC:4C:E8 is the MAC address of the access point we are targeting.
- -c E0:B5:2D:EA:18:A7 is the MAC address of the client to deauthenticate; if this is omitted then all clients are deauthenticated.
- wlan0mon is the interface name.
The command continuous output:
And its immediate result :
4 | Prevent the attack and take the necessary precautions
You are now well familiar with the attack and know all the theory a beginner may need! But how could one prepare himself for defending against a deauthentication attack?
You can not stop a bad guy from sending deauth packets. Instead you should make sure your network is configured in a way that the deauth attack doesn’t enable an attacker to compromise your network.
- Make sure your network is using WPA2 encryption.
- Your Wi-Fi passphrase should be very long and strong.
- Once you have been disconnected from your network, make sure that you connect back to a WPA2 secure network and not an open one with the same name as yours! IMPORTANT.
That was it! Thank you for reading! Here are some other Articles you might like:
You can show your support by liking our Facebook Page ! Support our efforts on Ko-Fi ! And you can get in contact with us either by sending us a message on Facebook or via the e-mail on the footer of the Page!
Источник
Инструменты Kali Linux
Список инструментов для тестирования на проникновение и их описание
Aireplay-ng
Описание Aireplay-ng
Aireplay-ng используется для инъекции (инжекта) фреймов.
Главная функция — это генерировать трафик для последующего использования в aircrack-ng для взлома WEP и WPA-PSK ключей. Существуют различные атаки, которые могут повлечь деаутентификацию (говоря проще, разъединение пользователей) в целях захвата данный рукопожатия WPA, фальшивой аутентификации, интерактивного повтора пакетов, вручную сконструированных ARP запросов в инъекциях и обратной закачки ARP запросов. С инструментом packetforge-ng возможно создавать произвольный фреймы.
Использование атак
На текущей момент реализовано несколько различных атак:
- Атака 0: Деаутентификация
- Атака 1: Фальшивая аутентификация
- Атака 2: Интерактивный повтор пакетов
- Атака 3: Атака повторной отправки запросов ARP
- Атака 4: Атака KoreK chopchop
- Атака 5: Фрагментированная атака
- Атака 6: Атака кафе-латтэ (Cafe-latte)
- Атака 7: Ориентированная на клиента фрагментированная атака
- Атака 8: Режим миграции WPA
- Атака 9: Тест инъекции
Автор: Thomas d’Otreppe, Первоначальная работа: Christophe Devine
Справка по Aireplay-ng
Опции повторного воспроизведения (инъекции):
Опции атаки Фальшивая деаутентификация:
Опции атаки повторной отправки запросов ARP:
Опции фрагментированной атаки:
Опции тестирования инжекта:
Режимы атаки (также можно использовать цифры):
Руководство по Aireplay-ng
ОПЦИИ:
-H, —help
Показать сообщение помощи.
Опции фильтра:
-b
MAC адрес точки доступа.
-d
MAC адрес пункта назначения.
-s
MAC адрес источника.
-m
Минимальная длина пакета.
-n
Максимальная длина пакета.
-u
Управление фреймом, поле type.
-v
Управление фреймом, поле subtype.
-t
Управление фреймом, «To» DS бит (0 или 1).
-f
Управление фреймом, «From» DS бит (0 или 1).
-w
Управление фреймом, WEP бит (0 или 1).
-D
Отключить выявление ТД.
Опции повторного воспроизведения:
-x
Количество пакетов в секунду.
-p
Установить слово контрольного фрейма (шестнадцатиричное).
-a
Установить MAC адрес точки доступа.
-c
Установить MAC адрес пункта назначения.
-h
Установить MAC адрес источника.
-g
Изменить размер кольцевого буфера (по умолчанию: 8 пакетов). Минимум — 1.
-F
Выбрать первый подходящий пакет.
Атака фальшивая аутентификация:
-e
Установить целевую SSID. Для SSID, содержащей специальные символы, смотри http://www.aircrack-ng.org/doku.php?id=faq#how_to_use_spaces_double_quote_and_sin‐gle_quote_etc._in_ap_names
-o
Атака фальшивая аутентификация: Установить количество пакетов для каждой попытке аутентификации и ассоциации (По умолчанию: 1). 0 означает автоматически.
-q
Атака фальшивая аутентификация: Установить время между временем жизни пакетов в режиме фальшивой аутентификации.
-Q
Атака фальшивая аутентификация: Отправлять запросы о повторном переподключении вместо выполнения полной аутентификации и ассоциации после каждого периода задержки.
Атака фальшивая аутентификация: Определить поток ключей для фальшивого общего ключа аутентификации.
-T n
Атака фальшивая аутентификация: Выйти если фальшивая аутентификация провалилась ‘n’ раз.
Атака воспроизведения ARP :
-j
Инъекция пакетов FromDS.
-k
Фрагментированная атака: Установить пункт назначения IP во фрагментах.
-l
Фрагментированная атака: Установить источник IP во фрагментах.
-B
Опция тестирования: Тест битрейта.
Опции источника:
-i
Захватывать пакеты с этого интерфейса.
-r
Извлечь пакеты из этого pcap файла.
Прочие опции:
-R
Отключить использование /dev/rtc.
—ignore-negative-one
Если интерфейс канала не может быть определён, игнорировать несоответствие, нужно для непропатченного cfg80211
РЕЖИМЫ АТАКИ:
-0 , —deauth=
Эта атака отправляет пакеты деаутентификации одному или более клиентами, которые в настоящий момент связаны с определённой точкой доступа. Деаутентификация клиентов может быть сделана по ряду причин: Восстановление скрытого ESSID. Этот ESSID не показывается в вещании. Другая причина для этого — это «маскировка» или Захват рукопожатия WPA/WPA2 путём принудительной повторной аутентификации клиентов или Генерация ARP запросов (Windows клиенты иногда очищают их ARP кэш после рассоединения). Конечно, эта атака совершенно бесполезна если нет подключённых к беспроводной сети клиентов или при фальшивой аутентификации. Подробности: Деаутентификация клиентов беспроводной сети в Kali Linux.
-1 , —fakeauth=
Эта атака фальшивой аутентификации позволяет вам выполнить два типа WEP аутентификации (Открытая система и Общий ключ) плюс ассоциироваться с точкой доступа (ТД). Это полезно только когда вам нужен ассоциированный MAC адрес в различных атаках aireplay-ng, а ассоциированных клиентов в данный момент нет. Следует отметить, что атака фальшивой аутентификации НЕ генерирует какие-либо ARP пакеты. Фальшивая аутентификация не может быть использована для аутентификации/ассоциации с WPA/WPA2 точками доступа.
-2, —interactive
Эта атака позволяет вам выбрать определённый пакет для воспроизведения (инъекции). Атака может получить пакеты для воспроизведения из двух источников. Первым является живой поток пакетов с вашей беспроводной карты. Вторым является файл pcap. Многие упускают из виду такую функцию aireplay-ng как чтение из файла. Она позволяет вам прочитать пакеты из захваченный сессий или нередко из различных сгенерированных для атак файлов pcap для простого повторного использования. Популярное использование — это чтение файла, который вы создали с помощью packetforge-ng.
-3, —arpreplay
Классическая атака повторного воспроизведения ARP запроса — это наиболее эффективный способ сгенерировать новые векторы инициализации (IVs), и работает он очень надёжно. Программа ищет ARP пакеты, затем пересылает их обратно к точке доступа. Это, в свою очередь, приводит точку доступа к повторению ARP пакета с новыми IV. Программа пересылает тот же ARP пакет снова и снова. При этом каждый ARP пакет, повторённый точкой доступ, имеет новые IVs. Это всё новые IVs, которые позволяют вам определить WEP ключ.
-4, —chopchop
Эта атака, в случае успеха, может расшифровать пакет данных WEP не зная ключа. Это может работать даже в отношении динамического WEP. Эта атака не восстанавливает сам WEP ключ, но лишь раскрывает простой текст. Тем не менее, некоторые точки доступа не уязвимы к этой атаке. Некоторые поначалу кажутся уязвимыми, но на самом деле отбрасывают пакеты данных короче чем 60 байт. Если точка доступа отбразывает пакеты корочем чем 42 байта, aireplay пытается предположить оставшиеся пропущенные данные, т. к. заголовок является предсказуемым. Если захвачен IP пакет, дополнительно проверяется контрольная сумма заголовка на корректность после угадывания недостающей его части. Эта атака требует по крайней мере один WEP пакет.
-5, —fragment
Эта атака, при успехе, может получить 1500 байт из PRGA (алгоритм псевдослучайной генерации). Эта атака не раскрывает сам WEP ключ, но лишь получает PRGA. Этот PRGA можно использовать для генерации пакета с packetforge-ng, который, в свою очередь, использовать для различных инъекционных атак. Требуется получить по крайней мере один пакет от точке доступа, чтобы инициировать эту атаку.
-6, —caffe-latte
В общих чертах, для того, чтобы атака сработала, атакующий должен быть в диапазоне ТД и подключённого клиента (фальшивого или реального). Атака Caffe Latte позволяет собрать достаточно пакетов для взлома WEP ключа без необходимости ТД, достаточно просто клиента в диапазоне.
-7, —cfrag
Эта атака превращает IP или ARP пакеты от клиента в ARP запросы в отношении клиента. Эта атака работает особенно хорошо в отношении сетей ad-hoc. Также она может использоваться в отношении клиентов softAP (программной точки доступа) и нормальных клиентов ТД.
-8, —migmode
Эта атака работает в отношении точек доступа Cisco Aironet, настроенных в WPA Migration Mode, который позволяет как клиентам WPA, так и WEP подключаться к точке доступа используя одинаковый Service Set Identifier (SSID). Программа прослушивает WEP-инкапсулированный широковещательный ARP пакет, меняет биты, чтобы переделать его в ARP, приходящий с MAC адреса атакующего, и переправляет к точке доступа. Это, в свою очередь, приводит к тому, что точка доступа повторяет ARP пакет с новым IV и также переправляет ARP ответ к атакующему с новым IV. Программа пересылает тот же ARP пакет снова и снова. При этом каждый ARP пакет, повторённый точкой доступа, имеет новый IV, и ARP ответ перенаправляется точкой доступа к атакующему. Все эти новые IV позволяют вам определить WEP ключ.
-9, —test
Фрагментация или Chopchop (отбивная котлета)
Показаны различия между фрагментированной атакой и Chopchop атакой
Фрагментация
- Обычно получает полную длину пакета из 1500 байт xor. Это означает, что впоследствии вы можете создать любой размер пакета. Даже в случаях, где собрано менее 1500 байтов, это достаточно, чтобы создать ARP запросы.
- Может работать там, где отбивная котлета (chopchop) не может.
- Метод крайне быстрый. При успехе он даёт крайне быстрый поток xor.
- Нужно больше информации для запуска этой атаки — например, информацию об IP адресе. Весьма часто её можно угадать. А ещё лучше то, что aireplay-ng предполагает IP источника и пункта назначения из 255.255.255.255, если ничего не указано. Это успешно наботает на большинстве, если не на всех ТД. Поэтому это очень незначительное «Против».
- Настройка для выполнения атаки в большей степени зависит от драйвера устройства. Например, Atheros не генерирует корректные пакеты, если беспроводная карта не настроена так, что имеет тот же мак адрес, который подвергается спуфингу.
- Вам нужно быть физически ближе к точке доступа, поскольку если какой-либо пакет теряется, то атака потерпит неудачу.
- Атака потерпит неудачу на точках доступа, которые не обрабатывают фрагментированные пакеты должным образом.
Chopchop
- Может работать там, где фрагментация не работает.
- Вам не нужно знать какую-либо информацию об IP.
- Может использоваться в отношении не каждой точки доступа.
- Максимум xor бит ограничено длинной пакета, который вы рубите. Хотя в теории вы могли бы получить 1500 байт xor потока, на практике вы редко (если вообще когда-нибудь) увидите 1500 байта беспроводных пакетов.
- Намного медленнее фрагментированная атаки
Примеры запуска Aireplay-ng
Перейти на канал 1 (iwconfig wlan0 channel 1), производить атаку Деаутентификация (-0), пока она не будет остановлена вручную (0) в отношении ТД с ВSSID 20:25:64:16:58:8C (-a 20:25:64:16:58:8C) с сетевого интерфейса wlan0 (wlan0):
Перейти на канал 1 (iwconfig wlan0 channel 1), произвести атаку Деаутентификация (-0), отправить пять пакетов разъединения (5) в отношении ТД с ESSID 20:25:64:16:58:8C (-e Mial) с сетевого интерфейса wlan0 (wlan0):
Вывод этих двух команд одинаковый:
Проверить, поддерживает ли беспроводная карта инъекции (инжект) (-9) на сетевом интерфейсе wlan0 (wlan0):
Установка Aireplay-ng
Программа предустановлена в Kali Linux.
Установка в другие операционные системы
Эта программа из пакета Aircrack-ng. Т.е. для её установки нужно установить Aircrack-ng.
Источник