Instructions For Cracking Wep

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Instructions For Cracking Wep as PDF for free.

More details

  • Words: 5,171
  • Pages: 12
cracking wep with windows xp pro sp2

there is a video counterpart to this which is in the format of me describing what i am doing and how to carry out all the actions in this paper from start to finish. it will be available as soon as i can secure my web site adequately and will only ever be available to registered taz members. this paper should be considered the pre-reading for the video tutorial.

this is part one in a two part paper on cracking wep with windows xp. this first part covers sniffing wireless traffic and obtaining the wep key. part two will cover associating with a wireless ap, spoofing your mac address, trying to log on administratively to the ap and further things you can carry out on the wlan once authenticated successfully.

what is wep: wired equivalent privacy (wep) is often mistakenly thought of as a protocol designed to 100% protect wireless traffic, when this is not the case. as its name suggests it was designed to give wireless traffic the same level of protection as a wired lan, which when you think about it is a very hard thing to set out to do. lan�s are inherently more secure than wireless lan�s (wlan) due to physical and geographical constraints. for an attacker to sniff data on a lan they must have physical access to it � which is obviously easier to prevent than to prevent access to traffic on a wlan. wep works at the lower layers of the osi model, layers one and two to be exact, so it therefore does not provide total end to end security for the data transmission. wep can provide a level of security between a wireless client and an access point or between two wireless clients. wep standards: wep is commonly implemented as a 64 bit or 128 bit encryption. these encryption strengths can sometimes be referred to as 40 bit or 104 bit due to the fact that each data packet is encrypted with an rc4 cipher stream which gets generated by an rc4 key. this rc4 key for say a 64 but wep implementation is composed of a 40 bit wep key and a 24 bit initialization vector (iv) � hence the 64 bit rc4 key, however the actual wep part of it is only 40 bits long, the iv taking up the other 24 bits, which is why a 64 bit wep key is sometime referred to as a 40 bit wep key. this resultant cipher is �xor�d� with the plain text packet. to decrypt the packet the wep key is used to stream� at the other end to decrypt the whole packet i will also go over the iv�s in more detail later on

data to encrypt the whole generate an identical �key but more about this later on, as well.

failures of wep: we have heard everyone say wep is easy to crack and should not be used, can be cracked in 10 minutes etc but why is this? well in my opinion wep is seriously flawed for the following reasons: 1) initialization vectors are reused with encrypted packets. as an iv is only 24 bits long it is only a matter of time before it is reused. couple this with the fact you may have 50 + wireless clients using the same wep key and the chances of it being reused improve even further. an iv is sent in clear along with the encrypted part of the packet. the reuse of any encryption element is always a fundamental flaw to that particular encryption and as an iv is sent in clear this further exposes a significant weakness in wep. as more rc4 cipher steams are found and more iv�s are deciphered and the closer we get to discovering the wep key. this is what forms the foundation of wep cracking. 2) the algorithm used to encrypt a wep �hash� is not intended for encryption purposes. the original purpose of the cyclic redundancy check (crc-32) was to detect errors in transmission, not to encrypt data. 3) the most significant flaw in my opinion is the mass use of the wep key. everything using that particular ap will need the same wep key hence all the resultant traffic will be using the exact same wep key as well. the one not so obvious side-affect of this is when it comes to administering the network. if you have 60 wireless clients all using the same wep key, do you really want to go and periodially change them all�..it is easier to leave it as it is. i am guilty of doing this on a network i used to administer a few years ago as i am sure others are who still use wep. wireless standards: the institute of electrical and electronic engineers (ieee) defined specifications for wireless traffic back in 1997. the protocol they came up with is the 802.11 standard. nowadays 802.11 has many different implementations for wireless traffic. the most common ones are: 1) 802.11 � this specifies that the wireless traffic will use the 2.4ghz frequency band utilizing either frequency hoping spread spectrum (fhss) or direct sequence spread spectrum (dsss). the fhss is a protocol whereby the traffic �hops� to predefined frequencies and is commonly used to reduce the effects of noise or interference in the transmission. dsss is also a protocol used to reduce noise interference by combining the signal with a higher data rate bit sequence (commonly called a chipping code) which separates the data up in to a logical sequence and attaches a form of crc to the packet before transmitting. 2) 802.11a � this provides data transmission in the 5ghz band at a rate of anything up to 54mbps. unlike the original 802.11 specification this uses orthogonal frequency division multiplexing (ofdm) to encode the traffic instead of

