Thursday, October 29, 2009

Installing wpa_supplicant in Slackware

Ever since I'm connecting to my wireless router WRT54GL from LinkSys, I never thought of WPA and the wpa_supplicant for my Slackware Linux box. I do connect through WEP security mode for my encryption algorithm. I know it's just a basic authorization for my wireless, instead with wpa_supplicant for WPA, until I found out that my neighbors are abusing my connection, and don't want my stuffs to be exposed.

It was funny actually when my neighbors approach me and ask me if I'm the owner of that connection that they able to detect, and say, "hey, don't put any password on that". Really, it sounds daring and hilarious but rude.

I do connect from my Slackware Linux via shell using the commands:

$> ifconfig wlan0 up

$> iwlist wlan0 scan
$> iwconfig wlan0 essid "myssid" key "8EEDEEFE41"

$> dhcpcd wlan0

The first command will take my wireless LAN card to be up, which actually down during start up. Somewhat like, disable and enable if in Windows environment. The second command will scan for available wireless connections in my area. It's actually fine to not do this, but I do usually check how my wireless status is, and if I have some available connections that I can reach through, that is lurking for some free connections. The third command will be the one to grant me access for my router and lastly, dhcpcd will connect the interface through the Internet.

WEP, which stands for Wired Equivalent Privacty, is already a deprecated algorithm for wireless connections. There are actually lots of issues with its algorithm for being weak and is also susceptible to be hacked easily. I remember, I found some videos in the Internet able to grant the WEP key but there's a lot of tools involve to achieve this. Because of those things, I choose to use WPA.

That's all about with WEP!!!

WPA stands for Wi-Fi Protected Access. My setup is just simple, achieving to connect through my WPA setup in my wireless network. Installing wpa_supplicant is easier through Slackbuilds, though I use the binary package, the .tgz file for my installation.

So I downloaded the package for wpa_supplicant for my Slackware at at list.

Then issue the command:
$> installpkg wpa_supplicant-0.5.9-i486-1.tgz

Afterwards, I move first the original file named /etc/wpa_supplicant.conf to /etc/wpa_supplicant.conf.backup and edit the contents leaving only the required things I need to have for my connection. My ssid is "myssid" and the WPA shared key is "mysecretcode".

I then issue the command:
$> wpa_passphrase myssid mysecretcode

and the output is:
So I edit the file with my favorite editor, vi
$> vi /etc/wpa_supplicant.conf

With contents:







As you can see, I put the generated psk after I ran the command wpa_passphrase.

Afterwards, I run this command:
$> wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf

-B = runs in the background
-D = specifies the driver to use. Mine is generic, which is shifted by Intel, so I use wext.
-i = specifies the interface to listen
-c = specifies the path of the configuration file.

In my opinion, I don't like to configure my stuffs automatically during start up, instead it would be great to create a bash script instead of putting them in somewhere else while I might forgetting them.

Afterwards I do:
$> ifconfig wlan0 up
$> dhcpcd wlan0
$> ping

For some external resources, I recommend this page, so check it out.

Although there are some reports about the algorithm of WPA specially with TKIP, my guide here is to achieve installing wpa_supplicant in Slackware Linux. I will post more about the exploits that WPA encounters soon.

No comments: