Docsity

Internetwork Security and Wireless Security - Special Topics | ECE 4893, Lab Reports of Electrical and Electronics Engineering

Toggle sidebar
bg1
1
Group Number: _________
Member Names: ___________________ _______________________
ECE 4893: Internetwork Security
Lab 10: Wireless 802.11 Security
Date Assigned: March 23, 2004
Date Due: March 30, 2004
Last Revised: March 22, 2004
Goal: The goal of this lab is to use wireless tools such as Kismet and AirSnort to
examine vulnerabilities that exist in wireless networks. We will see how we can sniff
packets to obtain MAC addresses to get around filters and how to crack a WEP key.
Hardware: This lab will use three Pentium 4, 2.4GHz machines. Two will be wireless
users running Windows XP and one will be an attacker running Linux 9.0. The wireless
access point (AP) will be the D-Link tri-mode dualband wireless access point (DWL-
7000AP), which means it can run 802.11a, 802.11b, and 802.11g, though we will only be
using 802.11b for cracking. One Windows XP machine and the Linux machine use
Linksys wireless A+G PCI adapter cards (WMP55AG). The other Windows XP machine
(the client) uses a Linksys PCMCIA wireless network adapter, like those used with
laptops, and Lucent PCI/PCMCIA bridges. You will not need your hard drive or any CD
from the TA’s.
Software:
Ethereal
Kismet - http://www.kismetwireless.net/
Airsnort - http://airsnort.shmoo.com
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 COC311. You do not have to
demo anything to the TAs so you may work whenever you want.
Note on this format: Commands to be typed into a command line are in bold and
preceded by a “#” sign, this is to be left out when typing the command. The setup for the
wireless lab is shown on the next page. The monitor for each machine is labeled
accordingly. WindowsXP1 will be used for the client (FTP and UDP) and WindowsXP2
will act as the server. Log onto the Linux box with username “root” and password
“password”. If your Linux Machine is restarted, be sure to select the hostap kernel from
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Partial preview of the text

Download Internetwork Security and Wireless Security - Special Topics | ECE 4893 and more Lab Reports Electrical and Electronics Engineering in PDF only on Docsity!

Group Number: _________ Member Names: ___________________ _______________________

ECE 4893: Internetwork Security

Lab 10: Wireless 802.11 Security

Date Assigned: March 23, 2004 Date Due: March 30, 2004 Last Revised: March 22, 2004

Goal: The goal of this lab is to use wireless tools such as Kismet and AirSnort to

examine vulnerabilities that exist in wireless networks. We will see how we can sniff packets to obtain MAC addresses to get around filters and how to crack a WEP key.

Hardware: This lab will use three Pentium 4, 2.4GHz machines. Two will be wireless users running Windows XP and one will be an attacker running Linux 9.0. The wireless access point (AP) will be the D-Link tri-mode dualband wireless access point (DWL- 7000AP), which means it can run 802.11a, 802.11b, and 802.11g, though we will only be using 802.11b for cracking. One Windows XP machine and the Linux machine use Linksys wireless A+G PCI adapter cards (WMP55AG). The other Windows XP machine (the client) uses a Linksys PCMCIA wireless network adapter, like those used with laptops, and Lucent PCI/PCMCIA bridges. You will not need your hard drive or any CD from the TA’s.

Software: Ethereal Kismet - http://www.kismetwireless.net/ Airsnort - http://airsnort.shmoo.com

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 COC311. You do not have to demo anything to the TAs so you may work whenever you want.

Note on this format: Commands to be typed into a command line are in bold and preceded by a “#” sign, this is to be left out when typing the command. The setup for the wireless lab is shown on the next page. The monitor for each machine is labeled accordingly. WindowsXP1 will be used for the client (FTP and UDP) and WindowsXP will act as the server. Log onto the Linux box with username “root” and password “password”. If your Linux Machine is restarted, be sure to select the hostap kernel from

the initial menu and login with root and “password”.

Introduction

IEEE standard 802.11 was designed mainly to enhance a user’s accessibility to the Internet by allowing wireless capabilities. Today, with the growth of high-speed Internet access, wireless networks are gaining popularity among both business and home users. For the business IT employee, this translates into reduced time and cost of connecting a new user to the network.

D-Link Wireless AP 192.168.1.

WindowsXP FTP Server 192.168.1.

WindowsXP FTP Client 192.168.1.

Evil RedHat Linux 8. Sniffer 192.168.1.

The first step in securing an 802.11 wireless network is making sure your data is being encrypted. Here, we will explore just how easy it is to compromise data that is being sent unencrypted or "in the clear." WindowsXP1 will be running a simple FTP server, while WindowsXP2 will be used to connect to that server. The Linux 9. machine is where we will sniff out useful data from the air and display it to the user.

It should be noted that the results of this experiment would remain the same whether it is a Telnet server being utilized, an FTP server, or any other service that does not encrypt its data before it is sent over the network. A telnet service runs by establishing a network connection between two hosts, and then simply transferring and then echoing every character the user happens to type on their keyboard. Thus, all our Linux 9.0 sniffer needs to do is listen to the packets and pick out the data portions in order to accomplish our goals at this point. We will do this first by using a packet sniffer we are already familiar with, Ethereal and then by looking at one designed for wireless sniffing called Kismet.

Before you begin, make sure the AP has been reset back to no MAC filtering and also no encrypted (WEP) settings. Do the following:

! Using a web-browser on WindowsXP2, connect to http://192.168.1. ! Username is “admin”. Password is “password”

To turn off the MAC control list filtering on the access point, connect to the AP. ! Click the advanced tab ! Choose enable MAC control filtering and select disable ! Click APPLY ! Wait for one minute as instructed and click OK

To turn off WEP on the Access Point: ! Connect to the AP again ! Click the “Advanced” tab on top then the “Encryption” tab on the left ! Make sure the “Disable” radio button next to WEP is clicked ! Click Apply, after you changes have been saved click continue

Make sure the last lab group turned off WEP on the two Windows XP machines. To do this on each of the two Windows XP machines:

! Start->Control Panel->Network and Internet Connections-> Network Connections ! Right Click on Wireless Connection -> Properties->Wireless Networks tab ! Select wireless_dev from the Preferred networks box and click

properties ! Remove the check by the Data encryption (WEP) box ! Make sure the "The Key is provided for me automatically" is NOT checked ! Click OK ! Disable and enable the network device: Again right click on Wireless Connection -> Enable, then Wireless Connection -> Disable

Make sure that all three computers can communicate with the AP. In our case, this is accomplished by running on each of the three machines:

#ping 192.168.1.

In the event the linux machine cannot ping, on the linux machine

**#ifconfig ath0 down #ifconfig ath0 –promisc

ifconfig ath0 192.168.1.

#ifconfig ath0 up #iwpriv ath0 mode 2 //sets wireless device to listen on B (could use A,G) #iwconfig ath0 essid wireless_dev #iwconfig ath0 mode managed #iwconfig ath0 channel 2**

#iwconfig (you should see essid and mode set correctly) #ifconfig (you should see wlan0 up with correct IP)

now try to ping the Access Point #ping 192.168.1.

This ends the procedure to reset the lab setup so you are starting at the proper configuration. Previous lab groups may have left the machine in another undesired state.

To start your lab, we are going to switch our Linux machine into monitor mode so that it can look at all the traffic flying by in the air and display the statistics it gathers to us.

Exercise #1: Use ethereal to capture ftp passwords. Ethereal is already installed on the linux machine. Use the following instructions to help you accomplish this:

On the linux machine we need to set the wireless card to promiscuous mode and in monitor mode. This is accomplished with

MAC Control List Subversion

One way to restrict the access to a wireless network is to allow only certain MAC address to connect. Almost all access points have such a feature, and it theoretically should provide a decent level of security. However, these MAC addresses can easily be spoofed.

Exercise #2 : Enable MAC address filtering on the access point and show that the attacker can gain access to the network by spoofing his address. Show screen captures and the like to show how you determined a valid MAC and how you gained access, include these with the questions section you turn in. Use the following instructions to help you accomplish this:

