Docsity

Wireless Network Security Lab: Detection and Penetration using Kismet and Aircrack, Lab Reports of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE4112 Internetwork Security
Lab X: Wireless Security
Group Number: _________
Member Names: ___________________ _______________________
Date Assigned:
Date Due:
Last Edited: April 29, 2007
Lab Authored By: Oscar Salazar & Anne Hewitt
Please read the entire lab and any extra materials carefully before starting. Be sure to start
early enough so that you will have time to complete the lab. Answer ALL questions in
the Answer Sheet and be sure you turn in ALL materials listed in the Turn-in Checklist
on or before the Date Due.
NOTE: Part of the lab requires you to reserve slots to use the equipment. The signup sheets will
be posted on the lab door. The equipment you need to sign up for will not be available at the last
minute. PLAN AHEAD.
Wireless Security
Goal: The goal of this lab is to use wireless tools on the Backtrack Live-CD such as
Kismet and Aircrack to detect and penetrate wireless networks. We will sniff packets to
obtain MAC addresses to get around filters and crack a WEP key and snoop on the traffic
in the network.
Summary: The four sections of this lab will show you how to spoof a MAC
address, crack WEP, perform a Man in the Middle attack, and snoop on wireless traffic.
Background and Theory:
Introduction
IEEE RFC 802.11 denotes a set of Wireless LAN standards developed by
working group 11 of the IEEE LAN/MAN Standards Committee (IEEE 802). This set of
standards is commonly called “Wi-Fi.”
The 802.11 family currently includes six over-the-air modulation techniques that
all use the same protocol, the most popular (and prolific) techniques are those defined by
the a, b, and g amendments to the original standard; security was originally included, and
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Wireless Network Security Lab: Detection and Penetration using Kismet and Aircrack and more Lab Reports Electrical and Electronics Engineering in PDF only on Docsity!

ECE4112 Internetwork Security

Lab X: Wireless Security

Group Number: _________ Member Names: ___________________ _______________________ Date Assigned: Date Due: Last Edited: April 29, 2007 Lab Authored By: Oscar Salazar & Anne Hewitt Please read the entire lab and any extra materials carefully before starting. Be sure to start early enough so that you will have time to complete the lab. Answer ALL questions in the Answer Sheet and be sure you turn in ALL materials listed in the Turn-in Checklist on or before the Date Due. NOTE: Part of the lab requires you to reserve slots to use the equipment. The signup sheets will be posted on the lab door. The equipment you need to sign up for will not be available at the last minute. PLAN AHEAD.

Wireless Security

Goal: The goal of this lab is to use wireless tools on the Backtrack Live-CD such as

Kismet and Aircrack to detect and penetrate wireless networks. We will sniff packets to obtain MAC addresses to get around filters and crack a WEP key and snoop on the traffic in the network.

Summary: The four sections of this lab will show you how to spoof a MAC

address, crack WEP, perform a Man in the Middle attack, and snoop on wireless traffic.

Background and Theory:

Introduction IEEE RFC 802.11 denotes a set of Wireless LAN standards developed by working group 11 of the IEEE LAN/MAN Standards Committee (IEEE 802). This set of standards is commonly called “Wi-Fi.” The 802.11 family currently includes six over-the-air modulation techniques that all use the same protocol, the most popular (and prolific) techniques are those defined by the a, b, and g amendments to the original standard; security was originally included, and

