WPA_Supplicant config for WPA encryption Backtrack 5

Why use WPA_Supplicant Daemon?

Wpa_supplicant config

So after finding an old Backtrack 5 R3 persistent USB drive I had created years ago, I booted it up to browse the content I had on it. Last time I used it, I was connected to a WEP encrypted network, but as we all know those offer weak protection and are slightly outdated for today. The tools and techniques to break WEP encryption have been around for a while and therefore WEP is rarely used these days. That being said, WPA encryption isn’t flawless, but a better alternative. I’m not going to discuss how to crack those here. Anyway, I figured I would share with you how to connect to a WPA encrypted network in Linux using the terminal and WPA_Supplicant daemon.

If you’re still using Backtrack 5 R3, I recommend upgrading to Kali Linux by creating a persistent USB.

Normally, we use iwconfig to configure wireless networks. However, iwconfig does not support WPA/WPA2 encryption. We have to use the “WPA_Supplicant Daemon” to connect to a WPA encrypted network.

Wpa_supplicant comes pre-installed in most Linux distros (including Backtrack 5 R3, Kali Linux and Ubuntu). Since Backtrack 5 R3 is outdated, it is configured to make connecting to WEP encrypted networks easily,

Wpa_supplicant Config

First, we need to create a configuration file for wpa_supplicant and call it wpa_supplicant.conf. You can really put it anywhere but I created my copy in “/etc/wpa_supplicant.conf”. Now, open the file type the following code:

network={
ssid="5EUWI"
key_mgmt=WPA-PSK
psk="8UEBW8F32SFJV525"
} 

So essentially:

network={
ssid=[Your network SSID]
key_mgmt=WPA-PSK
psk=[Your WPA key]
}

*Remember where you saved this file

Now, open up Terminal and type:

root:# ifconfig

or sudo ifconfig and determine which wireless LAN interface (wlan0, wlan1, etc.) you will be using. You should get a list of your interfaces. In my case, my I will be using the wlan0 adapter/interface.

Now in Terminal, type:

root:# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -Dwext -B

Now in another terminal window (if you didn’t use the -B parameter above) or the same terminal if you used the it. The -B parameter basically has it run in the background instead of outputting to the terminal. (For more information use -H.)

Now in the Terminal type:

root:# dhclient wlan0

If successful, should get an output similar to following:

Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/74:xx:xx:xx:4b:f8
Sending on   LPF/wlan0/74:xx:xx:xx:4b:f8
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
DHCPOFFER of 192.168.1.12 from 192.168.1.1
DHCPREQUEST of 192.168.1.12 on wlan0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.12 from 192.168.1.1
bound to 192.168.1.12 -- renewal in 42878 seconds.

Now you should be connected to the Internet using your WPA/WPA2 key. 🙂

I recommend upgrading to Kali Linux if you haven’t already anyways. It is available at kali.org.

If you want to setup a persistent Kali USB drive, please see my tutorial here.

Leave a Reply

Your email address will not be published. Required fields are marked *