To enable MAC control list filtering on the access point, connect to the AP. ! using a web-browser on WindowsXP2, connect to http://192.168.1. ! Click the advanced tab ! Click on the “Filters” tab on the left ! Change “Access Control” drop down box to “accept” for BOTH A & G (left and right columns) ! Place the MAC address of each Windows XP machine in the first two entries of the table. ASIDE: To determine the MAC address, open up a command window in Windows and type: > ipconfig /all *Make sure you get the MAC of the wireless device ! Click “apply”, and after your changes have been saved message, “continue” ! On the two Windows XP machines, disable and enable the wireless connections to reset them. (see previous instructions on how to enable and disable the wireless cards in the Windows XP machines).

The Linux machine should not be able to connect to the wireless network now, to see this try to ping the router (however the Windows XP machines should be able to ping 192.168.1.144). The Linux machine can, however, still sniff the wireless network and see what MAC addresses are allowed on the network.

Let’s use Kismet on our Linux 8.0 machine to see the active MAC addresses on a network.

The Linux card should already be in monitor mode, but these commands will make sure:

#ifconfig ath0 promisc #iwconfig ath0 mode monitor #iwconfig ath0 channel 2

The Linux machine is now set up for our purposes but it should be noted that no normal network operations could be accomplished now that we are in monitor mode. Next run:

#cd /root/Programs/kismet-3.0.1/ #./kismet_server In a new window run: #./kismet_client Finally, as you are monitoring, change the listening channel a few times by doing: #iwconfig ath0 channel 11 (or other numbers between 1-11)

This launches the kismet application itself and begins to display data. (Aside: kismet logs all packets it sees in a file which it stores in /root/Kismet_logs). The interface is entirely keyboard driven and if you get lost, you can display the help screen at any time by pressing H. Type in H and take a look at the commands. Use + to scroll down so you may read all the help info. Use Q to quit the help menu.

Several useful options are given but to begin with, simply hit S then S again in order to sort the wireless networks displayed by their SSID. We want to look at data coming from the network identified as wireless_dev so move down to it using the arrow keys and "tag" it by hitting T.

Now use the C option for the tagged wireless network. Do a ping from the Windows XP machines to generate some traffic from each wireless card and note how the client list in kismet shows you the client MAC address. If you are not able to see the MAC address with traffic generated by ping, use the UDP traffic generator discussed later in this lab to create traffic. (Some have reported that ping does not cause the MAC to show up and more traffic like the UDP traffic generator described later in the lab must be used).

Now that you're finished running kismet, it is important to shut it down properly or the wireless card will not return to normal operation. Do this by exiting out of the kismet application (use Shift Q ) and then running the command in another terminal window:

#ifconfig ath0 –promisc #iwconfig ath0 mode managed #iwconfig ath0 channel 2

This places the wireless card back in its standard mode and it can now resume standard network operations.

Now lets spoof a MAC address (and an IP address as well) that is allowed on your network. We would need to find the IP addresses as well as the MAC addresses but for the purpose of this lab we will just cheat and look on the windows machine to find the IP address of that windows machine. Note we still have MAC address filtering turned on in the access point.

First lets change the IP address of the linux machine from 192.168.1.50 to that of the WindowsXP1 machine 192.168.1.100:

! Change the “Access Control” drop down to “disabled” on BOTH A & G (the left and right columns) ! Click “apply”, wait 1 minute, click “continue”

Encrypted Traffic

Data security in 802.11 is accomplished by what is known as Wireless 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:

First an integrity checksum is calculated on the plaintext message and appended to the end to create the message we want to send.

M = {Plaintext, Checksum}

The second stage involves encrypting the message M using the RC4 algorithm. This is done by choosing an IV and concatenating it with the secret key k. The RC4 algorithm will generate a long sequence of pseudo-random bytes specific to this secret key and IV pair. This sequence is known as a keystream. To encrypt the packet, the plaintext message M is XORed with the keystream producing an encrypted message E.

E = M xor RC4(IV,k)

The encrypted message E is now ready to be transmited. Figure 1 shows a graphical representation of what encryption looks like.

Note: This figure is taken from source [3]

To decrypt a packet, the process is reversed. Once the packet is received, the IV used in

