[00:00.000 --> 00:04.000] Welcome to DEF CON. First speaker is up. Let's give him a big hand. [00:12.870 --> 00:19.710] Thank all of you for being here. Really appreciate it. So, the first thing we want to talk about is [00:20.250 --> 00:25.390] this whole talk has really been pushed because of how much the technology out there is moving [00:25.390 --> 00:32.390] to mesh technology. Everything's meshed. From cellular, we have mesh-tastic, LoRa, [00:32.390 --> 00:36.910] all these different creations. But one of the creations that has been around for quite a while [00:36.910 --> 00:41.810] that we're going to talk about is Gotenna. And we're going to talk about all three stages that [00:41.810 --> 00:48.210] we've seen it go through. My name's Woody. This is Erwin. Yeah, I'm Erwin Korenczyk. I go by [00:48.210 --> 00:53.330] Dollar Hyde. And we also want to make sure that we gave credit to Clayton Smith, who [00:54.650 --> 00:59.450] really did a ton of work on the second generation and made this talk possible. So, [00:59.450 --> 01:02.970] thank you very much for that. Awesome. Yeah, thank you, Clayton. [01:07.610 --> 01:11.810] So, mobile mesh networks, the way that they typically work is one device will talk to [01:11.810 --> 01:16.430] another. You're able to go through and pivot. And that way you can get extended range. [01:16.510 --> 01:20.970] You can have multiple people communicate at the same time. There's a lot of things that you can [01:20.970 --> 01:25.230] do. Now, one of the things with a traditional network is the way that your data and your [01:25.230 --> 01:31.430] controls are handled versus the way that Gotenna mesh does it. So, the Gotenna's capability of [01:31.430 --> 01:37.610] meshing is actually really efficient. And that's one of the things that makes it fairly unique is [01:37.610 --> 01:45.790] because they've combined that and made it pretty controllable. So, some of you seven years ago [01:45.790 --> 01:55.320] may have seen the talk that I did in the RF Hacker Sanctuary. It was on the Gotenna version [01:55.320 --> 02:01.840] one. This one right here. So, what you're seeing on the screen right now is as he goes through [02:01.840 --> 02:08.700] and does the Gotenna or his script, this was our original exploit. And what we figured out was [02:09.280 --> 02:14.140] the Gotenna is designed over Bluetooth to communicate with a phone, at least the gen one [02:14.140 --> 02:20.820] and two were. Once that happens, then you can send a message that can be either open in a broadcast [02:20.820 --> 02:26.780] or person to person or in a group, but you can encrypt it. And that's what you're seeing here on [02:26.780 --> 02:33.900] the screen. But we were able to see seven years ago that it was broadcasting some things plain [02:33.900 --> 02:39.440] text. And when it broadcasted things plain text, the things that you could see even in encrypted [02:39.440 --> 02:45.580] mode were the unique identifier. Which for the unique identifier for the gen one and two by [02:46.020 --> 02:52.320] default, can anyone tell me what it was? Your cell phone number. So, this script is demonstrating how [02:52.320 --> 02:58.340] we could run against a Gotenna version one and pull your phone number out of the air. Even if [02:58.340 --> 03:05.400] you were using encrypted mode. Now, they fixed that since, well, they've evolved since then. Um, [03:05.400 --> 03:10.700] and the new management has really made an effort to try to fix some of the issues that have [03:10.700 --> 03:15.040] happened in the past. But this on the screen is actually what it looks like when we're able to [03:15.040 --> 03:19.300] come in here and pull this data. Yeah, and you can see the phone number, call sign, and the [03:19.300 --> 03:23.500] message in unencrypted mode. In encrypted mode, payload is not visible. But the phone number [03:23.500 --> 03:28.800] still is. So this was gen one. And if you want to see a live demo of this, come to RF Hackers. We're [03:28.800 --> 03:37.760] showing just the video here. So, gen one, we see how it communicates. Now, gen two, they changed [03:37.760 --> 03:43.660] some things. Instead of using two FSK, they moved to four FSK. But by default, there were still a [03:43.660 --> 03:48.760] couple things that were the same that we were able to start exploiting. Uh, Clayton specifically [03:48.760 --> 03:54.040] found some really great things that were vulnerable here. A lot of them were similar to [03:54.040 --> 04:00.000] version one, but you needed a four FSK demodulator to do it. But you could still find the phone [04:00.000 --> 04:05.580] number. You could still find some of those unique identifiers. And as we're gonna discuss, those [04:05.580 --> 04:10.040] unique identifiers, even if they're not your phone number, can be a bad day. So this is an [04:10.040 --> 04:15.600] example of exactly what we could pull while you think you're doing encrypted messages. And we [04:15.600 --> 04:20.220] start getting your phone number, we can start seeing some of your messages depending on how [04:20.220 --> 04:32.880] you're using it. And we're gonna talk how that can be effective for other things as well. Now, [04:32.880 --> 04:39.100] the current version of Gotenna, the Gotenna Pro, we started working with, one of the things [04:39.100 --> 04:43.720] that I do is I'm staffed in the RF Hacker Sanctuary, the RF village, so please come and try [04:43.720 --> 04:48.020] some of our challenges out later. That's actually how a lot of these things get discovered is [04:48.020 --> 04:53.820] people trying them in challenges. Some things that were fixed. You did not have to connect via [04:53.820 --> 04:57.980] Bluetooth because we all know that Bluetooth by itself can be a unique identifier that can be [04:57.980 --> 05:04.100] used to find somebody or come after them. They improved it so you could use either Bluetooth or [05:04.100 --> 05:08.720] you could actually hardline to your phone with the device. And then the only thing that was [05:08.720 --> 05:17.660] communicating was either at, you know, the 140 to 170 megahertz band or 445 to 480. They also [05:17.660 --> 05:23.920] improved the channels you could use, you had some bandwidth things you could control. So, on [05:23.920 --> 05:30.100] initial viewing of this, it looked like it was a much more secure device. But this is what we're [05:30.100 --> 05:44.300] going to be talking about. This is basically the Gen 3. Why is it important for us to worry about [05:44.300 --> 05:49.780] what we give out? Well, we have some representatives from Wiggle here and I'm sure that [05:49.780 --> 05:54.820] they can tell you how important it is to protect your MAC addresses. In fact, the industry has [05:54.820 --> 05:58.780] already started making sure that unique identifiers start rolling and that it's much more [05:58.780 --> 06:05.340] difficult to track them because you can be tracked over space and time, geographical location, and it [06:05.340 --> 06:10.300] can be used to fingerprint. So, that's why we're worried about this. It also gives out unique [06:10.300 --> 06:15.940] identifiers about you. What if I couldn't just tell that you were using that MAC book, but I could [06:15.940 --> 06:22.440] tell you whether Tim was using it or whether Jeff was using it, right? That's even more refined and [06:22.440 --> 06:26.540] that's what we're going to start getting into in here and that is why to us it was so important. [06:27.000 --> 06:32.580] Both of us, our primary jobs, when we're not doing this stuff for fun, is to actually help people [06:32.580 --> 06:39.140] protect their RF signature and to help people have good cyber security in vehicles, in [06:39.140 --> 06:49.870] equipment that they use, and global travels. So, some of the problems that we started wondering [06:49.870 --> 06:54.750] about, is there any chance that we can find some of the same vulnerabilities in a Gen 3 that we [06:54.750 --> 06:56.210] find in a Gen 1? [06:56.210 --> 07:00.110] Yeah, so basically we're looking for those GIDs for the call signs. We're looking, are they [07:00.110 --> 07:02.310] present? Have they fixed it? [07:02.410 --> 07:07.690] Yeah, because it's been seven years, we wanted to see whether or not all those things had been [07:07.690 --> 07:14.170] fixed or not. And some things had and some things we found were still somewhat vulnerable. But, [07:14.170 --> 07:19.190] having that base is what we moved from to be able to do all the rest of this. So, having a good [07:19.190 --> 07:29.160] foothold and then from there, pushing out and finding new things. So, who are we? Erwin? [07:29.160 --> 07:33.480] Yeah, so I'm Erwin. I'm a security researcher. I'm experienced in hardware and software [07:33.480 --> 07:38.340] reverse engineering as well as RF exploitation. My mission is essentially what's shown on the [07:38.340 --> 07:44.040] screen as well as the overall mission to protect this nation and citizens by identifying and [07:44.040 --> 07:48.080] mitigating threats before those threats are even known to these people. So, this is one [07:48.080 --> 07:52.680] example of that mission to protect the people that serve us. [07:52.940 --> 08:01.420] My name's Woody. I'm staff for the RF Hacker Sanctuary or the RF Village. I was one of the [08:01.420 --> 08:06.820] co-authors of the original Gotenna attack, Raptor Captor, some other vehicle exploits and some [08:06.820 --> 08:12.460] things like that. I spent 20 years in special operations before I started playing in this world. [08:13.180 --> 08:19.640] And the reason that this is so important to both of us is we work with law enforcement. We work [08:19.640 --> 08:25.860] with government. We work with corporations. And we educate them on how to control and [08:25.860 --> 08:30.940] understand all the different aspects, not just the physical but also the digital and even the [08:30.940 --> 08:36.700] light aspects of what happens in your life and why it's important. So, that's what got us to [08:36.700 --> 08:48.050] this point. So, just having encryption is not enough. Configurations matter. Imagine having an [08:48.050 --> 08:54.630] amazing router with WPA3, an incredible password, and everything's good to go, but you just [08:54.630 --> 09:00.950] leave it as an open network. You still have encryption, but does it matter? Not at that [09:00.950 --> 09:04.950] point. Configurations, and that's what we're gonna talk about. [09:04.950 --> 09:09.930] Yeah, so this is our testing setup. So, we were testing in an anechoic chamber at the [09:09.930 --> 09:14.030] university where I'm pursuing my PhD in electrical and computer engineering. We used a [09:14.030 --> 09:18.550] representative sample of both iPhones and Androids connected with Gotenna Pros. And then we [09:18.550 --> 09:23.810] used just open source hardware and software. So, HackRF1 connected with open source software [09:23.810 --> 09:30.330] running on an Ubuntu laptop. So, very simple. So, the first step of any sort of RF analysis [09:30.330 --> 09:34.790] starts by identifying the frequency and capturing the signal. This can be done either by [09:34.790 --> 09:38.430] analyzing FCC documentation, by scanning the whole spectrum. In this case, it was [09:38.430 --> 09:42.790] configurable. Like, we figured out where it was configurable, so we set those frequencies and [09:42.790 --> 09:46.290] then we appropriately captured it in GQRX as seen on the waterfall on the right. [09:46.290 --> 09:53.390] And this doesn't take expensive equipment. $30 TV dongle, some $100 radios, you can really [09:53.390 --> 09:55.170] start moving along very quickly. [09:55.170 --> 10:00.890] 100%. So then, we started analyzing the signal and figured out that Gotenna Pro was using [10:00.890 --> 10:06.730] 4FSK. That is four-level frequency shift keying. That's where the carrier shifted between four [10:06.730 --> 10:11.550] discrete frequencies. As we can see on the screen, it goes between negative 1.5 and positive [10:11.550 --> 10:18.550] 1.5. We implemented a custom GNU radio flow graph that can decode this exact type of 4FSK [10:18.550 --> 10:24.390] that Gotenna was using. Once we were confident that our demodulation was successful, we [10:24.390 --> 10:31.110] started analyzing raw bytes and their ASCII representation. In this case, in Gen 1 and Gen 2, [10:31.110 --> 10:37.350] we were able to see the GID, the call sign, and the payload all unencrypted. So this was [10:37.350 --> 10:43.050] sort of, like we're seeing here, it is encrypted somehow because we cannot see any of the [10:43.050 --> 10:50.850] data. It's more of an obfuscation, really. So then, we sent two identical messages and we [10:50.850 --> 10:57.150] compared them. So we see that in yellow color, they're mostly the same. They only differ in [10:57.150 --> 11:03.150] the red color. And red only is the one that changes from if the same packet is being sent. So [11:03.150 --> 11:09.870] this is very commonly some form of static encryption in use. This observation is actually [11:09.870 --> 11:20.830] data whitening, not to be confused with white shadowing. So... [11:20.830 --> 11:25.290] data whitening is a technique that ensures that there are no long sequences of zeros that can [11:25.290 --> 11:32.170] cause drops in communication. It uses XOR with a static set of bytes. Those bytes are [11:32.170 --> 11:35.570] typically generated by something called linear feedback shift register, and we're gonna talk [11:35.570 --> 11:40.450] about it later. It's important to note that while this is similar to XOR encryption, it is not [11:40.450 --> 11:46.450] cryptographically secure, as we will demonstrate in the next few slides. So our de-whitening [11:46.450 --> 11:52.030] process is shown in this algorithm. We transmit a handful of A's followed by a handful of B's. So [11:52.030 --> 11:57.050] for those who are not familiar with ASCII representation in hex, capital A is 41, so you'll [11:57.050 --> 12:02.950] see that a lot throughout our presentation, and B will be 42. So we transmit a handful of [12:02.950 --> 12:10.330] number of A's, we extract a byte from that transmission, and we XOR it with 0x41, which is [12:10.330 --> 12:15.410] capital A, and then that will give us our potential key stream. We then use that key stream [12:15.410 --> 12:19.490] against the second message, which is with B's, and then we repeat that for the length of the [12:19.490 --> 12:24.730] entire message. And then we only keep the bytes that produce the accurate result, i.e. we [12:24.730 --> 12:34.950] receive the B's. At that point, we found our offset at 42. This means that Gotenna is [12:35.510 --> 12:39.710] offsetting this, like the entire, probably the header, because we've seen in the beginning [12:39.710 --> 12:44.910] that the header and data are combined. So in this case, the payload was started off at 42, and [12:44.910 --> 12:50.050] we found all of the green bytes in the first green line, and when we apply that against the [12:50.050 --> 12:55.790] message, we get 42's, and we translate that to ASCII, those are B's. So we have a partial [12:55.790 --> 13:00.390] whitening key. Then we can use this against a different message. So here, we have the [13:00.390 --> 13:06.310] payload between 0 and 71. We can de-whiten everything after 42, so all part in orange, we [13:06.510 --> 13:12.090] de-whiten, and then we can receive that, okay, we have seen 10 A's. So we have 10 41's, and [13:12.090 --> 13:18.050] also the 0 A that's also represented as the lengths. However, Gotenna is using a custom [13:18.050 --> 13:25.870] header, so we do not know what the 0 to 41 is. And the only way to find a whitening key for [13:25.870 --> 13:31.810] something is you have to know what's there. So we keep looking. So we're investigating special [13:31.810 --> 13:39.310] conditions, so we reiterate that we cannot, we don't know what's below 42. So we observe a [13:39.310 --> 13:44.790] special condition when we said 100 A's. What happens there is that the message splits. As you [13:44.790 --> 13:52.390] can see here, our capture received two different messages. So then, let's investigate that. So we [13:52.390 --> 13:57.350] run the same exact script that was shown in that algorithm against the second message, and we see [13:57.570 --> 14:03.530] a potential XOR starting at byte 2 instead of 42. So this means this is a fragment split, the [14:03.530 --> 14:10.190] message split, and the payload started at offset 42. So we now have extra 40 bytes shown in green, [14:10.190 --> 14:17.090] we combine them with the already existing key that we found earlier between 42 and 96. And then [14:17.090 --> 14:24.890] that gives us a key between 2 and 96. Now we use that, we use that key, so we take our packet, we [14:24.890 --> 14:29.510] apply the key between 2 and 96, and now we're seeing the payload, but we're not only seeing the [14:29.510 --> 14:34.810] payload, we're also seeing the call sign. So my call sign is $hide, and we can see that in blue. [14:34.990 --> 14:42.070] That is very critical. So another part that Gotenna was using was Gotenna identifier, or GID. So in [14:42.070 --> 14:47.750] this case, we could not easily identify there. It was not, like, easily seen. So, but we do have a [14:47.750 --> 14:51.910] known value, and this is very important against known values. If we have a known value, i.e. in [14:51.910 --> 14:57.010] the app, it told us the very bottom part at 1029, that's our GID. So we're looking for that. So [14:57.010 --> 15:04.230] eventually, we discover it in the green, in the orange part in the packet. It is encoded in a very [15:04.230 --> 15:10.490] special way. So first, the 7 bits that are containing the actual number, and then the most [15:10.490 --> 15:15.950] significant bit indicates where another byte is following. So that's how they avoid the use of [15:15.950 --> 15:20.890] essentially, for example, as you can see, the 0A in both the payload and the call sign, that's the [15:20.890 --> 15:25.650] length. That's how they can sort of avoid, like, be more efficient of the use of the data stream [15:25.650 --> 15:30.630] within the radio. So that's simple enough. We can write this Python decode script to decode the [15:30.630 --> 15:34.750] GID, and then we can take the orange bytes at the top and get the orange bytes at the bottom. [15:34.750 --> 15:42.390] Relatively simple. So now, our next part was like, OK, let's discover the byte 0. So FCC comes to [15:42.390 --> 15:47.750] the rescue. They have a lot of useful information. I highly recommend FCC documentation. So that [15:47.750 --> 15:53.890] says, the FCC essentially says that GoTenna is using SI4460 radio, and that radio, based on its [15:53.890 --> 16:00.250] documentation, adds length as byte 0. So that means that we can find our node. We take our packet, [16:00.250 --> 16:06.030] we take the length, we get that 69. So then we have to subtract 1, because that is the length byte. [16:06.030 --> 16:13.750] So we get 68. We convert decimal 68 to hex, and we get 44. And then the ciphertext was 47. We [16:13.750 --> 16:21.530] extorted 2, and we get 3. So that is our whitening byte at byte 0. For byte 1, we did a lot of [16:21.530 --> 16:26.130] testing, and eventually we figured out it was 96. So we'll kind of skip all the detail there, [16:26.130 --> 16:30.230] because it's a short presentation. So in our current de-whitening status, we have pretty much [16:30.230 --> 16:36.230] everything from byte 0 to 96. We do not, unfortunately, know what last 10 are. So, of course, [16:36.230 --> 16:42.850] we do more investigation. We find that the two bytes immediately following the message are a [16:42.850 --> 16:49.630] result of CRC16 CCITT variant. CRC16 stands for Cyclered Redundancy Check. It's used as error [16:49.630 --> 16:56.290] correcting code that is capable of determining whether or not the payload has been corrupted in [16:56.290 --> 17:01.130] the transmission. So that's a very quick way to determine that. So we also do more analysis. We [17:01.130 --> 17:06.830] figure out that this CRC is initialized with 0s, and it uses 1021 as the polynomial. So then we [17:06.830 --> 17:12.010] take the entire packet up to those 10 bytes, and we compute the CRC16. So here on this slide, you [17:12.010 --> 17:18.110] can see the Python script that we implemented. So it's using 0s and 1021 as the polynomial. So [17:18.110 --> 17:22.810] then we run it through that function, we put the packet that we saw earlier through that function, [17:22.810 --> 17:29.810] and then we get the CRC16 value is DCD2. And then our whitened message, the ciphertext, was BCAA. [17:30.110 --> 17:36.150] So then we take, we XOR the two, and we get that the key at that offset is 6078. Okay, pretty [17:36.150 --> 17:42.670] great. So then the last 8 bytes are a result of Reed-Solomon error correcting scheme. So Gotenna [17:42.670 --> 17:47.870] is using both CRC and Reed-Solomon for error detection and correction. So a very [17:47.870 --> 17:53.890] powerful part about Reed-Solomon is that it can not only detect the errors, it can also correct [17:53.890 --> 17:58.650] them. So they are using 8 error correction symbols and first consecutive root set to 1. So we're [17:58.650 --> 18:02.950] using Reed-Solomon library and these four lines to essentially compute the Reed-Solomon against [18:02.950 --> 18:10.610] the packet we found earlier. Once we do that, we get the line in the first bullet. So those are [18:10.610 --> 18:15.390] those 8 bytes. We get the whitened message, the ciphertext, we XOR the two, and we have the [18:15.390 --> 18:20.950] entire key. We have now the entire sequence from zero to the end. So that's pretty awesome, [18:20.950 --> 18:31.590] right? So now a big part here that we want to note is that this entire sequence has been [18:31.590 --> 18:36.070] generated by something called linear feedback shift register or LFSR polynomial. A very [18:36.070 --> 18:40.710] powerful thing about this algorithm called Berlikamp-Massey. So we can use this sequence [18:40.710 --> 18:45.810] within Berlikamp-Massey to retrieve this polynomial. The polynomial is shown at the bottom. [18:45.810 --> 18:51.430] But there is more to here. So in case that we could not determine something like byte 1 or any [18:51.430 --> 18:55.550] other part, like we could have a very partial sequence, we could use Berlikamp-Massey and [18:55.550 --> 19:01.590] mathematical techniques to determine this polynomial and the associated sequence even if we [19:01.590 --> 19:05.650] don't know things. So we could technically wait enough time and enough brute force using [19:05.650 --> 19:10.390] Berlikamp-Massey, only knowing the payload, figure out the header, even if they were not [19:10.390 --> 19:14.670] being split. So math is pretty awesome thing. So we can do that. [19:15.910 --> 19:21.130] So yeah, so this is the polynomial. So they're using x to the 23. So you know that, you know, and [19:21.130 --> 19:27.210] this is not, this is just meant to ensure that the receiver and the transmitter do not lose [19:27.210 --> 19:29.490] connection. So this is not meant as encryption. [19:29.670 --> 19:34.470] Yeah, this is really acting almost like a form of two party authentication to make sure yes, they [19:34.470 --> 19:40.330] received the message. Yes, I've received the message and using that as a way to almost have a [19:40.330 --> 19:41.010] packet count. [19:43.370 --> 19:47.050] So in our current decoding process, so this is done in green radio and we're doing this [19:47.050 --> 19:52.870] essentially live. And this is just a screen capture of my console. So we get the raw bytes and [19:52.870 --> 19:57.630] we automatically extract the GID. We apply the function. We can translate that to ASCII. We get [19:57.630 --> 20:02.590] the call sign, the payload, including multi-fragmented messages. So even in multi-fragmented [20:02.590 --> 20:07.930] we can still extract the payload. So what Gotenna chose to encrypt. So we played a bit with [20:07.930 --> 20:13.510] encryption and we see that it's only the payload. So what does it mean essentially once we can read [20:13.510 --> 20:18.150] all of the other signs? Because in encrypted, unencrypted mode, all of these are visible. [20:18.150 --> 20:24.010] So everything you see in red here means that at this point where we currently are, we are able to [20:24.010 --> 20:28.850] see the message length. That can be pretty valuable. That can definitely add up to things in [20:28.850 --> 20:35.170] the future, especially with long term collection techniques. The GID, the GID is going to be your [20:35.170 --> 20:39.970] unique identifier, which used to be your cell phone number and you had to pick for it to be a [20:39.970 --> 20:46.290] randomized one, which we found out was just actually epoch. But you now can still, with this, [20:46.290 --> 20:50.770] they don't do the phone number. So that's a much better improvement there. But that GID tells me [20:50.770 --> 20:57.650] that is that exact same device. And you can change it, but understand that that GID is a unique [20:57.650 --> 21:01.310] identifier like a MAC address that follows you. Now the call sign's a little bit different. This [21:01.310 --> 21:07.650] goes back to my former community. When you have call signs involved that can be read in the clear, [21:07.650 --> 21:12.730] now I possibly know how many people are in an organization because typically they have a [21:12.730 --> 21:18.310] numerical sequence after it and I can start telling more about that individual organization. So by [21:18.310 --> 21:24.110] having the equipment and the call sign, I can now start linking equipment to not only [21:24.110 --> 21:29.870] organizations, but individuals to who was using the equipment at what time. Payload length, again, [21:29.870 --> 21:35.090] much like message length. That gives us really valuable things to know what is it that we need [21:35.090 --> 21:39.610] to focus on and what are they saying. Is it short messages? Long messages? Are they using brevity? [21:41.210 --> 21:46.070] And the CRC and the Reed-Solomon, we're gonna look and see that those become fairly valuable in the [21:46.070 --> 21:52.410] end. But these are the reasons this really concerned me. 100%. So now in this case, we've [21:52.410 --> 21:56.670] shown what we discovered so far. So we go more in our analysis, right? So that's what happens, [21:56.670 --> 22:01.150] right? So we analyze the remaining fields. We see the highlighted in blue. We decode that and [22:01.150 --> 22:05.170] figure out that's the time stamp. So you see here January 12th, that's we did the very initial [22:05.170 --> 22:19.540] capture. So that's pretty awesome. So, um, we also discovered these tags. So, ha ha. Ha ha. [22:20.000 --> 22:25.480] There we go. And we knew we were on our way to something great at this point. Yeah. So an [22:25.480 --> 22:29.120] additional thing with this presentation that we want to do is we want to teach you how we do [22:29.120 --> 22:34.000] reverse engineering. So we discovered that this protocol is using tags. So they're using tag [22:34.000 --> 22:39.460] 57, tag 24, and others. So this is important to note. So we'll use this in the rest of the [22:39.460 --> 22:45.660] presentation, but it's important to note how we discovered that, okay, so 57 or 39 hex, after [22:45.660 --> 22:52.160] that, there is the, um, UTC time stamp. So then we use this in tag-based identification in our [22:52.160 --> 22:58.700] script. So, uh, we take the tag is equal to 57 and then we appropriately, uh, apply, uh, the [22:58.700 --> 23:03.680] Python code to decode that. So that's what we're doing. So at this point we're a bit stuck, [23:03.680 --> 23:08.100] right? So we could keep going the same things over and over again and like eventually we'll, we'll [23:08.100 --> 23:12.980] get everything. Maybe we won't, but we're, you know, what happened in the B1 here? So this is [23:12.980 --> 23:19.760] where I kind of fell back to the version 1 when I worked with Tim Kerster on that. And he and I [23:19.760 --> 23:24.100] had kind of a light bulb moment. He's an engineer, I'm a knuckle dragger. So we looked at it two [23:24.100 --> 23:29.840] totally different ways. So he went home that night to start working on an automatic, um, [23:29.840 --> 23:35.000] demodulator for the FSK and I started seeing what I could find so we could try to compare [23:35.000 --> 23:39.760] knowledge and he comes back the next day and goes, Woody, I really hope that, you know, this [23:39.760 --> 23:43.980] demodulator that I made is working. I wish there was some way that I could check against what the [23:43.980 --> 23:48.800] actual code that's coming out is to make sure that everything's correct. And I said, well, hey, [23:48.800 --> 23:52.180] we can just compare it to the stuff that I've been looking at through the UART and then we'll [23:52.180 --> 23:57.780] just know, right? At which point he said, what do you mean you have UART? I just assumed he'd [23:57.780 --> 24:04.120] check. Yeah, so we don't have UART in this case with GoTenna Pro, but we have something better. [24:04.120 --> 24:08.000] So Clayton just casually mentions, um, why don't you read from the app? It was useful when I did [24:08.000 --> 24:12.800] Mesh. Um, wait, what? We had code the entire time? Like, what? I go online and like, I'm [24:12.800 --> 24:17.900] supposedly this like reverse engineer, right? And like, I didn't look at the app. What? So [24:17.900 --> 24:24.400] everything in the app is plain text. Yeah. Look at this. So we go in, decompile it. Boom. We can [24:24.400 --> 24:29.020] see the firmware in there. We can see the source code. Like I was looking for this, but like, [24:29.020 --> 24:34.480] it's right there. Wow. Yeah. So companies really don't think it's like hackers. So like hackers, [24:34.480 --> 24:37.780] like, like the guys in these pictures, they can find full source code and firmware available [24:37.780 --> 24:44.980] completely unencrypted and unobfuscated. It exists. Yeah. And this is where we said, oh, I [24:44.980 --> 24:50.140] think things are going to be a little bit better now because in version one, we just had to kind [24:50.140 --> 24:53.480] of bare knuckle through it and hope we were close. We just knew that our demodulation was [24:53.480 --> 24:58.000] working. We didn't have tags yet, which I think we're going to get to. Yeah. So we go back and [24:58.000 --> 25:00.640] we'll look through a source code. We find these tags. Remember that we were talking about [25:00.640 --> 25:05.160] reverse engineering tags. We see 57 right here. So we were spot on. Our reverse engineering, [25:05.160 --> 25:09.880] like methodology was very spot on. So that's what we want to show you. We find more tags, [25:09.880 --> 25:14.700] right? PB broadcast, we see key data coordinates. So, you know, we have a bunch of tags, [25:14.700 --> 25:19.320] right? So you're assuming that we use this Java source code, essentially slowly update our [25:19.320 --> 25:24.400] script. This may take like a couple of months and eventually we'll have a better product. Well, [25:24.400 --> 25:30.940] not quite. Ain't nobody got time for that. So we find an interesting observation. There's a [25:30.940 --> 25:35.500] file descriptor and we find something called Proto 3. Some of you are familiar with that [25:35.500 --> 25:40.380] already. But we weren't, right? So we look this up and it's a protocol buffer. It's used as an [25:40.380 --> 25:45.780] open source library developed by Google to help companies and other people to develop custom [25:45.780 --> 25:52.260] protocols. And they're supported by all kinds of languages. Python, Java, C. All kinds of things. [25:52.260 --> 25:59.540] Right? So we go online and we kind of take the string, the binary string, and we kind of figure [25:59.540 --> 26:03.700] out, okay, these may be the fields, right? The sender, the call sign. And then let's try it. [26:03.700 --> 26:08.000] So we put in the hex at the bottom. And then, wow, the whole thing is there. [26:08.820 --> 26:13.220] But literally, you just put it in the program on one side, push a button, and it gives you [26:13.220 --> 26:19.180] everything on the other. It's automatic. Like, this did not happen in V1 or Mesh. This is way [26:19.180 --> 26:25.880] easier. So, yeah. So we then go in and then let's do this for real. So we go through all of the [26:26.760 --> 26:31.820] decompiled stuff. We take the file extractors. We put in our own custom file called Proto [26:31.820 --> 26:38.340] extraction. And that will generate a binary file. And then we use PBTK. This is an open source tool. [26:38.820 --> 26:43.780] We use this against this binary file. And that gives us all of these things at the bottom. Like, [26:43.780 --> 26:48.920] all the proto files. So the base header essentially sets up the message. This imports the header [26:48.920 --> 26:54.980] protobuf. The header protobuf was what we were doing in reverse engineering in Blackbox. What's [26:54.980 --> 27:00.760] important here is this data type, right? This enum would be very difficult to reverse engineer. Like, [27:00.760 --> 27:06.060] we would have to take so many samples and then hope that we can maybe figure out the text is 3 [27:06.060 --> 27:11.820] and then ping is 5. That would be very difficult. So let's go back full circle. What were those [27:11.820 --> 27:16.080] tags, right? So if we compile this protobuf in Java, because that's what Gotenna is using, [27:16.080 --> 27:20.700] we can see these cases. So these cases are used as different parts of the protocol to essentially [27:20.700 --> 27:26.280] define different things. So we were spot on, right? These tags were cases. That's pretty awesome. And [27:26.280 --> 27:31.200] we got 57 and the rest of them. And you also noticed that you could see things like when they [27:31.200 --> 27:37.740] requested, I don't know, keys. You could see the code of how to request a key. 100%. So yeah, so [27:38.280 --> 27:42.860] a cool part about protobuf is they can be compiled for Python. What else is using Python? [27:44.160 --> 27:48.220] I believe there's a little thing called GNU radio. Yeah, that might be cool. It's so easy, [27:48.220 --> 27:53.380] even I can do it. Yeah. So we go in and we import a base message data type and we make a [27:53.380 --> 28:00.420] statement to associate everything and perfect decode! Victory! [28:02.640 --> 28:07.260] But wait, we haven't found a single vulnerability yet. We just decoded the thing. There's 30 more [28:07.260 --> 28:13.480] slides of actual vulnerabilities. So, you know, stay seated. So with this decode, now that we can [28:13.480 --> 28:21.120] read things, we get the we can do frequency decoding, shared location, we can do emergency [28:21.120 --> 28:26.000] messages, all kinds of things. The only thing where we received a challenge was in, um, [28:26.000 --> 28:30.500] coordinate decoding. So in the app, we can make, for example, like around this island, we can make [28:30.500 --> 28:35.560] coordinates and then when we're capturing it, we see binary data represented as base64 and JSON [28:36.180 --> 28:41.360] and in this case, there, there isn't much, right? So like, like we can't see here. So we go back [28:41.360 --> 28:46.780] to proto, they're defined as bytes, so that means that decoding on our side has not been added. So [28:46.780 --> 28:51.140] that's very simple. We just use decode as little nd and double double and then boom, we get the [28:51.140 --> 28:56.460] coordinates. So that's fixed. So now we found our true first vulnerability, right? It's like, [28:56.460 --> 29:00.460] like we encrypt the message and we're just kind of looking at things. So, so what can you do when [29:00.460 --> 29:04.660] somebody can capture yes or no and tell the differences? When you start dealing with [29:04.660 --> 29:08.700] organizations that are using brevity for communication, simple things like the length [29:08.700 --> 29:13.020] of a message become very easy, even without going into advanced steps to be able to tell what kind [29:13.020 --> 29:17.700] of communication may be happening. Are they only sending coordinates? Are they sending commands? Are [29:17.700 --> 29:22.060] they just sending comms checks? So this starts becoming really important, being able to understand [29:22.060 --> 29:28.340] these message lengths. Yeah, so it's crucial. So then let's go look at how they're doing encryption. [29:28.340 --> 29:32.760] So one of, one form of encryption is encrypting the broadcast. So this is the process how it works [29:32.760 --> 29:37.320] in the app. So we generate the new key, we put in the name, it can be either broadcast or QR code, [29:37.320 --> 29:40.360] and we're going to get to that, right? That's not important, but what we go in is the validation [29:40.360 --> 29:46.720] thing. It's kind of interesting, right? We do this a bunch of times, like they're kind of short. [29:47.060 --> 29:54.660] So, and it's all lowercase or numbers, and that's it. But there is a space, so I guess we have nine, [29:54.660 --> 30:00.940] but the space is consistent, so nope, really just eight. So you have lowercase numbers, or I'm sorry, [30:00.940 --> 30:04.920] lowercase letters and numbers, and that's all you have to figure out. And you only have to figure [30:04.920 --> 30:09.900] out eight of them, put a space in the middle for your dictionary. Yeah, so very interesting. So then [30:09.900 --> 30:14.380] we go in, okay, we capture this QR broadcast, right? QR broadcast gets sent unencrypted over [30:14.380 --> 30:19.340] the air, so this key data is actually encrypted, right? So what we have here is encrypted, but [30:19.340 --> 30:24.160] you know, we do some of our analysis, and then long story short, to make the fit in the presentation, [30:24.160 --> 30:29.620] we were able to decrypt it. And the nice thing too is it told us where the IV and the salt was, [30:29.620 --> 30:34.200] because we were able to find where they were, so it made it much easier because we knew which was [30:34.200 --> 30:40.200] which. So then essentially the key data is fed into the PBKDF HMAC with 10,000 orations. This is [30:40.280 --> 30:45.980] a very good hashing, but it's protected by state character password. So let's say password is known, [30:45.980 --> 30:51.280] it's going to give us the encryption key, and encryption key along with the IV and the GID [30:51.280 --> 30:57.700] can decrypt the cipher text. AES-GCM will give us the plain text and HMAC. We also, you know, [30:57.700 --> 31:02.040] to be good communications people, we can compute our own HMAC and verify the message was correct, [31:02.040 --> 31:07.880] right? So now one may ask, like, how complex, how complicated is it to get this password? So [31:08.540 --> 31:15.480] in MD5 this will be very quick. PBKDF2 is pretty strong. So we do hashcat and we essentially [31:15.480 --> 31:22.440] analyze. This is an actual engineering analysis. So with RTX4090 one card, one can figure this out [31:22.440 --> 31:28.380] in 15.33 days. A very common commercial cracking rig can have 12 of these, so in 1.27 days, [31:28.380 --> 31:33.540] one can determine this password. Now we look at more well-funded adversaries. A100 is used by [31:33.540 --> 31:38.780] chat GPT, neural nets, AI, that's the whole thing now, right? This one card is actually worse, [31:38.780 --> 31:44.160] right? But if you have 10,000 of them, you can figure out in 5.31 seconds. It's important to [31:44.160 --> 31:49.880] know that all of these times here... It's important to know that all of these are kind of worst case [31:49.880 --> 31:54.400] scenarios. That means that your script found the password the very last time. So it's likely it's [31:54.400 --> 32:01.200] going to be like about half the time. So we go in and we can essentially, if we know the key, we [32:01.200 --> 32:05.960] wrote our little script and then we can decode it. We can get the hex key and now we can add this to [32:05.960 --> 32:11.040] our automatic decoding script and now we can decrypt live. Awesome. And we can also decrypt [32:11.040 --> 32:17.160] everything that happened in the past. So now we have it all. Yeah, but there's more. So another [32:17.160 --> 32:22.460] form of communication is point-to-point and that uses public key encryption. So public key [32:22.460 --> 32:28.020] encryption on its own is a lot more secure. It uses PKI, or public key encryption, to share the [32:28.020 --> 32:34.320] symmetric key. It doesn't require any of this manual key sharing. However, in our code, we, the [32:34.320 --> 32:38.420] message receiver class was not, did not cleanly decompile. So we could spend some time, do that, [32:38.420 --> 32:44.120] but in help with some Craigslist, eBay and Freedom, maybe we can figure it out without it. So [32:44.120 --> 32:48.540] initial conversation starts with public key sharing. So here we get the GIDs and the public [32:48.540 --> 32:54.880] keys. Pretty cool. So then we get to the source code. Uh, we figured out that the, uh, public key [32:54.880 --> 33:01.420] and the private key are, uh, generated using ECDH384R1 curve to generate the share key. The [33:01.420 --> 33:07.700] share key is used as first input to HMAC SHA-256. The second input is not known here. So we [33:07.700 --> 33:12.660] could not figure out what are the parameters here. So using Freedom, uh, we can essentially [33:12.660 --> 33:19.420] intercept this Cryptomagdo final. So we, we essentially instrument this phone right here, which [33:19.420 --> 33:25.740] is an Android phone. We, this is connected with Gotenna and then, uh, we cap, we send a P2P and [33:25.740 --> 33:29.960] then we capture this. And then from this kind of hex string, we can figure out, okay, the second [33:29.960 --> 33:35.340] parameter is actually concatenated GID public key and the private, uh, and the share key. We do [33:35.340 --> 33:38.620] know the public key and the GID. We just found that earlier in the slide earlier. We don't know [33:38.620 --> 33:43.280] the share key. So let's look for that. We go in the device and we find the Gotenna folder in that [33:43.280 --> 33:49.080] same phone and we find something called Gotenna key encryption. I wonder if that's used for [33:49.680 --> 33:56.420] encryption. So we go in and okay, it's using private keys, share keys, but now to, you know, [33:56.420 --> 34:00.980] the best luck, this, all of this is encrypted, right? Fully encrypted, we, we can't read it. [34:00.980 --> 34:06.880] But let, let's verify. Okay. So we go in and we find the file that's using Gotenna key [34:06.880 --> 34:12.440] encryption. We see at the top something called as an IV. But we can't tell from that function. So [34:12.440 --> 34:16.600] we track this over two different functions and figure out it's not only used as a static hi- as [34:16.600 --> 34:24.460] an IV, it's used as a static IV to AES-GCM. So, keys are AES-GCM encrypted, but static IV allows [34:24.460 --> 34:29.960] complete encryption bypass. This is when AES is doing what not, what, what AES is not meant to [34:29.960 --> 34:34.440] do, right? And then using the public key as a known plain text and the encrypted, uh, public [34:34.440 --> 34:39.220] key, we can XOR them to get the key stream and then we can decrypt essentially everything else. [34:39.220 --> 34:44.200] And, and what's stored in a database are public keys, shared keys, broadcast keys, the top two, [34:44.200 --> 34:50.920] the pin, pretty much everything. So we have a lot of stuff here. So then, yeah, there is AES. [34:51.220 --> 34:59.180] There is. However, there's also AES sitting here and then implementation or configuration sitting [34:59.180 --> 35:05.080] here. This is kinda like having a really nice blast proof, bullet proof door at your house and [35:05.080 --> 35:09.740] then realizing that when the bad guys come, they just cut a hole through the siding and the dry [35:09.740 --> 35:15.320] wall right next to it. Yeah. So, let's now summarize this just so kinda everybody can be on [35:15.320 --> 35:19.980] the same page. We get the public key and the public key cipher text in the XML. We XOR them to [35:19.980 --> 35:23.600] get the key stream and then we take the key stream and XOR that with the private key cipher [35:23.600 --> 35:28.300] text to get the private key. Then, when we have the p- public key and the private key, we use [35:28.300 --> 35:34.240] ZCDH to get the shared key. Shared key is used within HMAC SHA-256 along with GID public key [35:34.240 --> 35:38.420] and the shared key to get the encryption key. That along with the IV and the GID can decrypt [35:38.420 --> 35:43.740] the cipher text of P2P encryption. Group encryption is another form of encryption. It's the [35:43.740 --> 35:48.400] last one that we'll talk about. Uh, or the last one supported really. Um, so it's using the [35:48.400 --> 35:52.680] very same method, so same exact attack against P2P works against this and we can show here [35:52.680 --> 35:57.320] that we have done it. So this are, this are true vulnerability summary, right, of encryption [35:57.320 --> 36:01.180] summary findings. So broadcast is vulnerable and allows unauthorized decryption. Using set up [36:01.180 --> 36:05.280] QR message, which is captured over the air, and brute force password, we can decrypt it. We [36:05.280 --> 36:09.780] can also get it if the phone is compromised and we get the, the key from there. P2P and group [36:09.780 --> 36:14.600] are both vulnerable to unauthorized decryption if, again, the phone is compromised and we get [36:14.600 --> 36:18.880] some of these. Um, so if you want to know the feasibility, you can check out our DEF CON talks [36:18.880 --> 36:22.680] and things like that to sort of really know that. There's no authentication public key, so [36:22.680 --> 36:26.520] man in the building is possible. Short messages, less than one fragment used, less secure [36:26.520 --> 36:32.440] AES CTR, so less than 35, 45 characters, depending on the message. Uh, are using CTR, so that [36:32.440 --> 36:37.220] has integrity concerns, even though it is encrypted. And then longer messages use more secure [36:37.220 --> 36:43.160] ACM, uh, GCM, but you need to be sending like 50 characters to get to that. So we also, you [36:43.160 --> 36:48.080] know, we could also transmit directly from the GNU radio, uh, from, from our GNU radio. We can [36:48.080 --> 36:51.300] spoof GID call sign the message. We can get into the existing... [36:51.300 --> 37:01.280] So I could take a HackRF or an NES or a Blade and I can actually make my own Gotenna out of it and [37:01.280 --> 37:02.600] just start using my computer. [37:02.600 --> 37:08.780] We also added support for Wireshark. So we have, um, essentially that, so, so, so all the [37:08.780 --> 37:12.540] messages are fed into Wireshark. We don't have the decode there currently, but we'll add it [37:12.540 --> 37:18.640] eventually. Um, so now let's get to live demos. So if you want to, if you have a Gotenna Pro, [37:18.640 --> 37:22.680] then you can get the frequency on the left and the encryption in the middle and validation on the [37:22.680 --> 37:26.060] right. So we have six minutes, so let's be quick. [37:27.780 --> 37:39.440] I wouldn't scan it because we're both sketchy guys, but still. So it's firing up live right now. [37:39.440 --> 37:44.480] He's just turning the program on. You can see it's already starting to sniff and listen. We'd [37:44.480 --> 37:49.060] like to have a little waterfall so we can see when we are or not capturing. Now he's going to send a [37:49.060 --> 38:04.980] message and there you go. There we go. We have enough time, so let's see if we can decrypt [38:04.980 --> 38:12.900] something. So now being able to do the same type of process for an encrypted message. So that was a [38:12.900 --> 38:17.560] broadcast. Now broadcast means it's sent out so that anyone that has one of these devices is able [38:17.560 --> 38:22.140] to catch it. It's meant for an emergency situation or you're just looking for other people around [38:22.140 --> 38:28.960] you. But the next step is all those things we talked about by combining that information, can [38:28.960 --> 38:36.140] you take an encrypted message for a group or a person to person and actually decrypt and see it? [38:36.460 --> 39:02.800] So when you think about this, this is where everyone feels safe. So while we're going through [39:02.800 --> 39:14.870] this, he's going to set the demo up, you're going to be able to see it. And we'll go ahead, are [39:14.870 --> 39:20.490] there any questions right now while he's setting this up? We have a minute or so. Any questions [39:20.490 --> 39:30.670] over anything that we've seen so far? Okay. Here we go. Now one of the things that I want to make [39:30.670 --> 39:35.470] sure that we cover in this is that when we reached out to Gotenna for the version one [39:35.470 --> 39:41.250] exploit, they were, had zero response. Other than the fact that they said, that's fine, we don't [39:41.250 --> 39:46.410] care. Under the new management, Gotenna was extremely receptive. We got a call back within one [39:46.410 --> 39:53.470] day. Uh, they were happy to take the advice that we gave them and they are actively working to [39:53.470 --> 39:59.110] try to fix these issues. That's why we are going to make sure we wait at least two months from [39:59.110 --> 40:04.910] today before we release the full code publicly, but then we will. Now for gen one and two, the [40:04.910 --> 40:09.530] code's already out there. Okay, so now we're ready. So I'm going to, we're going to send [40:09.530 --> 40:12.910] something encrypted just so we can see that messages are indeed encrypted. So we can see [40:12.910 --> 40:33.610] they're, they're encrypted now. Now this part here decrypted. So this was added to our local [40:33.610 --> 40:38.630] database. So we're going to run our script again. So this is going to now pull the keys from [40:38.630 --> 40:52.440] there immediately. And then we will transmit again. Boom, this was encrypted. So now it's full [40:52.440 --> 41:06.640] circle. So, you know, live demos are something that I'm a big fan of. So Irwin did an amazing job [41:06.640 --> 41:12.780] of writing all this crazy code. I don't want anyone to misconstrue that. The big thing that we [41:12.780 --> 41:20.560] want to make sure that everyone takes away from this is it is up to everyone in this community to [41:20.560 --> 41:25.580] test equipment. Just because something says it's secure, don't believe it. Challenge it. And [41:25.580 --> 41:29.960] when you find it, see if the manufacturer's willing to listen. Occasionally they are. Gotenna [41:29.960 --> 41:36.520] was. Most of the ones I've dealt with aren't. So if something's been done in the past, don't be [41:36.520 --> 41:40.400] afraid to try to recreate it when something new comes out. You might find that they didn't [41:40.400 --> 41:43.860] change a lot of the things and then you can move forward and do well with it. [41:45.040 --> 41:50.200] Yep, so let's talk about, I mean you already mentioned this, so they were very receptive. [41:53.340 --> 41:54.820] And yeah, the conclusion. [41:54.900 --> 42:01.760] Yeah, so the big things we wanted to say about this is, you know, we reached out to industry. We [42:01.760 --> 42:05.860] were able to have a good relationship with them doing this. They took away key points. [42:06.040 --> 42:10.380] Acknowledgements of what we want to make sure we talk about here. So we want to reach out to [42:10.380 --> 42:14.440] White Shadow, who unfortunately couldn't be here because he's actually doing some responsible [42:14.440 --> 42:19.320] things for his family, but he is going to be here later. But don't tell him I said anything nice. [42:19.460 --> 42:23.080] What the Freak, which is the wireless CTF team that... [42:23.080 --> 42:25.020] Let's do a shout. We got a win today. [42:25.860 --> 42:29.440] Which I'm glad they're here because now all the other teams are jumping ahead of them. [42:30.020 --> 42:32.480] Yep, so we also want to thank EFF and CISA. [42:32.940 --> 42:38.280] Both of them were amazing organizations and very easy to work with. The RF Hacker Sanctuary, [42:38.280 --> 42:44.400] please go there, try some challenges. It's everything from Wi-Fi, Bluetooth, tire pressure [42:44.400 --> 42:48.920] sensors, go tennis. All of these challenges will be there as well for you to solve for all the go [42:48.920 --> 42:52.540] tennis stuff. We want to make sure that, you know... [42:52.540 --> 42:57.420] Yeah, Jason Rojas and Cisco Systems. I want to thank them for making my trip here possible and [42:57.420 --> 43:00.500] Potify Media for making this team for this presentation. [43:00.780 --> 43:04.720] And Buffalo Trace, because without them, I probably wouldn't get done as much work as I do. [43:07.380 --> 43:09.800] Thank you for your time. Are there any questions? [43:13.280 --> 43:15.100] Well, thank you and enjoy the con!