Open JesGonTej opened 6 years ago
Did you disable Wi-Fi in the network manager? Otherwise hostapd won't work.
Thanks for the prompt response.
I did run:
nmcli radio wifi off
It looks down when I run:
ip a
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 2e:8a:6c:83:9d:8f brd ff:ff:ff:ff:ff:ff
Seems like another copy of wpa_supplicant
is still running. You're starting the script as root? Try a killall wpa_supplicant
to test things. Otherwise search for the error messages that wpa_supplicant
is outputting, since this is an issue specific to wpa_supplicant
.
Thanks.
Yes, I am running as a root. Killall outputs that no other wpa_supplicant is running.
I searched for the specific wpa_supplicant error. I ended up in line 618 of wpa_supplicant/ctrl_iface_unix.c. If I am not mistaking, it is trying to unlink the path given by by krack-test-client.py is hostapd_ctrl/
Also try running airmon-ng check kill
just to be sure. Are you executing the script from a writable directory? Hostapd must be able to create a new subdirectory. Does the directory hostapd_ctrl
already exist somewhere?
root@kali:~# airmon-ng check kill
ls: cannot access '/sys/class/ieee80211/': No such file or directory
Killing these processes:
PID Name
482 dhclient
I am running the script as root with 777 permissions in the current directory.
The only hostapd_ctrl directory I can find in the whole system is the one created after running the script. However, it is empty. What is the purpose of it?
Hi! I had a similar issue and reported this #17. In my case I think the root cause is this: WLAN card is not supporting AP mode. This is documented in Debian wiki.
To verify if your WLAN adapter supports AP mode just execute:
iw list | grep AP$```
Hi,
Sorry for the delay in the answer. I managed to solve the issue. There were several things:
Depending on the distribution you use you might not be allowed to run the script (even being root) anywhere. The script opens a unix socket to communicate with host apd. Not all locations are allowed depending on your OS (more info). I ended up moving it to /var/run and it was working
Another issue I faced earlier was to do with my bad practice ... I am using vagrant on Windows and sharing some folder with the virtual machine. I download the repository on a zip file and unzip it in Windows (big mistake). 3 links should be created during this operation, naturally they are not created if you use a Windows zip application. You should do this in Linux!
So it is now working for me.
I appreciate your effort.
Jesus
I'm also trying to get around this problem. Whenever I'm running the script, it gets the "connect exception hostapd_ctrl/wlan0 9877" but when I run hostapd on it's own with the same hostapd.conf, the "rogue ap" works with no problem at all.
Has anyone fixed this error yet?
Can you provide the exact commands you used to run the script? And the Linux distribution/version you are using?
Did you try the steps by JesGonTej?
My version Linux is 6.5.0-kali2-amd64.
┌──(venv)─(root㉿kali)-[/home/kali/Downloads/krackattacks-scripts/krackattack]
└─# python3 krack-test-client.py
[13:28:04] Note: disable Wi-Fi in network manager & disable hardware encryption. Both may interfere with this script.
[13:28:05] Starting hostapd ...
Configuration file: /home/kali/Downloads/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
wlan0: CTRL-EVENT-TERMINATING
hostapd_free_hapd_data: Interface wlan0 wasn't started
connect exception hostapd_ctrl/wlan0 9877
[13:28:06] It seems hostapd did not start properly, please inspect its output.
[13:28:06] Did you disable Wi-Fi in the network manager? Otherwise hostapd won't work.
Traceback (most recent call last):
File "/home/kali/Downloads/krackattacks-scripts/krackattack/krack-test-client.py", line 663, in
Try to start hostapd directly. It might be that your Wi-Fi card doesn't support AP mode. Disable Wi-Fi in your network manager as well.
Hi,
Firstly, thanks for all your hard work.
I cannot make it run.
And this is what the script returns:
It looks like it is trying to open a UDP connection as the line 25 (wpaspy/wpaspy.py) raises an exception. Then the UDP connection with the ctrl_interface cannot be established. Could you help me?