Kali/Wireless
From charlesreid1
This is an absurd romp through the land of Linux wireless device drivers trying to get Kali to connect to a wireless network on Mac hardware.
What it boiled down to?
1. Not using the on-board Broadcom wireless card in the MacBook Pro, because it had a proprietary driver. Not using the USB wireless dongle from Airlink because it also had a proprietary driver.
2. Using a USB wireless dongle from Panda Wireless, which sells Kali-friendly hardware
3. Installing wicd network manager. This worked like a dream.
(Any Wireless Router)
Testing on Ubuntu (LiveCD, Same Computer)
I decided to test out this USB device from Ubuntu, and see if I could connect to the wireless.
Looking through some info about the card using the iw utility.
FIrst, when I plug in the wireless USB device, I can see it is available to the computer:
lsusb
now I try and see it through the wireless interface, iw (or whatever iw stands for). I type:
iw dev
there is only one device listed, and I'm not sure if it is the USB device or the built-in broadcom wireless. To figure out what's there and more info about the physical device, I list physcial devices:
iw phy
This lists a device, phy2, so I print more information about it:
iw phy phy2 info
This prints lots of information about the specs of the device. Couple interesting things:
- Supported ciphers are listed:
- WEP40
- WEP104
- TKIP
- CCMP
- CMAC
I went through the rigamaroll above, and couldn't connect to the wireless.
Then I had a crazy idea. What if I just tried using the network manager in Ubuntu?
Boom. It worked fine.
To confirm it was actually the USB device that it was using to connect, and not the internal wireless card, I unplugged the card, and immediately lost the wifi connection.
I plugged the wireless device back in, and started to have trouble connecting to the network. The network would try and connect, and be dropped, and this happened perhaps 5-10 times in a row.
Then I turned off the wifi, and turned it back on, and was asked foir a phassphrase when I tried to connect to my home network. After entering my passphrase, I was connected again.
So on Ubuntu, even though there is turbulence, the damn thing is ultimately able to connect to the wireless.
On Kali, there is also turbulence, but no happy ending.
Monkey's Uncle
This is obviously some idiotic confluence of bugs that the universe has destined to deposit right on my head like so much bird shit.
The Ubuntu network manager is able to connect to the wireless network just fine.
So, I guess it's something of a solution - I wanted to figure out what this handshake problem business was, but it is pretty clear my OS is just doing something dumb that it shouldn't be doing. If it didn't do it, we wouldn't have any wireless problems. Like the Ubuntu live cd.
So it turns out, the network manager may be useful after all.
Here's what we're gonna try:
Boot into a plain shell
Strip this thing of gnome
Switch to another window manager with a sane network manager (although... Ubuntu just uses gnome-network-manager, so I don't see what the issue is.)
If worse comes to worse, figure out exactly what is on this live cd, and use it.
Fixing This Mess
It's been interesting to dive into the internals of the system's wifi, but I'm ready to be done with it.
And On The Third Day, The Network Manager Rose Again
I decided to download and build a copy of the latest NetworkManager, instead of relying on... whatever it was that came with Kali.
Building Network Manager
Download, extract, and run:
$ cd NetworkManager-1.0.4/ $ ./configure [...] ./configure: line 16785: intltool-update: command not found checking for intltool >= 0.40.0... found configure: error: Your intltool is too old. You need intltool 0.40.0 or later. $ apt-get install --upgrade intltool
This made a bunch of usb networking packages in aptitude obsolete - lots of stuff related to USB, WPA, and networking. So, maybe that was the Linux equivalent blowing hard on the Nintendo cartrige.
$ ./configure checking for DBUS... no configure: error: Package requirements (dbus-1 >= 1.1 dbus-glib-1 >= 0.94) were not met: No package 'dbus-1' found No package 'dbus-glib-1' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_CFLAGS and DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
I see a whole bunch of dbus libraries:
$ aptitude search libdbus i A libdbus-1-3 - simple interprocess messaging system (library) p libdbus-1-dev - simple interprocess messaging system (development headers) p libdbus-c++-1-0 - C++ API for D-Bus (runtime package) p libdbus-c++-bin - C++ API for D-Bus (utilities) p libdbus-c++-dbg - C++ API for D-Bus (debugging symbols) p libdbus-c++-dev - C++ API for D-Bus (development package) p libdbus-c++-doc - C++ API for D-Bus (documentation) i A libdbus-glib-1-2 - simple interprocess messaging system (GLib-based shared library) p libdbus-glib-1-2-dbg - simple interprocess messaging system (GLib library debug symbols p libdbus-glib-1-dev - simple interprocess messaging system (GLib interface) p libdbus-glib-1-doc - simple interprocess messaging system (GLib library documentation i A libdbus-glib1.0-cil - CLI implementation of D-Bus (GLib mainloop integration) p libdbus-glib1.0-cil-dev - CLI implementation of D-Bus (GLib mainloop integration) - develo [...]
Double check by installing the user versions, then install the developer versions:
$ apt-get install --reinstall libdbus-1-3 libdbus-glib-1-2 $ apt-get install libdbus-1-dev libdbus-glib-1-dev $ ./configure [...] checking for DBUS... yes checking for dbus_g_method_invocation_get_g_connection in -ldbus-glib-1... no checking for DBUS_GLIB_100... yes checking for GLIB... no checking for GLIB... yes checking for GUDEV... no configure: error: Package requirements (gudev-1.0 >= 165) were not met: No package 'gudev-1.0' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GUDEV_CFLAGS and GUDEV_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
Okay, search/find/install:
$ aptitude search gudev $ apt-get install --reinstall libgudev-1.0-0 $ apt-get install libgudev-1.0-dev
Keep on rolling here...
$ ./configure [...] checking for SELINUX... no checking for LIBNL... no configure: error: Package requirements (libnl-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0) were not met: No package 'libnl-3.0' found No package 'libnl-route-3.0' found No package 'libnl-genl-3.0' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBNL_CFLAGS and LIBNL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
And again:
$ aptitude search libnl $ apt-get install -y libnl-3-dev libnl-route-3-dev libnl-genl-3-dev
And again:
$ ./configure [...] checking for rtnl_link_inet6_get_token in -lnl-route-3... no checking for UUID... no configure: error: Package requirements (uuid) were not met: No package 'uuid' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables UUID_CFLAGS and UUID_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
$ aptitude serach uuid $ apt-get install -y uuid-dev
And again:
checking for NSS... no configure: error: Package requirements (nss >= 3.11) were not met: No package 'nss' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NSS_CFLAGS and NSS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
And again:
$ aptitude search nss $ apt-get install -y libnss3-dev
And again:
checking for NSS... yes checking pppd/pppd.h usability... no checking pppd/pppd.h presence... no checking for pppd/pppd.h... no configure: error: "couldn't find pppd.h. pppd development headers are required."
And again:
$ aptitude search pppd $ aptitude search ppp $ apt-get install -y ppp-dev [press enter]
And again:
checking for iptables... /sbin/iptables checking for dnsmasq... no checking for LIBSOUP... yes checking for LIBNDP... no configure: error: Package requirements (libndp) were not met: No package 'libndp' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables LIBNDP_CFLAGS and LIBNDP_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
And again:
$ echo "deb http://ftp.de.debian.org/debian jessie main" >> /etc/apt/sources.list $ apt-get update $ aptitude search libndp $ apt-get install libndp0 libndp-dev
And again:
./configure
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: executing po/stamp-it commands
System paths:
prefix: /usr/local
exec_prefix: ${prefix}
systemdunitdir: no
nmbinary: ${exec_prefix}/sbin/NetworkManager
nmconfdir: ${prefix}/etc/NetworkManager
nmdatadir: ${datarootdir}/NetworkManager
nmstatedir: ${prefix}/var/lib/NetworkManager
nmrundir: ${prefix}/var/run/NetworkManager
Platform:
session tracking: consolekit
suspend/resume: upower
policykit: yes (restrictive modify.system) (default=yes)
polkit agent: no
selinux: no
Features:
wext: yes
wifi: yes
wimax: no
ppp: yes
modemmanager-1: no
concheck: yes
libteamdctl: no
nmtui: no
Configuration plugins (main.plugins=ifupdown,ibft)
ibft: yes
ifcfg-rh: no
ifcfg-suse: no
ifupdown: yes
ifnet: no
Handlers for /etc/resolv.conf:
resolvconf: no
netconfig: no
DHCP clients:
dhclient: /sbin/dhclient
dhcpcd: no
Miscellaneous:
documentation: no
tests: yes
valgrind: no
code coverage: no
LTO: no
And aga - wait! IT WORKED!!! HAHAHA - wait - quick, make and make install before it breaks again:
$ make -j4 && make install
Nope:
make make all-recursive make[1]: Entering directory `/root/Downloads/NetworkManager-1.0.4' Making all in . make[2]: Entering directory `/root/Downloads/NetworkManager-1.0.4' make[2]: Leaving directory `/root/Downloads/NetworkManager-1.0.4' Making all in include make[2]: Entering directory `/root/Downloads/NetworkManager-1.0.4/include' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/include' Making all in introspection make[2]: Entering directory `/root/Downloads/NetworkManager-1.0.4/introspection' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/introspection' Making all in libnm-core make[2]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-core' make all-recursive make[3]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-core' Making all in . make[4]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-core' make[4]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-core' Making all in tests make[4]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-core/tests' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-core/tests' make[3]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-core' make[2]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-core' Making all in libnm make[2]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm' make all-recursive make[3]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm' Making all in . make[4]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm' make[4]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm' Making all in tests make[4]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm/tests' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm/tests' make[3]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm' make[2]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm' Making all in libnm-util make[2]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-util' make all-recursive make[3]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-util' Making all in . make[4]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-util' make[4]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-util' Making all in tests make[4]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-util/tests' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-util/tests' make[3]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-util' make[2]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-util' Making all in libnm-glib make[2]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-glib' make all-recursive make[3]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-glib' Making all in . make[4]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-glib' make[4]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-glib' Making all in tests make[4]: Entering directory `/root/Downloads/NetworkManager-1.0.4/libnm-glib/tests' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-glib/tests' make[3]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-glib' make[2]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/libnm-glib' Making all in src make[2]: Entering directory `/root/Downloads/NetworkManager-1.0.4/src' make all-recursive make[3]: Entering directory `/root/Downloads/NetworkManager-1.0.4/src' Making all in . make[4]: Entering directory `/root/Downloads/NetworkManager-1.0.4/src' CC wifi-utils-nl80211.lo platform/wifi/wifi-utils-nl80211.c: In function '_nl80211_send_and_recv': platform/wifi/wifi-utils-nl80211.c:147:8: warning: implicit declaration of function 'genlmsghdr' [-Wimplicit-function-declaration] platform/wifi/wifi-utils-nl80211.c:147:34: error: invalid type argument of '->' (have 'int') make[4]: *** [wifi-utils-nl80211.lo] Error 1 make[4]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/root/Downloads/NetworkManager-1.0.4/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/root/Downloads/NetworkManager-1.0.4' make: *** [all] Error 2
Okay, so I dug around in the source file that was creating the problem and found that the issue was with a call to a genlmsg_hdr from the libnl library.
Well... When I checked the version of libnl installed, it was 3.2.7, and the latest is 3.2.25, so... there you go.
Get the latest from here: http://www.infradead.org/~tgr/libnl/
$ cd libnl-3.2.25
$ ./configure
[...]
-------------------------------------------------------------------------------
NOTE
There have been some changes starting with 3.2 regarding where and how libnl
is being installed on the system in order to allow multiple libnl versions
to be installed in parallel:
- Headers will be installed in ${prefix}/include/libnl3, therefore
you will need to add "-I/usr/include/libnl3" to CFLAGS
- The library basename was renamed to libnl-3, i.e. the SO names become
libnl-3.so., libnl-route-3.so, etc.
- libtool versioning was assumed, to ease detection of compatible library
versions.
If you are using pkg-config for detecting and linking against the library
things will continue magically as if nothing every happened. If you are
linking manually you need to adapt your Makefiles or switch to using
pkg-config files.
Good to know. Now make and make install the libnl library:
$ make $ make install
Whew. First thing today to go smoothly.
Now we cross our fingers and hope pkg-config figures out this shit.
It does. It works. We've successfully installed NetworkManager after several hours of work.
More Things Break
The Segfault
After a multi-hour network manager install, dealing with endless problems, and finally getting it to install, it segfaults on its first run:
NetworkManager: /lib/x86_64-linux-gnu/libnl-genl-3.so.200: no version information available (required by NetworkManager) NetworkManager: /lib/x86_64-linux-gnu/libnl-3.so.200: no version information available (required by NetworkManager) NetworkManager: /usr/lib/x86_64-linux-gnu/libnl-route-3.so.200: no version information available (required by NetworkManager) NetworkManager-Message: <info> No config file found or given; using /usr/local/etc/NetworkManager/NetworkManager.conf
from the system log:
Jul 26 14:24:22 kronos kernel: [ 9582.981868] NetworkManager[6329]: segfault at 20 ip 00007fa84d9106f6 sp 00007fffbaf83ba0 error 4 in libglib-2.0.so.0.3200.4[7fa84d8c8000+f5000] Jul 26 14:24:33 kronos kernel: [ 9593.734360] NetworkManager[6333]: segfault at 20 ip 00007f263b49b6f6 sp 00007fff6ddf7e40 error 4 in libglib-2.0.so.0.3200.4[7f263b453000+f5000]
Backtracking
Rip it all out:
$ cd NetworkManager-1.0.4/ $ make uninstall $ cd ../ $ cd libnl-3.2.25/ $ make uninstall $ cd ../
Forget any of this ever happened.
Here We Go Again
$ apt-get update $ aptitude search network $ apt-get install network-manager network-manager-dev network-manager-gnome network-manager-iodine network-manager-iodine-gnome
Nope, still having problems.
Different Approach
For a different approach, I started looking for wireless devices that people had definitely had success with, on Kali on Mac hardware. Ultimately both of the wireless devices I was trying to use were made by corporations run by ignorant turds who would prefer the dark ages of Microsoft Windows to the open alternative, because they are money-grubbers, so the devices were closed source and I couldn't get them working in Linux.
Panda Wireless Adapters
I ordered better Linux-compatible hardware for my wireless adventures.
When it arrived, I plugged the panda wireless adapter in, fired up Kali Linux, and gave it a go.
Network Manager
My first try was to connect to the wireless using Network Manager.
No dice. Same behavior as before: it asks me for my password, then thinks a while, then asks me for my password again.
Manually Through Command Line
I fired up the wireless through the command line:
$ iw dev $ ip link show wlan2 $ ip link set wlan2 up $ ip link show wlan2 $ iw wlan2 link $ iw wlan2 scan > file; cat file | grep SSID
Now for the moment of truth:
$ wpa_passphrase 'Walrus' > /etc/wpa_supplicant.conf [enter password] $ wpa_supplicant -d -D wext -i wlan2 -c /etc/wpa_supplicant.conf
But unfortunately, I saw a familiar problem:
wext: interface wlan2 phy: phy1 rfkill: initial event: idx=0 type=2 op=0 soft=0 hard=0 rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0 rfkill: initial event: idx=2 type=1 op=0 soft=0 hard=0 SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf capabilities: key_mgmt 0xf enc 0xf flags 0x0 netlink: Operstate: linkmode=1, operstate=5 wlan2: Own MAC address: 7c:dd:90:74:09:9d wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=4 set_tx=0 seq_len=0 key_len=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument Driver did not support SIOCSIWENCODEEXT wpa_driver_wext_set_key: alg=0 key_idx=5 set_tx=0 seq_len=0 key_len=0 ioctl[SIOCSIWENCODEEXT]: Invalid argument Driver did not support SIOCSIWENCODEEXT wpa_driver_wext_set_countermeasures wlan2: RSN: flushing PMKID list in the driver wlan2: Setting scan request: 0 sec 100000 usec WPS: Set UUID for interface wlan2 WPS: UUID based on MAC address - hexdump(len=16): f3 98 17 ad f5 b9 5f 55 a6 fe 81 77 58 5e e4 54 EAPOL: SUPP_PAE entering state DISCONNECTED EAPOL: Supplicant port status: Unauthorized EAPOL: KEY_RX entering state NO_KEY_RECEIVE EAPOL: SUPP_BE entering state INITIALIZE EAP: EAP entering state DISABLED EAPOL: Supplicant port status: Unauthorized
Network Interfaces with New /etc/network/interfaces
Trying a quick fix: edit /etc/network/interfaces and add this:
# hopefully this helps with the wireless allow-hotplug wlan2 iface wlan2 inet dhcp
This didn't lead to any improvement connecting to the wireless with Network Manager.
From Command Line with New /etc/network/interfaces
Again, the same output as before:
wext: interface wlan2 phy: phy1 rfkill: initial event: idx=0 type=2 op=0 soft=0 hard=0 rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0 rfkill: initial event: idx=2 type=1 op=0 soft=0 hard=0 SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf capabilities: key_mgmt 0xf enc 0xf flags 0x0 netlink: Operstate: linkmode=1, operstate=5 wlan2: Own MAC address: 7c:dd:90:74:09:9d wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=4 set_tx=0 seq_len=0 key_len=0 Driver did not support SIOCSIWENCODEEXT wpa_driver_wext_set_key: alg=0 key_idx=5 set_tx=0 seq_len=0 key_len=0 Driver did not support SIOCSIWENCODEEXT wpa_driver_wext_set_countermeasures wlan2: RSN: flushing PMKID list in the driver wlan2: Setting scan request: 0 sec 100000 usec WPS: Set UUID for interface wlan2 WPS: UUID based on MAC address - hexdump(len=16): f3 98 17 ad f5 b9 5f 55 a6 fe 81 77 58 5e e4 54 EAPOL: SUPP_PAE entering state DISCONNECTED EAPOL: Supplicant port status: Unauthorized EAPOL: KEY_RX entering state NO_KEY_RECEIVE EAPOL: SUPP_BE entering state INITIALIZE EAP: EAP entering state DISABLED EAPOL: Supplicant port status: Unauthorized EAPOL: Supplicant port status: Unauthorized wlan2: Added interface wlan2
It basically went into an endless loop, I'm not even sure what it's doing:
Wireless event: new AP: 74:85:2a:97:5b:08 wlan2: Event ASSOCINFO (4) received wlan2: Association info event resp_ies - hexdump(len=146): 01 08 82 84 8b 0c 12 96 18 24 32 04 30 48 60 6c 2d 1a ad 01 1b ff ff ff 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 3d 16 06 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 4a 0e 14 00 0a 00 2c 01 c8 00 14 00 05 00 19 00 7f 08 01 00 00 00 00 00 00 40 dd 18 00 50 f2 02 01 01 80 00 03 a4 00 00 27 a4 00 00 42 43 5e 00 62 32 2f 00 dd 18 00 50 f2 04 10 4a 00 01 10 10 3b 00 01 03 10 49 00 06 00 37 2a 00 01 20 FT: Stored MDIE and FTIE from (Re)Association Response - hexdump(len=0): wlan2: Evenioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument t ASSOC (0) received wlan2: State: ASSOCIATING -> ASSOCIATED wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT) netlink: Operstate: linkmode=-1, operstate=5 wlan2: Associated with 00:00:00:00:00:00 wlan2: WPA: Association event - clear replay counter wlan2: WPA: Clear old PTK EAPOL: External notification - portEnabled=0 EAPOL: Supplicant port status: Unauthorized EAPOL: External notification - portValid=0 EAPOL: Supplicant port status: Unauthorized EAPOL: External notification - EAP success=0 EAPOL: Supplicant port status: Unauthorized EAPOL: External notification - portEnabled=1 EAPOL: SUPP_PAE entering state CONNECTING EAPOL: enable timer tick EAPOL: SUPP_BE entering state IDLE wlan2: Setting authentication timeout: 10 sec 0 usec wlan2: Cancelling scan request RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP]) RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan2' added WEXT: if_removed already cleared - ignore event Wireless event: cmd=0x8b15 len=24
Using Ubuntu
I had tried a live Ubuntu CD earlier, and that seemed to work. So I'm gonna try it again.
Random side note: http://developer.ubuntu.com/en/start/ubuntu-sdk/installing-the-sdk/
Initial Boot
On initially reaching Ubuntu on boot, I opened Network Manager, found the wireless USB dongle device, connected to my wireless, and everything worked flawlessly.
Connecting Manually
Just to inspect what was going on, I decided to try and connect manually using my procedure from before.
$ iw dev $ ip link show wlan0 $ iw link wlan0 $ iw wlan0 scan
Then the two steps to connect:
$ wpa_passphrase $ wpa_supplicant
This did not work. I saw more familiar errors:
PSK - hexdump(len=32): [REMOVED] Priority group 0 id=0 ssid='Walrus' WEXT: cfg80211-based driver detected wext: interface wlan0 phy: phy1 rfkill: initial event: idx=0 type=2 op=0 soft=0 hard=0 rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0 SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf capabilities: key_mgmt 0xf enc 0x1f flags 0x0 netlink: Operstate: ifindex=3 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT) Add interface wlan0 to a new radio phy1 wlan0: Own MAC address: 7c:dd:90:74:09:9d wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0 wpa_driver_wext_set_key: alg=0 key_idx=4 set_tx=0 seq_len=0 key_len=0 Driver did not support SIOCSIWENCODEEXT wpa_driver_wext_set_key: alg=0 key_idx=5 set_tx=0 seq_len=0 key_len=0 Driver did not support SIOCSIWENCODEEXT wpa_driver_wext_set_countermeasures wlan0: RSN: flushing PMKID list in the driver wlan0: Setting scan request: 0.100000 sec wlan0: WPS: UUID based on MAC address: f39817ad-f5b9-5f55-a6fe-8177585ee454 EAPOL: SUPP_PAE entering state DISCONNECTED EAPOL: Supplicant port status: Unauthorized EAPOL: KEY_RX entering state NO_KEY_RECEIVE EAPOL: SUPP_BE entering state INITIALIZE [...] wlan0: WPA: not using MGMT group cipher WPA: Set own WPA IE default - hexdump(len=22): 30 14 01 00 00 0f ac 02 01 00 00 0f ac 04 01 00 00 0f ac 02 00 00 wlan0: State: SCANNING -> ASSOCIATING wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT) netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT) Limit connection to BSSID 74:85:2a:97:5b:08 freq=2437 MHz based on scan results (bssid_set=0) wpa_driver_wext_associate wpa_driver_wext_set_drop_unencrypted wpa_driver_wext_set_psk wlan0: Association request to the driver failed wlan0: Setting authentication timeout: 5 sec 0 usec EAPOL: External notification - EAP success=0 EAPOL: External notification - EAP fail=0 EAPOL: External notification - portControl=Auto RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP]) RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added WEXT: if_removed already cleared - ignore event Wireless event: cmd=0x8b1a len=16 RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP]) RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added WEXT: if_removed already cleared - ignore event Wireless event: cmd=0x8b06 len=12 RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP]) RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added WEXT: if_removed already cleared - ignore event Wireless event: cmd=0x8b1a len=22 wlan0: RX EAPOL from 74:85:2a:97:5b:08
After I attempted this process, I tried switching back to the Network Manager and connecting to the wireless again, no problem.
Files Needed to Replicate Working Wireless?
The network through Network Manager works, on Ubuntu, with my wireless device.
/etc/network/interfaces isn't very interesting:
$ cat /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback
The network manager looks completely different. Using aptitude to look into that:
$ sudo apt-get install aptitude $ aptitude search network i A gir1.2-networkmanager-1.0 - GObject introspection data for NetworkMana i A glib-networking - network-related giomodules for GLib i A glib-networking-common - network-related giomodules for GLib - data p glib-networking-dbg - network-related giomodules for GLib - debu i A glib-networking-services - network-related giomodules for GLib - D-Bu i libproxy1-plugin-networkmanager - automatic proxy configuration management l i A libqt4-network - Qt 4 network module i A libqt5network5 - Qt 5 network module p libqtnetwork4-perl - perl bindings for the Qt Network library p libsmokeqtnetwork4-3 - Qt Network SMOKE library i A network-manager - network management framework (daemon and u p network-manager-dbg - network management framework (debugging sy p network-manager-dev - network management framework (development i A network-manager-gnome - network management framework (GNOME fronte i A network-manager-pptp - network management framework (PPTP plugin i A network-manager-pptp-gnome - network management framework (PPTP plugin p nova-network - OpenStack Compute - Network manager p python-networkx - tool to create, manipulate and study compl p python-networkx-doc - tool to create, manipulate and study compl
By using lsof before and after opening the network manager, I found it was using the binary /usr/bin/nm-connection-editor, which is part of the network-manager-gnome package. So theoretically, this should be using the same stuff under the Network Manager hood as Kali.
Other things to check? Versions of libraries and packages?
- libnm
- libdbus-glib
- libdbus
- libgmodule
- libgobject
- libnss
- libgvfsdbus
- libgvfs
- libltdl
- libtdb
- libxcb
- libnih
- libnih-dbus
- libplds
- libplc
- libnssutil
Even better:
$ apt-cache dump > freeze
The full freeze file: http://charlesreid1.com/freeze
Back to Kali
Now we're back to Kali. We have the freeze list from the working Ubuntu install........ now what?
Now make a freeze file for Kali, and compare versions of networking stuff, starting with network-manager and network-manager-gnome.
Kali freeze file: http://charlesreid1.com/freeze2
Here we go folks! Note the higher versions of just about everything on Ubuntu:
| Ubuntu apt-cache dump | Kali apt-cache dump |
|---|---|
Package: network-manager Version: 0.9.8.8-0ubuntu7 |
Package: network-manager Version: 0.9.4.0-10 |
Package: network-manager-gnome Version: 0.9.8.8-0ubuntu4.3 |
Package: network-manager-gnome Version: 0.9.4.1-5 |
Package: libnm-gtk0 Version: 0.9.8.8-0ubuntu4.3 |
Package: libnm-gtk0 Version: 0.9.4.1-5 |
Package: libnm-gtk-common Version: 0.9.8.8-0ubuntu4.3 |
Package: libnm-gtk-common Version: 0.9.4.1-5 |
|
Dependencies of network-manager package: Depends: libc6 2.14 Depends: libdbus-1-3 1.0.2 Depends: libdbus-glib-1-2 0.88 Depends: libglib2.0-0 2.31.8 Depends: libgudev-1.0-0 146 Depends: libmm-glib0 0.7.991 Depends: libnl-3-200 3.2.7 Depends: libnl-genl-3-200 3.2.7 Depends: libnl-route-3-200 3.2.7 Depends: libnm-glib4 0.9.8.0 Depends: libnm-util2 0.9.6.0+git201212071413.8a9759a Depends: libpolkit-gobject-1-0 0.99 Depends: libsoup2.4-1 2.26.1 Depends: libsystemd-login0 31 Depends: sysv-rc 2.88dsf-24 Depends: file-rc 0.8.16 Depends: lsb-base 3.2-14 Depends: wpasupplicant 0.7.3-1 Depends: dbus 1.1.2 Depends: udev (null) Depends: isc-dhcp-client 4.1.1-P1-4 Depends: iproute2 (null) Depends: dnsmasq-base (null) Depends: policykit-1 (null) Depends: iputils-arping (null) Depends: multiarch-support (null) Depends: avahi-autoipd (null) Depends: python (null) Depends: network-manager-pptp (null) Depends: network-manager-gnome (null) Depends: plasma-widget-networkmanagement (null) Depends: plasma-nm (null) Depends: ppp 2.4.5 Depends: iptables (null) Depends: modemmanager (null) Depends: systemd-services (null) Depends: crda (null) Depends: connman (null) Depends: network-manager-gnome 0.9 Depends: network-manager-kde 1:0.9 Depends: network-manager-openconnect 0.9 Depends: network-manager-openvpn 0.9 Depends: network-manager-pptp 0.9 Depends: network-manager-vpnc 0.9 Depends: plasma-widget-networkmanagement 0.9~ Depends: ppp 2.4.5 |
Dependencies of network-manager package: Depends: libc6 2.4 Depends: libdbus-1-3 1.0.2 Depends: libdbus-glib-1-2 0.88 Depends: libgcrypt11 1.4.5 Depends: libglib2.0-0 2.31.8 Depends: libgnutls26 2.12.17-0 Depends: libgudev-1.0-0 146 Depends: libnl-3-200 3.2.7 Depends: libnl-genl-3-200 3.2.7 Depends: libnl-route-3-200 (null) Depends: libnm-glib4 0.9.4.0 Depends: libnm-util2 0.9.4.0 Depends: libpolkit-gobject-1-0 0.99 Depends: libuuid1 2.16 Depends: lsb-base 3.2-14 Depends: wpasupplicant 0.7.3-1 Depends: dbus 1.1.2 Depends: udev (null) Depends: adduser (null) Depends: isc-dhcp-client 4.1.1-P1-4 Depends: dpkg 1.15.7.2 Depends: avahi-autoipd (null) Depends: policykit-1 (null) Depends: ppp 2.4.5 Depends: dnsmasq-base (null) Depends: iptables (null) Depends: modemmanager (null) Depends: crda (null) Depends: network-manager-gnome 0.9 Depends: network-manager-kde 1:0.9 Depends: network-manager-openconnect 0.9 Depends: network-manager-openvpn 0.9 Depends: network-manager-pptp 0.9 Depends: network-manager-vpnc 0.9 Depends: plasma-widget-networkmanagement 0.9~ Depends: ppp 2.4.5 |
If that isn't the cause of all of Kali's wireless woes, it certainly isn't helping.
Next step is to figure out how to bootstrap our way toward a better network-manager without going through the very, very, very painful manual installation process for it.
(All these tiny hurdles and closed-off alleyways add up.)
Adding Ubuntu PPA Repositories
Adding Ubuntu/PPA repositories to Kali: http://www.blackmoreops.com/2014/02/21/kali-linux-add-ppa-repository-add-apt-repository
If I understand it right.
$ apt-get install python-software-properties $ apt-get install apt-file $ apt-get update # just in case $ apt-file update # may take a while
Now that you've got apt-file set up:
$ apt-file search add-apt-repository
Now edit the file (which will not exist) and add some contents:
#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]
then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"
echo "$0 ppa:user/ppa-name"
else
echo "$ppa_name"
# This is where you pick which Ubuntu release to use
echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu trust main" >> /etc/apt/sources.list
apt-get update >> /dev/null 2> /tmp/${NAME}_apt_add_key.txt
key=`cat /tmp/${NAME}_apt_add_key.txt | cut -d":" -f6 | cut -d" " -f3`
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
rm -rf /tmp/${NAME}_apt_add_key.txt
fi
else
echo "Utility to add PPA repositories in your debian machine"
echo "$0 ppa:user/ppa-name"
fi
now add the network-manager PPA (listed here: https://launchpad.net/~network-manager/+archive/ubuntu/ppa):
$ add-apt-repository ppa:network-manager/ppa
Fixing It
IT WORKS:
I installed wicd, after seeing a link to this video: https://www.youtube.com/watch?v=FFRDzcCDnc4
Thank you thank you thank you thank you thank you dear precious person who made that video and dear precious people who made wicd
Thank you
Thank you
A thousand thank yous
for i in range(1000):
print "thank you"
-->