Режим мониторинга wifi kali linux

Airmon-ng

This script can be used to enable monitor mode on wireless interfaces. It may also be used to go back from monitor mode to managed mode. Entering the airmon-ng command without parameters will show the interfaces status.

Airmon-ng Help

airmon-ng [channel] or airmon-ng

  • indicates if you wish to start or stop the interface. (Mandatory)
  • specifies the interface. (Mandatory)
  • [channel] optionally set the card to a specific channel.
  • check” will show any processes that might interfere with the aircrack-ng suite. It is strongly recommended that these processes be eliminated prior to using the aircrack-ng suite. “check kill” will check and kill off processes that might interfere with the aircrack-ng suite.

Airmon-ng Usage Example

Check status and/or listing wireless interfaces

airmon-ng PHY Interface Driver Chipset phy0 wlan0 ath9k_htc Atheros Communications, Inc. AR9271 802.11n

Checking for interfering processes

When putting a card into monitor mode, it will automatically check for interfering processes. It can also be done manually by running the following command:

airmon-ng check Found 5 processes that could cause trouble. If airodump-ng, aireplay-ng or airtun-ng stops working after a short period of time, you may want to kill (some of) them! PID Name 718 NetworkManager 870 dhclient 1104 avahi-daemon 1105 avahi-daemon 1115 wpa_supplicant

Killing interfering processes

This command stops network managers then kill interfering processes left:

airmon-ng check kill Killing these processes: PID Name 870 dhclient 1115 wpa_supplicant

Enable monitor mode

Note: It is very important to kill the network managers before putting a card in monitor mode!

sudo airmon-ng start wlan0 PHY Interface Driver Chipset phy0 wlan0 rt2800usb Ralink Technology, Corp. RT3572 (mac80211 monitor mode vif enabled for [phy0]wlan0 on [phy0]wlan0mon) (mac80211 station mode vif disabled for [phy0]wlan0)

As you can see, it created a monitor mode interface called wlan0mon and it notified there are a few process that will interfere with the tools.

sudo iwconfig wlan0mon IEEE 802.11 Mode:Monitor Frequency:2.457 GHz Tx-Power=20 dBm Retry short limit:7 RTS thr:off Fragment thr:off Power Management:off lo no wireless extensions. eth0 no wireless extensions.

Disable monitor mode

airmon-ng stop wlan0mon PHY Interface Driver Chipset phy0 wlan0mon ath9k_htc Atheros Communications, Inc. AR9271 802.11n (mac80211 station mode vif enabled on [phy0]wlan0) (mac80211 monitor mode vif disabled for [phy0]wlan0mon)

Don’t forget to restart the network manager. It is usually done with the following command:

sudo systemctl start NetworkManager

Enable monitor mode (using ip and iw)

sudo ip link set wlp2s0 down sudo iw wlp2s0 set monitor control sudo ip link set wlp2s0 up
sudo ip link set wlp2s0 down && sudo iw wlp2s0 set monitor control && sudo ip link set wlp2s0 up

Or (with auto detect wireless interface name):

t=`iw dev | grep 'Interface' | sed 's/Interface //'`;sudo ip link set $t down && sudo iw $t set monitor control && sudo ip link set $t up

Enable monitor mode (using ifconfig and iwconfig)

ifconfig wlan0 down iwconfig wlan0 mode monitor ifconfig wlan0 up
ifconfig wlan0 down && iwconfig wlan0 mode monitor && ifconfig wlan0 up
iwconfig eth0 no wireless extensions. wlan0mon IEEE 802.11abgn Mode:Monitor Frequency:2.457 GHz Tx-Power=15 dBm Retry short limit:7 RTS thr:off Fragment thr:off Power Management:off lo no wireless extensions.

Disable monitor mode

ifconfig wlan0 down iwconfig wlan0 mode managed ifconfig wlan0 up

NetworkManager prevents monitor mode

If NetworkManager restarts automatically after each kill, and it pretends monitor mode, you can stop it manually:

In Kali Linux:

sudo systemctl stop NetworkManager

In BlackArch:

sudo systemctl stop NetworkManager

Note: when you stop NetworkManager, your Internet access disappears!

How to install Airmon-ng

The program is pre-installed on Kali Linux.

Installation on Linux (Debian, Mint, Ubuntu)

Airmon-ng is included in the Aircrack-ng suite. To get Airmon-ng it is enough to install Aircrack-ng.

sudo apt-get install aircrack-ng

Airmon-ng Screenshots

Airmon-ng Tutorials

Источник

HackWare.ru

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

Перевод беспроводной карты в режим монитора (наблюдения) в Kali Linux с использованием команд ip и iw

Любая (почти) атака на Wi-Fi начинается с перевода карты в режим монитора (режим слежения). Как это сделать описано, например, а разделе «Как перевести беспроводную карту в режим монитора (контроля) в Kali Linux». Для этого можно использовать программу Airmon-ng, но лично я этому скрипту не доверяю: у меня возникала проблема, когда скрипт создавал новый виртуальный интерфейс, но не переводил его в режим монитора, в результате пришлось некоторое время разбираться, чтобы найти ответ.

Решением стало «ручной» перевод в режим наблюдения (без создания виртуального интерфейса). Это делается так: смотрим имя беспроводного интерфейса:

И переводим его в режим монитора:

sudo ifconfig wlan0 down sudo iwconfig wlan0 mode monitor sudo ifconfig wlan0 up

