Latest / CyberCode Academy / Course 23 - WiFi Hacking with Raspberry Pi | Episode 5: Cracking Wi-Fi Passwords With Raspberry Pi
Transcript
- 0:00Speaker 1: Okay, take a look at the corner of your room,
- 0:02Speaker 1: or maybe up on that shelf behind your TV. It's
- 0:05Speaker 1: a little plastic box there right, yeah, probably blinking away.
- 0:07Speaker 1: That's your WiFi rader. We just we treat it like
- 0:11Speaker 1: a light switch. You flick it on, Internet happens, and that's.
- 0:15Speaker 2: It, right, You stop thinking about it. But you trust
- 0:17Speaker 2: it with everything, your bank details, your private messages, all
- 0:20Speaker 2: of it, which.
- 0:21Speaker 1: Is precisely the problem we're diving into today. Yeah, because
- 0:25Speaker 1: that trust, that's the vulnerability.
- 0:28Speaker 2: It's always the vulnerability, and that little box is the
- 0:31Speaker 2: gatekeeper exactly.
- 0:32Speaker 1: And we're looking at how that trusted gatekeeper can be
- 0:35Speaker 1: completely compromised. And the really unsettling part this isn't being
- 0:40Speaker 1: done with some massive supercomputer. It's a tiny device that
- 0:43Speaker 1: costs what less than a pizza, and it looks harmless.
- 0:46Speaker 2: We're talking about a raspberry pie.
- 0:47Speaker 1: Yeah. Most people hear raspberry pie and they think, oh,
- 0:49Speaker 1: a fun little project for kids, or maybe a retro gaming.
- 0:52Speaker 2: Thing, right, not a portable hacking station, but that's what
- 0:55Speaker 2: it becomes. Our sources really break down how this little
- 0:59Speaker 2: credit card size can can become a localized nightmare for
- 1:03Speaker 2: a wireless security.
- 1:04Speaker 1: It's such an inversion of what you'd expect. You don't
- 1:06Speaker 1: need a van full of gear anymore. You just need
- 1:08Speaker 1: a battery pack and this tiny little board. You do.
- 1:11Speaker 2: But and this is critical, before we even get into
- 1:14Speaker 2: the how, we have to talk about the why, the rules.
- 1:17Speaker 1: The White had disclaimer. This is not just a formality.
- 1:21Speaker 1: This is the line between research and well a felony.
- 1:25Speaker 2: It is absolutely the line. The techniques we're about to
- 1:27Speaker 2: discuss are the real deal. They are what criminals use,
- 1:30Speaker 2: but they're also what security pros use to test a
- 1:32Speaker 2: network's defenses. The only difference is permission.
- 1:35Speaker 1: So if you do this on your own WiFi, you're
- 1:38Speaker 1: learning you're testing your own.
- 1:39Speaker 2: Locks exactly, that's a security audit. If you do it
- 1:42Speaker 2: on your neighbor's network or the Starbucks down the street,
- 1:45Speaker 2: that's illegal.
- 1:46Speaker 1: Seriously, illevile, we're talking federal crimes in many places.
- 1:49Speaker 2: We are, so for this entire discussion, the assumption is
- 1:53Speaker 2: we are the good guys. We are auditing a network
- 1:56Speaker 2: we own or have explicit permission to test.
- 1:59Speaker 1: Okay, permission grant. Let's get into the setup. The pie
- 2:02Speaker 1: itself is running a specific operating system, usually Collie Linux.
- 2:06Speaker 2: Yeah, Collie is the standard for this stuff. It's basically
- 2:09Speaker 2: a version of Linux that comes preloaded with all these
- 2:11Speaker 2: security tools. When you install that on a Pie, you've
- 2:15Speaker 2: just built yourself a security Swiss army knife.
- 2:18Speaker 1: I like that Swiss Army knife because it's so small.
- 2:20Speaker 1: You can run it headless, right, which.
- 2:21Speaker 2: Just means no monitor, no keyboard plugged into it.
- 2:24Speaker 1: So how do you even control it?
- 2:26Speaker 2: You you connect to it remotely from your laptop. You
- 2:29Speaker 2: use something called SSH secure show. It's like opening a
- 2:31Speaker 2: little tunnel. You open a terminal on your main computer,
- 2:34Speaker 2: that black window with the blinking cursor, and you're in
- 2:38Speaker 2: your keyboard is now controlling the Pie.
- 2:40Speaker 1: You're typing commands, no clicking.
- 2:42Speaker 2: Icons, exactly, command line.
- 2:45Speaker 1: Now the start of the show. Here. The main tool
- 2:48Speaker 1: is something called wi Fight. The sources make it look
- 2:51Speaker 1: so simple. You just type pseudo wi fi.
- 2:53Speaker 2: Well, that's both the beauty and the danger of it.
- 2:56Speaker 2: See years ago, this was a manual process. You had
- 2:59Speaker 2: to type all these long, complicated commands for every single step.
- 3:02Speaker 1: And we fight is what a rapper?
- 3:04Speaker 2: It's a rapper. Yeah, it's an automated script that basically
- 3:08Speaker 2: runs all those other tools for you. It's the conductor
- 3:11Speaker 2: of the orchestra. It scans, it finds a target, it
- 3:13Speaker 2: tries one attack, and if that doesn't work, it just
- 3:15Speaker 2: moves on to the next one. It makes the whole
- 3:18Speaker 2: process accessible.
- 3:19Speaker 1: But you need the right hardware first. You can't just
- 3:22Speaker 1: use the pies built in Wi Fi. The source says
- 3:25Speaker 1: you need a specific external adapter. Why is that.
- 3:29Speaker 2: Yeah, this is the key, your normal Wi Fi card,
- 3:32Speaker 2: the one in your phone or laptop. It's designed to
- 3:35Speaker 2: be polite. It only listens for data that's specifically addressed
- 3:38Speaker 2: to it. Everything else is just noise that it ignores.
- 3:41Speaker 1: And for hacking, you need to hear the noise.
- 3:43Speaker 2: You need to hear everything. You need a card that
- 3:45Speaker 2: supports what's called monitor mode.
- 3:46Speaker 1: Okay, so what's the difference managed mode versus monitor mode.
- 3:50Speaker 2: Think of it like being at a loud party. Managed mode,
- 3:53Speaker 2: your normal mode is you focusing on the one person
- 3:55Speaker 2: you're talking to. You're filtering out all the other conversations.
- 3:58Speaker 1: Right.
- 3:58Speaker 2: Monitor mode is like closing your eyes and suddenly being
- 4:01Speaker 2: able to hear every single conversation in that room all
- 4:05Speaker 2: at once.
- 4:05Speaker 1: You're a digital eavesdropper.
- 4:07Speaker 2: In a sense. Yeah, but there's a second piece you
- 4:09Speaker 2: need packet injection injection. Listening is passive, packet injection is active.
- 4:15Speaker 2: It means you can't just listen to the conversations. You
- 4:17Speaker 2: can shout across the room and force people to react.
- 4:20Speaker 2: That combination is what turns the card into a weapon.
- 4:24Speaker 1: Okay, so let's walk through it. Pie is on special
- 4:27Speaker 1: card is plugged in, and we've run Wi Fi. The
- 4:30Speaker 1: terminal starts scrolling and it's listing all the nearby networks
- 4:33Speaker 1: and this is where it looks for what do you
- 4:35Speaker 1: call it?
- 4:36Speaker 2: The low hanging fruit, the WPS vulnerability, Wi Fi protected setup?
- 4:40Speaker 1: Oh, the push button thing. My parents love that. No
- 4:42Speaker 1: typing in long passwords.
- 4:44Speaker 2: And that's the problem. I mean, convenience is the absolute
- 4:46Speaker 2: enemy of security. WPS was a great idea for ease
- 4:49Speaker 2: of use, but the way it was built created massive,
- 4:53Speaker 2: massive loophole.
- 4:54Speaker 1: How I mean, why does Wi fi get so excited
- 4:57Speaker 1: when it sees a network with WPS enable?
- 5:00Speaker 2: Because it doesn't have to guess the actual password anymore.
- 5:03Speaker 2: It just has to guess an eight digit PI. And
- 5:07Speaker 2: even that is easier than it sounds, because the router
- 5:10Speaker 2: checks the first four digits separately from the last.
- 5:13Speaker 1: Four, so it tells you if you're halfway right.
- 5:15Speaker 2: It tells you if you're halfway right. Cuts the problem
- 5:17Speaker 2: down to something a computer can guess really really fast.
- 5:21Speaker 2: But the attack, the source mentions, is even slicker. It's
- 5:24Speaker 2: called pixie dust pixy dust.
- 5:26Speaker 1: It sounds harm right, it's not. It turns out a
- 5:29Speaker 1: lot of router manufacturers were let's say, lazy with how
- 5:34Speaker 1: they generated random numbers for the WPS process.
- 5:37Speaker 2: Lazy seems like a bad word in cryptography.
- 5:39Speaker 1: It's a catastrophic word. The pixie dust attack basically looks
- 5:42Speaker 1: at the numbers exchanged in a single WPS attempt, and
- 5:45Speaker 1: because they aren't truly random, it can work backward and
- 5:48Speaker 1: just calculate the PI, no guessing required, so it doesn't
- 5:51Speaker 1: even have to stay there trying over and over.
- 5:53Speaker 2: Nope, it grabs the data, does the math offline, and boom,
- 5:57Speaker 2: it has the pon And once it has the PON,
- 6:00Speaker 2: happily hands over the real Wi Fi password.
- 6:02Speaker 1: And the source shows this happen in what ten seconds? Yeah,
- 6:06Speaker 1: the password just appears on screen.
- 6:08Speaker 2: It's game over. If you have an older router with
- 6:10Speaker 2: WPS on, you might as well not have a password
- 6:12Speaker 2: at all.
- 6:13Speaker 1: Wow. Okay, so note to everyone listening, go disabled WPS,
- 6:18Speaker 1: like right now. But let's say you've already done that.
- 6:21Speaker 1: WPS is off, the screen door is locked.
- 6:24Speaker 2: Now what now we have to deal with the steel
- 6:25Speaker 2: door the WPA two handshake?
- 6:28Speaker 1: Right, the source shifts here. They force the hard way
- 6:32Speaker 1: and this brings in the idea of a dictionary attack.
- 6:35Speaker 2: Yes, but to use the dictionary, you first need to
- 6:37Speaker 2: get a copy of the lock. And that lock is
- 6:40Speaker 2: the handshake.
- 6:41Speaker 1: Explain that what is the handshake?
- 6:42Speaker 2: When your phone connects to your Wi Fi, they perform
- 6:45Speaker 2: the sort of mathematical dance to prove they both know
- 6:48Speaker 2: the password without ever saying the password out loud.
- 6:50Speaker 1: It's called the four way handshake, right, That's the.
- 6:52Speaker 2: One and the result of that dance is a unique
- 6:55Speaker 2: cryptographic hash, an encrypted fingerprint of the password.
- 6:59Speaker 1: And the pie is job is to steal that fingerprint exactly.
- 7:02Speaker 2: If the pie can record that handshake, it has the
- 7:05Speaker 2: encrypted file, not the password itself, but the key to
- 7:08Speaker 2: finding it.
- 7:08Speaker 1: Now, the source mentioned something you kind of glossed over.
- 7:11Speaker 1: It called pmkid.
- 7:14Speaker 2: The tool tried that first, Yes, and that is super important.
- 7:18Speaker 2: Pmkid is a newer attack factor. It's related to how
- 7:22Speaker 2: modern mesh routers let you roam around the house without disconnecting.
- 7:26Speaker 1: And it's worse than the regular handshake attack.
- 7:28Speaker 2: Much worse in a way, because for a normal handshake capture,
- 7:32Speaker 2: you need a device a client to be connecting, you
- 7:35Speaker 2: need a victim. With a pmkid attack, you can attack
- 7:39Speaker 2: the router directly, even if nobody's home. The router just
- 7:42Speaker 2: kind of advertises the hash. It's a clientless attack.
- 7:46Speaker 1: That is a huge deal. But okay, let's say the
- 7:48Speaker 1: router isn' vulnerable to that. We're back to needing to
- 7:51Speaker 1: capture a regular handshake. But what if all my devices
- 7:54Speaker 1: already connected. There's no handshake happening.
- 7:56Speaker 2: Right, everyone's already sitting down at the party. So you
- 7:58Speaker 2: flip the table over.
- 7:59Speaker 1: You're talking about it jamming attack, deauthentication. It's aggressive. The
- 8:03Speaker 1: Raspberry Pie uses that packet injection feature we talked about.
- 8:06Speaker 1: It pretends to be the router and sends a tiny
- 8:09Speaker 1: message to your phone that just says disconnect now.
- 8:11Speaker 2: And does the user even see it barely. Your Wi
- 8:14Speaker 2: Fi icon might flicker for a second, but your phone
- 8:17Speaker 2: is designed to reconnect instantly. It just thinks the signal dropped.
- 8:20Speaker 1: And that's the trap.
- 8:21Speaker 2: That is the trap because in that split second of reconnecting,
- 8:25Speaker 2: it performs the four way handshake, and the pie, which
- 8:28Speaker 2: is in monitor mode listening to everything, just snatches it
- 8:31Speaker 2: right out of the air.
- 8:32Speaker 1: So now the hacker has the encrypted file. They don't
- 8:35Speaker 1: even need to be near your house anymore.
- 8:36Speaker 2: The heist is done. Now they just have to crack
- 8:38Speaker 2: the safe. They can take that file home and use
- 8:41Speaker 2: a more powerful computer. And this is where that file
- 8:44Speaker 2: rock you dot txt comes in dictionary.
- 8:46Speaker 1: The command of the source is pseudo Wi Fi dash
- 8:49Speaker 1: dick rock you dot txt.
- 8:51Speaker 2: What is that file rock you dot txt is. It's
- 8:54Speaker 2: a legend in the security community. It's a text file,
- 8:57Speaker 2: a huge one. It has about fourteen million passwords that
- 9:00Speaker 2: were leaked in a real data breach years ago.
- 9:02Speaker 1: Fourteen million real passwords that real people actually used.
- 9:05Speaker 2: That's the crucial part. Humans are predictable. We use password one,
- 9:10Speaker 2: two three, we use I love you, we use our
- 9:12Speaker 2: favorite ban or dog's name. The dictionary attack is just
- 9:16Speaker 2: the computer taking that list of fourteen million common passwords
- 9:20Speaker 2: and trying them one by one against the stolen handshake.
- 9:23Speaker 1: It does the math on a word and checks does
- 9:25Speaker 1: this match the fingerprint, if not on.
- 9:28Speaker 2: To the next one thousands or millions of times a second.
- 9:32Speaker 1: And in the demo, because the password was weak, it
- 9:34Speaker 1: found it almost instantly, just popped up on the screen.
- 9:38Speaker 1: This is really the core lesson, isn't it.
- 9:40Speaker 2: This is the entire takeaway. If your password is in
- 9:42Speaker 2: that dictionary or is a simple variation of it, you
- 9:45Speaker 2: are vulnerable. It's just a matter of time.
- 9:47Speaker 1: But what if I add a one on the end
- 9:50Speaker 1: or an exclamation point?
- 9:51Speaker 2: The tools are smart. They have what are called rules
- 9:53Speaker 2: or mutations. They know people do that, so they'll take
- 9:55Speaker 2: the word password from the dictionary and automatically try password one,
- 10:00Speaker 2: its sword password, all of those common variations.
- 10:02Speaker 1: How do you actually beat it? If they can grab
- 10:04Speaker 1: the handshake and they have this massive list, are.
- 10:06Speaker 2: We just no? No, The math is still on your side,
- 10:09Speaker 2: but you have to use it. The dictionary attack only
- 10:12Speaker 2: works if your password is guessable. If it's not in
- 10:15Speaker 2: the list, the attacker has to fall back to a
- 10:17Speaker 2: brute force.
- 10:18Speaker 1: Attack, trying every single possible combination of characters AA AaB precisely.
- 10:25Speaker 2: And that's where complexity and length become your shield. A
- 10:28Speaker 2: truly random twelve character password with symbols and numbers. The
- 10:32Speaker 2: number of combinations is so astronomical a Raspberry Pie would
- 10:35Speaker 2: literally never finish trying them all, not in our lifetime.
- 10:38Speaker 1: So the vulnerability isn't the WPA two encryption itself. It's us.
- 10:42Speaker 1: It's the person choosing password twenty twenty four.
- 10:45Speaker 2: It's always the human. These tools just automate exploiting our predictability.
- 10:49Speaker 1: That pmkid attack you mentioned, the one that works even
- 10:52Speaker 1: if no one is home. It really shows this is
- 10:55Speaker 1: an arms race, doesn't it. We treate a defense, they
- 10:57Speaker 1: find a way around it.
- 10:58Speaker 2: It is an ongoing arms race, absolutely, But the fundamentals
- 11:01Speaker 2: of good defense don't really change. Turn off the features
- 11:04Speaker 2: you don't need, like WPS, and use long, unpredictable pass phrases.
- 11:08Speaker 1: Okay, speaking of that, I have a review question for you,
- 11:11Speaker 1: the listener, because I want this idea of the dictionary
- 11:14Speaker 1: attack to really sync in. Go for it all right.
- 11:17Speaker 1: We know the tool uses a word list to guess
- 11:20Speaker 1: the key for the encrypted locket stole, So the question
- 11:23Speaker 1: is why is a password like battery staple horse three
- 11:29Speaker 1: random unconnected words so much stronger against this attack than
- 11:34Speaker 1: something that looks complex like pt SS.
- 11:37Speaker 2: That's a great question. It gets to the heart of
- 11:39Speaker 2: how this actually works.
- 11:41Speaker 1: It's about length versus what looks complex.
- 11:43Speaker 2: It's about the search space. PTSS might trick a human,
- 11:46Speaker 2: but it's short. A computer can root force five characters
- 11:49Speaker 2: in no time at all, but battery staple horse. Even
- 11:52Speaker 2: though the words themselves are simple, the overall length is huge.
- 11:55Speaker 1: And crucially, that specific three word phrase probably isn't in
- 11:59Speaker 1: any diction exactly.
- 12:01Speaker 2: The tool will run through all fourteen million words in
- 12:03Speaker 2: rocky txt, it'll try its mutations, and it'll come up
- 12:06Speaker 2: with nothing. It will just say password not found. You
- 12:09Speaker 2: basically created a password that isn't in the book.
- 12:11Speaker 1: It totally changes how you see those little WiFi bars
- 12:14Speaker 1: on your phone. Yeah, behind them is this constant, invisible
- 12:17Speaker 1: battle of packets and handshakes.
- 12:19Speaker 2: And a tool like Wi Fi on a Raspberry Pie
- 12:21Speaker 2: just makes that invisible war visible. It lets you see
- 12:25Speaker 2: the cracks in your own foundation.
- 12:26Speaker 1: It's empowering. Actually, when you know how the lock can
- 12:29Speaker 1: be picked, you understand why you need a better lock.
- 12:31Speaker 2: Knowledge is the only real security. Just hoping nobody notices
- 12:35Speaker 2: your network isn't a strategy.
- 12:36Speaker 1: So here's your homework. Go log into your router. I
- 12:39Speaker 1: know it's a pain. Find that setting for WPS and
- 12:42Speaker 1: turn it off, and then look at your Wi Fi password.
- 12:45Speaker 1: If it's your pet's name, or if it's in this
- 12:47Speaker 1: deep dive, it's time for a change.
- 12:50Speaker 2: Make the math hard for them. That's the goal.
- 12:53Speaker 1: That's all for this deep dive. We'll be back soon
- 12:56Speaker 1: with more on the hidden mechanics of your digital world.
- 12:58Speaker 1: Until then, keep learning and stay secure.