From charlesreid1

Revision as of 09:28, 29 July 2015 by Admin (talk | contribs) (Created page with "This is a summary of my "adventure" getting my wireless card to work in Kali. What it boiled down to? 1. Not using the on-board Broadcom wireless card in the MacBook Pro, b...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is a summary of my "adventure" getting my wireless card to work in Kali.

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.

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 wlan1, which is a USB wireless device, instead of wlan0, the problematic built-in wireless requiring proprietary Broadcom drivers.

Step 1

First, get the device name:

$ iw dev

Step 2

Now show the status of the device:

$ ip link show wlan1

If you don't see the word UP in brackets, set up the driver and bring it online:

$ ip link set wlan1 up
$ ip link show wlan1

Step 3

Now show the connection status:

$ iw wlan1 link

Step 4

And show networks available:

$ iw wlan1 scan

Step 5

Make sure your network is there in the list.

Create a file with the encoded WPA passphrase:

$ wpa_passphrase 'YOURNETWORKSSID' > /etc/wpa_supplicant.conf
[now press enter, type your password on this line, and press enter]

Step 6

Run the wpa_supplicant program to connect to the wireless network:

$ wpa_supplicant -D wext -i wlan1 -c /etc/wpa_supplicant.conf

This is where I learned more about what was going on with the wireless connection problems. You can add the -d or -dd flags to get a whole lot of debug information printed out:

$ wpa_supplicant -dd -D wext -i wlan1 -c /etc/wpa_supplicant.conf

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:

$ wpa_supplicant -Dwext -iwlan1 -c/etc/wpa_supplicant.conf
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument

Then I called it with the -d flag (my network is called WALRUS):

$ 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

[...]

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:

network={
        ssid="WALRUS"
        proto=WPA RSN
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP
        psk=0904d35f3a88add26fb64b3c2e203ae7cc480814e1ebd7
}

but unfortunately this had no effect - still saw the same error message. When I run:

$ ifconfig wlan1 down
$ ifconfig wlan1 up

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 wlan1 interface (USB wireless device):

$ 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

Same problem as before.

I killed any remnants of the process, and ran it again, with debug output:

$ 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

[...]

Again, same results, same error: "no WPA/RSN proto match".

Kill Network Manager

die die die network manager dieeeeeeee

$ ps aux | grep NetworkManager
$ killall NetworkManager

Ok, now let's try that again.

$ 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

[...]

Aaaaand, same result.

Adding More Parameters to Supplicant File

Gonna give this one more shot.

Adding to supplicant file, per this thread on reddit.

Step 1: create the supplicant file

wpa_passphrase 'YOURNETWORK' 'YOURPSK' > /etc/wpa_supplicant.conf

Now edit the conf file to add more information. Here's the original:

network={
        ssid="WALRUS"
        #psk="secret!"
        psk=0904d35fc8add26fb64b3c2e203ae7cc480814e1ebd7
}

and now the new version, with more information:

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"
}

Now re-run all the other steps:

$ 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

and shot down again, with the same error:

[...]
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
[...]

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 802.11 g/n protocol, so I switched it to the 802.11b/g/n 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

  network={
        ssid="NetworkEssid"
        scan_ssid=1 # only needed if your access point uses a hidden ssid
        proto=WPA
        key_mgmt=WPA-PSK
        psk=945609a382413e64d57daef00eb5fab3ae228716e1e440981c004bc61dccc98c
  }

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

$ apt-get purge network-manager-gnome

Setting the Wireless Interface to Connect at Boot: Add the following lines to /etc/rc.local:

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

and here's the supplicant file:

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
}

Trying Them

Nuke Net Mgr

I nuked net manager with a

apt-get purge network-manager-gnome

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:

$ 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

and now, connecting:

$ wpa_passphrase 'YOURNETWORK' 'YOURPSK' > /etc/wpa_supplicant.conf
$ wpa_supplicant -D wext -i wlan1 -c /etc/wpa_supplicant.conf

WTF??? My router is blacklisted??? This is some royally fucked up shit, Kali Linux.

[...]
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)
[...]


Different Supplicant File

Now tyring a differnet supplicant file, as per one suggestion above

  network={
        ssid="NetworkEssid"
        scan_ssid=1 # only needed if your access point uses a hidden ssid
        proto=WPA
        key_mgmt=WPA-PSK
        psk=945609a382413e64d57daef00eb5fab3ae228716e1e440981c004bc61dccc98c
  }

Now trying to connect:

$ ...
$ ...

and finally, the command itself:

$ 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
[...]

Now trying again, with debugging output:

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

Other Supplicant Files

Other things to try?

https://bbs.archlinux.org/viewtopic.php?id=115613

Also, saw this in the output:

Driver did not support SIOCSIWENCODEEXT

Still No Luck

I'm beating my head against a wall.

Wireless USB Device Driver

My next thought was that, maybe, just maybe, the manufacturer's claim of "out of the box compatibility" with Linux systems is a load of bulldip.

The device is an Airlink 101, which uses a Realtek chipset inside. The drivers are provided here, but as usual, Linux developers get a big "fuck you" because they're all binary and in .exe or .dmg format.

An equally worthless, 4 year old pile of bulldip at the Ubuntu wiki that says installing the drivers for this wireless card may cause kernel panics.

Great, because connecting to a wireless network isn't THE FIRST FUCKING THING you do when you turn on a computer, it is obviously very complicated, and would certainly require someone to build their own wireless driver from scratch, and potentially risk kernel panics.

A big, wet, cold fuck you to all of you wireless chipset manufacturers out there.

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: EAPOL: Supplicant port status: Unauthorized, 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):

(Computer running Kali Linux)<--->(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]

A big, cold, wet middle finger to you too, NetworkManager.

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.