fhss or dsss. ofdm is a method of transmitting digital data by splitting it up in to smaller �chunks� and transmitting them at the same time but on different frequencies, which is why the data transfer rate is quite good. 3) 802.11b � came along in 1999 with the intention of allowing wireless functionality to be similar to that provided by ethernet. it transmits data in the 2.4ghz band at 11mbps using dsss only. is sometimes called wi-fi. 4) 802.11g � this works in the 2.4 ghz band at a rate of 20mbps or more and came along in 2003. it uses ofdm like 802.11a and transmits data in a very similar way. however unlike 802.11a it is backward compatible with 802.11b. a point worth noting here is if you have an 802.11b wireless adaptor you will not be able to receive 802.11g traffic. if you do want to get in to wep cracking it is well worth your while investing in a dual band card. i will talk about wireless adaptors more later on. how do we crack wep: well cracking wep is fairly easy to understand if you have followed what i explained above. we briefly touched on iv�s and wep encryption and how they tie in together. to put it very simply, if you can decipher the iv algorithm you can decrypt or extract the wep key. as i stated before wep very kindly transmits the iv in clear, so if we can run a mathematical equation against it we can find and decipher the rc4 stream that encrypted the whole packet in the first place. the wep �key� is the missing value [key] from this mathematical equation. remember the ap or the client has this key to use when decrypting the packet and is what we must find by running a complicated algorithm against the encrypted packet. if you think about it like this it may become clearer: you have an algorithm that is produced by concatenating a randomly generated 24 bit iv with your wep key � you also have an rc4 key stream - the two are then �hashed� together to encrypt the packet. the iv is the hub of the whole process as this is they only thing that has used your wep key. if we run a statistical anyalisis against the iv to try and decrypt the packet, we can find the key used at the begining of the process. when you try to decrypt them, every time you crack a piece of the algorithm the corresponding plain text part of the packet is revealed, once the whole packet is decrypted you know the algorithm used to encrypt that particular packet � a crude way of describing it but as simple as i can make it. any attacker can passively collect encrypted data, after a while due to the limitations explained earlier; two iv�s that are the same will be collected. if two packets with the same iv are xor�d, an xor of the plain text data can be revealed. this xor can then be used to infer data about the contents of the data packets. the more identical iv�s collected the more plain text data can be revealed. once all the plain text of a data packet is known, it will also been known for all data packets using the same iv. so before any transmission occurs wep combines the keystream with the payload

