Good afternoon, everyone. And this next talk that is sponsored by the Packet Hacking Village. Is More Money More Problems? Actually, I'm wrong. Sorry. Is More Wireless More Problems? By Jeff Horvath and Winston Tam. Hey, guys. Thanks for coming out to our talk today. More Wireless, More Problems. From the modular wireless security systems to the data analytics that love them. I'm Jeff Horvath from Alsatian Consulting. Presenting with me today is Winston Tam from Uplinks LLC. So, to tell you guys a little bit about me, I did 13 years in the Army as an intelligence officer. I did 10 of those years in special operations units. Once I got out of the military, I started Alsatian Consulting. There's our website if you ever want to check us out. We do cybersecurity, digital signature reduction, personal data protection to private sector and public sector individuals. I have a BA in political science from Drexel University. I have a master's in information security engineering from the Sands Institute. And with that, I got 10 GAIAC certifications and there's my analyst ID so you can prove that I'm not a liar. I'm a huge wireless enthusiast and I have two German Shepherds. A 13-year-old girl named Belle and a 3-year-old boy named Gunner. Hey, everybody. My name is Winston. I work in software development with my company, Uplinks. I spent eight years in the Navy. Four of those in special operations. During that time, I was a network engineer, pen tester, and a red teamer. I also did like three concurrent years as a commercial pen tester for banks, ISPs, and funny enough, like an Indian reservation. They get like a .gov domain. That's kind of cool. Yeah, I do DIY tinkering, love 3D printing. I have a lot of projects. A bunch of expired certs I don't care about. I'm a proud Bengal cat dad. I stopped playing Factorial. I switched over to RimWorld. But I'm still... yeah, I know, I know. Yeah, and I'm a decent rock climber. And yeah, that's how I spend my time. So let's talk about why we did this. Why the impetus behind this whole project. And me being a huge wireless nerd, I wanted to collect large swaths of data. I want to collect all of the channels, all of the packets, get all of the things. And my initial thought for this was, okay, how many adapters can I actually put onto one computer? Can I just do an all-in-one situation? And if I can, how physically big is that and how much power is that going to take? And what I found is that that then creates a huge issue with form factor. Because in order to put the requisite amount of cards that we have displayed here on the front on one computer, that's going to be a rather large box. So there's form factor issues. There are power concerns with it, with getting enough power to have that and actually have it be kind of portable. Number of peripheral devices, right? The more things you add, the more the operating system has to take care of and has to keep track of. So the more things you add, the more RAM you have. And eventually you have this incredibly powerful system that really can only do about one or two things. And with all that collection, even if we did get that to work, it still has a large amount of data. I mean, think about how much Wi-Fi is flying around right now and how much data in a one-hour run you can get if you're listening to every single channel. So we had a lot of large amounts of data that were choking my analytic tools. I couldn't put it into Google Earth. I couldn't put it into another app called QGIS. I couldn't put it into Wireshark because they were just too big. And I would end up either having to strip out data and miss things, or I would end up having an incomplete amount of data. So my solution to that is building the signal processing and reconnaissance kit yellow. Which, yes, I know it looks a little orange, but I really wanted the last letter to be a Y, and I couldn't think of any kind of tech thing that started with Y. So that's why it ends in Y, and that's why I'm calling that yellow. It's a modular wireless collection. Each Raspberry Pi is set to do a different band of the wireless frequency. It will also do Bluetooth BLE. With these Android phones, it will do cellular parameters. So what tower you're on, what frequencies you're talking to the cell network on, how good or how bad of service you have, how far you are from the tower. Because, again, I'm a huge wireless nerd, and that stuff really interests me. It's got 13 alpha NEH cards, 13 MediaTek alpha cards, one Wi-Fi 6 card, because there really isn't that much Wi-Fi 6. And me, being a self-funded guy, I'm not going to waste money buying chips that just aren't going to get used. And then there are five NULAC SDRs running, looking for RTL 433 compatible devices. Again, these things are running on three individual Raspberry Pi 5s, four Android phones. The Android phones are running Wiggle and also GNET Track Pro. And then I bagged it all up into these REI Trailgate gear cubes, and then put all of that into this portable REI Trailgate gear bin. So why did I make it modular? Well, one, we talked earlier about the memory requirements for having a lot of devices. If I distribute those devices across multiple computers, multiple Pis, my RAM requirements go down, because Raspberry Pis have been able to run 13 wireless cards simultaneously ever since the Raspberry Pi 2. So the Raspberry Pi 5 has more than enough power to handle that much traffic. So we distributed amongst multiple devices. I don't have a need for live processing. I don't need to see my data come in. I'm going to do all of my analytics on the back end when I have everything merged together. So I don't need to set alerts. I don't need to have a GUI. I don't need to have anything. This is all just a fire-and-forget headless collection system. This also reduces bottleneck, because now I don't have all this stuff feeding into one device. It still has to keep track of all the other devices and all of the other peripherals that are attached to it. That also allows for a little bit more robustness, because if I have an issue with a collected file, if I have an issue with a collected database, I may lose that entire day's run. I may lose that entire day's session. So now that I have it distributed amongst different devices, if something happens to one of them, I still have collection from the other two. This also, by dividing it up like this, creates smaller files, which are much more manageable. It's scalable. As I become more interested in other types of wireless technology, I just build a new Pi, and then we build a new ingest into it. So I'll show you what some of that looks like. And I've got two examples here for single-device characterization and AP characterization. And because this is not my first DEF CON, I'm not doing it live. So what we have here is the sample dashboard for single devices, and we have the OUI of the devices that it sees, time-of-day analysis about when those devices are active, day of week, and I did all my collection on a Tuesday, so that's why it's all in one pot. Probed SSIDs for client devices, so what Wi-Fi networks are they looking for, what access points have they been seen on, what protocols have been collected, and this is a video, this is not a live website, so I can't scroll. There we go. We've got the layers and the types of protocols that we got collected, and this is all from Tshark or Wireshark. We got MDNS device names, we've got DHCP client names and operating system, we have user agent strings, we have MDNS information about the actual thing, and this is all from unencrypted wireless networks that are collected with Kismet that PacketGlass actually will take out and customize and contextualize. So that's what it can show for single devices. When we talk about access points, when we talk about that, here we've got dots on a map, this is from a drive that I took in Washington, D.C. Here we've got the top values of the access points, their encryption, their channel, their bandwidth, their capabilities, and it scrolls down and you can see there's lots of things. And then again, we get into more information about the network itself. So again, the chip manufacturer, the BSID with the OUI lookup, the SSID list of the SSIDs we've seen, what the router gateway IP address is, subnet mask, DNS server, information that the router is giving up in an unencrypted network. And there's also support for 802.11h, the country code, country settings, so I can see what kind of frequencies the device is using, what the WPS Wi-Fi protected setup information is about the manufacturer, about the type of device, what clients are associated with it, all kinds of information related to the operation of that network. Again, all passively collected because I can collect all of the Wi-Fi's with the SparkyBox. So I'm going to turn it over to Winston, he's going to tell you about the ones and zeros behind it all that actually make those pretty dots appear on a map. All right. Everybody, so, uh, yeah, what I was trying to let's get this blows up. Do I doesn't look like it took a second. Cool. Thanks. All right. So, uh, yeah, he collected a lot of data. And a lot of them were geo data. And I'm just going to go over the specs, the planning and the kind of the execution of it. But overall, I kind of realized over the course of a conversation at a bar that this is a geo wireless processing hub from multiple software. So like I said, we kind of were just having a chat, just drinking. And he was telling me about all his wireless problems. And, you know, and two and a half hours later, I was like, yeah, hold my beer. Let me let me do this. And I signed on to do that. So the objective is to kind of like put dots on maps, right? Jeff is doing everything in the number one column over there. He's collecting it from Kismet, Wiggle, ArrowDump, a couple of other formats. I'll mention more later. So pretty much all my responsibility is in the number two section, the analytics platform. At this point, as he was telling me all about it, I kind of had one in mind. Spoiler alert, it's Elk. And the goal is to make it easy for him to put dots on maps and pretty much change out maps or even visualization if he needs to. So like I was mentioning earlier, these are the type of different formats that he mentioned. But just to give you an idea, the files I'll be actually be dealing with were like .kismets, .tsv, SQLite, CAP, CSVs. Maybe not everything needs to be preprocessed. But as I was working on this, I was realizing I kind of have to consolidate everything down to one single format that would work with Elk. So what is Elk? So overall, Elk is just this open source-ish, it's a big asterisk there, analytics platform. It does real-time data collection. E stands for Elasticsearch, L is Logstash, K is Kibana. But what you really care about is the ingestion order is actually from Logstash, that's where the data comes in. Logstash forwards it over to Elasticsearch into indexes, where you will perform some kind of tagging to let go, hey, this is how we're going to retrieve the data. And so when you can actually look up, do the searching later. And Kibana is where you do the visualization. So right out of the box, Elk doesn't really do what we need it to do. It doesn't know what a Kismet file is. It certainly doesn't know... Yeah, it doesn't really know how to use any of that data. For example, maybe coming from Wiggle, we have something called Trilat, a field called Trilat. And coming from Kismet, we have something called Latitude. We need to somehow let Elasticsearch know, hey, these guys are the same thing. This is the same type of geodata. They also have a different data structure for all of these files coming in. And lastly, the first-party solution for Elastic Map is Elastic Map Server. That costs money. And I don't like to give money away. So let's do a free version of that. So this is a little diagram I drew up to kind of handle the whole solution. The right side is everything you saw. It's containerized with Docker. In this case, we're just using Docker Compose. And we also added a little map server on the right side there. On the left-hand side is pretty much where most of the preprocessing happens. We're using a Python script to just handle everything. And, yeah, we have, like, three directories that we'll kind of go over in a little bit. So the work ahead of us is pretty much to have, one, stand up a copy of Elk. Two, convert the files. Three, we need to normalize the data field. Four, we need to tell how we're going to use that data. And then five, we need somewhere, even if we can put it on a coordinate space, some kind of mapping on the background to show, hey, where on the map are we? Because you can have coordinate systems, but it doesn't necessarily have to translate to a map. You can put anything you want behind there. All right, so great news about Elk. It already came pretty much preassembled, right? If you look for Docker Compose for Elk, they've already made it super easy. Easiest thing you ever do is just download it. Docker Compose up deep, you have it up and running. But like I said, it doesn't do anything yet. But I do want to give, like, huge props to, like, Elk Ninja for making this, like, really frictionless. I'm pretty sure that's actually the first-party GitHub project for them. All right, so talking a little bit about converting the files into a compatible format. So like I said, I decided to do this in a Python script outside of the Elk stack. So we have an ingest folder, an index folder, and an archive folder. We're pretty much dumping all of the data that we collected into an ingest folder, where the Python script can be monitoring it. And we can be monitoring for, like, Kismet files, SQL files, or whatnot. And we kind of chose it for the least amount of work that Jeff had to do. So pretty much as soon as he's exporting it, we want to have all the default settings. So for, I think, Wiggle, it might be something as simple as, like, backup.sqlite. All right, so the search pattern I'm looking for, then, is backup.sqlite for the Python script. If I have to convert it down, then I'll convert it down to JSON. And if I don't have to, I pretty much just pass it along from TSV or CSV and move it right along. For the JSONs, there is a little kind of like a Logstash or Elasticsearchism, which is you pretty much have to convert all JSONs into a single line per entry. And this is for Elasticsearch efficiency reasons. So there is a multi-line format you can do, but that, like, honestly, do you want to be less efficient? So here's an example of how we might convert it from Wiggle. So the Python script is going to look for, okay, cool, I see a backup.sqlite. And we're going to just run this command. Yeah, these are prefields, so this is kind of like slightly of a destructive editing. This is also why we also backup the originals. But these are the fields that Jeff told me, hey, this is what I need. Great, awesome. You could, hey, say select star and grab everything. But if you're not really needing to, because the amount of data we're dealing with, we really want to just, like, cut down on size where we can. And same thing for Kismet as well. We're also dumping it out into a JSON file. And if it has a PCAP file, we can, like, dump it out into a PCAP NG. And this is where we kind of ran into a little tricky thing. I tried using PacketBeat. And PacketBeat really feels like it's more designed for any kind of, like, streaming or network monitoring. It's not really designed for this, like, individual file ingestion. So what I decided to do was just have Tshark actually convert it back from PCAP also into JSON. And that's also another step where we can do more filtering down so we can remove data that has absolutely nothing to do with us. Because at first I was like, yeah, let's keep all the data. I think we wound up filling up that... Yeah. In, like, a single session. So that was, like, well, let's not do that. So, yeah, we started looking for other types of traffic and things that we specifically wanted. So to... yeah, the next part is then we had to tag and normalize the data, right? So even though we bring it into Logstash, so we moved it over from preprocessing into Logstash now. Logstash kind of needs a way to go, okay, what am I doing with this? So right off the bat, we're using the file plugin. And then for filtering, this is where I was talking about earlier. This is how we let it know, hey, or start transforming from... If Wiggle calls it Latitude and Kismet calls it, I don't know, Trilong or Trilat or whatever, right? We're trying to give it a way to say, hey, we're going to consolidate all of this data type into one single naming field or a single field. So that Elasticsearch knows how to use it. And then, yeah, in the output, obviously, we're just sending it over to Elasticsearch. And now that we are actually in Elasticsearch, we need to tell Elasticsearch, okay, cool. Within this index, it doesn't, even though we called it, say, location, right, it doesn't really know what location is yet. So here's where we actually define, hey, we made something called location, and we're going to define it into a geopoint. Now, geopoint is something that's native to Elasticsearch, so it knows how to use that data. Because we gave it a lat and a long, and it looks at it and says, oh, cool, this is an array. It has a lat and a long. Let's put that as a dot. Let's put that somewhere on the map. And that's pretty much how that works, and we have to repeat this process for every software that we want to do that. But that's essentially the whole pipeline. And to tie the whole thing together, like I said, because we're not interested in, you know, paying too much to do this, we just decided to use MapTiler, which is another open source software that we can just grab that. Elasticsearch actually made it pretty easy where you can just either pop it into settings or in an environmental variable when you run up or spin up Elasticsearch. For the case of using MapTiler, that's actually just a domain for a self-hosted option for it. And in this case, we're also using just OpenStreetMaps. So that's how we're able to just, like, put tiles underneath the coordinate system. So to wrap it up, I want to give some special thanks to Ming, the Packet Hacking Village committee, for allowing us to present today. Elk Ninja for the work on the Dockerized version of Elastic. Dark Matter for giving me the idea of how to build a large-scale wireless collection rig. Dragorn, Weigel Project, Guyakoff Solutions for making all the software that powers this system. My husband, Mark Winters, who helped me make this actually fit into a nice, pretty presentable form. Monkey User for letting us borrow a lot of his pictures for this amazing presentation. And Tyler Carper for his contributions with Winston. Questions, comments, complaints, other things to begin with. Let's see. I have a question. Yeah. I think if I heard correctly, you have three separate... Yes. Do you do anything special? Do you make any special efforts to synchronize the time you give the rig? Because I would imagine when you reintegrate the data... Yep. ...you have to have the... Yep. So they get their time from the NTP server whenever I connect them up. And then they have an RTC battery in there that's keeping that running. So I may lose a few seconds, but with what I'm doing, it's not really... Like, I'm not looking for an exact one-to-one correlation. Got it. Cool. Thank you. Anything else? I just grab it all. Yep. And then afterwards, then I look for the anomalies. Then I look for the things that I want to see. It's like, oh, that protocol looks interesting. Let's look more at that device. So I've been able to find a lot of stuff through MDNS. I've been able to find a lot of stuff through DHCP requests. A lot of information about devices themselves, which has been really handy for that. Yep. They're getting mid-signal.