Хороший метод — никогда меня не подводил. Но, оказывается, и команда ifconfig и команда iwconfig теперь считаются устаревшими. ifconfig уже не устанавливается в системы по умолчанию, и однажды это же начнёт происходить и с iwconfig — это только вопрос времени.

Чтобы не сидеть «на старье», конечно же, были найдены альтернативы.

Теперь мы имя интерфейса смотрим так:

А переводим в режим монитора так (замените wlan0 на имя вашего беспроводного интерфейса):

sudo ip link set wlan0 down sudo iw wlan0 set monitor control sudo ip link set wlan0 up

А эта большая команда сама посмотрит имя интерфейса с беспроводным расширением и переведёт его в режим монитора (если у вас только один беспроводной интерфейс):

t=`iw dev | grep 'Interface' | sed 's/Interface //'`;sudo ip link set $t down && sudo iw $t set monitor control && sudo ip link set $t up

Если вместо изменения реального интерфейса вы хотите создать виртуальный в режиме монитора, то для создания беспроводного интерфейса в режиме монитора с именем mon0 нужно сделать так:

sudo iw phy phy0 interface add mon0 type monitor

У меня этой командой создаётся виртуальный интерфейс, но он не переводится в режим монитора. Если у вас аналогичная ситуация, то делаем так:

sudo ip link set mon0 down sudo iw mon0 set monitor control sudo ip link set mon0 up

Чтобы удалить виртуальный интерфейс:

Ну и чтобы посмотреть разные подробности и просто для расширения кругозора рекомендуется к прочтению следующий материал:

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

В Kali Linux и BlackArch это делается так:

sudo systemctl stop NetworkManager

Примечание, после отключения NetworkManager пропадёт Интернет!

Также дополнительно рекомендуется выполнить:

Смена каналов командой iw

Чтобы изменить канал, на котором функционирует беспроводной интерфейс, переведите его в режим монитора, а затем используйте команду вида:

sudo iw wlan0 set channel

К примеру, чтобы переключить Wi-Fi карту с именем сетевого интерфейса wlan0 на шестой канал:

sudo iw wlan0 set channel 6

Источник

Using Monitor Mode in Kali Linux

Wi-Fi adapters are used for connecting your device to the Internet. Most laptops, tablets, and mobile phones have a built-in Wi-Fi card. In a wireless environment, data is transferred from the device to the internet in the form of packets by sending a request for a packet to the router. The router fetches the requested packet from the internet, and once it obtains the webpage, it sends the information back to your device in the form of packets, thereby controlling all the traffic going to connected devices. Monitor Mode in Kali Linux allows you to read all the packets of data, even if they are not sent through this mode, and controls the traffic received on wireless-only networks. Monitor Mode is able to capture all these packets, which are not only directed to their device but also other to devices connected to the network. This article will provide an overiew of Monitor Mode in Kali Linux.

Uses

For an ethical hacker, Monitor Mode is used to capture all relevant data packets to check whether the router is vulnerable. It is also used to check whether the network is vulnerable to any attacks. Monitor Mode thus provides all the crucial information on every device, and can also be used for observing large volumes of network traffic.

3 Ways to Use Kali Linux Monitor Mode

If you have the wireless adapter that supports Monitor Mode, then you can easily set the wireless interface. The following sections list some of the ways that you can use Monitor Mode in Kali Linux.

1. Enable Monitor Mode Using iw

First, we will take a look at the use of the iw Wi-Fi configuration tool. It is used for configuring Wi-Fi in particular and can be more powerful than other tools. You might have already used iw for several other purposes, for example, to obtain information about your Wi-Fi network. In fact, this tool can even give you more information about different commands. The iw list gives you much more information about wireless wlan0, interface modes, HT, bit rates, scanning, etc.

The first step is to check the interface information. You can do so by entering the following:

The output will look like the following window:

To access the traffic of other people, you will have to switch this over to Monitor Mode. You can switch iw to Monitor Mode by entering the commands given below:

IFACE replaced the actual name, as shown:

The next step is to check the wireless interface one more time by entering the following command:

The output of the aforementioned commands can be seen in the window above.

Wondering how to get back to the Managed Mode? To do so, enter the following commands:

IFACE replaced the actual name, as shown:

2. Enable Monitor Mode Using airmon-ng

If you have already tried enabling Monitor Mode using iw and failed, then another method you can use to enable Monitor Mode is through airmon-ng.

The first step is to get information about your wireless interface. Do so by issuing the following command:

The output of the above command is as follows:

You will want to kill any process that can interfere with using the adapter in Monitor Mode. To do so, you can use a program called airmon-ng, simply entering the following commands:

Now, you should enable Monitor Mode without any interference.

Wlan0mon has now been created.

Use the following commands to disable Monitor Mode and return to Managed Mode:

Enter the following command to restart the network manager:

3. Enable Monitor Mode Using iwconfig

As in previous sections, check your interface name via the following command:

The next step is to enable Monitor Mode. Do so by entering the following commands:

Disable Monitor Mode

Turn off the Network Manager that Prevents Monitor Mode

Conclusion

Enabling Monitor Mode is a great method for sniffing and spying around your network and router. There are a number of ways to enable Monitor Mode. Every method does not work for every adapter. So, try out any of the methods listed above if your adapter does not behave as expected.

About the author

Younis Said

I am a freelancing software project developer, a software engineering graduate and a content writer. I love working with Linux and open-source software.

Источник

Читайте также:  Резервное копирование для линукс
Оцените статью
Adblock
detector