mfruba / kernel

152 stars 103 forks source link

nl80211: Driver does not support authentication/association or connect commands #1

Open SebastianSmolorz opened 7 years ago

SebastianSmolorz commented 7 years ago

Hey dude,

I followed your README instructions however I ran into a problem when running the wifi.sh script. This is the output I got:

net.ipv4.ip_forward = 1 Configuration file: /etc/hostapd.conf nl80211: Driver does not support authentication/association or connect commands 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

Here are some relevant command outputs:

uname -a:

Linux kali 4.9.0-kali3-amd64 #1 SMP Debian 4.9.18-1kali1 (2017-04-04) x86_64 GNU/Linux

lsusb

Bus 001 Device 003: ID 2357:010c <---- the wifi card Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 003: ID 80ee:0021 VirtualBox USB Tablet Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

I'm running Kali in Virtualbox on Windows 10 host and I copied and pasted your versions of /etc/hostapd.conf and /etc/NetworkManager/NetworkManager.conf. Any idea what could be causing this? I have run apt-get update and upgrade. Thanks in advance!

mfruba commented 7 years ago

Strange... Are you sure that you loaded proper driver? I had same issue when I used https://github.com/lwfinger/rtl8188eu driver. So make sure that you removed old driver.

Try to: rmmod 8188eu

And next: insmod /path/to/ko/8188eu.ko

If this does not work then disconnect and connect wifi card and look into dmesg to check if driver is used (or if there is any error): [ 732.820528] usb 1-1: new high-speed USB device number 4 using ehci-pci [ 733.193506] usb 1-1: New USB device found, idVendor=2357, idProduct=010c [ 733.193508] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 733.193510] usb 1-1: Product: 802.11n NIC [ 733.193510] usb 1-1: Manufacturer: Realtek [ 733.193511] usb 1-1: SerialNumber: .......... [ 733.196252] RTL871X: usb_endpoint_descriptor(0): [ 733.196253] RTL871X: bLength=7 [ 733.196254] RTL871X: bDescriptorType=5 [ 733.196254] RTL871X: bEndpointAddress=81 [ 733.196255] RTL871X: wMaxPacketSize=512 [ 733.196255] RTL871X: bInterval=0 [ 733.196256] RTL871X: RT_usb_endpoint_is_bulk_in = 1 [ 733.196256] RTL871X: usb_endpoint_descriptor(1):

Regarding to your box setup I use same configuration Win10 + Virtualbox with same kali and it works for me.

SebastianSmolorz commented 7 years ago

First of all dude, thanks for the quick reply, and you are a legend for writing this. I think for most people just adding that rmmod 8188eu command will do the trick for anyone else facing this problem. However, when I try to use wifi on my virtualbox instance I still cannot see any networks (bridged adapter if that makes any difference). Any ideas?

mfruba commented 7 years ago

But wait, what do you want to achieve? You want to setup AP or just connect to wifi? My instruction describes how to setup your own access point.

If you want to connect to an wifi network then you do not need wifi.sh and remove: unmanaged-devices=mac:xx:xx:xx:xx:xx:xx from /etc/NetworkManager/NetworkManager.conf and next run: service network-manager restart as you want to use this card via Network Manager

Bridged adapter? You should attach usb card directly to Kali VM ( Virtualbox->Devices->USB->Realtek )

SebastianSmolorz commented 7 years ago

What I want to achieve is to use this wifi usb adapter to intercept and inject packets using aircrack, to be honest I don't care much about connecting to wifi but I thought that was part of the process, sorry I misunderstood! Anyways yes it is connected via usb and like I said I was able to get the correct output from the wifi.sh script however after appempping to use airodump-ng the device is now renamed to wlan0mon, how do I revert that and use airodump using this driver? (Sorry I realise this is off-topic)

mfruba commented 7 years ago

Ah ok. Sorry I have not tested it with aircrack. I only needed AP to make MiTM. So unfortunately you have to figure out it on your own or maybe some other users of this driver done it already...

JosephRedfern commented 7 years ago

Hi @SebastianSmolorz. I've been able to successfully place this adapter into Monitor mode -- have not yet tried an injection, but interception should certainly be possible. I did not use airmon-ng to do this, simply ran sudo iwconfig <adapter_name> mode monitor.

@mfruba Thank you so much for this work -- I ordered x3 WL722N's, not knowing that there was now a v2 that had an entirely different chipset to v1. This modified driver has really saved me!

Rajssss commented 7 years ago

@JosephRedfern Sir can you please guide me how did you do that because i have make and make install the driver and also insmod then. And now i can use browse the internet but airmon-ng shows me ???? in the Driver section.. what to do now?

JosephRedfern commented 7 years ago

@Rajssss If just used iwconfig, rather than airmon-ng. Assuming your adapter has been named wlan0 (it's likely to be something else, but just swap the name out), try:

sudo ip link set wlan0 down
sudo iwconfig wlan0 mode monitor
sudo ip link set wlan0 up
tng99 commented 5 years ago

After 10h hard focus i found a solution (by coincident) for this error "nl80211: Driver does not support authentication/association or connect commands"

Never use wpa_supplicant but "ifup". Pls read below

work on beaglebone black , debian "buster" (also stretch I guess) uname -a : 4.4.91-ti-r133

wifi stick: i try 2 different tp-link TL-wn722n Generic USB device - Realtek - bought on dx.com

I believe with this trick below, it will work on all linux distribution which run on PC, raspberry.

1) root@beaglebone:~# lsmod|grep 81 8188eu 825099 0 Use this good youtube guide to make a new module NB: I believe the one you have on your machine is OK, only compile a new if you get doubt

