Gabriel Ryan, I'm a security engineer at Gotham Digital Science. We do pen testing and secure source review, stuff like that. So we're going to be talking about two kinds of rogue AP attacks today. We're going to be talking about the evil twin attack and the karma attack. So let's talk about evil twin attacks. So suppose we're sitting downstairs, and we're all connected to one of the legitimate access points for DEF CON open network, you know, for example. And that access point is running on Channel 6, and it has an SSID set to DEF CON open Wi-Fi or whatever it is. If we were to spin up our own hotspot, and with the same SSID in the same channel, how would our connected laptops be able to tell the difference between the legitimate access point and the one we just created? Well, it's kind of a trick question because actually they can't. The factor that is used in that scenario is whatever access point has the better signal strength and the better signal-to-noise ratio, that is what gets connected to. So, you know, if we were to do this, and if we were to set up our own access point with the same SSID and channel and boost our TXOs just to slightly better than the legitimate access point, all these wireless clients would drop their connections from the legitimate one and connect to us. And when this happens, we essentially have the perfect. Create the access point and then route it out to the internet and capture everything in between. So there's some pretty obvious advantages to this attack. I mean, one of them is that it's really easy to perform. You just need something that's capable of making a hotspot. It's also really hard to detect, and we'll go over this a bit later. And it's also very targeted. If you're working in a red team situation and you only want to attack a specific network, this is really good because by default, this kind of attack only targets an access point on the network that you're intending to. So if your scope is limited to DEF CON open, for example, and you spin up a hotspot for DEF CON open, you're probably only going to get clients that are connected to the target that's in scope. Disadvantages. Well, I mean, for one thing, it doesn't work out of the box against protected networks. So if you have a WPA protected network or something like that, unless you have that pre-shared key, which presumably if you're doing this, you probably don't. Unless you have that pre-shared key, you're not actually going to have a lot of luck. The way you get around this is by basically, so we're in the wireless village. I'm assuming you guys, OK, so show of hands, who does not know how? I'm assuming the one thing that would happen is I'm not going to have a chance to ask for an answer. And I'm going to be able to get something out of it. I'm going to have to give a word to someone and try to answer their question properly. It's going to be a bit confusing to see if we're getting an answer out of that. because it could be that you're trying to get a little bit of information out of that. It could be that you're trying to get This could be something that you're using for using a particular network you're using on the network. So that's one issue. they are, you'll automatically connect to it. So what we can do in this situation is that we can sniff for packets, for per request packets, from devices that are currently connected to the target network. We can identify one that a lot of them have in common. Then we can deauth the target network while simultaneously running a rogue AP that matches that preferred network. And all these devices, when they drop off the deauth network, they'll connect to us instead. But it's a little more complicated, which is kind of why it's not so great against protecting networks. So how do we detect evil twin attacks? Well, I mean, for one thing, we can use whitelisting. So the standard way to do this is just to keep an inventory of what access points belong to your network. If you have a BSS ID that is not belonging to your whitelist, it's not on your whitelist, then at that point you know that something shady is going on. So for example, this guy is saying, I have the ESS ID Starbucks, and your IDS system picks this up and checks the whitelist. And it's not there, so the BSS ID is not there, so you just take action accordingly. So this doesn't always work, because a motivated attacker can simply use like arrow dump or something like that to create a list of all the, to basically figure out what are all the valid BSS IDs for your wireless network. So at that point, it's pretty easy to just spit up an AP that has the BSS ID matching one of your legitimate access points as well, not just the ESS ID and channel. So this actually makes evil twins really hard to detect. The way we get around this is by paying attention to signal strength, however. So if I have an access point sitting up here, like in the front of the room, and we have like a packet sniffer. Like it's, you know, chilling over there in the corner. The signal strength from my access point to that packet sniffer should not change very much. You know, it should stay like within a, provided, you know, and of course, you know, with like interference and stuff like this, this doesn't always hold true. But in most cases, it should stay within a certain threshold. So what this means is that, you know, if we establish a baseline TX value from our packet sniffer to our access point, you know, and then listen for probe requests, or probe responses, should I say, from the claim to come from our access point that have the BSS ID, ESS ID, and same channel as one of our legitimate access points, but there's a TX value that is really noticeably different from our legitimate access point, then we know that it's probably a rogue AP. So quick demo of how this works. I'm actually going to spin up, please don't sue me, DEF CON. So we're going to, right here, so I'm spinning up a server here, and there's going to be a web interface on here. And we're going to see like an alert pop up when this happens. And now we're starting up our packet sniffer. And it's just kind of chilling here. And if the demo gods are mergeable, when I spin up this pseudo rogue access point, we should see something. Ah, yes, here it is. So we have the alert show up on the screen. So this is like a really, really cheap way to easily spot these rogue AP attacks. And it literally can be done in a few lines of Python code. So I'm going to kill host APD really fast, because it's not quitting. All right. So, Karma attacks. So the second kind, and this is actually the later evolution of your rogue AP attack, is the Karma attack. Remember how we mentioned that all your 802.11 devices constantly send out probe requests? How many of them send out probing requests? Because we're trying to get to this point How many of them go about doing probe requests? Well, here's a couple. So some of these are called probe requests. And if they don't say probe requests, they're going to get to this batch right there. And this is the first one we're going to be doing, probably the next one. This is the first one we're going to be doing. So this is a very low full loadmentation if you're at the point that it's in the 802.11 network. access point or some kind of access point and just have it gratuitously respond to every single probe request that it receives. So for example, I'm the access point and some client over there sends out a probe request for Linksys. And if I see that and I respond saying, yeah, I'm Linksys, go ahead and connect, that device will automatically connect. And then if from the same access point we send out another probe, we receive another probe request for a different ASUS ID, AT&T Wi-Fi, and the rogue AP sends out a probe request, the rogue AP actually sends a response to that for AT&T Wi-Fi, then the second client will connect as well. So what you have is a situation where you have a single access point that is responding to every single probe request that it receives, regardless of whether or not it's a probe request for itself or some other thing. So this is the kind of tech that you often see with a lot of these, I can't really name brand names, but for example, these very fruity, kind of like tropical-looking fruit name devices that you tend to buy at security conferences. This is how they work. You just set one up, and then you just listen for requests and respond to all of them. And then the device thinks that it's a legitimate AP and connects. And as those of you who may have purchased these devices, you may know it's a relatively automatic process. You turn it on, the script runs, and you just start pwning the shit out of everything nearby. So they're fast. There's minimal supervision. Supervision or recon required. And you can still target nearby APs. The problem with these kinds of attacks is that they're really easy to spot. And because I've been in Vegas all week and I've been in a lot of bars, let me use a bar analogy. So suppose that you walk into a bar, and you're looking for this dude named Jake. So you walk into the bar, and you say, hey, is anyone here named Jake? And then some sketchy dude with a ski mask and a DEF CON badge stands up in the back and is like, yeah, yeah, I'm Jake. So you might be actually inclined to believe him, because why would this guy be making this up? Well, let's rewind a bit, and suppose that we're in the business of bullshit detection. So this time we have a little notepad, a pen and paper with us. We walk into the bar and say, hey, is anybody here named Jake? Sketchy guy in a DEF CON badge stands up and asserts that his name is Jake. You write down, OK, yeah, that guy says his name is Jake. Immediately step back out of the bar, and you step back into the bar and say, is anybody here named Katie? And Jake now is saying that he's Katie. Well, the same principle can be applied to rogue access points. You know? If you see, if you send out a probe request for some random hash string and you get a response, well, I mean, that itself should tell you that something shady is going on. You know? Like if I'm looking for ESS ID, oh, whatever that says on the, yeah. I probably shouldn't receive a probe response for it. But suppose we do. OK, we can go with that. We send another one for a second randomized hash string. Well, I mean, when that happens, if we get a single BSS ID, a single piece of hardware, responding for both of these, that's probably a good indication that, you know, it resembles one of these citrus-like devices that we've been seeing a lot. And in that case, you can try to locate it or de-auth it or whatever. So for the sake of time, I'm going to skip the demo for that one. Also, I don't have a pineapple. Can't say that. Yeah, you know what I mean. With me. But let's talk about some, like, existing solutions to, like, you know, preventing and detecting rogue AP attacks. So Aruba Networks makes this thing called an airwave. Last time I talked about it. I checked the price list. It's, like, $3,000. And it's awesome. And it can detect a lot of this stuff. Unfortunately, it's a little out of the reach of the kind of network admin that is going to be the target of this. You know, if I want to steal, like, 50 credit card numbers or 500 credit card numbers, I'm not going to be going after Enterprise Network. I'm going to be sitting up in a coffee shop, you know, in Harlem or something like that and seeing who are on the subway and seeing, like, you know, who I can actually ensnare that way. You know. Cisco makes another really, really awesome product. Actually in the references of these slides, which I'm going to be releasing online, there's a reference to their slick sheet about, like, how these things work. And it's frankly genius. But they're also, like, probably out of the price range of the kind of network admin that's going to be working on a network that's going to be the target of this kind of thing. So the same is true with the other example of this, you know, Fluke Networks. They have an analyzer that is, like, $4,000 for a software license. It's great, once again. But it's not really something that, you know, your typical network admin is going to be able to afford. So I think what we can do is to ask ourselves, what are the bare minimum resources needed for effective rogue AP mitigation? So if you have to run an open Wi-Fi network, case in point, actually, we did this at B-Sides earlier in the week. This is pretty much how we handle our wireless security. But if you have to run an effective, you know, if you have to open... If you have to open... If you have to run an open Wi-Fi network and, you know, you need to provide rogue AP protection, you know, how do you do this? What is the minimum cost here? And frankly, you know, using these algorithms that we just described, you can do this with, you know, just a Raspberry Pi and, you know, about 500 lines of Python code, a little more if you want to get into fancy client-server stuff, and just, like, a cheap, like, $10 TP-Link adapter. And that should pretty much cover it. So that brings the cost of rogue AP protection down to about 45 bucks, you know, per unit. So if you... Another thing, I mean, this... If you know math, statistics, or physics really well, that TX single strength thing that we did earlier, I mean, it works pretty well, but, like, it's not great. It was built using pretty much hacker math. But if you know math math and want to contribute to this project, you know, feel free to send out an email to research at GDSsecurity.com. Because we'd love to actually have someone who can do math helping with this. And if you want to mess around with the source code, it's at github.com slash solstice slash sentrygun. And you can get the server, which the client thing he's talked to, at solstice slash sentryguns dash server. And there will be a read me up there in an hour. And that's it, basically. Any... Thanks. Thanks. Any questions? So the TP-Link TLWN722N is an external Wi-Fi adapter that you can get on Amazon. It's just one of many that pretty much do the same thing. But it's basically an external network adapter that can... It's really good at sniffing packets. What's up, dude? So when we started working on this initially, I kind of thought that you'd need two separate cards for sniffing a D off. Turns out you don't. With the Atheros cards. With the ones I plugged in right here, actually you do. And I don't know why. It's multi-channel. See, this guy knows Wi-Fi. I know Python. So it's... What's up, dude? Could you do this one with a Mac? Like, the filtered... With the... Leave me on OSX? Diagnostic and stuff. I don't know. I mean, most of this is hand rolled. It's running on Linux. I don't... I don't think so. But don't quote me on it. Any other questions? What's up? From the Carvon team. Q. Why don't you just change your BSSID in the second one? Because you have a new one. A new one. Q. Why don't you change the BSSID? Good question. Good question. So, and this question comes up a lot. So the question he asked, and it's a really good one, is why don't you just change your BSSID between probe requests or probe response? And you can do that, but remember that if the entire attack revolves around you spinning up a rogue access point and somebody connecting to you, in order to maintain that connection, in order to actually have a valid AP, you need a valid BSSID. So if you're constantly changing your BSS ID, this kind of becomes a problem because how do you, you know, handle all these people connecting to you and then you can only have a BSS ID up for more than, you know, a little bit. And, you know, not to mention each time that you change your BSS ID, you pretty much have to like take the, you know, you pretty much have to bring the whole network interface down, change it, restart the software, bring it back up again. And, you know, it's just kind of like pretty much unfeasible. You know, I had someone actually tell me that it sounds as if like there's probably a way to do it with STR. I don't know because I don't know STR. But, you know, as of right now, like it's pretty much, if you want to go down that route, a better approach would be to just kind of like, you know, actually go with the evil twin and just try to like intelligently, you know, find a bunch of pretty much like a common network that a lot of people nearby have connected to. And it will pretty much have a similar effect. Anything else? What's up, man? So, you mean have some way of, so have an evil twin that is able to figure out what the threshold. Yeah. Yeah. Yeah. That is the problem. So, you know, for example, if you do want to look for it this way, if you start, so there is this calibration phase that this thing has to use. And if you're able to, you know, send out your own packets during that thing, yeah, it's going to mess it up. Yeah. Right. So, it actually becomes a bit of like a physical security problem. At that point, you know, if you're, for example, like what we did at B-Sides, the whole building was pretty much closed off, you know, we calibrated it and then let everybody in. But if you're not able to do that, you know, you can't really do it on the fly. One thing that's been talked about is instead of like using, you know, like establishing a statistical norm to like maybe use, you know, like some kind of machine learning or something like that to kind of figure it out. But then again, I mean, machine learning algorithms are still, you know, prone to poisoning. So, that's another issue. So, awesome question. What's up? That's also a really good idea. Actually, do you want to? So, what he asked is why not send a known good packet out and then listen for that and then you know the transmit. And you can kind of like listen for the packet. That you just send out and record that. And this is an open source project. So, if you want to add that. Anything else? What's up? I never feel safe. Any other questions? Am I missing or is that it? All right. Well, yeah. That's.