Download Lab 2

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Airborne Networking wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Network tap wikipedia , lookup

Wi-Fi wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Policies promoting wireless broadband in the United States wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

Wireless security wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Transcript
EECS 4215
Winter 2016
LABORATORY 2
Due date: February 26, 11:30AM
Understanding WEP and WPA2 Security Algorithms
The purpose of this assignment is to become more familiar with WEP, WPA and
WPA2 security standards, and to provide you the basic knowledge on cracking WEP,
WPA and WPA2 encryption keys.
In this assignment you will perform the following tasks:
1. Crack WPA2 encryption keys using a set of network tools and show your
result.
2. Optionally crack WEP encryption keys using the same a set of network tools
and show your result.
3. Answer questions about wireless network security
Background
WEP (Wired Equivalent Privacy) is a security algorithm for IEEE 802.11 introduced
in 1997. WEP has been replaced by WPA/WPA2, yet about 19% of households still
use WEP. More information about WEP is available at
https://en.wikipedia.org/wiki/Wired_Equivalent_Privacy
WPA and WPA2 (IEEE 802.11i-2004) were introduced in 2003. WPA2 (with AES) is
currently the most secure method and the recommended solution for securing
wireless networks. More details on WPA is available at
https://en.wikipedia.org/wiki/Wi-Fi_Protected_Access and
https://en.wikipedia.org/wiki/IEEE_802.11i-2004
There are two forms of WPA: WPA Personal (also known as WPA-PSK) and WPA
Enterprise. PSK (or Pre-shared Key) is a shared secret that is shared between two
parties through a secure algorithm before it is used. This is also known as the fourway handshake. WPA also supports Wi-Fi protected Setup (WPS), which is
intended for simplifying key distribution.
WEP is obsolete and easy to break. WPA2, on the other hand, is more difficult to
crack with currently available tools.
Last updated: Feb. 3, 2016
1
EECS 4215
Winter 2016
To crack WEP or WPA2 security we are going to use a toolkit called AirCrack-ng.
This toolkit is freely available. More details about the tools required for this
assignment is available in section Required Tools of the lab hand-out.
Even though cracking a WEP or WPA2 network requires slightly different steps,
both exercises can be performed using AirCrack-ng.
Note: This assignment is for educational purposes only. Do not experiment with
networks and devices that do not belong to you without prior permission.
Required Tools
The following tools are required to complete the assignment. These tools are
available for Unix based operating systems as well as Windows.
1- AirCrack-ng : This is the essential toolkit required to monitor the
network and crack the keys. Airmon-ng, aircrack-ng, airplay-ng and
airodump-ng are all part of AirCrack-ng.
a. Homepage: http://www.aircrack-ng.org/
b. Tutorials: http://www.aircrackng.org/doku.php?id=Main&DokuWiki=g1p63br8iqa3mqaga9g
38ttu60
2- Macchanger: This is a Linux tool that allows the modification of MAC
addresses. Alternatively you can use ifconfig (on Debian based linux)
or ip (on Red-had based Linux such as Fedora and CentOS)
a. Direct download:
http://gnu.mirror.vexxhost.com/macchanger/macchanger1.6.0.tar.gz
b. Google Mac changer [your OS here] to find a program that
changes the MAC address for your OS. Some operating systems
(such as Kali) provide MAC changing feature out of the box.
3- Dictionary File/Word List: This assignment (particularly cracking
WPA/WPA2) relies on brute force search to crack the keys. You need
to download a word list file to use with Aircrack-ng. There are
numerous web sources to find word list files. Following are a few of
them:
a. http://hashes.org/public.php
b. http://www.darknet.org.uk/2008/02/password-crackingwordlists-and-tools-for-brute-forcing/
c. Kali Linux distribution comes with a few dictionary files
covering different cracking targets including Wi-fi passwords
Ensure that your dictionary file/word list contain the temporary
password that you have use for your wireless router.
Last updated: Feb. 3, 2016
2
EECS 4215
Winter 2016
d. Wireshark: You can use this tool to monitor network protocols and
connections.
https://www.wireshark.org/
Preparation and Requirements
-
To begin you will need a network router that supports WPA2-PSK. This
means the security algorithm is WPA2 and the authentication is based on
pre-shared keys. Note that recent routers support AES and/or PSK
encryption algorithms. This assignment focuses on cracking the PSK
encryption algorithm.
-
You will have to use your own router or the router provided during the lab.
Update the router’s password to a temporary password. The goal is to learn
the process and concepts, and not spend hours cracking a key. In addition,
you do not want to expose your secret wireless key in the lab submission.
-
Ensure your router’s signal is strong and easily detectable by your computer.
-
Ensure your computer has the necessary tools listed above.
-
The trickiest part is to ensure your wireless card (either external or internal)
can be switched into the Monitor mode. Normally wireless cards listen to the
packets addressed specifically to them. When a card is switched to Monitor
mode, it can listen to all packets intended for any address, and it can
optionally inject packets. See https://en.wikipedia.org/wiki/Packet_injection
for more information about packet injection. Certain models of wireless
cards cannot be turned into the Monitor mode.
Overview of the Laboratory
1. Change the MAC address of your wireless interface to a new address. This is
commonly done to hide the real identity of your computer or bypass MAC
filtering.
2. From the Aircrack-ng toolset use airmon-ng to view detected wireless cards
and to switch the interface into Monitor mode.
3. Use airodump-ng to view available wireless stations and their details and to
collect the authentication handshake. The handshake contains the preshared key.
4. To speed up key retrieval, use airplay-ng to de-authenticate all wireless
clients. This causes automatic re-authentication of network clients, which
provides us with the authentication handshake.
5. Once the keys are obtained, use aircrack-ng and a word list file to crack the
pre-shared key.
Last updated: Feb. 3, 2016
3
EECS 4215
Winter 2016
6. In the second part of the assignment you are to answer questions about IEEE
802.11 wireless security
Detailed Steps
Aircrack-ng is composed of various programs including aircrack-ng, airodumpng, aireplay-ng and airmon-ng. Tutorials on using Aircrack-ng and other tools are
available online. The following section describes the general steps that should be
taken to crack WPA2 keys.
1. Assuming you are running a Linux distribution, you can obtain the list of your
wireless interfaces by running the following command:
Ifconfig
The above Unix command will show a list of wireless interfaces. If you are
running Windows try ipconfig –All. The execution of the above command
produces a result similar to the following:
Wlan0 Link encap:Ethernet HWaddr 00:02:20:CF:8B:32
inet addr:111.139.127.10 Bcast:111.139.127.63 Mask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2472694671 errors:1 dropped:0 overruns:0 frame:0
TX packets:44641779 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1761467179 (1679.7 Mb) TX bytes:2870928587 (2737.9 Mb)
Interrupt:2
The name of the interface and its corresponding MAC address are
highlighted.
2. You first need to ensure that your wireless card is in Monitor mode and can
inject packets. Turn your card into Monitor mode by running the following
command in console:
airmon-ng start wlan0
Note wlan0 is the name of your wireless interface obtained from step one.
Your computer’s wireless interface may be named something else such as
auth0. Once the wireless card is switched to Monitor mode. A new temporary
wireless interface may be created. You can find the name of the new wireless
interface by the running ifconfig.
Last updated: Feb. 3, 2016
4
EECS 4215
Winter 2016
Optional: Once the monitor mode is on you may run the following command
to test your card for injection capability:
aireplay-ng -9 wlan0
Provided that your wireless interface name is wlan0.
3. End unnecessary network programs. Upon running airmon-ng from step 2, it
may be helpful to close certain programs that may interfere with aircrack-ng
toolset. These programs include NetworkManager, dhclient and
wpa_supplicant. Airmon-ng provides an option called check, that checks to
ensure no running program is conflicting with aircrack-ng.
4. By using MacChanger program described under the Tools section - or by any
other method possible - change your MAC address to the following address:
00:11:22:33:44:55. If you get an error message regarding insufficient
permission, ensure that you have closed other network processes that are
suggested by airmon-ng from step 3.
5. Start airodump-ng with the wireless interface obtained from previous steps
to view existing wireless network stations:
airodump -ng wlan0mon
The above code assumes that the newly created wireless interface by airmonng is called wlan0mon. The above command displays a list of nearby network
stations similar to the following:
CH 9 ][ Elapsed: 4 s ][ 2016-01-03 01:22
BSSID
PWR
Beacons
#Data
#/s
CH
MB
ENC
CIPHER
AUTH
ESSID
FF:EE:00:11:22:33
-38
100
8
0
1
1
54e
WPA2
PSK
myWirlessRouter
The above list shows only one station, you may see a list of stations. Locate
and observe the BSSID, ESSID, Channel, Cipher and Authentication type of the
target network station that you intend to crack. You can exit airodump-ng
(using Control-C) once you have copied the details of the target network.
6. Start airdump-ng with the proper parameters to target a specific network
station. For example to target the station shown in step 5, run the following
command.
Last updated: Feb. 3, 2016
5
EECS 4215
Winter 2016
airodump -ng -c 1 --bssid FF:EE:00:11:22:33 -w output wlan0mon
From the above command, the parameter –c 1 indicates that we want to
listen to channel 1. The parameter --bssid FF:EE:00:11:22:33 indicates that
we are targeting the network station with that MAC address. The parameter
–w output copies the recorded packets into a file named output, and finally
wlan0mon is the name of our wireless interface.
Observe the number of connected network devices and their details. Observe
the number of data packets in the #Data column. Note if airodump-ng
successfully obtains the WPA handshake it will show the message “WPA
handshake” on the top right corner of the console. This message will not
appear until a client is connected to the network station and the WPA
handshake is recorded by airodump-ng.
7. To expedite the retrieval of the WPA handshake we are going to inject some
packets into the network, note that this step is optional but it will help you
obtain the WPA handshake much faster while airdump-ng is running. Open a
new console window. On the new console start airplay-ng to de-authenticate
all clients within the network. This causes the clients to re-establish the
connection by attempting to re-authenticate. The re-authentication step will
be stored by airdump-ng instance that is running from step 6. To deauthenticate existing clients your command should look similar to the
following:
aireplay -ng --deauth 1 -a FF:EE:00:11:22:33 wlan0mon
The first parameter --deauth means “de-authentication”. The second
parameter 1 means that you want to send only one de-authentication
message. You can send more if you wish. The third parameter –a specifies the
access point’s MAC address (obtained from previous steps) and lastly, just
like before we have the interface name. Upon a successful de-authentication
a message similar to the following will display:
10:33:30 Waiting for beacon frame (BSSID: FF:EE:00:11:22:33) on channel 1
NB: this attack is more effective when targeting a connected wireless client (-c
<client’s mac>)
10:33:30 Sending DeAuth to broadcast -- BSSID: [ FF:EE:00:11:22:33]
The above message means that the de-authentication message has been sent
and you should see the words “WPA handshake: FF:EE:00:11:22:33” at the
top right corner of the other console where airodump-ng is running.
The warning “NB: this attack …” that appears in the above result means that
you can target a specific client to send the de-authentication message to,
Last updated: Feb. 3, 2016
6
EECS 4215
Winter 2016
instead of broadcasting the de-auth message. If you prefer to do that you can
obtain the client’s MAC address by running airodump-ng in step 6.
8. Once the authentication process is stored into the output files, end the
airodump-ng program (typically by pressing Control and C). Make sure the
WPA authentication handshake is obtained before closing airodump-ng.
Start aircrack-ng to crack the stored shared key. Aircrack-ng must be given a
word list/dictionary file to crack WPA2 keys. Ensure the dictionary file you
use includes the temporary password that you used for your router’s
wireless; otherwise the process of cracking may take longer or it may never
successfully end. The following is an example of how to use aircrack-ng with
the stored packets obtained from previous step and a dictionary file. See
Tools section for links to dictionary files.
aircrack-ng -w mywordlist.lst –b FF:EE:00:11:22:33 output*.cap
The parameter –w mywordlist.lst specifies the word list that we are going to
use to search for the password. The parameter –b FF:EE:00:11:22:33 is the
network station that we are targeting. It is an optional parameter but it
makes the cracking more efficient by filtering the results down to the target
network only. The parameter output*.cap points to the files that contain the
captured packets. It is possible to use a wild card in the file to indicate
multiple files. Note the files containing the packets starts with “output”
because we specified it in step 6. Refer to Troubleshooting section of the
assignment if you get an error such as “read(file header) failed: Success”.
1. Aircrack-ng will exhaustively compare passwords in the dictionary file
against the shared keys. This process may take seconds to days depending on
the complexity of the key, the quality of dictionary file and the performance
of your computer. From other experiments running on a dual core 2.8Ghz,
Aircrack-ng is able to test over 500 passwords per seconds. That is 1.8
million passwords per hour. There are ways to make the tests more efficient.
Once the key is found the result of the program will look similar to the
following.
Aircrack-ng 1.2
[00:01:22] 2 keys tested (37.20 k/s)
KEY FOUND! [ 12345678 ]
Master Key : CD 69 0D 11 8E AC AA C5 C5 EC BB 59 85 7D 49 3E
B8 A6 13 C5 4A 72 82 38 ED C3 7E 2C 59 5E AB FD
Transient Key : 06 F8 BB F3 B1 55 AE EE 1F 66 AE 51 1F F8 12 98
CE 8A 9D A0 FC ED A6 DE 70 84 BA 90 83 7E CD 40
FF 1D 41 E1 65 17 93 0E 64 32 BF 25 50 D5 4A 5E
2B 20 90 8C EA 32 15 A6 26 62 93 27 66 66 E0 71
Last updated: Feb. 3, 2016
7
EECS 4215
Winter 2016
EAPOL HMAC
: 4E 27 D9 5B 00 91 53 57 88 9C 66 C8 B1 29 D1 CB
Troubleshooting
1. Please note that this assignment covers only WPA2 Personal and not
Enterprise. There is a different method for cracking WPA2 Enterprise.
2. If you get the following error upon running airodump-ng or airplay-ng:
“ioctl(SIOCSWMODE) failed: Device or resource busy”, ensure that no other
processes are using the wireless interface. You can check for conflicting
programs by running the following command: “airmon -ng check “.
Alternatively you can try killing the processes by entering: “Airmon-ng check
kill”
3. Questions regarding whether Aircrack-ng is compatible with your network
card or whether there is a patch for your network card can be found at
http://www.aircrack-ng.org/doku.php?id=compatibility_drivers and
http://www.aircrack-ng.org/doku.php?id=compatible_cards
4. Questions regarding injection test is available at http://www.aircrackng.org/doku.php?id=injection_test&DokuWiki=to4kuc3tm2gncbvb3m5e2m5
gq0
5. Aircrack-ng runs best under a Linux distribution. Certain live CD Linux
distributions (e.g., Kali/BackTrack) come with Aircrack-ng and other
network tools preinstalled.
6. If you plan on using virtualization solutions such as VMware or Virtual box
along with a Linux distribution such as Kali, you should use an external USB
network card. Internal cards will probably not work with virtualization
methods. In other words Aircrack-ng suite cannot detect and switch the
network interface into monitor mode unless it is an external network card. If
you connect an external wireless card, ensure that that the card is enabled
for use in the virtualized environment. More information about this issue is
available at http://www.aircrackng.org/doku.php?id=install_aircrack#installing_on_mac_osx
7. Parts of Aircrack-ng namely airodump-ng and aireplay-ng are available on
Linux and Windows distributions only; They do not work under OS X. You
need to use a virtualization solution to run Aircrack-ng on OS X.
8. Aircrack-ng is available for Windows as well. However it is not as complete as
the Linux version. Certain wireless cards that come with Windows machines
Last updated: Feb. 3, 2016
8
EECS 4215
Winter 2016
(especially wireless cards with Intel chips) do not provide the Monitor mode.
You may need to use a different laptop or use an external wireless card. If
you are using a Linux based OS, you may be required to patch your wireless
card driver.
9. If running Aircrack-ng in step 8 produces the following error message
“read(file header) failed: Success”: Try providing one .cap file at a time
instead of using a wild card. This error is generated when Airodump-ng exits
unexpectedly. Remember you can always delete the .cap files and start fresh
by re-running Airodump-ng in step 6.
10. Search the web for your issues and read the manual of Aircrack-ng toolset.
Aircrack-ng consists of numerous useful network tools each of which has its
own man page and tutorials.
What to Submit
Provide a cover sheet that contains your name, student number, course name and
laboratory number and title. Include the marking sheet as the second page, followed
by the solution to part 1 and part 2 of the assignment.
Part 1: Explain the steps taken to crack WPA2 pre-shared keys. Provide screenshots
of the input and output of each step. Describe
1. tools and network equipment used
2. every step of the process including inputs and outputs of every step
3. challenges faced while performing the exercise
Instead of WPA2, you may provide the steps taken to crack a WEP encryption. As
with WPA2, you must describe your own solution and make sure the three items
listed above are addressed.
Part 2: Answer the following questions:
1- In a few sentences describe the difference between WEP and WPA security
algorithms?
2- How is WEP vulnerable to cracking?
3- How is WPA Personal (i.e. WPA/PKS) vulnerable to cracking? Why is it more
secure than WEP?
4- How is WPA2 Personal (i.e. WPA2/PKS) vulnerable to cracking? Why is it
more secure than WPA?
Last updated: Feb. 3, 2016
9
EECS 4215
Winter 2016
5- In a few sentences describe the difference between TKIP and AES encryption
method used in WPA and WPA2?
6- In a few sentences describe the difference between Enterprise and Personal
WPA?
7- How can you make the cracking procedure described in this assignment
more efficient?
8- Can you provide the name of other tools, or describe other methods of
cracking wireless network keys?
Last updated: Feb. 3, 2016
10
EECS 4215
Winter 2016
Grading Scheme
Task
Mark
Part 1: Description of each step including input and output
/40
Part 1: Successfully cracking the wireless key and showing the result
/15
Part 2: Questions 1
/5
Part 2: Questions 2
/5
Part 2: Questions 3
/5
Part 2: Questions 4
/5
Part 2: Questions 5
/5
Part 2: Questions 6
/5
Part 2: Questions 7
/5
Part 2: Questions 8
/5
Presentation of the report
/5
Total
Last updated: Feb. 3, 2016
/100
11