https://www.youtube.com/watch?v=LAwlnBhbi4A

my old: locate 8188eu root@beaglebone:~# ls -l /lib/modules/4.4.91-ti-r133/kernel/drivers/staging/rtl8188eu/r8188eu.ko.old -rw-r--r-- 1 root root 620984 Oct 10 2017 /lib/modules/4.4.91-ti-r133/kernel/drivers/staging/rtl8188eu/r8188eu.ko.old

new: root@beaglebone:~# ls -l /lib/modules/4.4.91-ti-r133/kernel/drivers/net/wireless/8188eu.ko -rw-r--r-- 1 root root 1082436 Oct 29 17:15 /lib/modules/4.4.91-ti-r133/kernel/drivers/net/wireless/8188eu.ko

2) never use wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -B -d nor wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -B -d -Dwext

BUT a script /etc/rc.local . This script will activate the wifi during the reboot. It kill the faulty "/sbin/wpa_supplicant" process and then "up" the interface. Sometime the first "ifup" failed, so just try again.

root@beaglebone:~# cat /etc/rc.local

!/bin/sh

PATH="/sbin:/bin:/usr/bin" ts() { date +%Y%m%d-%H%M%S }

ps -ef|grep wpa|awk '{print $2}' |xargs -i kill {}

in case you want to test the script

ifdown wlan0 ifup wlan0 ifup wlan0 ifup wlan0 ip a >/tmp/basename $0.ts

END

chmod 755 /etc/rc.local

DONE

TEST: ip a /etc/rc.local ip a look if wlan0 is UP 10: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether d4:6e:0e:19:d5:a7 brd ff:ff:ff:ff:ff:ff inet 192.168.11.118/24 brd 192.168.11.255 scope global noprefixroute wlan0 valid_lft forever preferred_lft forever

My other files

root@beaglebone:~# cat /etc/wpa_supplicant.conf network={ ssid="LASUISSE 6" psk=166f480d43e88fe3a73dbb28fdca8d52b78d95701b0eea33308c26afb4e3907a }

root@beaglebone:~# cat /etc/network/interfaces auto wlan0 iface wlan0 inet dhcp wpa-ssid "LASUISSE 6" wpa-psk SECRET

GOOD LUCK TN

ps: yes "wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -B -d" still fail...but who cares :-) ps2: I had now done tons of reboot, everytime wifi get active and an IP get assigned to wlan0

tng99 commented 5 years ago

just try on another mini linux box , odroid. I just put the rc.local at /etc (keep the same wifi module rt2800usb.ko).....it works

if using wpa_supplicant , i got another error and wlan0 is still DOWN root@odroid:/etc# wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -B -d ... wlan0: RSN: flushing PMKID list in the driver nl80211: Flush PMKIDs wlan0: Setting scan request: 0.100000 sec TDLS: TDLS operation not supported by driver TDLS: Driver uses internal link setup TDLS: Driver does not support TDLS channel switching wlan0: WPS: UUID based on MAC address: ff9000cd-a830-5be2-8700-6bf37b7bb2c0 ENGINE: Loading dynamic engine ENGINE: Loading dynamic engine EAPOL: SUPP_PAE entering state DISCONNECTED EAPOL: Supplicant port status: Unauthorized nl80211: Skip set_supp_port(unauthorized) while not associated EAPOL: KEY_RX entering state NO_KEY_RECEIVE EAPOL: SUPP_BE entering state INITIALIZE EAP: EAP entering state DISABLED wlan0: Added interface wlan0 wlan0: State: DISCONNECTED -> DISCONNECTED nl80211: Set wlan0 operstate 0->0 (DORMANT) netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT) Daemonize..

using the ifup (rc.local) trick: reboot -> wait 5min -> wifi is back on nb: root@odroid:~#date Tue Oct 30 17:26:50 +07 2018 root@odroid:~#lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.1 LTS Release: 18.04 Codename: bionic root@odroid:~# uname -a Linux odroid 4.14.69-148 #1 SMP PREEMPT Mon Sep 10 13:07:55 -03 2018 armv7l armv7l armv7l GNU/Linux root@odroid:~# lshw -c network -network:0 description: Ethernet interface physical id: 7 logical name: eth0 serial: 00:1e:06:32:b1:95 size: 1Gbit/s capacity: 1Gbit/s capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.09.9 duplex=full ip=192.168.137.154 link=yes multicast=yes port=MII speed=1Gbit/s -network:1 description: Wireless interface physical id: 8 bus info: usb@1:1 logical name: wlan0 serial: 7c:dd:90:ef:a7:12 capabilities: ethernet physical wireless configuration: broadcast=yes driver=rt2800usb driverversion=4.14.69-148 firmware=0.36 ip=192.168.11.120 link=yes multicast=yes wireless=IEEE 802.11 root@odroid:~#

00usb 28672 0 rt2800lib 98304 1 rt2800usb rt2x00usb 20480 1 rt2800usb rt2x00lib 45056 3 rt2800lib,rt2800usb,rt2x00usb mac80211 614400 3 rt2800lib,rt2x00lib,rt2x00usb

root@odroid:~# lshw odroid description: ARMv7 Processor rev 3 (v7l) product: Hardkernel Odroid XU4 width: 32 bits capabilities: smp

root@odroid:~# ps -ef|grep wpa root 1217 1 0 17:21 ? 00:00:00 /sbin/wpa_supplicant -s -B -P /run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -C /run/wpa_supplicant

ip a 3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 7c:dd:90:ef:a7:12 brd ff:ff:ff:ff:ff:ff inet 192.168.11.120/24 brd 192.168.11.255 scope global wlan0 valid_lft forever preferred_lft forever