using an xor process, which produces ciphertext (data that has been encrypted). wep includes the iv in clear in the first few bytes of the frame. the receiving ap / client uses this iv along with the shared secret key (your wep key) to decrypt the payload of the frame. xor is a mathematical algorithm which i am not even going to attempt to explain. this site explains it very well though: http://mathworld.wolfram.com/xor.html so in short � the more identical iv�s we can get the more plain text data we can reveal and the closer we get to obtaining the key used to encrypt the data in the first place. as it is not pre-determined when we are going to receive identical iv�s it is impossible to say how many iv�s need to be collected but more about that later. software used: for this attack i am going to use aircrack-ng for windows which can be obtained from here: http://tinyshell.be/aircrackng/wiki/index.php?title=aircrack-ng whilst here download cygwin1.dll and paste it in to the same folder as aircrackng. there is a copy of cygwin1.dll included already but the one available from the tinyshell site is a later version of it. the peek.dll and peek5.sys files also need to be in the same directory as aircrack. they are available here: if you download winaircrack - which is a gui version of what i cover in this paper - copy the peek.dll and peek5.sys files across to where you have aircrack stored. you will get a peek driver not found message if you dont do this. once it has downloaded you have to option of pasting the directory path of it in to your command prompt path so you can start the application straight from the command line without having to �cd� to the correct directory. for example i copied this in to my path: c:\documents and settings\nokia\desktop\aircrack-ng-0.3-win\aircrack-ng-0.3-win\bin in the bin folder is airodump and aircrack-ng � so now i can just type airodump straight in to the command prompt to run the application. to add something to your path: right click my computer > properties > advanced > environment variables > under system variables highlight path > edit > enter the directory path using a ; to separate it from any existing entries. you also need to go to wild packets to pick up a new driver for your card. http://www.wildpackets.com/ i have found that the most common cause of stress when trying to crack wep is incompatible hardware. the airopeek driver from wild packets is not compatible with all types of hardware. there is a list of supported adaptors and the relevant driver you need to use on the web site. for this crack i am using an atheros based netgear wag511 dual band adaptor which you can get from here for �35.99. this card works with whax, auditor and backtrack pretty much straight out of the box. it is also a dual band so you don�t have to worry about sniffing traffic on a

�g� wlan when you have a �b� wireless adaptor. it is my preferred wireless adaptor and has not let me down yet. most cards that are atheros based will have the atheros logo on the side of the box, use one of these if possible. **some people i know have confused the netgear wg511 which does not work, with the netgear wg511t which does work so try not to fall in to this trap** cards that i can 100% say to stay away from are ones that use the prisimgt chipset. connexant cards are also a complete waste of time (which i found out the hardway) so please do not even think about buying one of these if you want to crack wep. see this list to check what chipset your card uses: http://www.linux-wlan.org/docs/wlan_adapters.html.gz so you should now have: aircrack-ng cygwin1.dll � in the same directory as aircrack peek.dll and peek5.sys in the same directory as aircrack relevant drivers from wild packets for your adaptor added aircrack-ng to your path got an adaptor that works with all of the above! so what�s next? now we need to install the driver you have downloaded. **warning � the next procedure will overwrite your existing windows driver, so make sure you have the disc or a backup of it before carrying on.** the peek driver will not let you use your wireless adaptor in the conventional way. you won�t be able to associate to an ap with it or browse the internet etc. 99% of windows drivers a designed to make your wireless adaptor reject any 802.11 traffic not destined for it. the peek driver puts your adaptor in to a promiscuous mode to allow it to sniff all 802.11 traffic that is compatible with your adaptor. to install the driver open up your device manager and right click on your wireless adaptor > update driver > install from a specific location > don�t search, i will chose the driver to install > have disk > browse to where you have downloaded the driver > double click. windows may display a prompt warning you that the driver is not digitally signed, if ths happens click continue anyway. once the driver is installed we are ready to crack wep. **if you get an error message saying �the specified destination contains no information about your device�, you have either downloaded the wrong driver or more likely your wireless adaptor is not compatible with what we need it to do.** cracking wep: cracking wep is by now means a skilful thing to do, as all the hard work was done by chris devine who is the excellent coder of aircrack, all we need to do is collect the data and start the program. if you have questions about aircrack a good place to post them is on the netstumbler linux forums as i believe the author

checks here quite often. alternatively you can email the author at devine [at] iie [dot] cnam [dot] fr � whether he will reply or not i don�t know but i wouldn�t have thought he will appreciate you emailing him with stupid questions � use the forum for these! airodump so open a command prompt and type airodump � or if you have not added it to your path you will need to cd to the right directory. a new window opens now which will search for all installed wireless adaptors, give it a numerical signature and display the following: code: usage: airodump [ivs only flag] known network adapters: 14 22

netgear wg511t 54 mbps wireless pc card netgear wag511 802.11a/b/g dual band wireless pc card

