From charlesreid1

No edit summary
No edit summary
 
Line 9: Line 9:
3. Installing <code>wicd</code> network manager. This worked like a dream.
3. Installing <code>wicd</code> network manager. This worked like a dream.


<!--


And now for my stream-of-consciousness notes from the very ugly process of getting to those three simple pieces of information...
=The Problem=
I installed Kali as a dual boot on Mac OS X, as described here: [[Dual_Boot_Kali_on_OS_X]]
However, when I booted into Kali, I had problems with my wireless.
Here's the problem that I'm seeing: if I try and connect to a wireless network from Kali, using the gnome NetworkManager (top right, two-computer icon), then I enter the SSID of the network, then the passphrase, and then it tries to connect. But after a minute or so, it presents me with the same dialogue - requesting a password. The wireless just won't connect.
This could be a problem with my wireless network, or it could be a problem with my wireless card.
I tried connecting to a different wireless network, to see if that was the issue. It wasn't. I was not able to connect to any wireless networks I tried, from Kali Linux. I'm able to connect to those networks just fine from Mac OS X.
I suspected the wireless card was the issue, since MacBooks have Broadcom drivers that are proprietary and spotty. So I plugged in a USB wireless adapter.
Same problem.
Now I'm stumped.
=The Details=
I started digging in at the command line. This means, we have to understand how to connect to a wireless network from the command line.
==Connecting to a Wireless Network from the Command Line==
In Linux, we can do this using a multi-step process.
Note I'm using <code>wlan1</code>, which is a USB wireless device, instead of <code>wlan0</code>, the problematic built-in wireless requiring proprietary Broadcom drivers.
===Step 1===
First, get the device name:
<pre>
$ iw dev
</pre>
===Step 2===
Now show the status of the device:
<pre>
$ ip link show wlan1
</pre>
If you don't see the word UP in brackets, set up the driver and bring it online:
<pre>
$ ip link set wlan1 up
$ ip link show wlan1
</pre>
===Step 3===
Now show the connection status:
<pre>
$ iw wlan1 link
</pre>
===Step 4===
And show networks available:
<pre>
$ iw wlan1 scan
</pre>
===Step 5===
Make sure your network is there in the list.
Create a file with the encoded WPA passphrase:
<pre>
$ wpa_passphrase 'YOURNETWORKSSID' > /etc/wpa_supplicant.conf
[now press enter, type your password on this line, and press enter]
</pre>
===Step 6===
Run the wpa_supplicant program to connect to the wireless network:
<pre>
$ wpa_supplicant -D wext -i wlan1 -c /etc/wpa_supplicant.conf
</pre>
This is where I learned more about what was going on with the wireless connection problems. You can add the <code>-d</code> or <code>-dd</code> flags to get a whole lot of debug information printed out:
<pre>
$ wpa_supplicant -dd -D wext -i wlan1 -c /etc/wpa_supplicant.conf
</pre>
==The Protocol Problem==
The problem is a protocol problem between the laptop and the wireless router. More details below. Still not sure how to fix it...
===WPA Supplicant Dump===
At first this was all I was seeing:
<pre>
$ wpa_supplicant -Dwext -iwlan1 -c/etc/wpa_supplicant.conf
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
</pre>
Then I called it with the <code>-d</code> flag (my network is called WALRUS):
<pre>
$ wpa_supplicant -Dwext -iwlan1 -c/etc/wpa_supplicant.conf
[...]
wlan1: 19: 93:c7:92:1e:33:30 ssid='xfinitywifi' wpa_ie_len=0 rsn_ie_len=0 caps=0x1 level=-90
wlan1:    skip - SSID mismatch
wlan1: 14: 00:71:e2:5d:e5:b9 ssid='' wpa_ie_len=26 rsn_ie_len=24 caps=0x11 level=-88
wlan1:    skip - SSID not known
wlan1: 16: 44:85:2a:97:4b:08 ssid='WALRUS' wpa_ie_len=0 rsn_ie_len=0 caps=0x1 level=-34
wlan1:    skip - no WPA/RSN proto match
[...]
</pre>
Okay - so the problem is with the protocol. The wireless device on Kali sees the wireless router, but when they try and talk, neither understands the other. So the wireless device skips that wireless router and looks through alll the other wireless networks.
===More Info in Supplicant File===
I tried adding more information in the supplicant file, per other people's posts about it, for example:
<pre>
network={
        ssid="WALRUS"
        proto=WPA RSN
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP
        psk=0904d35f3a88add26fb64b3c2e203ae7cc480814e1ebd7
}
</pre>
but unfortunately this had no effect - still saw the same error message. When I run:
<pre>
$ ifconfig wlan1 down
$ ifconfig wlan1 up
</pre>
and then try re-running, using the supplicant file above, still no die.
===When In Doubt, Restart===
Okay, trying a fresh reboot.
Going through the steps above, to connect to my wireless network with the <code>wlan1</code> interface (USB wireless device):
<pre>
$ iw dev
$ ip link show wlan1
$ iw wlan1 link
$ iw wlan1 scan > file
$ wpa_passphrase 'YOURNETWORK' 'YOURPSK' > /etc/wpa_supplicant.conf
$ wpa_supplicant -D wext -i wlan1 -c /etc/wpa_supplicant.conf
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
</pre>
Same problem as before.
I killed any remnants of the process, and ran it again, with debug output:
<pre>
$ ps aux | grep wpa
$ killall wpa_supplicant
$ wpa_supplicant -d -D wext -i wlan1 -c /etc/wpa_supplicant.conf
[...]
wlan1: 17: c0:4e:cf:a0:b3:82 ssid='WHAT UP WAZ' wpa_ie_len=0 rsn_ie_len=0 caps=0x11 level=-84 wps
wlan1:    skip - SSID mismatch
wlan1: 19: c6:89:2c:38:f5:cc ssid='xfinitywifi' wpa_ie_len=0 rsn_ie_len=0 caps=0x1 level=-73
wlan1:    skip - SSID mismatch
wlan1: 18: 74:85:2a:9c:5b:c9 ssid='WALRUS' wpa_ie_len=0 rsn_ie_len=0 caps=0x1 level=-34
wlan1:    skip - no WPA/RSN proto match
[...]
</pre>
Again, same results, same error: "no WPA/RSN proto match".
===Kill Network Manager===
die die die network manager dieeeeeeee
<pre>
$ ps aux | grep NetworkManager
$ killall NetworkManager
</pre>
Ok, now let's try that again.
<pre>
$ iw dev
$ ip link show wlan1
$ ip link set wlan1 up
$ iw wlan1 link
$ iw wlan1 scan > file
$ wpa_passphrase 'YOURNETWORK' 'YOURPSK' > /etc/wpa_supplicant.conf
$ wpa_supplicant -D wext -i wlan1 -c /etc/wpa_supplicant.conf
[...]
wlan0: 20: 20:4c:7f:c0:c3:82 ssid='WHAT UP WAZ' wpa_ie_len=0 rsn_ie_len=0 caps=0x11 level=-69 wps
wlan0:    skip - SSID mismatch
wlan0: 21: c2:45:b0:cf:7c:cc ssid='' wpa_ie_len=0 rsn_ie_len=0 caps=0x11 level=-73
wlan0:    skip - SSID not known
wlan0: 22: 7c:85:ca:97:5b:08 ssid='WALRUS' wpa_ie_len=0 rsn_ie_len=0 caps=0x1 level=-24
wlan0:    skip - no WPA/RSN proto match
[...]
</pre>
Aaaaand, same result.
===Adding More Parameters to Supplicant File===
Gonna give this one more shot.
Adding to supplicant file, per [http://www.reddit.com/r/linuxquestions/comments/2lyr1w/wpawpa2_enterprise_problem/ this thread on reddit].
Step 1: create the supplicant file
<pre>
wpa_passphrase 'YOURNETWORK' 'YOURPSK' > /etc/wpa_supplicant.conf
</pre>
Now edit the conf file to add more information. Here's the original:
<pre>
network={
        ssid="WALRUS"
        #psk="secret!"
        psk=0904d35fc8add26fb64b3c2e203ae7cc480814e1ebd7
}
</pre>
and now the new version, with more information:
<pre>
network={
    ssid="WALRUS"
    #scan_ssid=1
    proto=RSN WPA
    key_mgmt=WPA-EAP IEEE8021X
    eap=PEAP
    identity="charles@localhost"
    password="secret!"
    phase1="peaplabel=0"
    phase2="auth=MSCHAPV2"
}
</pre>
Now re-run all the other steps:
<pre>
$ iw dev
$ ip link show wlan1
$ iw wlan1 link
$ iw wlan1 scan > file
$ # no wpa_passphrase step, we already have our supplicant file
$ wpa_supplicant -D wext -i wlan1 -c /etc/wpa_supplicant.conf
</pre>
and shot down again, with the same error:
<pre>
[...]
wlan1: 8: 90:c7:92:e7:60 ssid='' wpa_ie_len=26 rsn_ie_len=24 caps=0x11 level=-86 wps
wlan1:    skip - SSID mismatch
wlan1: 9: 20:4e:7f:23:82 ssid='WHAT UP WAZ' wpa_ie_len=0 rsn_ie_len=0 caps=0x11 level=-78 wps
wlan1:    skip - SSID mismatch
wlan1: 10: 72:83:2a:92:52:22 ssid='WALRUS' wpa_ie_len=0 rsn_ie_len=0 caps=0x1 level=-36
wlan1:    skip - no WPA/RSN proto match
[...]
</pre>
===Trying Again===
This time, using the psk keyword instead of password key word in the supplication file...
But that didn't work either. Same error on trying to connect.
==Router Protocol==
One last thing to try before resorting to aircrack-ng and wireshark: my wireless router was using the <code>802.11 g/n</code> protocol, so I switched it to the <code>802.11b/g/n</code> protocol. Tried the above steps one more time.
Nope.
==Few More Things To Try==
===Nuke Network Manager===
This link says that the Network Manager may be causing problems:
http://askubuntu.com/questions/106633/wpa-supplicant-ioctlsiocsiwencodeext-invalid-argument
===More Supplicant===
This link suggests adding some stuff to supplicant file:
https://help.ubuntu.com/community/WifiDocs/WPAHowTo
<pre>
  network={
        ssid="NetworkEssid"
        scan_ssid=1 # only needed if your access point uses a hidden ssid
        proto=WPA
        key_mgmt=WPA-PSK
        psk=945609a382413e64d57daef00eb5fab3ae228716e1e440981c004bc61dccc98c
  }
</pre>
===Other Suggestions===
More suggestions for supplicant file:
http://ubuntuforums.org/showthread.php?t=1659866
===Nuke Network Manager For Sure===
This link suggests adding even more stuff, and suggests purging gnome network manager:
http://askubuntu.com/questions/191836/wpa-supplicants-connection-issues
<pre>
$ apt-get purge network-manager-gnome
</pre>
Setting the Wireless Interface to Connect at Boot: Add the following lines to <code>/etc/rc.local</code>:
<pre>
ifconfig eth0 down
ifconfig wlan0 down
dhclient -r wlan0
iwconfig wlan0 essid "A-B-C-D"
iwconfig wlan0 mode Managed
ifconfig wlan0 up
dhclient wlan0
</pre>
and here's the supplicant file:
<pre>
ctrl_interface=/var/run/wpa_supplicant
network={
        ssid="ESSID_IN_QUOTES"
        psk="ASCII PSK Password in Quotes"
        key_mgmt=WPA-PSK
        proto=RSN WPA
        pairwise=CCMP TKIP
        group=CCMP TKIP
}
</pre>
==Trying Them==
===Nuke Net Mgr===
I nuked net manager with a
<pre>
apt-get purge network-manager-gnome
</pre>
Then I logged out and logged back in.
===Next Try===
Next thing was to give this a shot without NetworkManager getting in the way. First, setting up the wireless to connect:
<pre>
$ ip link show wlan1
$ ip link set wlan1 down
$ ip link set wlan1 up
$ ip link show wlan1
$ iw wlan1 link
$ iw wlan1 scan
$ iw wlan1 scan | grep SSID
</pre>
and now, connecting:
<pre>
$ wpa_passphrase 'YOURNETWORK' 'YOURPSK' > /etc/wpa_supplicant.conf
$ wpa_supplicant -D wext -i wlan1 -c /etc/wpa_supplicant.conf
</pre>
and the output:
<pre>
[...]
netlink: Operstate: linkmode=-1, operstate=5
wlan1: Associated with 00:00:00:00:00:00
wlan1: WPA: Association event - clear replay counter
wlan1: 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
[...]
wlan1: Event SCAN_RESULTS (3) received
Scan results did not fit - trying larger buffer (8192 bytes)
Scan results did not fit - trying larger buffer (16384 bytes)
Received 16358 bytes of scan results (29 BSSes)
wlan1: BSS: Start scan result update 46
wlan1: New scan results available
wlan1: Selecting BSS from priority group 0
wlan1: 0: 74:85:2a:97:5b:08 ssid='IAMTHEWALRUS2' wpa_ie_len=26 rsn_ie_len=24 caps=0x11 level=-38 wps
wlan1:    skip - blacklisted (count=1 limit=0)
[...]
</pre>
WTF?! my router is blacklisted?
===Different Supplicant File===
Now tyring a differnet supplicant file, as per one suggestion above
<pre>
  network={
        ssid="NetworkEssid"
        scan_ssid=1 # only needed if your access point uses a hidden ssid
        proto=WPA
        key_mgmt=WPA-PSK
        psk=945609a382413e64d57daef00eb5fab3ae228716e1e440981c004bc61dccc98c
  }
</pre>
Now trying to connect:
<pre>
$ ...
$ ...
</pre>
and finally, the command itself:
<pre>
$ wpa_supplicant -D wext -i wlan1 -c /etc/wpa_supplicant.conf
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
wlan1: Trying to associate with 74:85:2a:97:5b:08 (SSID='WALRUS' freq=2437 MHz)
wlan1: Associated with 00:00:00:00:00:00
wlan1: WPA: No SSID info found (msg 1 of 4)
wlan1: CTRL-EVENT-DISCONNECTED bssid=74:85:2a:97:5b:08 reason=0
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
wlan1: Trying to associate with 74:85:2a:97:5b:08 (SSID='WALRUS' freq=2437 MHz)
wlan1: Associated with 00:00:00:00:00:00
wlan1: CTRL-EVENT-DISCONNECTED bssid=74:85:2a:97:5b:08 reason=0
[...]
</pre>
Now trying again, with debugging output:
<pre>
red - ignore event
Wireless event: cmd=0x8c08 len=162
AssocResp IE wireless event - 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 17 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
RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan1' added
WEXT: if_removed already cleared - ignore event
Wireless event: cmd=0x8b15 len=24
Wireless event: new AP: 74:85:2a:97:5b:08
wlan1: Event ASSOCINFO (4) received
wlan1: 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 17 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):
wlan1: Event ASSOC (0) received
wlan1: State: ASSOCIATING -> ASSOCIATED
wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)
netlink: Operstate: linkmode=-1, operstate=5
wlan1: Associated with 00:00:00:00:00:00
wlan1: WPA: Association event - clear replay counter
wlan1: 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
wlan1: Setting authentication timeout: 10 sec 0 usec
wlan1: Cancelling scan request
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan1' added
</pre>
No luck, still failing.
===Other Supplicant Files===
Other things to try?
https://bbs.archlinux.org/viewtopic.php?id=115613
Also, saw this in the output:
<pre>
Driver did not support SIOCSIWENCODEEXT
</pre>
===Still No Luck===
I'm beating my head against a wall.
==Testing Elsewhere==
===Testing On Kali (Different Computer)===
I decided to test out the wireless USB device on another desktop install of Kali Linux. I ran through all of the steps above, and I saw the same error message: <code>EAPOL: Supplicant port status: Unauthorized</code>, followed by my home router being "blacklisted" - whatever that means.
So the problem is specific to any computer running Kali, so far (have not tested any other OSes), and to any wireless router (I've tried a couple of common routers):
<code>(Computer running Kali Linux)<--->(Any Wireless Router)</code>
===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 <code>iw</code> utility.
FIrst, when I plug in the wireless USB device, I can see it is available to the computer:
<pre>
lsusb
</pre>
now I try and see it through the wireless interface, <code>iw</code> (or whatever iw stands for). I type:
<pre>
iw dev
</pre>
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:
<pre>
iw phy
</pre>
This lists a device, phy2, so I print more information about it:
<pre>
iw phy phy2 info
</pre>
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:
<pre>
$ 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
</pre>
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.
<pre>
$ ./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.
</pre>
I see a whole bunch of dbus libraries:
<pre>
$ 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
[...]
</pre>
Double check by installing the user versions, then install the developer versions:
<pre>
$ 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.
</pre>
Okay, search/find/install:
<pre>
$ aptitude search gudev
$ apt-get install --reinstall libgudev-1.0-0
$ apt-get install libgudev-1.0-dev
</pre>
Keep on rolling here...
<pre>
$ ./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.
</pre>
And again:
<pre>
$ aptitude search libnl
$  apt-get install -y libnl-3-dev libnl-route-3-dev libnl-genl-3-dev
</pre>
And again:
<pre>
$ ./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.
</pre>
<pre>
$ aptitude serach uuid
$ apt-get install -y uuid-dev
</pre>
And again:
<pre>
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.
</pre>
And again:
<pre>
$ aptitude search nss
$ apt-get install -y libnss3-dev
</pre>
And again:
<pre>
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."
</pre>
And again:
<pre>
$ aptitude search pppd
$ aptitude search ppp
$ apt-get install -y ppp-dev
[press enter]
</pre>
And again:
<pre>
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.
</pre>
And again:
<pre>
$ 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
</pre>
And again:
<pre>
./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
</pre>
And aga - wait! IT WORKED!!! HAHAHA - wait - quick, make and make install before it breaks again:
<pre>
$ make -j4 && make install
</pre>
Nope:
<pre>
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
</pre>
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 <code>genlmsg_hdr</code> 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/
<pre>
$ 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.
</pre>
Good to know. Now make and make install the libnl library:
<pre>
$ make
$ make install
</pre>
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:
<pre>
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
</pre>
from the system log:
<pre>
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]
</pre>
===Backtracking===
Rip it all out:
<pre>
$ cd NetworkManager-1.0.4/
$ make uninstall
$ cd ../
$ cd libnl-3.2.25/
$ make uninstall
$ cd ../
</pre>
Forget any of this ever happened.
==Here We Go Again==
<pre>
$ apt-get update
$ aptitude search network
$ apt-get install network-manager network-manager-dev network-manager-gnome network-manager-iodine network-manager-iodine-gnome
</pre>
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.
[[Image:PandaWireless.jpg|300px]]
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:
<pre>
$ 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
</pre>
Now for the moment of truth:
<pre>
$ wpa_passphrase 'Walrus' > /etc/wpa_supplicant.conf
[enter password]
$ wpa_supplicant -d -D wext -i wlan2 -c /etc/wpa_supplicant.conf
</pre>
But unfortunately, I saw a familiar problem:
<pre>
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
</pre>
==Network Interfaces with New /etc/network/interfaces==
Trying a quick fix: edit <code>/etc/network/interfaces</code> and add this:
<pre>
# hopefully this helps with the wireless
allow-hotplug wlan2
iface wlan2 inet dhcp
</pre>
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:
<pre>
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
</pre>
It basically went into an endless loop, I'm not even sure what it's doing:
<pre>
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
</pre>
==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.
<pre>
$ iw dev
$ ip link show wlan0
$ iw link wlan0
$ iw wlan0 scan
</pre>
Then the two steps to connect:
<pre>
$ wpa_passphrase
$ wpa_supplicant
</pre>
This did not work. I saw more familiar errors:
<pre>
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
</pre>
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.
<code>/etc/network/interfaces</code> isn't very interesting:
<pre>
$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
</pre>
The network manager looks completely different. Using aptitude to look into that:
<pre>
$ 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
</pre>
By using lsof before and after opening the network manager, I found it was using the binary <code>/usr/bin/nm-connection-editor</code>, which is part of the <code>network-manager-gnome</code> 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:
<pre>
$ apt-cache dump > freeze
</pre>
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 <code>network-manager</code> and <code>network-manager-gnome</code>.
Kali freeze file: http://charlesreid1.com/freeze2
Here we go folks! Note the higher versions of just about everything on Ubuntu:
{|class="wikitable"
!Ubuntu apt-cache dump
!Kali apt-cache dump
|-
|
<pre>
Package: network-manager
Version: 0.9.8.8-0ubuntu7
</pre>
|
<pre>
Package: network-manager
Version: 0.9.4.0-10
</pre>
|-
|
<pre>
Package: network-manager-gnome
Version: 0.9.8.8-0ubuntu4.3
</pre>
|
<pre>
Package: network-manager-gnome
Version: 0.9.4.1-5
</pre>
|-
|
<pre>
Package: libnm-gtk0
Version: 0.9.8.8-0ubuntu4.3
</pre>
|
<pre>
Package: libnm-gtk0
Version: 0.9.4.1-5
</pre>
|-
|
<pre>
Package: libnm-gtk-common
Version: 0.9.8.8-0ubuntu4.3
</pre>
|
<pre>
Package: libnm-gtk-common
Version: 0.9.4.1-5
</pre>
|-
|
Dependencies of network-manager package:
<pre>
  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
</pre>
|
Dependencies of network-manager package:
<pre>
  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
</pre>
|}
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.
<pre>
$ apt-get install python-software-properties
$ apt-get install apt-file
$ apt-get update # just in case
$ apt-file update # may take a while
</pre>
Now that you've got apt-file set up:
<pre>
$ apt-file search add-apt-repository
</pre>
Now edit the file (which will not exist) and add some contents:
<pre>
#!/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
</pre>
now add the network-manager PPA (listed here: https://launchpad.net/~network-manager/+archive/ubuntu/ppa):
<pre>
$ add-apt-repository ppa:network-manager/ppa
</pre>
=Fixing It=
IT WORKS:
[[Image:KaliWirelessWorking.png|500px]]
I installed <code>wicd</code>, 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=
<source lang="python">
for i in range(1000):
    print "thank you"
</source>
-->


[[Category:Kali]]
[[Category:Kali]]
[[Category:Wireless]]
[[Category:Wireless]]

Latest revision as of 05:51, 15 July 2016

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.