the encryption is retrieved from the unencrypted header. Using the IV, the keystream is regenerated using the secret key k that both sides of the transfer have. The encrypted message is then XORed with the regenerated keystream, which will leave just the plaintext message that was initially encrypted.

M = E xor RC4(IV,k)

The checksum is then analyzed to ensure that the message has not been tampered with. Assuming everything checks out, the original plaintext message is passed along.

While WEP may sound like a great idea, it is inherently flawed on many levels. For the scope of this lab, the major flaws lie in the use of the initialization vector and the RC algorithm itself. In a paper entitled Weaknesses in the Key Scheduling Algorithm of RC by Fluhrer, Mantin, and Shamir, the authors propose a method in which under certain conditions the key setup algorithm of RC4 can leak information about the secret key. To attack RC4, they propose to search for specific IV’s that place keystream in this vulnerable state. In the parlance of this attack, these vectors are called “interesting”. By collecting enough of these “interesting packets” the entire secret key can be reconstructed.

This attack was first implemented in a paper called Using the Fluhrer, Mantin, and Shamir Attack to Break WEP , written by Stubblefield, Ioannidis, and Rubin. Using the techniques described in this paper, the programmers of two programs, WEPcrack and ArirSnort, released their own attacks to the internet soon after. In this lab, we will use AirSnort to break the WEP encryption and retrieve the shared key. Generally, AirSnort requires capturing between 5-10 million packets that on a busy network can be obtained in a few hours. A nice feature of AirSnort is its ability to save the current captured packets to a file and load them at some other time to continue trying to crack the key. This means that an attacker can work over many days to crack the encryption.

Here is what the AirSnort documentation says about what kind of packets it is looking for (source [5]):

Useful packets are those with the following property of their IV; the first byte is a number three greater than one of the offsets of the bytes of the key. For 128 bit encryption, this means a number from 3-16. The second byte must be 255 and the third byte can have any value. This means that for every byte of the key, there are 256 weak IVs. As of version 0.2.0, two additional classes of IVs are recognized by airsnort. See the source code for details.

Turning on WEP First, we must enable WEP in the AP. To do this, do the following:

! Using a web-browser in WindowsXP2, connect to http://192.168.1. ! User name is “admin” Password is “password” ! Click on the “Advanced” tab on top and the “Encryption” tab to

should also set the appropriate channel after doing this.)

To run AirSnort, do the following in Linux:

**# cd /root/Airsnort-0.2.1b/src

./airsnort**

This will launch the AirSnort program. By selecting File->Load Crack File or File- >Load pcap file, you are able to use previously captured traffic to try to crack the WEP key. For this lab, a crack file has been provided for you to speed up the recovery of the WEP key. Load the provided crack file by:

  • Set it to monitor Channel 2 (not Scan)
  • Set the device to ath0 (just type it in)
  • Select “Other” Card Type drop down menu
  • Set breadth to 4
  • File->Load crack file ! Find the file named airsnort-crack-file located in the /root/WepLogs/ directory and double click on it

The crack file has already captured close to 5 million packets and is almost ready to recover the key. With the file loaded,

  • Click “okay” to any warning
  • Click the start button

Now on the two Windows XP machines, we will need to generate some encrypted traffic for airsnort to analyze in addition to this previously captured traffic on the lab network. A traffic generator client and server have been provided on both Windows XP machines for this purpose. (This code sends the user data aaaaaaaaaaaaa, it is nice to know what the data is so that if you are running the UDP traffic generator when you collect some data with airsnort you will know where all the aaaa’s come from). This additional traffic along with the file that was provided for you will give airsnort enough traffic to crack the WEP in somewhere between minutes and hours depending upon the luck of the draw. (For example with just under 5 million packets sent and 2302 interesting packets among these, the key was cracked in just less than one hour). The more traffic you provide, the faster it cracks WEP. On WindowsXP1, run the udp traffic generator. On WindowsXP run the udp sink.

WindowsXP ! open a command prompt ! # cd c:\wireless_lab ! # udp_gen 192.168.1.150 5555 WindowsXP ! open a command prompt ! # cd c:\wireless_lab