network interface index number

->

select the relevant id for the card you want to use: code: network interface index number

-> 22

you are then prompted to enter the type of chipset of your card: code: interface types: 'o' = hermesi/realtek 'a' = aironet/atheros network interface type (o/a)

->

we are using an atheros card so we enter 'a': code: network interface type (o/a)

-> a

then you are asked what channel you would like it to sniff traffic on: code: channel(s): 1 to 14, 0 = all

->

the usa only uses up to channel 11 and europe use up to channel 14. channel 11 in the uk is the most common one that wireless ap�s default to however, so i normally start off with channel 11. if you want to scan all channels use the 0 option. we shall use channel 11:

code: channel(s): 1 to 14, 0 = all

-> 11

now you are asked what you would like to save your capture file as: code: (note: if you specify the same output prefix, airodump will resume the capture session by appending data to the existing capture file) output filename prefix

->

if you specify a file name that you have already used the resulting data will be added to the file � which is an excellent feature if it becomes apparent later on that you do not have enough iv�s as you won�t have to start all over again! code: output filename prefix

->wep1

now you are asked if you only want to save the iv�s or all packets that are sniffed. code: (note: to save space and only store the captured wep ivs, press y.the resulting capture file will only be useful for wep cracking) only write wep ivs (y/n)

->

as we know to crack a wep key we only need iv�s so we can select yes to this question. the resultant file will be saved as an .ivs file. code: only write wep ivs (y/n)

-> y

so now we have told it everything it needs to know, let�s see what happens: code: bssid 00:09:5b:fd:c6:52 00:30:f1:f5:a1:35

pwr

beacons

# data

ch

mb

enc

essid

10 60

3 359

6 1234

11 11

54 54

opn wep

homewireless stuart

bssid

station

00:09:5b:fd:c6:52 00:30:f1:f5:a1:35

00:09:5b:b6:1d:2a 00:09:5b:84:a6:df

pwr

packets

17 87

6 1793

essid homewireless stuart

this is the output from a successful airodump start-up. bssid = the mac address of the wireless access point. pwr = the strength of the signal being received

beacons = every ap transmits around 10 beacons per second � these are not encrypted and are useless to us from a wep cracking point of view � they basically say � i�m an ap, come and associate with me�. data = this is what we are interested in. data packets are our iv�s that we need and what we are most interested in. enc = encapsulation � wep / wpa / open etc � speaks for itself essid = the name of the wireless network. this is not always broadcasted by the ap but we will need it to associate with the ap later on. the second part lists any associated clients that are talking to the ap. make a note of these mac addresses. some ap�s have mac address filtering enabled. this is a table of mac addresses stored on the ap � when you try to associate with the ap if mac filtering is enabled the ap checks your mac with the list of allowed mac�s to see if you can associate with it. if it is not in the list, regardless of if you have the correct wep key or not, you will not be allowed to associate with the ap. you will also leave an entry in the logs. this is a very helpful feature of airodump that informs us what we need to spoof our mac to when associating with the ap.

data: as i mentioned before it is impossible to give an exact number of iv�s that need to be collected to crack a wep key. the more we can get the more chance we have of cracking the wep key. from trial and error i have found that i can crack a 40 bit wep key in a few seconds with around 250,000 � 400,00 iv�s. you may be able to do it with more iv�s or less iv�s, it is different every time. for a 104 bit wep key you will need anything up to 2000000 iv�s and maybe even more. the fewest amount of iv�s i have ever been able to use in one of my lessons for a 104 bit crack is 710,325 and this took just 4 minutes 31 seconds to crack but in other lessons i have had to collect in excess of 2 million. this is where the very handy feature of airodump amending to existing files is useful. if you have collected 500,000 and run a 64 bit attack on the file but are unsuccessful, simply start airodump again and use the same file name, all the new iv�s will be added to the ones you already have, so you don�t have to start from the beginning all over again! so now sit there and wait for the amount of iv�s that you decide on to be collected! aircrack-ng so once you have decided you have enough iv�s press ctl + c to end airodump. i have collected 413,994 iv�s for this crack. you will still have the white command prompt open so just type aircrack-ng at the prompt. (or �cd� to it) you will now get a list of �usages� for aircrack that you can use. code:

common options: -a -e -b -q -w

: force attack mode (1/wep, 2/wpa-psk) <essid> : target selection: network identifier : target selection: access point's mac : enable quiet mode (no status output) <words> : path to a dictionary file

static wep cracking options: -c -t -d -m -n -i -f -k -x -y

<start> <maddr>

: : : : : : : : : :

search alpha-numeric characters only search binary coded decimal chr only debug - specify beginning of the key mac address to filter usable packets wep key length: 64 / 128 / 152 / 256 wep key index (1 to 4), default: any bruteforce fudge factor, default: 2 disable one attack method (1 to 17) do bruteforce the last two keybytes experimental single bruteforce mode

aircrack-ng 0.3 - (c) 2006 thomas d'otreppe original work: christophe devine http://www.aircrack-ng.org usage: aircrack-ng [options] <.cap / .ivs file(s)> as this paper is getting a bit long i will just cover the options we need to crack a wep key from a file. if you want to try the other options out..try them and see what you come up with. the helpful descriptions provided speak for themselves really. so we have collected 413,994 iv�s which is not enough for a 104 bit wep crack so we will try a 40 bit wep crack instead (we can always add iv�s to the file later on if it does not work) so we issue the following command to aircrack: code: c:\docu~\nokia>aircrack-ng -n 64 wep1.ivs we use the �n 64 switch to tell it we think it is a 64 bit wep key. you can also use the �f switch, which is the fudge factor switch. in the programmers own words: �by default, this parameter [fudge factor] is set to 2 for 104-bit wep and to 5 for 40-bit wep. specify a higher value to increase the brute force level: cracking will take more time, but with a higher likelihood of success. so if you have no joy cracking it you can try again with the �f 5 switch. if you forget what you called the airodump file it is saved in the following directory by default:

c:\documents and settings\%user name% if you selected to only save the iv�s it will be an .ivs file, if you said no and wanted to save everything it will be a .cap file. our scan only turned up one network so aircrack will only crack those iv�s, if you have more than one network you will need to use the �m switch to tell it the bssid of the ap whose packets you want to use,

the result of issuing our command is: code:

aircrack-ng 0.3 [00:00:00] tested 1231 keys (got 413994 ivs)

kb 0 1 2 3 4

depth 0/ 4 0/ 3 0/ 1 0/ 1 0/ 1

byte(vote) a6( 68) 82( 22( 75) 52( 04( 76) 33( 09( 106) fb( eb( 153) 19(

40) 19) 8) 15) 27)

ee( 43( 8b( ed( 0e(

20) 15) 5) 12) 15)

e4( 5a( c8( 58( 38(

15) 13) 5) 12) 15)

18( 21( 47( f0( b8(

5) 8) 0) 11) 13)

23( 8a( 62( 29( e0(

5) 5) 0) 7) 10)

04( b2( 63( c8( dc(

3) 4) 0) 5) 9)

key found! [ a6:22:04:09:eb ]

there you have it our 40 bit wep key is a6:22:04:09:eb. with 413994 iv�s this key took aircrack less than 1 second to crack. which is an example of how good aircrack truely is. with 250,000 ish iv's chances are it would only take a few seconds more to crack but i like to collect a few more iv's to be on the safe side. like i said the programmer has done all the hard work for us, we just need to tell it what to do. for an end users part wep cracking is not a skilful hack in any way whatsoever (we just tell aircrack what we want it to do) unless you want to write your own program for it! troubleshooting: common problems are: incompatible wireless card. 90% of my students who come to me complaining they can�t crack wep and that aircrack does not work are failing because they do not have a compatible wireless adaptor. if you are giving the commands that i am giving here, or get an error message when installing the driver i can almost guarantee you that your card is not compatible. it is possible to flash the firmware of some prisim2 cards, this pages helps you do this: http://tinyshell.be/aircrackng/wiki/index.php?title=prism2_flashing can�t receive data / iv�s with airodump:

to receive iv�s from an ap there has to be a client associated with it that is sending / receiving traffic. if you are not receiving iv�s the most likely causes of this are that there is no associated clients or you are too far away from the ap. as far as i know aireplay does not work with windows so you will have to use a packet injection application of your choosing. i will cover this in part 2. finally, if you are just plain unlucky you may just not be able to crack the wep with the iv�s you have. if this happens the only option is to start from the beginning again. if you cant crack the 64 bit wep collect more iv�s and try doing it as a 104 bit wep key. my thanks go to chris divine, korek and all who helped him, for writing such a helpful application and to thomas d'otreppe who i believe imported it on to windows? faq the following faq has been put together from questions in this thread. additionally the following link was found by moo and has proved very helpful: http://www.wirelessdefence.org/contents/aircrackoriginal.html can we ask that you look through the faq in that link and this faq before you post questions here, thanks q. i can't get the wild packet drivers to work for my xxxxx wireless card. after i install it says the card will not work properly now? a. you won�t be able to connect to the internet / ap in the conventional way after you install the wild packet drivers - these drivers place your card in a promiscuous mode to enable you to receive traffic not destined for you. if you fire airodump up after installing the drivers it should work, if they have been installed correctly. there are two versions of the drivers. if it does not work then either the drivers either haven�t been installed properly, you have installed the wrong version, or they are incompatible with your card. after you have finished go to your device manager in your control panel and 'roll back' the driver to revert back to the original one so you can get normal connectivity. ____________________________________________________________ q. can i have two different wireless cards installed, one for general internet surfing and another with the wild packet drivers installed for penetration testing? a. yes, this is a good solution; i do it most of the time when i need internet connectivity and a passive connection at the same time. if you have more than one pcmcia slot on your laptop use the same slot for each card - this will prevent you having to constantly reinstall the relevant drivers! ____________________________________________________________ q. when i load airodump i get the following error "loadlibrary(peek.dll) failed, make sure this file is present in the current directory." what does this mean?

a. you will need to get the peek.dll and peek5.sys files and put them in the same directory as aircrack. the easiest way to get them is to go here: http://tinyshell.be/aircrackng/wiki/index.php?title=links and download winaircrack - which is a gui version of aircrack - copy and paste peek.dll and peek5.sys in to your directory. you should have added cygwin1.dll, peek.dll and peek5.sys in to your directory before starting airodump/aircrack ____________________________________________________________ q. when a click on (airdecap-ng,arpforge-ng.....),they quick open and close? a. read all of the paper......specifically the part about adding them to your path � once you have done this double clicking on the wont work any more. ____________________________________________________________ q. i have it running fine, but the iv collection is really slow, can i speed it up at all? a. if the wireless network does not have many clients, then iv collection will be very slow. if this is your own network open up a command prompt and type: ping "ip address of ap" -l 65500 -t (that�s a small l not a |) this will send a constant stream of icmp packets 65500b big to the ap which should generate a good stream of iv's. this will only work if you are already associated with the ap and is for use to test your own wep key you cannot use it against somebody elses ap until you have associated with it. ____________________________________________________________ q. how do i use packet injection to speed up collection of iv�s? / i can�t seem to get packet injection program xxxxxx to work properly, can you help? a. unfortunately packet injection is outside the scope of this tutorial and may be covered in a future one. for the time being you will have to do some research on google. enjoy. _________________ drugs have taught an entire generation of kids the metric system..

Related Documents

Cracking Wep Keys
June 2020 5
Wep
July 2020 10
Wep
November 2019 17
Cracking
May 2020 10