Latest / CyberCode Academy / Course 14 - Wi-Fi Pentesting | Episode 7: WPA/WPA2 Cracking via WPS: Reaver Exploitation, Error Bypassing, and WPS Unlocking
Transcript
- 0:00Speaker 1: Welcome back to the deep dive. You know, if you've
- 0:02Speaker 1: ever thought about network security, you've probably heard the standard
- 0:05Speaker 1: line cracking a Wi Fi network with say W two
- 0:09Speaker 1: encryption is well, it's basically impossible with brute force. If
- 0:13Speaker 1: the key's any good. You're talking millions of years. It's
- 0:16Speaker 1: supposed to be a fortress.
- 0:18Speaker 2: That's absolutely the consensus, and for a good reason. I mean,
- 0:21Speaker 2: trying to guess a sixty three character WPA key is
- 0:24Speaker 2: just it's a computational dead end. But the thing about
- 0:27Speaker 2: security so often is that it's not defined by its
- 0:30Speaker 2: strongest wall. It's defined by the little door someone added
- 0:34Speaker 2: for convenience.
- 0:35Speaker 1: And that little door is exactly what we're going to
- 0:37Speaker 1: dig into today. Wi Fi Protected Setup or WPS. It
- 0:41Speaker 1: was designed so you could just press a button or
- 0:43Speaker 1: type a short pion to connect your new printer. We're
- 0:45Speaker 1: going to walk through how that simple eight digit PI
- 0:48Speaker 1: and turns that impenetrable fortress into a solvable puzzle. Our
- 0:52Speaker 1: mission is to really unpack the layers needed to exploit this,
- 0:55Speaker 1: especially how to fight back against the countermeasures modern routers use.
- 0:59Speaker 2: It really is a fascinating cat and mouse game. The
- 1:02Speaker 2: moment WPS was introduced, it was mathematically flawed. That full
- 1:08Speaker 2: WPA key is long and random, but the wpspin is
- 1:12Speaker 2: just eight numbers, and the real key is how it's structured.
- 1:16Speaker 2: It's actually seven digits and a final checksum digit, which
- 1:20Speaker 2: just it dramatically shrinks the number of possibilities. You have
- 1:23Speaker 2: to guess. We're talking about going from you know, basically
- 1:26Speaker 2: forever to maybe just a few hours.
- 1:28Speaker 1: Okay, let's unpack that. So step one is finding a target.
- 1:32Speaker 1: Before you can do anything, you need the right tools. Specifically,
- 1:35Speaker 1: you need a wireless adapter that can listen to everything.
- 1:38Speaker 1: What we call monitor mode.
- 1:40Speaker 2: Exactly. Your laptop's normal Wi Fi card is designed to
- 1:43Speaker 2: ignore everything that isn't addressed to it. Monitor mode is
- 1:46Speaker 2: like giving it Superhero. It captures all the traffic in
- 1:48Speaker 2: the air. Once you have that, you need a very
- 1:50Speaker 2: specific kind of scanner, not one that shows you every network,
- 1:53Speaker 2: because we don't care about every network.
- 1:54Speaker 1: Right You're looking for one specific vulnerability, So you need
- 1:57Speaker 1: a tool that filters for that.
- 1:58Speaker 2: Precisely. There's a specialized utility for this. You pointed at
- 2:02Speaker 2: your wireless interface and it goes out and listens, but
- 2:05Speaker 2: it only reports back the access points that are advertising. Hey,
- 2:08Speaker 2: I have WPS turned on. This is the absolute first step.
- 2:11Speaker 1: And what kind of information does that scanner give you?
- 2:13Speaker 2: It gives you a few key things. You get the BSSID,
- 2:16Speaker 2: which is just the router's unique MA address. You need
- 2:20Speaker 2: that to target it. You also see the vendor, which
- 2:22Speaker 2: can be a hint about how it might behave. But
- 2:26Speaker 2: the most important column is one labeled LAC for lock
- 2:30Speaker 2: the lock status.
- 2:32Speaker 1: So that's tell you if the router is set up
- 2:34Speaker 1: to defend itself.
- 2:35Speaker 2: That's it exactly. If it says no, the router hasn't
- 2:37Speaker 2: been told to lock down after failed PI attempts, we can,
- 2:40Speaker 2: you know, probably proceed pretty smoothly. But if it says yes,
- 2:44Speaker 2: we know right away we're going to hit a wall,
- 2:45Speaker 2: a major defense mechanism, and we'll have to plan for that.
- 2:48Speaker 2: The bottom line is if WPS is on the strength
- 2:51Speaker 2: of WPA two, doesn't matter anymore. It's all about that
- 2:53Speaker 2: fragile little PI in Okay.
- 2:55Speaker 1: So we found our target BSSID in hand time for
- 2:59Speaker 1: the actual attack. And this uses a core tool designed
- 3:02Speaker 1: just for this job.
- 3:03Speaker 2: Right. The tool is called Reaver, and its job is
- 3:06Speaker 2: pretty simple, but it's very persistent. It just starts trying
- 3:09Speaker 2: pen combinations one by one. But here's the really clever part.
- 3:14Speaker 2: The pin isn't the final prize. The pinen is the
- 3:17Speaker 2: key to the prize. Once Reaver guesses the correct eight digits,
- 3:22Speaker 2: the router, as part of that WPS handshake, just hands
- 3:25Speaker 2: over the full WPA key.
- 3:27Speaker 1: That's the payoff. But this is where things get messy
- 3:30Speaker 1: in the real world. You launch Reaver against a target.
- 3:34Speaker 1: What's the first roadblock?
- 3:35Speaker 2: Everyone hits yep, failed to associate. You get stuck before
- 3:38Speaker 2: you even start.
- 3:38Speaker 1: Why does that happen?
- 3:39Speaker 2: The router is just it's designed to ignore you. It
- 3:42Speaker 2: sees this unknown device trying to start a WPS handshake
- 3:45Speaker 2: out of the blue, and it just doesn't respond. Reaver
- 3:48Speaker 2: tries to handle that connection process that association by itself,
- 3:52Speaker 2: but most modern routers are wise to that in just silence,
- 3:56Speaker 2: So you can't.
- 3:56Speaker 1: Rely on the tool to make that first connection. You
- 3:59Speaker 1: have to do it yourself manually.
- 4:00Speaker 2: You do. You have to basically run this this low
- 4:04Speaker 2: level fake authentication attack. At the same time, it's like
- 4:06Speaker 2: constantly sending a little signal to the router that says, hey,
- 4:09Speaker 2: I'm here, don't forget me, I want to talk.
- 4:11Speaker 1: So this is two things running at once.
- 4:12Speaker 2: Two things at once. Yeah, first you start Reaver, but
- 4:15Speaker 2: you tell it don't even try to associate. You use
- 4:18Speaker 2: a special flag to disable that feature.
- 4:20Speaker 1: Okay.
- 4:21Speaker 2: Then immediately in a different terminal you launch that fake
- 4:24Speaker 2: authentication process. You tell it to just keep pinging the
- 4:27Speaker 2: router for say thirty or one hundred seconds. It keeps
- 4:30Speaker 2: that connection warm, so Reaver in the background can focus
- 4:33Speaker 2: on its one job, guessing the pin. If you don't
- 4:36Speaker 2: do this, you just sit there and fail over and over.
- 4:39Speaker 1: So solving association is step one the real world attack, right,
- 4:42Speaker 1: But even after that you can hit another wall, right,
- 4:44Speaker 1: the infamous zero point zero zero percent loop.
- 4:48Speaker 2: Oh, yes, the worst. The connection is open. The tool
- 4:52Speaker 2: says it's running, but the progress bar just sits there
- 4:55Speaker 2: at zero forever.
- 4:56Speaker 1: It's connected, but it's not making any progress. So now
- 4:59Speaker 1: you have to figure out what the router is doing
- 5:00Speaker 1: on the inside to block you.
- 5:02Speaker 2: This is where you have to go into full on
- 5:04Speaker 2: diagnostics mode. You have to run the brute force tool again,
- 5:07Speaker 2: but this time you tell it to be extremely verbose.
- 5:10Speaker 2: You add a flag that makes it print out every
- 5:13Speaker 2: single thing it's doing every packet, every message. It floods
- 5:16Speaker 2: the screen, but you need that detail, and what.
- 5:18Speaker 1: Are you looking for in all that noise.
- 5:20Speaker 2: You'll see a lot of timeout errors, but there's a
- 5:23Speaker 2: specific pattern to look for. You'll see the tool sending
- 5:26Speaker 2: these things called WSC NAC cackets. NACK just means negative acknowledgment.
- 5:32Speaker 1: Okay, and what's that actually doing?
- 5:34Speaker 2: Well, what's happening is the router gets a pin and guess,
- 5:36Speaker 2: but instead of just saying wrong pin, it sends back
- 5:39Speaker 2: this confusing NACK message. The tool sees that NACK and
- 5:43Speaker 2: misinterprets it. It thinks, oh, there was a signal error
- 5:47Speaker 2: or something not that was a wrong guess. So what
- 5:49Speaker 2: does it do? It tries the exact same pinyan again
- 5:51Speaker 2: and again, and you're stuck in an infinite loop at
- 5:54Speaker 2: zero percent.
- 5:55Speaker 1: That's a brilliant piece of analysis. So the fix has
- 5:57Speaker 1: to be you just tell the tool to stop attention
- 6:00Speaker 1: to those anacs.
- 6:01Speaker 2: Precisely, you add another option to the command line that
- 6:04Speaker 2: basically says, hey, if you see a neck, just treat
- 6:08Speaker 2: it as a wrong PI message and move on to
- 6:10Speaker 2: the next guess. It forces the tool to stop getting
- 6:13Speaker 2: confused by the router's weird response.
- 6:15Speaker 1: So you can see how this becomes a layered process.
- 6:18Speaker 1: First solve the connection with the fake hand jake, then
- 6:21Speaker 1: solve the software loop by ignoring the nec cakes. You
- 6:26Speaker 1: have to sort of adapt your attack to how the router.
- 6:28Speaker 2: Is behaving absolutely, and that brings us to the final
- 6:30Speaker 2: and probably toughest barrier, the WPS lock. This is what
- 6:36Speaker 2: we were worried about when that first scan came back
- 6:37Speaker 2: and said, Luk, yes, this is.
- 6:40Speaker 1: The router's hardware level defense kicking in right.
- 6:42Speaker 2: Router manufacturers got smart. They programmed the firmware to say, Okay,
- 6:46Speaker 2: after four or five bad PI in attempts, I'm shutting
- 6:49Speaker 2: down the whole WPS feature for a while. Sometimes it's
- 6:52Speaker 2: just one fails attempt. Once it's locked, it won't accept
- 6:55Speaker 2: any more WPS request. You're completely blocked until the router
- 6:58Speaker 2: gets reset.
- 6:59Speaker 1: And if you hit a router that doesn't have a lock,
- 7:00Speaker 1: the math is still pretty good, right, maybe six hours max.
- 7:04Speaker 2: Yeah, if it doesn't lock, you'll get it eventually. Six
- 7:07Speaker 2: hours is a good estimate. But if it locks after
- 7:10Speaker 2: four tries, that six hour attack suddenly becomes days, maybe weeks.
- 7:15Speaker 2: It's not practical anymore.
- 7:16Speaker 1: You can't just wait for the owner to get frustrated
- 7:19Speaker 1: and unplug their router. You have to find a way
- 7:21Speaker 1: to force that reset yourself.
- 7:23Speaker 2: This is where we get to the third level of
- 7:24Speaker 2: the attack. We have to use a denial of service
- 7:27Speaker 2: or DOSS attack to force the router to restart and
- 7:30Speaker 2: clear that lock, specifically something called an authentication doss.
- 7:35Speaker 1: Okay, now I want to be clear here. How is
- 7:36Speaker 1: that different from a deauthentication attack, which just sort of
- 7:39Speaker 1: kicks people off the Wi Fi?
- 7:41Speaker 2: Great question. A death attack targets the connected users, it
- 7:44Speaker 2: tells their devices to disconnect. An authentication doss it targets
- 7:49Speaker 2: the router itself. We use a tool MDK three to
- 7:52Speaker 2: just flood the access point with a ridiculous number of
- 7:55Speaker 2: fake connection requests. These are called authentication frames. We're basically
- 7:59Speaker 2: making the router I think that thousands of new devices
- 8:01Speaker 2: are all trying to connect at the exact same time, so.
- 8:04Speaker 1: You're just overwhelming its processor with connection demands exactly.
- 8:08Speaker 2: We tell the tool to generate these requests, thousands of
- 8:11Speaker 2: them from what look like valid devices. When a little
- 8:14Speaker 2: home router gets hit with five, maybe ten thousand simultaneous
- 8:18Speaker 2: connection requests. It just can't handle the load. The memory
- 8:22Speaker 2: fills up, the processor chokes, and it's forced into a
- 8:25Speaker 2: critical restart to save itself.
- 8:26Speaker 1: And that restart that's the golden ticket.
- 8:28Speaker 2: That's it. That reboot clears the router's internal state, including
- 8:32Speaker 2: the WPS lockout timer. And the beauty is that Reaver,
- 8:36Speaker 2: our main tool, can be paused and resumed. So you
- 8:39Speaker 2: run it for four tries, the router locks, you hit
- 8:41Speaker 2: it with the MDK three doss, it reboots, the lock
- 8:44Speaker 2: is gone. Then you just unpause Reaver and it picks
- 8:47Speaker 2: up right we're left off on the next peon it
- 8:49Speaker 2: completely defeats the lock.
- 8:50Speaker 1: That is just a brilliant layered attack. It shows you
- 8:53Speaker 1: have to understand the software, the protocols, and the hardware's
- 8:55Speaker 1: breaking points.
- 8:56Speaker 2: And that synthesis is really the most important part of
- 8:59Speaker 2: this whole deep dive. We started knowing WPO two is strong,
- 9:03Speaker 2: but we found this viable attack vector by going after
- 9:06Speaker 2: the most convenient feature WPS. We learn that getting around
- 9:10Speaker 2: the defenses means this adaptive troubleshooting. You identify the target,
- 9:14Speaker 2: you manually associate, you silence the neacks, and finally you
- 9:19Speaker 2: force a hardware reset to break the locks.
- 9:21Speaker 1: So what does this all mean for someone at home?
- 9:23Speaker 1: It feels like convenience is the enemy of security. But
- 9:26Speaker 1: given all of this complexity, all the tools and flags
- 9:29Speaker 1: we've talked about, if you're just a typical user who
- 9:32Speaker 1: wants to completely eliminate this risk right now, what is
- 9:35Speaker 1: the single most important thing you should do?
- 9:38Speaker 2: The answer is actually really really simple. Log into your
- 9:40Speaker 2: router's admin page, find the setting that says Wi Fi
- 9:43Speaker 2: Protected setup or WPS and turn it off. Disable it completely.
- 9:47Speaker 2: If that feature isn't running, the vulnerability the entire attack surface.
- 9:52Speaker 2: It just disappears a.
- 9:53Speaker 1: Strong reminder that sometimes the best defense is just to
- 9:55Speaker 1: remove the weaklink entirely, something for all of you to
- 9:58Speaker 1: think about as you check your own netw work settings
- 10:00Speaker 1: this week. We hope you enjoyed this deep dive.