! # udp_sink 5555

If you would like to speed up the process, you can start up a separate server/client pair using a different port. Also, you can send UDP traffic directly to the AP by pointing the generators at the IP 192.168.1.144. Furthermore, you can run continuing pings between the machines (ping –t destIP) The more the merrier. If you look at the activity light on the access point it should always be on now.

If you have not cracked the key after 100,000 packets or so, increase the breadth parameter every minute or two until it cracks. The breadth parameter controls how many guesses should be tried with a higher breadth parameter trying less likely guesses. Doing this several times over should eventually crack WEP. If you still have trouble, try reloading the crack file with a higher breadth.

When the key has been cracked, it will appear in the airsnort window under the "PW: Hex" and "PW: Ascii" tabs. (Recall in our case the key will be 08905EF49F). When you are finished, close Airsnort (no need to save this huge file) and then:

#ipconfig ath0 –promisc #iwconfig ath0 mode managed #iwconfig ath0 channel 2

Turn of the UDP traffic source and sink by using control C on the windows boxes in the windows with the programs running.

After cracking the key with Airsnort, answer the questions in the section provided.

Exercise 4: Decrypt the actual traffic on the wireless network and show how any evil hacker type can read the data. Note we are assuming we got the WEP key in exercise 3 and are using that answer here in exercise 4. Repeat exercise 1 with WEP turned on (as it is now assuming you are following the lab). After your FTP session file you created with kismet has been decrypted, open Ethereal and load the decrypted output file. The unencrypted packets are now available to be analyzed. Notice you can see the same stuff you saw before we turned on WEP. Use the instructions below.

In general, once the key is obtained, all previous traffic saved in logs can be decrypted and read. One method to prevent this is to change the key often, perhaps every 15 minutes or less. This is difficult since we have not seen an access point that would support this type of key switching.

AirSnort comes with a program to decrypt the traffic that you may have collected using kismet or AirSnort. To do this in Linux (wait not yet this is background):

! # cd /root/Airsnort-0.2.1b/src ! **# ./decrypt -p -m ! Click on the “Filters” tab on the left ! Change “Access Control” drop down box to “disable” ! Click “apply”, wait one minute and click “continue”

To turn off WEP on the Access Point: ! Connect to the AP again ! Click the “Advanced” tab on top then the “Encryption” tab on the left ! Make sure the “Disable” radio button next to WEP is clicked ! Click Apply, after you changes have been saved click continue

Make sure you turn off WEP on the two Windows XP machines. To do this on each of the two XP machines:

! Start->Control Panel->Network and Internet Connections-> Network Connections ! Right Click on Wireless Connection -> Properties->Wireless Networks tab ! Select wireless_dev from the Preferred networks box and click properties ! Remove the check by the Data encryption (WEP) box ! Make sure the "The Key is provided for me automatically" is NOT checked ! Click OK ! Disable and enable the network device: Again right click on Wireless Connection -> Enable, then Wireless Connection -> Disable

Make sure that all three computers can communicate with the AP. In our case, this is accomplished by running on each of the three machines:

#ping 192.168.1.

In the event the linux machine cannot ping, on the linux machine

#ifconfig ath0 –promisc #iwconfig ath0 mode managed #ifconfig ath0 192.168.1. #iwconfig ath0 essid wireless_dev #iwconfig ath0 channel 2

#iwconfig (you should see essid and mode set correctly #ifconfig (you should see wlan0 up with correct IP)

Sources:

[1] http://www.tipsybottle.com/technology/wireless/RedHat8-Kismet-HOWTO.shtml

[2] http://www.isaac.cs.berkeley.edu/isaac/wep-draft.pdf

[3] http://www.drizzle.com/~aboba/IEEE/rc4_ksaproc.pdf

[4] http://osiris.978.org/~brianr/crypto-research/wep/wep_attack.pdf

[5] http://airsnort.shmoo.com

[6] http://www.kismetwireless.net/

some possible ways to correct it.

Exercise #4:

No questions for this part, just include screen shots of encrypted and unencrypted packets.

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 corrections/suggestions. Note that part of your lab grade is what improvements you make to this lab.