was later enhanced via the 802.11i amendment. Other standards in the family (c–f, h–j, n) are service enhancement and extensions, or corrections to previous specifications. 802.11b was the first widely accepted wireless networking standard, followed (somewhat counter intuitively) by 802.11a and 802.11g. 802.11b and 802.11g standards use the unlicensed 2.4 GigaHertz (GHz) band. Operating in an unregulated frequency band, 802.11b and 802.11g equipment can incur interference from microwave ovens, cordless phones, and other appliances using the same 2.4 GHz band. The equipment in the lab is capable of using either the 802.11a or 802.11b protocol. We will be using 802.11b. Wireless Network Security SSID Hiding The broadcast properties of wireless technology makes it vulnerable to a series of attacks. Snooping on a wireless network consists of using a laptop, a wireless card, and some software while being in transmission range of a wireless network. The service set identifier, or SSID, is the name of the wireless network and it can be used to gain access. Turning off SSID broadcasting means that no one can see it by using an auto find of networks. However, if you leave the default SSID unchanged, a hacker could try the common SSIDs and connect to your network if there is no other security on the network. MAC Address Filtering MAC address filtering can be used to increase the security of your network. It works by allowing only a set list of network cards to connect based upon their known MAC address, which should be unique for every device. However, MAC address can be captured by snooping and then spoofed which will then allow an attacker to gain access. Most wireless cards now allow MAC addresses to be changed, so this is does not adequately work as a security feature either. WEP Encryption If a user activates WEP, the wireless encrypts the payload (frame body and CRC) of each 802.11 frame before transmission using an RC4 stream cipher provided by RSA Security. The receiving station, such as an access point or another radio NIC, performs decryption upon arrival of the frame. As a result, 802.11 WEP only encrypts data between 802.11 stations. Once the frame enters the wired side of the network, such as between access points, WEP no longer applies. As part of the encryption process, WEP prepares a keyschedule ("seed") by concatenating the shared secret key supplied by the user of the sending station with a random-generated 24-bit initialization vector (IV). The IV lengthens the life of the secret key because the station can change the IV for each frame transmission. WEP inputs the resulting "seed" into a pseudo-random number generator that produces a keystream equal to the length of the frame's payload plus a 32-bit integrity check value (ICV).

The static nature of the shared secret keys emphasizes this problem. 802. doesn't provide any functions that support the exchange of keys among stations. As a result, system administrators and users generally use the same keys for weeks, months, and even years. This gives mischievous culprits plenty of time to monitor and hack into WEP-enabled networks. Due to this, WEP is very easily cracked. In 2005, a group from the U.S. Federal Bureau of Investigation gave a demonstration where they broke a WEP-protected network in 3 minutes using publicly available tools. We will perform some of these attacks. One of the most basic attacks a hacker can perform once finding a wireless network is to identify the access point, AP, and check to see if the default settings are in use. A large number of home users, and some businesses, do not change their settings on their AP. Once the brand of the device is known, its default settings are easy to lookup on the Internet, as companies publish them so people can use their devices. [6] Lab Scenario: Two machines will be setup by the TAs to simulate a wireless network. One of those machines will be a wired connection to a Wireless Access Point, which is a Linksys WMP55AG. There will be a client connected to through wireless and constantly sending data on the network. You will be using two of our lab machines to get access to the wireless network & see what the machines are doing. Both machines will be running a BackTrack2 live machines. The machines, called Attacker 1 & Attacker 2, will do different things, so make sure you look at which machine we say to use. Software: WireShark - http://www.wireshark.com/ BackTrack2 - http://www.remote-exploit.org/backtrack.html Aircrack - http://www.cr0.net:8040/code/network/aircrack/ Aircrack-ptw http://www.cdc.informatik.tu-darmstadt.de/aircrack-ptw/ Kismet - http://www.kismetwireless.net/ Signup: There is only one setup for this lab so you will need to sign up in advance. Your group may sign up for a maximum of 2 hours in the future. Do not abuse this rule! Once you have used your “two hours” you may sign up again for another hour. You are never allowed to have more than 2 hours scheduled in the future. If you do not show up within the first 15 minutes, you forfeit your reservation and someone else may claim your reservation. The reservation sheet is located on the door of Klaus 2446. You do not have to demo anything to the TAs so you may work whenever you want.

The setup for the wireless lab is shown in below. The monitor for each machine is labeled accordingly. Section 1: Reconnaissance on the network One reason for poor security in wireless networks has nothing to do with the technology; it is due to the operators. Most consumer wireless devices are extremely easy to setup. Many users hook up the equipment and when it works, they do not modify its settings. This leaves huge security holes. We will be exploring a network that does have some security features implemented on it. It will be your job to break into the network and snoop on what is going on inside. Step 0 – Attacker 1 & 2

  1. Login to Backtrack > bt login: root > password: toor
  2. Start xWindows > startx Step 1 – Attacker 1 & 2

