Friday, July 2, 2010

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


You already know that if you want to lock down your Wi-Fi network, you should opt for WPA encryption because WEP is easy to crack. But did you know how easy? Take a look.
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

Unless you're a computer security and networking ninja, chances are you don't have all the tools on hand to get this job done. Here's 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. After consulting with my friendly neighborhood security expert, I purchased an Alfa AWUS050NH USB adapter, pictured here, and it set me back about $50 on Amazon.Update: Don't do what I did. Get the Alfa AWUS036H, not the US050NH, instead. The guy in this video below is using a $12 model he bought on Ebay (and is even selling his router of choice). There are plenty of resources on getting aircrack-compatible adapters out there.
  • A BackTrack 3 Live CD. We already took you on a full screenshot tour of how to install and use BackTrack 3, 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 pre-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 an ten-step 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. Like the doctor said to the short person, be a little patient.

Crack That 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 ra0. 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).
Now, run the following four commands. See the output that I got for them in the screenshot below.

airmon-ng stop (interface)
ifconfig (interface) down
macchanger --mac 00:11:22:33:44:55 (interface)
airmon-ng start (interface)
If you don't get the same results from these commands as pictured here, 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 (interface)
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. (I had to do this once or twice to find the network I was looking for.) 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)
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 "yoyo," 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)
Here the ESSID is the access point's SSID name, which in my case is yoyo. 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)
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. (Also, I was unable to surf the web with the yoyo network on a separate computer while this was going on.) 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. (Pictured below it's only at 854.)
Depending on the power of your network (mine is inexplicably low at -32 in that screenshot, even though the yoyo AP was in the same room as my adapter), 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.
Once you've collected enough data, it's the moment of truth. Launch a third Konsole window and run the following to crack that data you've collected:
aircrack-ng -b (bssid) (file name-01.cap)
Here the filename should be whatever you entered above for (file name). You can browse to your Home directory to see it; it's the one with .cap as the extension.
If you didn't get enough data, aircrack will fail and tell you to try again with more. If it succeeds, it will look like this:
The WEP key appears next to "KEY FOUND." Drop the colons and enter it to log onto the network.

Problems Along the Way

With this article I set out to prove that cracking WEP is a relatively "easy" process for someone determined and willing to get the hardware and software going. I still think that's true, but unlike the guy in the video below, I had several difficulties along the way. In fact, you'll notice that the last screenshot up there doesn't look like the others—it's because it's not mine. Even though the AP which I was cracking was my own and in the same room as my Alfa, the power reading on the signal was always around -30, and so the data collection was very slow, and BackTrack would consistently crash before it was complete. After about half a dozen attempts (and trying BackTrack on both my Mac and PC, as a live CD and a virtual machine), I still haven't captured enough data for aircrack to decrypt the key.
So while this process is easy in theory, your mileage may vary depending on your hardware, proximity to the AP point, and the way the planets are aligned. Oh yeah, and if you're on deadline—Murphy's Law almost guarantees it won't work if you're on deadline.

To see the video version of these exact instructions, check out this dude's YouTube video.
How To Boot From A USB Flash Drive
For starters this is still a new science and many people have had good luck with at least one of these methods and others have not. Note that flash drives are often also called thumb drives, keychain drives, pendrives, etc. The NEWEST methods are listed last on this page, starting with Method 6 for Vista/Win7
A FEW THINGS YOU NEED TO CONSIDER IN ADVANCE.
1. The PC has to support booting from a USB flash/pen/key drive. There may be anywhere from 1-3 items to change in the BIOS to make this possible assuming your BIOS supports it. Some bios's may refer to your flash drive as a USB floppy or USB zip. Of course there are exceptions, perhaps some are covered here.
2. The USB flash drive must support booting from it in general.
3. The flash drive must contain the boot/system files.
4. The flash drive must have bootsector area. This is done with special utilities.
5. References to "A:" drive lines in the autoexec.bat and/or config.sys files you copy to the drive after you make it bootable may result in errors.
6. You "may" have to format your floppy disk first in WinXP before you create a bootdisk as XP may "not" like working later on with a disk formatted otherwise.
7. Included below is a bootable ISO of DOS 7.1 which may be used with some of these methods if you do not have a 1.44 drive.



METHODS
Method 1 - Make your flash drive bootable using Bart's mkbt util:http://www.nu2.nu/mkbt/ | Alt: mkbt20.zip
Put a bootable floppy disk in your A: drive or create one using Windows.
Download mkbt20.zip and unpack to to new temp folder you create.
Go to the temp folder.
Extract the bootsector from the bootable floppy disk. eg Open a DOS Window and go to the directory where you extracted MKBT. Type:

mkbt -c a: bootsect.bin
The boot sectors from the bootable floppy disk have just been saved to a file in the temp folder you created.
Format the flash drive in FAT or FAT16.
Copy the bootsector to the flash drive. Open a DOS Window and go to the folder where you extracted MKBT. Type:
mkbt -x bootsect.bin Z:
"Z" represents the flash drive drive Letter. So if your flash drive has another drive letter, then change the "Z" accordingly.
Now you can [grin] "should" be able to copy the utils you need to the pen drive.


Method 2 - Try these 2 USB Flash Drive Utilities by HP/Compaq. They work with Most other brands of flash drives as well.
hpflash2.zip HP USB Disk Storage Format Tool. Formerly called hpflash1.zip
HP Drive Key Boot Utility Version 7.41Download
"I would put a little extra in there." Says a fan who emailed me with no name:)
For the downloads section I use nLite to make and create the image file as you can import the service packs and do some tweaking to the install files.
http://www.nliteos.com/download.html
1. Install the HP USB Disk Storage Format Tool and run the program.
2. Select the Device and the File system from the drop down menus and click start.
3. Close the above program and install and run the HP Drive Key Boot Utility. Selecting the appropriate drive letter. Click Next.
4.Select the circle on the top that says create New or Replace Existing Configuration. Click Next.
5. Select the circle labeled Hard Drive. Click Next.
6. Select Create New Filesystem. Click Next.
7. Select the circle labeled HP Firmware Flash Package. Click Next.
Click Finish



Method 3 - Third Party Links
Boot off USB by floppy, CD, or NT boot menu when your computer doesn't support it
"I use it to boot off of USB by floppy when the computer doesn't support it - although in this mode it cannot save changes made to the setup." said Josh.



Method 4 - A Bootdisk.Com Visitor Suggested
Here is my another method for creating dos bootable USB sticks using windows format.
1. From Win98 DOS-Prompt type "SYS {USBDriveLetter}:" or "FORMAT {USBDriveLetter} /U /S". If from WinXp then from start->run command.com execute format.exe copied from win95 or win98.
OR
2. Simply by enabling copy system files in windows explorer format window. By default it is disabled for non-floppy drives. To enable it use windows enabler program from http://www.angelfire.com/falcon/speedload/Enabler.htm an whoila it works.


Method 5 - Another Bootdisk.Com Fan Suggested - Thanks Keith
First if you don't have a physical floppy drive (and don't want one) you can use the [free] "virtual floppy driver" from here:
http://chitchat.at.infoseek.co.jp/vmware/vfd.html
With that you get an A: drive and can manipulate a floppy image as if you were using real floppy. You can then use that image to make a bootable CD. It's not that user friendly but once you get how it works it does work perfectly.
Even cooler you can use a "raw write" utility like dd for windows to write the floppy image directly to your USB thumb drive. Even without that famous HP utility to do the magic this will make your USB thumb drive bootable. The 'dd' ported to Windows is located here:
http://www.chrysocome.net/dd
Another trick you can use with that dd utility involves MS VritualPC (which is free). You can create a virtual machine/virtual hard drive, set it up the way you want then use dd to "raw write" the virtual hard drive image to the thumb drive; this will make the thumb drive identical to the image, including bootable (again, no HP utilities required).
Of course, your thumb drive will effectively have the capacity the size if the image in question (your 1GB flash drive will effectively be 1.44 Megs).


Method 6 - Don Wrote below, or see this link from Justin:http://kmwoley.com/blog/?p=345
bootable USB guide, here we assume that you are using either Vista or Windows 7 to create a bootable USB.
1. Insert your USB (4GB+ preferable) stick to the system and backup all the data from the USB as we are going to format the USB to make it as bootable.
2. Open elevated Command Prompt. To do this, type in CMD in Start menu search field and hit Ctrl + Shift + Enter. Alternatively, navigate to Start > All programs >Accessories > right click on Command Prompt and select run as administrator.
3. When the Command Prompt opens, enter the following command:
DISKPART and hit enter.
LIST DISK and hit enter.
Once you enter the LIST DISK command, it will show the disk number of your USB drive. In the below image my USB drive disk no is Disk 1.
4. In this step you need to enter all the below commands one by one and hit enter. As these commands are self explanatory, you can easily guess what these commands do.
SELECT DISK 1 (Replace DISK 1 with your disk number)
CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=NTFS
(Format process may take few seconds)
ASSIGN

EXIT
Don’t close the command prompt as we need to execute one more command at the next step. Just minimize it.
5. Insert your Windows DVD in the optical drive and note down the drive letter of the optical drive and USB media. Here I use “D” as my optical (DVD) drive letter and “H” as my USB drive letter.
6. Go back to command prompt and execute the following commands:
D:CD BOOT and hit enter. Where “D” is your DVD drive letter.
CD BOOT and hit enter to see the below message.
BOOTSECT.EXE/NT60 H:

(Where “H” is your USB drive letter)
7. Copy Windows DVD contents to USB.
You are done with your bootable USB. You can now use this bootable USB as bootable DVD on any computer that comes with USB boot feature (most of the current motherboards support this feature).
Note that this bootable USB guide will not work if you are trying to make a bootable USB on XP computer.


Method 7 - Suggested by marc: Boot-USB-Stick
While trying to flash my bios I looked at your page. Most methods are complicated, after a while of browsing the net I found above:


Method 8 - Suggested by Kevin Ying: UNetbootin


BareBones Boot Floppy And ISO
DOS 7.10 | Readme





Fixing a noisy PC fan

This guide will help you make an old, noisy PC fan silent again. Almost everyone had fan noise problems at least once in his life. When this happens, you have two options. The first one is to go buy a new one and the second one is to fix the old one, at least for a while. It is a very simple procedure, suitable for anyone.
In this guide we will be servicing an 80mm ball-bearing fan, but other types can be fixed in a similar way (ball bearing are the most complex, so you can use this guide and skip the steps, you do not need).
What we need:
  • a small flat screwdriver
  • cleaning alcohol
  • mechanical oil for lubrication (low viscosity preferred)
  • cotton sticks
a fan

1.2.3.
1. Peel off the sticker on the back side of your fan and take out the rubber plug underneath. Be careful, because oil will spill out if you turn it over.2. Gently take out the little plastic o-ring with a screwdriver. Do not loose it, because it secures the fan in place.3. There is also a small washer on your propeller's axis, so be careful not to loose it as you pull the propeller out.

4
5
4. Put some cleaning alcohol on a cotton stick and clean these two parts with it. Dust is very likely to accumulate on the inner side of the propeller, so give it special attention. After cleaning, pour a few drops of oil on the axis and push it in and out a few times.