Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostapd_free_hapd_data: Interface wlan0 wasn't started #189

Closed
Lucifer1993 opened this issue Nov 12, 2021 · 8 comments
Closed

hostapd_free_hapd_data: Interface wlan0 wasn't started #189

Lucifer1993 opened this issue Nov 12, 2021 · 8 comments

Comments

@Lucifer1993
Copy link

Lucifer1993 commented Nov 12, 2021

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

@williamcaput
Copy link

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

@gdraper-cs
Copy link

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.

@mbb5546
Copy link

mbb5546 commented Mar 31, 2022

@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

@liamp-cs
Copy link

liamp-cs commented Apr 12, 2022

@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

@0x6d6f7468
Copy link

0x6d6f7468 commented May 4, 2022

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.

@sdcampbell
Copy link

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.

@breachr
Copy link

breachr commented Aug 12, 2023

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']

@s0lst1c3
Copy link
Owner

s0lst1c3 commented Oct 7, 2023

Resolved 1.14.0

@s0lst1c3 s0lst1c3 closed this as completed Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants