vanhoefm / krackattacks-scripts

Other
3.3k stars 768 forks source link

[14:38:00] Note: disable Wi-Fi in network manager & disable hardware encryption. Both may interfere with this script. #32

Closed DaniLuMa closed 6 years ago

DaniLuMa commented 6 years ago

Hi:

I am testing krack-test-clint.py but it doesnt work fo me :(.

I have TL-WN722NN v1. I have Kali 2017.1. I follow the instructions with the same order without succeful and of course I execute disable-hwcrypto.sh.

This is my currectly error, any idea?:

root@kal:~/krackattacks-scripts/krackattack# ./krack-test-client.py [14:38:00] Note: disable Wi-Fi in network manager & disable hardware encryption. Both may interfere with this script. Traceback (most recent call last): File "./krack-test-client.py", line 617, in attack.run(test_grouphs=test_grouphs, test_tptk=test_tptk) File "./krack-test-client.py", line 472, in run self.configure_interfaces() File "./krack-test-client.py", line 457, in configure_interfaces subprocess.check_output(["rfkill", "unblock", "wifi"]) File "/usr/lib/python2.7/subprocess.py", line 212, in check_output process = Popen(stdout=PIPE, *popenargs, **kwargs) File "/usr/lib/python2.7/subprocess.py", line 390, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory [14:38:00] Closing hostapd and cleaning up ...

Thanks a lot Best Regards Perico

DaniLuMa commented 6 years ago

Today, I have another error. Please, anyone know a completly and good guide? I am trying test the app for the university but it is impossible that it works for me, always I have errors and I don't know why.

Thanks a lot

root@kal:~/krackattacks-scripts/krackattack# python2 ./krack-test-client.py [09:31:16] Note: disable Wi-Fi in network manager & disable hardware encryption. Both may interfere with this script. [09:31:17] Starting hostapd ... Configuration file: /root/krackattacks-scripts/krackattack/hostapd.conf nl80211: Could not configure driver mode nl80211: deinit ifname=wlan0 disabled_11b_rates=0 nl80211 driver initialization failed. wlan0: interface state UNINITIALIZED->DISABLED wlan0: AP-DISABLED hostapd_free_hapd_data: Interface wlan0 wasn't started connect exception hostapd_ctrl/wlan0 9877 [09:31:18] It seems hostapd did not start properly, please inspect its output. [09:31:18] Did you disable Wi-Fi in the network manager? Otherwise hostapd won't work. Traceback (most recent call last): File "./krack-test-client.py", line 617, in attack.run(test_grouphs=test_grouphs, test_tptk=test_tptk) File "./krack-test-client.py", line 488, in run self.hostapd_ctrl = Ctrl("hostapd_ctrl/" + self.nic_iface) File "/root/krackattacks-scripts/krackattack/wpaspy.py", line 49, in init socket.SOCK_DGRAM) socket.gaierror: [Errno -2] Name or service not known [09:31:18] Closing hostapd and cleaning up ... root@kal:~/krackattacks-scripts/krackattack#

And... in the log...

Dec 12 09:31:16 kal NetworkManager[521]: [1513067476.8287] (wlan0mon): using nl80211 for WiFi device control Dec 12 09:31:16 kal NetworkManager[521]: [1513067476.8368] devices added (path: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-8/1-8:1.0/net/wlan0mon, iface: wlan0mon) Dec 12 09:31:16 kal NetworkManager[521]: [1513067476.8369] device added (path: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-8/1-8:1.0/net/wlan0mon, iface: wlan0mon): no ifupdown configuration found. Dec 12 09:31:17 kal kernel: [ 1269.234830] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready Dec 12 09:31:17 kal NetworkManager[521]: [1513067477.5194] device (wlan0): supplicant interface state: inactive -> disabled Dec 12 09:31:17 kal kernel: [ 1269.256918] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready Dec 12 09:31:17 kal NetworkManager[521]: [1513067477.5293] device (wlan0): supplicant interface state: disabled -> inactive Dec 12 09:32:21 kal NetworkManager[521]: [1513067541.2778] device (wlan0): set-hw-addr: set MAC address to 72:CC:22: (scanning) Dec 12 09:32:21 kal NetworkManager[521]: [1513067541.2878] device (wlan0): supplicant interface state: inactive -> disabled Dec 12 09:32:21 kal kernel: [ 1333.020605] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready Dec 12 09:32:21 kal NetworkManager[521]: [1513067541.3315] device (wlan0): supplicant interface state: disabled -> inactive

ptdropper commented 6 years ago

Hi PericoMele I found that I could disable the network manager by issueing the follwoing at the command line on my kali linux host: ifconfig wlan0mon down ifconfig wlan0 down nmcli networking off then proceed with the command ./krack-test-client.py You should end up with two devices listed by the ifconfig command: wlan0 wlan0mon

DaniLuMa commented 6 years ago

Thanks a lot ptdropper. It works very fine now. When I finish the test I will put a simple manual here for the rest of the people.

Best regards Dani

DaniLuMa commented 6 years ago

Hi:

This is a small guide to test your client wifi. I bought TL-WN722N v1 device but I will test it with anothers... I used Kali 2017.1.

1.- Install kali.

2.- Execute:

$ apt-get update $ apt-get install libnl-3-dev libnl-genl-3-dev pkg-config libssl-dev net-tools git sysfsutils python-scapy python-pycryptodome

3.- Clone krack-attack scripts

$ git clone https://github.com/vanhoefm/krackattacks-scripts.git

4.- Compile hostapd:

$ cd krackattacks-scripts/krackattack --> We are in "krackattacks-scripts/krackattack" directory $ pwd /root/krackattacks-scripts/krackattack $ cd ../hostapd $ cp defconfig .config $ make -j 2

5.- Disable hardware network

$ cd ../krackattack/ $ chmod 777 disable-hwcrypto.sh $ ./disable-hwcrypto.sh $ rfkill unblock wifi $ ifconfig wlan0mon down $ ifconfig wlan0 down $ nmcli networking off $ reboot

6.- Test client:

$ python2 krack-test-client.py

--> It will be waiting for connections to his own ESSID. It is "testnetwork" and psk is "abcdefgh". When you connect (with other device, not with this machine Kali 2017.1) the client you will see if your client has or hasnt the vulnerability in both, normal or group.

Best regards Perico

baonq-me commented 6 years ago

Could you show the output of these command right before running krack-test-client.py $ nmcli raio $ nmcli networking $ rfkill list wifi

What is the driver of your wifi card (check airmon-ng) ?. I have the same problem with you while using Intel wifi card.

imoulas commented 6 years ago

I have followed all proposed instructions. Netrwork card is TL-WN722N. Kali is updated. Kali is installed as a base OS on a MacAir laptop.

disable-hwcrypto.sh rfkill unblock wifi ifconfig wlan0 down ifconfig wlan1 down nmcli networking off reboot

ifconfig lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 12 bytes 720 (720.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 12 bytes 720 (720.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

krack-test-client.py [21:18:57] Note: disable Wi-Fi in network manager & disable hardware encryption. Both may interfere with this script. command failed: Operation not supported (-95) Traceback (most recent call last): File "./krack-test-client.py", line 617, in attack.run(test_grouphs=test_grouphs, test_tptk=test_tptk) File "./krack-test-client.py", line 472, in run self.configure_interfaces() File "./krack-test-client.py", line 463, in configure_interfaces subprocess.check_output(["iw", self.nic_iface, "interface", "add", self.nic_mon, "type", "monitor"]) File "/usr/lib/python2.7/subprocess.py", line 219, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command '['iw', 'wlan0', 'interface', 'add', 'wlan0mon', 'type', 'monitor']' returned non-zero exit status 161 [21:18:57] Closing hostapd and cleaning up ...