{"id":103,"date":"2025-04-28T07:36:41","date_gmt":"2025-04-28T07:36:41","guid":{"rendered":"https:\/\/hackingwithj.com\/?p=103"},"modified":"2025-04-28T07:39:27","modified_gmt":"2025-04-28T07:39:27","slug":"cracking-wi-fi-wep-vs-wpa2-vs-wpa3","status":"publish","type":"post","link":"https:\/\/hackingwithj.com\/?p=103","title":{"rendered":"Cracking Wi-Fi: WEP vs WPA2 vs WPA3"},"content":{"rendered":"\n<p>One part of pentesting involves attempting to gain access to a wireless network and capturing traffic to gather information about users or services. In this article, I\u2019ll walk through the main types of Wi-Fi security \u2014 from the outdated and broken to the modern and (relatively) secure<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u26a0\ufe0f <em>Note: The demos are for educational purposes only. Only test on networks you own or have explicit permission to analyze.<\/em><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\uded1 WEP \u2014 Don\u2019t Even Bother<\/h2>\n\n\n\n<p>You pretty much never see this one anymore \u2014 and for good reason.<\/p>\n\n\n\n<p>Wired Equivalent Privacy (WEP) was introduced back in 1997. It uses the RC4 stream cipher and supports either 40-bit or 104-bit key encryption. Everyone connecting to a WEP network uses the same encryption key, which already introduces a major flaw.<\/p>\n\n\n\n<p>RC4 works by generating a key stream using the encryption key and a small initialization vector (IV). This stream is XOR-ed with the plaintext data to produce ciphertext. But WEP has terrible IV management \u2014 it reuses IVs frequently, which allows attackers to capture enough packets and crack the encryption in minutes using tools like <code>aircrack-ng<\/code>.<\/p>\n\n\n\n<p>Bottom line: WEP is broken beyond repair. You should never use it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Demo: Cracking WEP in Minutes<\/h3>\n\n\n\n<p>To make it interesting, I generated a 13-character password (suitable for 128-bit WEP):<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-320131d38e68a49b4e2fbf3c9134c1e0\"><code>$ grep -E '^.{13}$' rockyou.txt | shuf -n 1\nana067burg231<\/code><\/pre>\n\n\n\n<p>Then I ran the following commands to attack a WEP network:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-07901b18d7ad5e48e42f0b0b63725bb5\"><code>$ airmon-ng start wlan0\n$ airodump-ng wlan0mon --bssid &lt;router-BSSID> -c &lt;channel> -w wep-crack\n$ aireplay-ng -3 -b &lt;router-BSSID> wlan0mon\n$ aircrack-ng wep-crack-01.cap<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"337\" src=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_22_08-1024x337.png\" alt=\"\" class=\"wp-image-115\" srcset=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_22_08-1024x337.png 1024w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_22_08-300x99.png 300w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_22_08-768x253.png 768w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_22_08.png 1155w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>aireplay-ng -3<\/code> is used to inject packets and speed up the capture process (especially useful if the router isn\u2019t connected to the internet).<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After just <strong>5 minutes<\/strong>, I captured enough packets.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>And in <strong>under 30 seconds<\/strong>, <code>aircrack-ng<\/code> cracked the password.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"488\" src=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_30_36-1-1024x488.png\" alt=\"\" class=\"wp-image-117\" srcset=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_30_36-1-1024x488.png 1024w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_30_36-1-300x143.png 300w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_30_36-1-768x366.png 768w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_30_36-1.png 1374w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd10 WPA2 \u2014 The Current Standard<\/h2>\n\n\n\n<p>WPA2 was introduced in 2004 and is still the most widely used standard today \u2014 especially in home networks. Most routers use <strong>WPA2-PSK<\/strong> (Pre-Shared Key), where you set a Wi-Fi password and share it with all devices that want to connect.<\/p>\n\n\n\n<p>It replaced the insecure RC4 cipher with <strong>AES-CCMP<\/strong>, which is much more secure. The real magic happens in the <strong>4-way handshake<\/strong>, which happens when a device connects:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Even though everyone uses the same Wi-Fi password (PSK), the handshake generates <strong>unique encryption keys per device<\/strong>.<\/li>\n\n\n\n<li>The password is never directly transmitted.<\/li>\n\n\n\n<li>An attacker would need the PSK to decrypt traffic, and even then, past sessions remain protected due to unique session keys.<\/li>\n<\/ul>\n\n\n\n<p>That said, <strong>WPA2-PSK is still vulnerable<\/strong> to brute-force attacks if the password is weak. Attackers can capture the handshake and attempt offline password cracking.<\/p>\n\n\n\n<p>Also worth noting: with the rise of quantum computing, <strong>AES encryption could theoretically be weakened using Grover\u2019s algorithm<\/strong>, which speeds up brute-force attempts. (I&#8217;ll write more about quantum cryptography in a future post.)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Demo: Cracking WPA2 with Hashcat<\/h3>\n\n\n\n<p>For WPA2-PSK, I used <strong>wifite<\/strong> to simplify the capture process:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"912\" src=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_52_46-1024x912.png\" alt=\"\" class=\"wp-image-119\" srcset=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_52_46-1024x912.png 1024w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_52_46-300x267.png 300w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_52_46-768x684.png 768w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Screenshot_2025-04-24_20_52_46.png 1150w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It automatically captures WPA2 handshakes.<\/li>\n\n\n\n<li>I converted the <code>.cap<\/code> file to <code>.hc22000<\/code> for <strong>Hashcat<\/strong> using <a href=\"https:\/\/hashcat.net\/cap2hashcat\/\">this converter<\/a>.<\/li>\n<\/ul>\n\n\n\n<p>If the password exists in a wordlist like <code>rockyou.txt<\/code>, cracking can take just seconds:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-90beb5585be156d80c2b8ecee1de4b5a\"><code>hashcat -m 22000 -a 0 \"53492_1745513159.hc22000\" \"rockyou.txt\"<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"462\" src=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-04-24-205840-1.png\" alt=\"\" class=\"wp-image-121\" srcset=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-04-24-205840-1.png 736w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-04-24-205840-1-300x188.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/figure>\n\n\n\n<p>But without a wordlist, you\u2019re in trouble. Even with a solid GPU like my <strong>RTX 4060 Ti<\/strong>, a brute-force attack on a password like <code>Superman1981x<\/code> (which uses uppercase, lowercase, numbers) could take <strong>centuries<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-accb5a7f086696ed2fefdebced292a3c\"><code>hashcat -m 22000 -a 3 \"pmkid_TPLINKF5C0_*.22000\" ?u?l?l?l?l?l?l?d?d?d?d?l<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"948\" height=\"409\" src=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-04-24-210512.png\" alt=\"\" class=\"wp-image-123\" srcset=\"https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-04-24-210512.png 948w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-04-24-210512-300x129.png 300w, https:\/\/hackingwithj.com\/wp-content\/uploads\/2025\/04\/Schermafbeelding-2025-04-24-210512-768x331.png 768w\" sizes=\"auto, (max-width: 948px) 100vw, 948px\" \/><\/figure>\n\n\n\n<p>This is where quantum computing could change the game. One day, attackers might use a strategy called <strong>\u201cstore now, decrypt later\u201d<\/strong> \u2014 collecting encrypted traffic today and breaking it when quantum computers are powerful enough.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udee1\ufe0f WPA3 \u2014 The New Kid on the Block<\/h2>\n\n\n\n<p>WPA3, released in 2018, builds on WPA2 with stronger encryption and better authentication.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>It uses <strong>AES-GCMP-256<\/strong>, doubling the encryption strength.<\/li>\n\n\n\n<li>For authentication, it ditches PSK and introduces <strong>Simultaneous Authentication of Equals (SAE)<\/strong> \u2014 also known as <em>Dragonfly<\/em>.<\/li>\n\n\n\n<li>SAE is a <strong>zero-knowledge proof<\/strong> system based on Diffie-Hellman. Devices prove they know the password without ever sending or deriving it directly.<\/li>\n\n\n\n<li>Even if someone captures the handshake, they <strong>can\u2019t brute-force it offline<\/strong> like in WPA2.<\/li>\n<\/ul>\n\n\n\n<p>WPA3 also ensures <strong>forward secrecy<\/strong>, meaning even if someone gets the Wi-Fi password later, they can\u2019t decrypt older captured traffic.<\/p>\n\n\n\n<p>Is WPA3 unhackable? Not quite.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Poor implementations, social engineering, and side-channel attacks can still be an issue.<\/li>\n\n\n\n<li>And yes \u2014 quantum computers running Shor\u2019s algorithm could, in theory, break Diffie-Hellman in the future.<\/li>\n<\/ul>\n\n\n\n<p>But realistically? If a hacker sees WPA3 active on your network, they&#8217;re probably moving on to easier targets.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Demo: What can you capture with WPA3<\/h3>\n\n\n\n<p>You can still capture WPA3 handshakes using tools like <code>airodump-ng<\/code> or <code>bettercap<\/code>, but the result is basically <strong>useless for offline cracking<\/strong> unless the password is ridiculously weak and your attack is live:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-c72da9c9fce80603873f3c9bb5b0a8a6\"><code>$ airodump-ng wlan0mon --bssid &lt;BSSID> -c &lt;channel> -w wpa3-handshake<\/code><\/pre>\n\n\n\n<p>But if you try to run that through <code>hashcat<\/code>, you\u2019ll get something like:<\/p>\n\n\n\n<pre class=\"wp-block-code has-vivid-purple-color has-text-color has-link-color wp-elements-01b1c5ac6a6ac8cd38847f9008c420bc\"><code>$ hashcat: No hashes loaded.<\/code><\/pre>\n\n\n\n<p>Unless it\u2019s WPA3-Transition mode (a mixed WPA2\/WPA3 mode), <strong>you won\u2019t get anything usable<\/strong>. And that\u2019s kind of the point.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>If your devices and router support <strong>WPA3<\/strong> \u2014 use it. If you&#8217;re stuck with <strong>WPA2-PSK<\/strong>, that&#8217;s still fine, but <strong>choose a strong, unique password<\/strong>. Long passphrases (think: 20+ characters) are your friend.<\/p>\n\n\n\n<p>Ask yourself: <em>how attractive of a target am I?<\/em><\/p>\n\n\n\n<p>Most attackers are opportunists. They&#8217;re not wasting time on tough networks when there are still plenty of easy ones out there.<\/p>\n\n\n\n<p>Stay one step ahead. \ud83d\udd10<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One part of pentesting involves attempting to gain access to a wireless network and capturing traffic to gather information about users or services. In this article, I\u2019ll walk through the main types of Wi-Fi security \u2014 from the outdated and broken to the modern and (relatively) secure \u26a0\ufe0f Note: The demos are for educational purposes [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[9,12],"tags":[14,11,10,13],"class_list":["post-103","post","type-post","status-publish","format-standard","hentry","category-network-hacking","category-wi-fi-security","tag-hashcat","tag-wap2","tag-wep","tag-wpa3"],"_links":{"self":[{"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/posts\/103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=103"}],"version-history":[{"count":19,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=\/wp\/v2\/posts\/103\/revisions\/130"}],"wp:attachment":[{"href":"https:\/\/hackingwithj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hackingwithj.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}