Attacker 1 Only Now we will try to inject some packets to get a better chance of finding the key. When we say use the BSSID shown in the AirDump Window. When we say , use the Station MAC shown in AirDump Window

  1. Now Start AirReplay: Start -> BackTrack -> Radion Network Anaylsis -> 80211 -> Cracking -> Aircrack -> AirReplay
  2. Run the command: aireplay-ng --deauth 10 -e -a -c rausb Leave this - DO NOT PRESS ENTER!
  3. Open Another AirReplay: Start -> BackTrack -> Radion Network Anaylsis -> 80211 -> Cracking -> Aircrack -> AirReplay
  4. aireplay-ng --arpreplay -b -h rausb DO NOT PRESS ENTER
  5. Have the deauth & arpreplay windows next to each other.
  6. Send replay first, the deauth immediately afterward. You will have to try both of these several times due to the ARP cache’s TTL being long.
  7. You will know that this is has worked when the window with arpreplay window says “(got X arp packet)” and X is greater than 0. As soon as it gets 1 ARP packet, they will start increasing rapidly. The “#/s” should be over 100 as well. Step 5 Attacker 2 In this step we will install Aircrack-ptw, a better version of Aircrack that takes less packets to crack than the version currently on Backtrack2.
  8. Get the floppy containing aircrack-ptw from the TA if it is not already with the Attacker 2 machine.
  9. Put it in the Attacker 2 machine and copy the folder to the root directory.
  10. Inside the folder, copy aircrack-ptw into usr/local/bin so that you can run it from the terminal.
  11. Open a terminal and run: > aircrack-ptw capture.cap (or whatever you capture file is called now)
  12. Restart if it fails to update it with the packets you captured in the mean time. However, it should find the WEP quickly. Question 3: How many packets did it take your group to crack the WEP key? Question 4: What was the WEP? Section 3: MAC Address Filtering

Step 6 - Attacker 1 Now that we have the WEP key we are going to snoop the traffic in the network.

  1. Open Terminal _> ifconfig rausb0 down

ifconfig rausb0 up iwconfig rausb0 essid enc <WEP w/o colons> mode managed dhcp rausb_

  1. We should be connected now. Ping the router using its address, 192.168.1.
  2. Didn’t work? You must have had your MAC address blocked for previous suspicious activity on the network. You must change your IP address to get access.
  3. Backtrack2 provides functionality to do this. Open a terminal and type: a. > ifconfig rausb0 down b. Open the MacChanger: Start -> Backtrack -> Misc -> MacChanger c. Since just Attacker 1 & Attacker 2 MACs are blocked, you can choose one at random to use. To do this type: > macchanger –a rausb If only certain MACs are allowed on a network, you could get around it by spoofing a MAC address of someone who leaves the network or that you don’t want to sniff traffic of.
  4. Now go back to the beginning of this step and try getting on the network again. Ping 192.168.1.1 to make sure it works. Section 4: Man in the Middle Attack Step 7 – Attacker 1
  5. Open Wire Shark by typing ‘wireshark &’ in the console start capturing on rausb
  6. Start Ettercap, our Man in the Middle software that you will remember from earlier labs by: Start -> Backtrack -> Privilege Escalation -> Sniffers -> Ettercap
  7. Set up Ettercap: a. In menu bar: Sniff -> Unified Sniff. Select ‘rausb0’ & click okay b. Press CTRL + S. You should see "2 hosts added to the hosts list" in the bottom box. It may take a second for Ettercap to find both hosts. Let it scan until it finds 2. c. In the menu bar: Mitm -> ARP Poisons. Choose Sniff Remote connections. It should display "GROUP 1" & "GROUP 2" in the box on the bottom. d. In the menu bar: Start -> Start Sniffing

