s0lst1c3/eaphammer

hostapd_free_hapd_data: Interface wlan0 wasn't started

Lucifer1993 opened this issue · 8 comments

when I use eaphammer to execute command,it's exception down. how to deal with it? my os is kali

[?] Am I root?
[] Checking for rootness...
[
] I AM ROOOOOOOOOOOOT
[] Root privs confirmed! 8D
[
] Saving current iptables configuration...
[*] Reticulating radio frequency splines...

[*] Using nmcli to tell NetworkManager not to manage wlan1...

100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.00s/it]

[] Success: wlan1 no longer controlled by NetworkManager.
[
] WPA handshakes will be saved to /var/lib/eaphammer/loot/wpa_handshake_capture-2021-11-12-09-17-58-n7bingOg1XNf2F4noP7tNDZXPpeVjzwz.hccapx

Configuration file: /var/lib/eaphammer/tmp/hostapd-2021-11-12-09-17-58-3UtjbPIi3l9yCfF3xM7jRAiZnDESZI6O.conf
[hostapd] AP starting...

mkdir[ctrl_interface]: No such file or directory
Failed to setup control interface for wlan1
wlan1: Unable to setup interface.
wlan1: interface state UNINITIALIZED->DISABLED
wlan1: AP-DISABLED
wlan1: CTRL-EVENT-TERMINATING
hostapd_free_hapd_data: Interface wlan1 wasn't started
nl80211: deinit ifname=wlan1 disabled_11b_rates=0

I'm getting the same error.
Installed eaphammer using the install script on an updated version of Kali.
Any help is appreciated.

so i think i worked it out - when debugging is enabled, you can see specifically what happens.

first eaphammer writes a tmp config file to:
/var/lib/eaphammer/tmp/hostapd-yyyy-mm-dd-hh-mm-ss-xxxxxxxxxxxxxxxxxxxxx.conf

go into the conf file and look for the #general --- section and specifically the field ctrl_interface field. It's missing a leading

/ in front of

var/lib/eaphammer/run/ctrl/iface-yyyy-mm-dd-hh-mm-ss-xxxxxxxx

place the leading / and save the file.

then run with eaphammer with the --manual-config flag specifying the path to that specific config.

Bingo.

Not sure where this is exactly in the github repository but someone can work it out.

@gdraper-cs very good catch, this issue was bothering me forever. I tried your fix but still couldn't get eaphammer to run successfully, where do you save the new conf file once you edit it? EAPhammer creates a new one in /var/lib/eaphammer/tmp each time you run, so a new .conf. file is created in /tmp with a missing / each time you run. I've tried saving the modified conf file in ../eaphammer, but when running with --manual-config it still errors out.

. I am trying to find it in the repository so I can just manually fix it there. really weird issue Im surprised more people haven't had

@mbb5546 I'm not sure what your error is but you can save your .conf file anywhere as long as you pass it the proper path with --manual-config.

You might also need to copy the .eap_user file (created on run in the same /tmp directory) as well and reference that in your main .conf file. So your .conf file should have two changes as listed below:

...
ctrl_interface=/var/lib/eaphammer/run/ctrl-iface-xxxxxxx
...
eap_user_file=/path/to/file/xxxxxx.eap_user
...

Then your command should look something like this:

eaphammer [options] --manual-config /path/to/file/hostapd-xxxxxx.conf

Hey folks, I just had a similar error on a Kali box but found that running from source fixed the issue. The latest version of the code handles pathing better in settings/paths.py, which is where the error occurred on my system (line 31).

Interestingly, the EAPHammer version installed on this Kali box is reportedly 1.13.5, which should be the latest, but the paths.py file is older. Not sure what's up with that, but running from source definitely seems to fix the configuration file path issues.

I just had this issue and restarting the laptop fixed it. I had previously been in monitor mode and had also run "airmon-ng check kill" before that. I noticed that each time I ran eaphammer and then checked "ifconfig", wlan0 no longer showed up and it was disabled. Even after reenabling wlan0 I still got this error until I restarted the laptop.

This is super unclean, but if you still want to use the cli parameters with packaged version and dont rely on manual config you can prepend a slash in here:

/usr/share/eaphammer/core/hostapd_config.py

-> line 495:
general_configs['ctrl_interface'] = "/" + settings.dict['paths']['hostapd']['ctrl_interface']

Resolved 1.14.0