Latest / CyberCode Academy / Course 14 - Wi-Fi Pentesting | Episode 3: Targeted Wireless Network Discovery and Pre-Connection Bypasses
Transcript
- 0:00Speaker 1: Welcome to the Deep Dive, the show where we take
- 0:02Speaker 1: complex source materials, in this case, the mechanics of modern
- 0:06Speaker 1: wireless networking, and really break them down into something you
- 0:09Speaker 1: can use.
- 0:10Speaker 2: Today, we're definitely leveling up. We're going way past just
- 0:14Speaker 2: you know, finding a network, right. We're looking at the
- 0:16Speaker 2: techniques you need when a Wi Fi network is actively
- 0:19Speaker 2: trying to hide or block you. We're shifting the wireless
- 0:23Speaker 2: card from just listening to well gathering real intelligence to
- 0:27Speaker 2: get past those defenses.
- 0:29Speaker 1: And that's the key, isn't it, Moving from passive listening
- 0:32Speaker 1: to active intelligence gathering. It's so easy to assume that
- 0:35Speaker 1: if a network is out there, you should just see it.
- 0:37Speaker 1: But what if the first wall isn't a password but
- 0:40Speaker 1: the radio frequency itself.
- 0:42Speaker 2: That's usually the first big one.
- 0:43Speaker 1: Okay, let's unpack this. What is that first major hurdle
- 0:46Speaker 1: to just seeing everything?
- 0:48Speaker 2: It's almost always the frequency. You've got two main Wi
- 0:51Speaker 2: Fi bands, four gigaherts and five big hurts. Yes, two
- 0:54Speaker 2: point four is the old workhorse. It goes further, punches
- 0:56Speaker 2: through walls better, but it's also slower, we more congested.
- 1:00Speaker 2: Five gigaherts is the new standard, much faster but the
- 1:03Speaker 2: range is shorter.
- 1:04Speaker 1: So if I'm running a tool and I know there's
- 1:06Speaker 1: a fast new network nearby, but it just doesn't show up,
- 1:09Speaker 1: I shouldn't assume it's hidden in the classic sense. It
- 1:12Speaker 1: could just be invisible to my setup.
- 1:13Speaker 2: Precisely, that is such a common trip up your hardware.
- 1:17Speaker 2: Your wireless card might totally support five getaherts, but the
- 1:20Speaker 2: tools you're using, a lot of them default to only
- 1:23Speaker 2: scanning the old two point four gearhurtz channels. The software
- 1:27Speaker 2: is basically wearing blinders, which means.
- 1:29Speaker 1: The fix isn't about hardware, it's about telling the software
- 1:32Speaker 1: where to look exactly.
- 1:34Speaker 2: You have to explicitly tell your sniffing app something like
- 1:37Speaker 2: Aero dumping for instance, to look at those five gig
- 1:40Speaker 2: your hertz channels. We call that band a band A
- 1:43Speaker 2: got it. Yeah, And if you want to see everything,
- 1:45Speaker 2: you set it to scan band ABG that covers both
- 1:48Speaker 2: and that simple change can suddenly reveal you know a
- 1:51Speaker 2: dozen networks you never knew were there. It's a real
- 1:53Speaker 2: aha moment.
- 1:54Speaker 3: That handles visibility. Yeah, okay, let's move on.
- 1:57Speaker 1: Once we can see our target and we want to
- 1:59Speaker 1: actually do something like connect to it, we hit another wall,
- 2:03Speaker 1: and this one's all about how the wireless card is operating.
- 2:05Speaker 2: This is maybe the most critical distinction in the whole process,
- 2:08Speaker 2: the difference between monitor mode and managed mode. Right, So
- 2:12Speaker 2: think about it. When you're sniffing using those tools, your
- 2:17Speaker 2: card has to be in monitor mode. It's just an eavesdropper.
- 2:20Speaker 2: It hears everything, every packet, no matter who it's for.
- 2:23Speaker 1: It's like a spy who can hear every conversation in
- 2:25Speaker 1: a room, but can't actually step forward and speak to anyone.
- 2:28Speaker 2: A perfect analogy. But the second you want to join
- 2:30Speaker 2: that conversation, to connect to the network, you have to
- 2:33Speaker 2: switch back to its normal state, which is managed mode.
- 2:36Speaker 2: Which is managed mode. You absolutely cannot connect to an
- 2:39Speaker 2: access point from monitor mode.
- 2:41Speaker 1: So after the recon we have to flip that switch.
- 2:44Speaker 1: What's the cleanest way to do that, because sometimes software
- 2:47Speaker 1: commands get.
- 2:48Speaker 2: Messy they do, Honestly, the most reliable, fool proof way
- 2:52Speaker 2: is often to just unplug the wireless card, wait a second,
- 2:55Speaker 2: plug it back in. That forces the whole system to
- 2:59Speaker 2: reset it to it's default managed mode, ready to connect.
- 3:02Speaker 1: Okay, one last thing on this before we move on.
- 3:04Speaker 1: The network manager service sometimes to prep for these attacks.
- 3:09Speaker 1: We have to kill that service. Why and how does
- 3:12Speaker 1: that bite us later?
- 3:13Speaker 2: We do that because the normal network manager service interferes
- 3:16Speaker 2: with monitor mode. It tries to manage the connection and
- 3:20Speaker 2: that gets in the way of the low level control
- 3:22Speaker 2: our tools need.
- 3:23Speaker 3: So we turn it off.
- 3:24Speaker 2: We turn it off, but then of course you forget.
- 3:26Speaker 2: You try to connect later and the system says it
- 3:28Speaker 2: can't find any networks because the very service that does
- 3:31Speaker 2: that is hmmm, well it's off.
- 3:33Speaker 3: And the fix is just to turn it back on.
- 3:34Speaker 2: Yep. Just run a simple command like service network Manager start,
- 3:39Speaker 2: and suddenly you can see and connect to networks again.
- 3:41Speaker 1: Okay, so visibility solved, modes are clean, services are running.
- 3:46Speaker 1: Now it gets really interesting. We're moving from just scanning
- 3:49Speaker 1: everything to precision targeting. We've got our network, how do
- 3:53Speaker 1: we zero in?
- 3:54Speaker 2: We use what's called targeted sniffing. Instead of just drinking
- 3:57Speaker 2: from the fire hose of all the data flying around,
- 4:00Speaker 2: we focus. We tell our tool to look at only
- 4:02Speaker 2: two things. The target's channel number and it's BSSID.
- 4:07Speaker 1: Let's clarify BSSID. That term gets thrown around a lot.
- 4:10Speaker 2: It's critical. It's the basic service set identifier. Which for
- 4:14Speaker 2: our purposes, is just the unique hardware address, the MFC
- 4:18Speaker 2: address of the router itself.
- 4:19Speaker 1: Okay, so the SSID is the name like coffee shop guest.
- 4:23Speaker 1: The BSID is more like the router's fingerprint exactly.
- 4:26Speaker 2: It's unique coordinate in the world. And when you focus
- 4:29Speaker 2: on that BSSID and its channel, you get this amazing
- 4:32Speaker 2: focused intelligence.
- 4:33Speaker 1: And what's the immediate payoff of being that specific.
- 4:36Speaker 2: The tool's output changes. You get a whole new section
- 4:39Speaker 2: that lists all the MSc addresses, the stations or clients
- 4:42Speaker 2: that are currently connected to that one specific network.
- 4:45Speaker 3: And that list is a gold mine.
- 4:47Speaker 2: A total gold mine. It tells you who's there, who's
- 4:49Speaker 2: a legitimate user, And all of this gets saved to
- 4:53Speaker 2: a capture file, a dot cap file, right.
- 4:55Speaker 1: And inside that file is everything URL's messages, you name it.
- 5:00Speaker 1: But if the network is using WPA two, WPA three,
- 5:03Speaker 1: it's all just encrypted gibberish.
- 5:05Speaker 2: It is. The encryption works. It stops you from just
- 5:07Speaker 2: reading their data. But even encrypted packets have value. The
- 5:11Speaker 2: content is hidden, but the metadata isn't.
- 5:13Speaker 1: What kind of metadata are we talking about.
- 5:15Speaker 2: The MSS addresses of those clients We just found the
- 5:18Speaker 2: first six digits of any MSS address point to the manufacturer.
- 5:22Speaker 1: Oh that's clever.
- 5:23Speaker 2: Yeah, so you can look them up and see, oh
- 5:24Speaker 2: that's an Apple device, that one's from Huawei. It gives
- 5:27Speaker 2: you clues about the types of devices on the network,
- 5:29Speaker 2: which can be really useful.
- 5:30Speaker 1: That is fascinating. Okay, let's talk about another classic defense,
- 5:35Speaker 1: the hidden network. The network hides its name, it's SSID.
- 5:40Speaker 1: You can see the BSSID the channel, but without the name,
- 5:45Speaker 1: you can't connect.
- 5:46Speaker 2: It's a real obstacle. For sure, you need the name
- 5:48Speaker 2: for the whole connection process to even start. But if
- 5:51Speaker 2: we think about the bigger picture, a network has to
- 5:53Speaker 2: follow rules. It might hide its name most of the time,
- 5:57Speaker 2: but when a device actually connects to it, it must
- 6:00Speaker 2: yell that name during the handshake. We just need to
- 6:02Speaker 2: force a handshake to happen.
- 6:03Speaker 1: So we need to make an already connected device disconnect
- 6:06Speaker 1: and then immediately reconnect, forcing it to broadcast the name. Yeah,
- 6:10Speaker 1: but we can't connect ourselves.
- 6:11Speaker 2: To do that exactly, we use a authentication attack. The
- 6:15Speaker 2: goal is simple. We send a packet to a connected
- 6:17Speaker 2: client that looks like it came from the router, telling
- 6:19Speaker 2: it to drop the connection.
- 6:21Speaker 1: And in that split second of reconnecting, the client has
- 6:24Speaker 1: to shout out the network's name so the router knows
- 6:26Speaker 1: what it wants.
- 6:27Speaker 2: That's the moment. So the process is you run your
- 6:31Speaker 2: targeted sniff on the hidden network to find the BSSID
- 6:34Speaker 2: and crucially the M A C address of a client
- 6:37Speaker 2: that's already on it. Then, with a tool like airplay,
- 6:41Speaker 2: you send a tiny number of death packets, just two,
- 6:44Speaker 2: maybe four?
- 6:45Speaker 1: Why so few? Why not just blast them with thousands
- 6:48Speaker 1: to make sure it works?
- 6:49Speaker 2: Because that's a denial of service attack. It's noisy, it's messy.
- 6:53Speaker 2: You might crash their device, which defeats the whole purpose.
- 6:56Speaker 2: We don't want to knock them offline. We just want
- 6:58Speaker 2: them to drop for a millisecond.
- 6:59Speaker 1: Just long, and for their phone or laptop to automatically say, oh,
- 7:02Speaker 1: I was disconnected. I must reconnect too to.
- 7:04Speaker 2: This network name. And that name is broadcast in plaintext,
- 7:07Speaker 2: and our sniffing tool, which is listening the whole time,
- 7:10Speaker 2: just grabs it.
- 7:11Speaker 1: Problem solved the elegance of exploiting predictable behavior. Yeah, okay,
- 7:17Speaker 1: so the hidden network is revealed, We switch our card
- 7:20Speaker 1: back managed mode, restart the network manager. We try to
- 7:23Speaker 1: connect and it still says no.
- 7:26Speaker 2: Then you're probably up against the final pre connection hurdle.
- 7:30Speaker 2: MA filtering. Access is being controlled based on the unique
- 7:33Speaker 2: hardware address of your device.
- 7:35Speaker 1: And this comes in two slavers, right, which means two
- 7:38Speaker 1: different strategies.
- 7:39Speaker 2: That's right. The easier one is a blacklist. The router
- 7:42Speaker 2: has a list of specific devices that are banned. Anyone
- 7:45Speaker 2: else is fine.
- 7:46Speaker 1: So the bypass is easy. You just change your MAY
- 7:48Speaker 1: address to a random one that's not on the list.
- 7:50Speaker 2: Simple as that. Use a mechchanger tool, get a new
- 7:52Speaker 2: random address, and you're in.
- 7:54Speaker 1: But the other method, the white list, that's the real wall.
- 7:57Speaker 1: It blocks everyone by default except for a few preapproved devices.
- 8:01Speaker 2: The whitelist is tough. A random angme address will fail
- 8:05Speaker 2: one hundred percent of the time. It won't be on
- 8:06Speaker 2: the approved list. This is where that intelligence we gathered
- 8:10Speaker 2: earlier becomes non negotiable.
- 8:11Speaker 1: So we have to go back to our targeted sniffing results,
- 8:15Speaker 1: to that list of clients that were already connected.
- 8:17Speaker 2: Exactly we know for a fact that their MC addresses
- 8:21Speaker 2: must be on the white list. So the solution is well,
- 8:25Speaker 2: it's digital identity theft.
- 8:26Speaker 1: Basically, you clone the MC address of an approved device
- 8:30Speaker 1: onto your own card. But wait a second, if that
- 8:33Speaker 1: device is still online using that address, won't that cause
- 8:37Speaker 1: a huge conflict on the network.
- 8:38Speaker 2: That's a great question, and in a perfect world, yes,
- 8:41Speaker 2: it would cause an IP conflict or an ARP table mess.
- 8:45Speaker 2: But in the real world of Wi Fi, the check
- 8:47Speaker 2: often only happens at the very beginning, at the initial connection.
- 8:50Speaker 3: During the association, right.
- 8:52Speaker 2: The router sees a whitelisted MC address asking to join,
- 8:55Speaker 2: and it says come on in. It might cause some
- 8:57Speaker 2: small glitches for the two devices later, but it often
- 9:00Speaker 2: doesn't stop the initial connection, which is our goal. Your
- 9:03Speaker 2: device is now seen as a trusted insider.
- 9:05Speaker 1: So the main takeaway here is if you've done everything
- 9:08Speaker 1: else right, you found the name, you have the password,
- 9:10Speaker 1: you're in the right mode, but you just cannot connect.
- 9:13Speaker 1: It is almost certainly whitelist and your only move is
- 9:16Speaker 1: to clone a known, good MS address.
- 9:19Speaker 2: That's the synthesis of it all. Really, we've tackled the
- 9:22Speaker 2: three big hurdles before you even get to a password,
- 9:25Speaker 2: frequency limitations, hidden names, and MP based controls, And in
- 9:29Speaker 2: every case the solution wasn't some brute force attack.
- 9:32Speaker 3: It was the intelligence gathering that came first.
- 9:35Speaker 2: It was just listening. Observing the clients already on the
- 9:37Speaker 2: network gave us everything we needed to bypass the defenses.
- 9:40Speaker 1: It really highlights something fundamental about network security.
- 9:43Speaker 3: Doesn't it.
- 9:44Speaker 2: Absolutely? I mean think about it. If that network had
- 9:46Speaker 2: been open with no encryption, that first capture file would
- 9:50Speaker 2: have had everything usernames, messages, passwords all readable right away.
- 9:55Speaker 2: The fact that encryption forces us to go through all
- 9:57Speaker 2: these other steps just proves how vital it is.
- 10:00Speaker 1: And this whole process shows that security so often relies
- 10:03Speaker 1: on devices just being predictable. They have to reassociate, they
- 10:08Speaker 1: must provide their MSSE address. The devices need to connect
- 10:12Speaker 1: becomes the vulnerability.
- 10:13Speaker 2: It really does. If all these techniques rely on exploiting
- 10:16Speaker 2: that predictable client behavior, it really makes you wonder what
- 10:21Speaker 2: other layers of security are built on that same fundamental assumption.
- 10:24Speaker 2: The assumption that the client device is always being totally
- 10:27Speaker 2: honest about who it.
- 10:28Speaker 1: Is something for you to think about. Yeah, but to
- 10:31Speaker 1: really lock this in, here's a little challenge for you.
- 10:34Speaker 1: Imagine you're trying to connect.
- 10:35Speaker 3: To a network.
- 10:36Speaker 1: You know the name, you even have the password, but
- 10:39Speaker 1: the connection just fails every time you suspect it's using
- 10:42Speaker 1: a whitelist. What is the one piece of information you
- 10:45Speaker 1: absolutely need and what specific action would you take to
- 10:48Speaker 1: find it.
- 10:49Speaker 2: The answer is you need the specific m MAL address
- 10:51Speaker 2: of a client that's already connected, and you'd find it
- 10:54Speaker 2: using targeted sniffing by passively listening to that network's traffic.