Sources:

[1] http://en.wikipedia.org/wiki/IEEE_802. [2] http://en.wikipedia.org/wiki/WEP [3] http://en.wikipedia.org/wiki/RC [4] http://www.securityfocus.com/infocus/ [5] http://www.cr0.net:8040/code/network/aircrack/ [6] http://www.wi-fiplanet.com/tutorials/article.php/

Appendix A – Why WEP is Insecure Data security in 802.11 is usually accomplished by Wired Equivalent Privacy (WEP). The RC4 stream-cipher algorithm is used to encrypt the data. WEP relies on a secret key, normally 40 bits, and an initialization vector (IV), which is 24 bits, as a seed for the algorithm. The encryption of a frame proceeds as follows: RC4 generates a pseudorandom stream of bits (a "keystream") which, for encryption, is combined with the plaintext using XOR as with any Vernam cipher; decryption is performed the same way. To generate the keystream, the cipher makes use of a secret internal state which consists of two parts:

  1. A permutation of all 256 possible bytes (denoted "S" below).
  2. Two 8-bit index-pointers (denoted "i" and "j"). The permutation is initialised with a variable length key, typically between 40 and 256 bits, using the key-scheduling algorithm (KSA). Once this has been completed, the stream of bits is generated using the pseudo-random generation algorithm (PRGA). For as many iterations as are needed, the PRGA modifies the state and outputs a byte of the keystream. In each iteration, the PRGA increments i , adds the value of S pointed to by i to j , exchanges the values of S[ i ] and S[ j ], and then outputs the value of S at the location S[i] + S[j] (modulo 256). Each value of S is swapped at least once every 256 iterations. i := 0 j := 0 while GeneratingOutput: i := (i + 1) mod 256 j := (j + S[i]) mod 256 swap(S[i],S[j]) output S[(S[i] + S[j]) mod 256] The key-scheduling algorithm is used to initialise the permutation in the array "S". "l" is defined as the number of bytes in the key and can be in the range 1 ≤ l ≤ 256, typically between 5 and 16, corresponding to a key length of 40–128 bits. First, the array "S" is initialised to the identity permutation. S is then processed for 256 iterations in a similar way to the main PRGA algorithm, but also mixes in bytes of the key at the same time. for i from 0 to 255 S[i] := i j := 0 for i from 0 to 255 j := (j + S[i] + key[i mod l]) mod 256 swap(S[i],S[j])

ECE 4112 Internetwork Security

Lab X: Wireless Security

Group Number: _________ Member Names: ___________________ _______________________ Wireless Security Question 1: What is the MAC address of the AP? Question 2: What is the MAC address of the client? Question 3: How many packets did it take your group to crack the WEP key? Question 4: What was the WEP? Question 5: What messages do you see being sent? What kind of activity are you sniffing? Questions 6: Take a screenshot (Start->Screenshot) of the TCP stream with the sniffed traffic. Attach it to your answers. Question 7: What makes WPA2 better than WEP?

General Questions

How long did it take you to complete this lab? Was it an appropriate length lab? What corrections and/or improvements do you suggest for this lab? Please be very specific and if you add new material give the exact wording and instructions you would give to future students in the new lab handout. You may cross out and edit the text of the lab on previous pages to make minor corrections/suggestions. General suggestions like add tool xyz to do more capable scanning will not be awarded extras points even if the statement is totally true. Specific text that could be cut and pasted into this lab, completed exercises, and completed solutions may be awarded additional credit. Thus if tool xyz adds a capability or additional or better learning experience for future students here is what you need to do. You should add that tool to the lab by writing new detailed lab instructions on where to get the tool, how to install it, how to run it, what exactly to do with it in our lab, example outputs, etc. You must prove with what you turn in that you actually did the lab improvement yourself. Screen shots and output hardcopy are a good way to demonstrate that you actually completed your suggested enhancements. The lab addition section must start with the form “laboratory Additions Cover Sheet” which may be found on the class web site.