For staying late, this is the latest talk this year at Packet Hacking Village of any day. So, appreciate sticking around. Oh yeah, presentation mode. So, in case you don't know, we're talking about mapping Wi-Fi networks and triggering with interesting traffic patterns using a new tool called TrackerJacker. So, a little bit about myself. I, by day, I work for FireEye on the Mandiant side, basically doing kind of like R&D for our consultants and that kind of stuff. I've been programming for about 18 years, so I come from more of a software engineering background and I kind of pivoted into cybersecurity like three and a half years ago. But I definitely enjoy it. And I typically enjoy, so programming stuff. But also like hacking stuff and then math-y kind of stuff. So, things like radio are really interesting to me because you kind of have to use mathematics to pull the signal out of the air and that kind of stuff. And ontologically, I describe myself as a Christian mystic, which is like a weird term you can ask me about later if you want. So anyway, Mandiant consultants are like ninjas and the team I work on is kind of like the sword makers, basically. I like fuzzy things like this dog and also things like fuzzy signals because, yeah, like I said, I think it's really cool trying to pull the signal out of the air. Or the signal out of the noise. So, you know, programming is cool and it's cool to move things around on the screen and that kind of thing. But if you want to move things in the real world, you kind of have to get out into the real world. Your programming needs to get out into the real world. And every time you need to do that, you know, whether it's image recognition, you know, radio stuff, text or voice, you've got to deal with the fuzziness. And so that's kind of where I'm coming from. I've been into the IoT stuff before I knew it was called IoT. And I kind of come in from that direction, like doing kind of like IoT things. I did a Raspberry Pi security system because I find the IoT stuff cool. And that was actually part of what... That drove this tool being created. Let me make the text bigger. So wireless hacking is cool. I've been into it for a while. And I've kind of worked at a lot of the different layers. Back in the day, I did a good bit at layer four and three. But, you know, with things like encryption, sometimes that's less fun. I've also kind of dropped down into the physical layer. I did a talk here at DEF CON last year with software-defined radio. And... Crafting signals and that kind of stuff. But this talk, you know, we're going back up to layer two, the physical layer. Or not the physical, the data frame layer. And, you know, for a while, I kind of felt like this layer was a little bit boring. Because ultimately, at this layer, almost every Wi-Fi is encrypted. And so the data is encrypted. So what is interesting there? And, well, you know, you can basically look at the data in the frame. You've got the source MAC address. So some of this stuff, systemically, they cannot encrypt. Because they need that data for the wireless communication to happen, right? So things like the source MAC address and destination MAC address have to be there. Things like the network SSID, the BSSID, the type of frame that it is. And then you have just a bunch of encrypted data. So it's not super exciting just looking at that. But... Let's add on the inferred data that we can ascertain. So, you know, we can also get things like power level implicitly based on the signal strength. We can get time. We can get the manufacturer of each device from the IEEE database. And we can also keep track of things like the network that each device is connected to. So if you look at any given frame, by the way, in 802.11, they don't all say I'm from this to this and I have this SSID. If you want to keep track of that, you need to actually be keeping an internal database of this is all the devices on this network and that kind of stuff. And that's kind of what we are going to get into. So this was kind of my problem. Like I said, I kind of am into IoT kind of stuff. And, you know, everyone's just going crazy making all these new IoT home automation systems. And they don't all talk together very well. And so I have... I had a Canary, which is like a IP camera, and it never ended up wanting to talk to my Wink security system. And so with the Wink, you know, I have like an alarm, like sirens and lights and that kind of stuff. And I was like, well, I would like if the camera sees motion and it's armed, turn on the sirens. So, you know, I thought, well, I could like try to root the device or something crazy like that. And I thought, well, what if I... What if I just look at... So it's a cloud-based camera. So it's going to want to upload the video to the cloud as fast as possible. If someone breaks in, they're going to take the camera and crush it. So ASAP, let's upload that video. So basically what I did is I just said, well, if I can look at the data and look at how... The threshold. Look at some threshold and say if it's above this threshold of data coming from the MAC address of the camera in some period of time, consider that motion was detected because it's uploading a video. And so that was kind of the approach. And that kind of created the whole TrackerJacker program. You know, there is... I'm a Python programmer. And so I have these problems where, you know, I have some problem and it's very much in quotations. And I end up writing a program to do it. So the solution was TrackerJacker. So TrackerJacker is... So I want to talk about... I want to show you briefly a little bit, a little demo of TrackerJacker. And then I want to jump over to some radio theory. Very light radio theory. And then I'll show a few more examples of using TrackerJacker. So it is open source. It's on GitHub. It's on PyPy, the Python index. And you can just... It's a single... In theory, it's a single command to install it. You can pip install. So the first demo that I want to do... So the thing is I didn't really want to bring my camera and connect it to DEF CON Wi-Fi. So I recorded this demo at home. So I'll go ahead and play this demo. And basically, I'll skip ahead because I think I have a little introduction. Now I'll just... I'll talk over it. Here we have a setup, test setup. So basically, you know, I've got this... This is a... Let me mute myself. So I've got... This is the siren right there. I've got TrackerJacker running on the laptop. And what's going to happen is... What's going to happen is the canary cameras face the other direction. And when I move over there, it should pick up motion and try to upload the video. So I'll show... It should try to upload video, which TrackerJacker will then see. Repeating ritual Caleb. Sorry about that. Cause TrackerJacker to run the script, which... It should take just a second. Ah, there it is. You can see something print out on the screen. So that's kind of the idea. And I cut the video right after that. So do you guys kind of see what happened? I mean, basically, the camera saw motion. TrackerJacker saw that motion detection. It hit the threshold. And behind the scenes... So TrackerJacker, it has two main ways of doing an action. You can either have it call a script. Like I did in this example. Or you can write a plug-in. And so I simply had a script that could turn on the sirens. And that's how that connection was made. The other demo I'll show you right off the bat is this one. So I always... Whenever... Not whenever, but often it ends up being the case when I'm doing a wireless hacking thing. And they ask me if there's audience participation. I always say, yes, there is audience participation. But it may not be voluntary. So I've just... I've just been running... I've been running TrackerJacker in the background last hour or whatever. So, you know, it's basically just picking up all of the Wi-Fi devices and it's building a map. And so I'll go ahead and show you what that looks like. So as you can see, it's just scanning. And you can see here it's channel hopping. So it's automatically cycling through the channels. It supports whatever channels your Wi-Fi adapter supports. And what it does then is... Packet has a lot of channels. Packing Village. It outputs it in this YAML file where it's... So I chose YAML because it's human readable. But if you want to write a program to parse it yourself, you can. And so it's kind of cool because it's both the output in a file, nice, clean, simple file, as well as the database. So ultimately, to be keeping... To do really interesting stuff, you need to keep track of all these relationships. And so internally, TrackerJacker keeps them in memory and then it serializes to this file from time to time. And so... So what you have is at the top level here, each SSID. And then underneath that, you have each BSSID. Or basically the nodes of that network. And then underneath that. And you can see things like the signal, channels it's on, the vendor. Let's find one that has some actual clients connected. Because there's a lot of noise apparently around here. Who would have thought in the Packet Hacking Village? So a lot of these are... Let's go down to one that's going to have people on it. So right here, you can see this node of the Caesars Villa. It has these devices. And so it's just got the MAC address, the bytes it's seen send recently, the signal strength, the manufacturer. And it has that then for every Wi-Fi device that's within range. And... And... Let's see. And so I want to just briefly show how that works. So I want to look at how Wi-Fi works from a radio perspective. So by the way, I should mention, I come from kind of a, like I said, software-defined radio slash ham radio world. So I kind of stepped away from the higher levels. And then I stepped back to them kind of from the radio perspective. So I kind of was thinking about a lot of this stuff from the radio perspective. So really briefly, you know, there's the two bands, 2.4 and 5 gigahertz. Now, you know, ultimately, these are channel numbers. But those are just standard abbreviations for the actual frequency. So ultimately, TrackerJacker is hopping between all these frequencies slash channels over time. There's 5 gigahertz channel. You know, ultimately, the data is modulated. The Wi-Fi card at layer 2 will demodulate that for you. Nothing too fancy there. This is kind of an important part, though, I think. So most of you are probably familiar with promiscuous mode. And that's kind of where if you're on a Wi-Fi or Ethernet network, you can just say, I don't want you to only give me the packets destined for my MAC address. I want you to give me all the packets, whether they're for someone else's MAC address or not. Well, there's this other thing called monitor mode. I mean, if you probably already know about it. But basically, it's where you don't connect to any network. And instead, you... You put your Wi-Fi adapter into more of a pure radio receiver and demodulation mode. And that's what this is using. This is using monitor mode. And so you're not connected to any network. But you can then receive the packets from every single network within range. That's how that works. And so that's kind of then what is being exploited by TrackerJacker. Okay, so I talked about the mapping functionality. And I showed you briefly in the video the tracking-slash-triggering functionality. But I want to show a few more examples of what it looks like. So, like I said, there's a really nice plug-in system. Let me show you what a plug-in looks like. How many... Actually, out of curiosity, how many people know how to program in Python, have rudimentary Python programming skills? Okay, maybe 30%, 40%. And like I said, basically, you can either call out to a script or you can call out a plug-in you want to run. Plug-ins look like this. This is a simple plug-in that just counts every Apple device within range. The plug-in API is very simple. There's no subclassing or anything like that. You just create a Python class called trigger and make sure it has an init method and a call method. And then there's these various... keyword arguments that get passed in. And you can just take any of those that you want and do whatever you want with them. And so, basically, I kind of look at TrackerJacker as it provides some basic mapping functionality and some basic responding to patterns and calling scripts kind of functionality as well as a few built-in plug-ins. But in some ways, it can also be seen as a platform. So, there's a lot of annoying things if you're trying to do this kind of tracking. So, you've got to be hopping between channels. You've got to be... Things like the frames, what's the source and what's the destination, those are different depending on the type of frame. And so, TrackerJacker does a lot of normalization and that kind of stuff. And it gives you all the data you would probably want within these calls to your functions. I have this one that kind of shows... Let me show what it looks like to run a plug-in. So, I'm going to go track mode, plug-in, plug-in example slash plug-in template. So, yeah, way too much data to see. But you can see it's just printing out all the data it's getting passed in. The device ID is the MAC or the SSID or the BSSID depending on the context. It tells you this is a BSSID. It tells you... It tells you how many bytes it's seen from that. It tells you the vendor. So, you can do like regexes on that. It gives you the power level. It gives you... It also gives you the SSID it's part of, the interface you're on, the channel, and then it also... The frame type. And then it also gives you the raw frame data in case you want to really drop down and do something else that is not provided. So, that's kind of there in the code as a example. Template. And there are several others. Let's go ahead and do another example template. So, you know, I did a simple Foxhunt plug-in. This is like what you get in Aircrack, right? It just shows you the top closest devices by power, and it just recycles that. So, you know, that's kind of... It's kind of a built-in plug-in, but that's an example of, you know, almost any... I think of it as almost any kind of thing you might want to do where you want to look at some traffic patterns of Wi-Fi at Layer 2 and do something. Call it script, whatever. Keep track of it. So, that's another one that actually I wrote. So, I was talking to someone, Lori over there, and we were like, I wonder how many different types of devices there are at DEF CON. Like, what's the biggest, you know, player? So, I wrote this little plug-in. Let's see if I have it loaded up here. Literally, I wrote this today. It was kind of fun trying to, you know, commit to source and all of that right before the talk and try not to break anything. So, this is the plug-in. It's a little more, you know, it's like 50-some lines of code. But then, with this, you can output, this is what I've seen so far at DEF CON. So, Zebra is actually the most popular, which is kind of a surprise. Apple is close behind. I don't even know what this Murata is, Broadcom, obviously. So, you know, it's just a pattern I wanted to look for, and it saw, like, 2,800 devices in maybe 30 minutes or something like that. And, yeah, so that's a few plug-in examples. Oh, let's do another one. So, all right, just to give you an idea of the flexibility and kinds of things you could do. So, you could... Let's say that you really hate some particular manufacturer of device, maybe Apple or something like that, and you're like, I really hate Apple, and I want to de-auth every Apple device that gets close to my house. For example. Now, I mean, maybe it'd be a drone. Maybe a drone, you don't like drones, right? Or maybe you're in an Airbnb, and you don't want your Nest Cam spying on you. So, there's actually some semi-non-malicious use cases for this. But... So, let me show you what the... Let's go down. History vendors. Oh, I've got to copy and paste it. All right, let's see if this works. So, this plug-in actually... There's also a plug-in config parameter. So, if you create a plug-in that itself, you would like to be able to pass parameters to. So, in this case, vendors to de-auth, that's... You could pass in multiple vendors to de-auth. You could also pass in particular Macs. And let's see if that works. All right. So, I think... Yep, so it's looking and finding devices. It has enough data to de-auth. And for this functionality, by the way, it's calling out to Aircrack. So, right now... Oh, there we go. We're killing... We're killing some. Now, this is... So, this is actually kind of cool, though. Okay, so... Right now, a TrackerJacker, like I said, it's just passive, but it can call things. So, you know, it can call Aircrack. But how many people have tried to de-auth with Aircrack before? Okay. So, one annoying thing, for those of you who know, if you try to de-auth, you need to know, like, the BSS ID and the MAC address and all that kind of stuff. Now, one problem, though... Like, let's say you're on a big network and it's got, let's just say, 20 nodes, like here. And if I de-auth you on one of the nodes, what's going to happen? Well, it's just going to jump over to the next node, right? And connect. And you're going to have to then do another scan and do another de-auth. Well, so this is going to... This is actually, behind the scenes, automatically doing that for you. Because it's really just... It's just whack-a-mole. Like, it will just... It's just reacting. So, every time it sees this particular, you know, something from this vendor, or if it's a MAC address that you really hate, it whacks it. And it automatically fills in all those parameters for you. And that's just... It was kind of like... It was... Oh, we'll go ahead and stop that. But, come on. People are like, you've got to expect that at DEF CON, right? But, anyway. But it was kind of like an afterthought, though. I was like, oh, it would be cool to be able to do this. And the cool thing is, again, it's just a plug-in. So, the core I actually kept kind of small. And the plug-in functionality is pretty powerful. So, I ended up writing a lot of stuff I thought I was going to write in the core into the plug-in system. So, that made me... That forced me into making the plug-in system very much a first-class citizen. So, it's... I think it's reasonably flexible at this point. And let's see. Some other things I want to note. So, TrackerJacker is... It's mostly been developed... Developed for and tested in Linux. So, Kali, Ubuntu, any of that kind of stuff. Like, what I'm doing is I'm running it in a VM. Obviously, if you're at the top level, that's even better. But I do have some preliminary Mac support as well. I can try to demo that. Also, TrackerJacker requires root privileges because it's doing the PCAP. So, that's one possible downside, I guess you might say. Let's see if this works. It's going to kill my Wi-Fi. And there... Yeah, so there it's running. Basic scan. By the way, TrackerJacker is built on Scapey. Now, how many of you guys are familiar with Scapey? Okay, cool. So, Scapey, it's this really sweet Python library that lets you do packet crafting, but also sniffing around. And that kind of stuff. And so, this is a layer over that, pretty extensive layer over that. I'm working with the Scapey team, kind of. I was trying to get them to push out some new functionality to make the Mac version better. So, I'm kind of pending on that. So, there'll be more Mac support forthcoming when some of that other stuff is ready. And further other features as well. If anyone wants to help port it to Windows, that would be... Someone else, other than myself. I have no promises on that. As far as Wi-Fi devices, I thought I would make a note. So, I really like these. I've never heard anyone talk about them, but the Panda brand, they have these really nice devices. Like this little one right here. It's a dual band. It runs on Linux right out of the box. And it supports monitor mode and injection. So, pretty cool. It's really sweet. That's the kind I've been using for most of my testing. The Alpha, there's some Alpha ones that work for it. The TP-Link. I have a few notes on that. And a few major takeaways. So, at the physical layer, Wi-Fi is just radio, right? And so, there's only so much you can do to prevent these kinds of attacks. So, a few more expoundings on some of the testing that I did. So, with the security system, with the camera, one of the things I realized after I wrote it is, oh, wait, I'm not even connected to my Wi-Fi network. I don't need to be connected to my Wi-Fi network. So, you can actually scan and find all the vendors of IP cameras near you. And you can see when they're detecting motion or not. Actually, a funny side note. Canary, so I was testing this stuff, and I have this Canary camera. And, you know, I would arm it and make sure it went off, and then I'd disarm it. And then it was going off while it was disarmed. And I was like, that's kind of weird. And it turns out they were uploading video even when it was not in the armed mode, which, now there was a setting kind of hidden away you could turn off, but it was kind of a weird, oh, wow, I saw that I did not think it was recording video during that time. So, it could also be useful for testing that kind of stuff. But it's also kind of scary because, yeah, I mean, it could be an IP camera in a neighboring house or building, and you could detect when there's motion, right? One of the other very obvious use cases would be tracking people with smartphones, right? And that's kind of what I was doing here, you know, so. But that's, there's only so much you can do to prevent that, right? Because, so there's some things like, you know, Apple devices, Apple devices do Mac randomization. So, if you're not connected to any network, they'll be not sending out their actual Mac when they're, like, probing for Wi-Fi networks and all of that. But if you ever connect, it basically has to use your Mac. And so, for example, if you're at your house and you're connected to your home Wi-Fi network, someone could just go and look and see if you're connected or not and basically know if you're home or not. That's kind of, you know, that's a little bit worrisome. And there's really not a lot you can do. Like I said, you can turn off Wi-Fi when you're traveling around so that at least while you're out and about, they're not going to be tracking your physical location, whoever they are is. And I believe I saw some report that, from Snowden, that the government is using this kind of tracking in addition to other kinds. It's also another funny testing thing I realized. So, my network at home, it has several repeaters. And I could notice from TrackerJacker when I was, like, upstairs versus downstairs based on which node I was connected to. There's all kinds of crazy things you can do like that. Another fun plug-in was... I'm not going to demo it for time's sake, but it'll just look and see who all is around and it'll show anomalies. So, that's another very simple plug-in to write. If you want to, you know, you can set a threshold. Like, if I see... Power level greater than negative 50 dBm and I haven't seen this MAC address before, then do an alert, right? And you wouldn't want to do that without any kind of power filter because people passing by in the street, right? But if you have a power level, that's really quickly a really interesting program to detect potential invaders. I could see that being useful for companies, you know, kind of a basic... That would be an interesting piece of data if there was someone who broke in and stole stuff, right? It's trivial to track in Wi-Fi monitor mode. Like I said, I was a little bit surprised by the kind of information that you can get out of the raw 802.11 mode. I kind of... For a while, I guess I thought, well, it's all encrypted and so there's not a lot of interesting stuff. But if you're tracking stuff over time and keeping track, then that's where the kind of creepy data gets leaked from. As I said, you know, I have this new tool, TrackerJacker, and I think that's the main takeaways. So I'll call that the end. And if any of you guys have any questions, let me know. Thank you. Thank you. Yes? What's been your experience with contact devices that do broadcast? As in, do they do randomization or not? I mean, they all send out their MAC address. Like, you know, almost every Wi-Fi device will do its probes and it'll send out data when it's trying to look for Wi-Fi to connect to, right? And so those are all kind of the same. There is probably some active scans you could do to track your data. Try to fingerprint more, right? I haven't got into any of that yet, but there's definitely stuff you could do, I think. Yes? Yes? No, not at this point. For that, you would need some kind of more active probing into it. Now, you can differentiate in location, and stuff like that, but that's not going to help with that, I don't think. Yes? Can this tool help me find these trends that the old thing might find? I don't know. It might be able to. Yes? Can this do the ARP spoofing? ARP spoofing? Not directly, but you could definitely use it as a trigger to call something that does ARP spoofing. ARP spoofing. So, like, let's say it has Skapy, it could go to Skapy. It uses Skapy, and you could definitely write a plug-in that would then call Skapy. Yeah. Yeah. Yes? So, just to be clear, there's... Do you normally pick up this information if the device is activated by transmitting data from one, let's say, node to another device? Mm-hmm. Yes, kind of. Yes and no. So, it doesn't have to be transmitting... It depends on what you mean by data. It could be not connected and just looking for networks to connect to, and it will be found. But it's transmitting data. But it's purely passive. So, it's only going to pick up on what's in the air. But if your Wi-Fi device is actually sending a signal over the air, whether it's a control frame or a data frame or management frame, that'll get picked up. Okay. So, the device is just scanning or, like, my iPod is just scanning for networks. You said there's back-randomization. So, it, like... Or, like, TrackerJagger will pick up my public key, the randomized back-randomization. Yeah. Oh, actually... Yes? So, that's the question here. Like, do you know it's the same app that I put in my iPod that I'm seeing that random back-address when it's standard or is it a new random back-address? It seems to be randomized from what I've seen. By the way, actually, since you brought that up, have you guys... Is Marv here? Okay. Because, like, I was scanning around the Hacking Village and I noticed, like, this Marv guy everywhere. So, yeah, I... It was kind of funny. Like, let me see if I can print this out. Python 3 filter Marv. I wrote a little script. Let's see if this works. So, Marv had 50 SSIDs. So, oh, by the way, so at the Packet Hacking Village, here, just in the last hour, it found 631 devices, 270 SSIDs, 50, not including the 50 that Marv made. So, just to show you what that looks like. I don't care. Marv. So, you can see what he was doing. He had, like, all these... So, kudos to Marv. Oh, actually, a funny other little thing. Just a funny DEF CON. This was, like, a great DEF CON moment. Okay? So, I was running Tracker Jacker in one of the Chill Out Lounges, like, three hours ago. And I got this exception thrown. And it was, like, this recursion error. And someone had crafted a packet so deep that it blew up Skapie's decoding. So, I actually created a new ticket for them. And I put my call to Skapie in an exception handler. So, I thought that was, like, a really cool DEF CON moment. In the code, I actually have a thank you DEF CON. Comment. Let me see. There it is. Thank you, DEF CON. All right. Let's see. Any others? Yes? Yes. Yes, it will. Actually, I've tried this on a couple airlines. And you see the guest one, usually. But the other ones also show up. And that's because some of the management type frames, so they're not sending out the beacons, right? If they're not, if they're hidden. But the SSID still shows up in other packets. And basically, any type of packet where it has that, if it has it, Skapie will grab it. And actually, I don't even know what all those type of packets are. I just know I look for it in every type. So, yeah. Yeah. Yeah, I think you can. I think you can. Because the same... So, Bluetooth does a little bit more to try to hide its MAC address, for example. But, yeah. You could, I think. Yes? Do you have any plans for equalization? And it's still in the calculation of the packets? I have thought about that, yeah. One of the other roadmap things is to have support for a couple Wi-Fi adapters simultaneously as well, which would help with that kind of thing. Yeah. Let's see. Any other questions? All right. Well, thank you. Thank you. Thank you. Thank you. Thank you.