1 00:00:00,000 --> 00:00:01,660 Welcome to DEF CON. 2 00:00:01,660 --> 00:00:02,680 First speaker is up. 3 00:00:02,680 --> 00:00:04,000 Let's give him a big hand. 4 00:00:12,870 --> 00:00:14,670 Thank all of you for being here. 5 00:00:14,670 --> 00:00:16,110 Really appreciate it. 6 00:00:16,190 --> 00:00:26,970 So, the first thing we want to talk about is this whole talk has really been pushed because of how much the technology out there is moving to mesh technology. 7 00:00:27,010 --> 00:00:27,890 Everything's meshed. 8 00:00:27,890 --> 00:00:34,310 From cellular, we have mesh-tastic, LoRa, all these different creations. 9 00:00:34,570 --> 00:00:39,870 But one of the creations that has been around for quite a while that we're going to talk about is Gotenna. 10 00:00:39,870 --> 00:00:43,050 And we're going to talk about all three stages that we've seen it go through. 11 00:00:44,370 --> 00:00:45,730 My name's Woody. 12 00:00:45,850 --> 00:00:46,890 This is Erwin. 13 00:00:46,890 --> 00:00:47,890 Yeah, I'm Erwin Korenczyk. 14 00:00:47,890 --> 00:00:49,150 I go by Dollar Hyde. 15 00:00:49,330 --> 00:00:59,170 And we also want to make sure that we gave credit to Clayton Smith, who really did a ton of work on the second generation and made this talk possible. 16 00:00:59,170 --> 00:01:01,470 So, thank you very much for that. 17 00:01:01,850 --> 00:01:02,070 Awesome. 18 00:01:02,070 --> 00:01:02,970 Yeah, thank you, Clayton. 19 00:01:07,610 --> 00:01:12,490 So, mobile mesh networks, the way that they typically work is one device will talk to another. 20 00:01:12,490 --> 00:01:14,330 You're able to go through and pivot. 21 00:01:14,330 --> 00:01:16,430 And that way you can get extended range. 22 00:01:16,510 --> 00:01:19,850 You can have multiple people communicate at the same time. 23 00:01:19,850 --> 00:01:21,610 There's a lot of things that you can do. 24 00:01:21,830 --> 00:01:29,050 Now, one of the things with a traditional network is the way that your data and your controls are handled versus the way that Gotenna mesh does it. 25 00:01:29,050 --> 00:01:33,130 So, the Gotenna's capability of meshing is actually really efficient. 26 00:01:33,130 --> 00:01:41,390 And that's one of the things that makes it fairly unique is because they've combined that and made it pretty controllable. 27 00:01:43,930 --> 00:01:49,650 So, some of you seven years ago may have seen the talk that I did in the RF Hacker Sanctuary. 28 00:01:53,580 --> 00:01:56,220 It was on the Gotenna version one. 29 00:01:57,500 --> 00:01:58,800 This one right here. 30 00:01:58,800 --> 00:02:07,400 So, what you're seeing on the screen right now is as he goes through and does the Gotenna or his script, this was our original exploit. 31 00:02:07,400 --> 00:02:15,200 And what we figured out was the Gotenna is designed over Bluetooth to communicate with a phone, at least the gen one and two were. 32 00:02:15,340 --> 00:02:24,740 Once that happens, then you can send a message that can be either open in a broadcast or person to person or in a group, but you can encrypt it. 33 00:02:25,260 --> 00:02:27,780 And that's what you're seeing here on the screen. 34 00:02:28,120 --> 00:02:34,700 But we were able to see seven years ago that it was broadcasting some things plain text. 35 00:02:34,700 --> 00:02:43,160 And when it broadcasted things plain text, the things that you could see even in encrypted mode were the unique identifier. 36 00:02:43,160 --> 00:02:47,760 Which for the unique identifier for the gen one and two by default, can anyone tell me what it was? 37 00:02:47,860 --> 00:02:49,880 Your cell phone number. 38 00:02:49,940 --> 00:02:57,780 So, this script is demonstrating how we could run against a Gotenna version one and pull your phone number out of the air. 39 00:02:57,940 --> 00:02:59,980 Even if you were using encrypted mode. 40 00:03:00,060 --> 00:03:05,080 Now, they fixed that since, well, they've evolved since then. 41 00:03:05,080 --> 00:03:11,540 Um, and the new management has really made an effort to try to fix some of the issues that have happened in the past. 42 00:03:11,540 --> 00:03:16,700 But this on the screen is actually what it looks like when we're able to come in here and pull this data. 43 00:03:16,700 --> 00:03:20,680 Yeah, and you can see the phone number, call sign, and the message in unencrypted mode. 44 00:03:20,680 --> 00:03:22,720 In encrypted mode, payload is not visible. 45 00:03:22,720 --> 00:03:24,460 But the phone number still is. 46 00:03:24,640 --> 00:03:26,060 So this was gen one. 47 00:03:26,060 --> 00:03:28,660 And if you want to see a live demo of this, come to RF Hackers. 48 00:03:28,660 --> 00:03:30,240 We're showing just the video here. 49 00:03:31,780 --> 00:03:34,860 So, gen one, we see how it communicates. 50 00:03:35,060 --> 00:03:38,340 Now, gen two, they changed some things. 51 00:03:38,340 --> 00:03:41,420 Instead of using two FSK, they moved to four FSK. 52 00:03:41,680 --> 00:03:47,720 But by default, there were still a couple things that were the same that we were able to start exploiting. 53 00:03:47,740 --> 00:03:52,520 Uh, Clayton specifically found some really great things that were vulnerable here. 54 00:03:52,520 --> 00:03:58,180 A lot of them were similar to version one, but you needed a four FSK demodulator to do it. 55 00:03:58,260 --> 00:04:00,480 But you could still find the phone number. 56 00:04:00,480 --> 00:04:04,100 You could still find some of those unique identifiers. 57 00:04:04,220 --> 00:04:09,240 And as we're gonna discuss, those unique identifiers, even if they're not your phone number, can be a bad day. 58 00:04:09,240 --> 00:04:14,680 So this is an example of exactly what we could pull while you think you're doing encrypted messages. 59 00:04:15,140 --> 00:04:21,480 And we start getting your phone number, we can start seeing some of your messages depending on how you're using it. 60 00:04:22,400 --> 00:04:27,040 And we're gonna talk how that can be effective for other things as well. 61 00:04:31,600 --> 00:04:45,520 Now, the current version of Gotenna, the Gotenna Pro, we started working with, one of the things that I do is I'm staffed in the RF Hacker Sanctuary, the RF village, so please come and try some of our challenges out later. 62 00:04:45,520 --> 00:04:49,720 That's actually how a lot of these things get discovered is people trying them in challenges. 63 00:04:50,420 --> 00:04:52,320 Some things that were fixed. 64 00:04:52,440 --> 00:05:00,460 You did not have to connect via Bluetooth because we all know that Bluetooth by itself can be a unique identifier that can be used to find somebody or come after them. 65 00:05:00,460 --> 00:05:07,460 They improved it so you could use either Bluetooth or you could actually hardline to your phone with the device. 66 00:05:07,460 --> 00:05:17,020 And then the only thing that was communicating was either at, you know, the 140 to 170 megahertz band or 445 to 480. 67 00:05:17,020 --> 00:05:21,900 They also improved the channels you could use, you had some bandwidth things you could control. 68 00:05:22,280 --> 00:05:28,280 So, on initial viewing of this, it looked like it was a much more secure device. 69 00:05:28,280 --> 00:05:31,460 But this is what we're going to be talking about. 70 00:05:31,460 --> 00:05:35,180 This is basically the Gen 3. 71 00:05:41,720 --> 00:05:45,800 Why is it important for us to worry about what we give out? 72 00:05:46,360 --> 00:05:53,760 Well, we have some representatives from Wiggle here and I'm sure that they can tell you how important it is to protect your MAC addresses. 73 00:05:53,760 --> 00:06:06,860 In fact, the industry has already started making sure that unique identifiers start rolling and that it's much more difficult to track them because you can be tracked over space and time, geographical location, and it can be used to fingerprint. 74 00:06:06,920 --> 00:06:08,880 So, that's why we're worried about this. 75 00:06:08,880 --> 00:06:11,900 It also gives out unique identifiers about you. 76 00:06:11,900 --> 00:06:20,900 What if I couldn't just tell that you were using that MAC book, but I could tell you whether Tim was using it or whether Jeff was using it, right? 77 00:06:20,900 --> 00:06:26,540 That's even more refined and that's what we're going to start getting into in here and that is why to us it was so important. 78 00:06:27,000 --> 00:06:42,400 Both of us, our primary jobs, when we're not doing this stuff for fun, is to actually help people protect their RF signature and to help people have good cyber security in vehicles, in equipment that they use, and global travels. 79 00:06:45,870 --> 00:06:56,210 So, some of the problems that we started wondering about, is there any chance that we can find some of the same vulnerabilities in a Gen 3 that we find in a Gen 1? 80 00:06:56,210 --> 00:06:59,150 Yeah, so basically we're looking for those GIDs for the call signs. 81 00:06:59,150 --> 00:07:00,870 We're looking, are they present? 82 00:07:01,210 --> 00:07:02,310 Have they fixed it? 83 00:07:02,410 --> 00:07:08,550 Yeah, because it's been seven years, we wanted to see whether or not all those things had been fixed or not. 84 00:07:08,550 --> 00:07:13,790 And some things had and some things we found were still somewhat vulnerable. 85 00:07:13,790 --> 00:07:18,490 But, having that base is what we moved from to be able to do all the rest of this. 86 00:07:18,490 --> 00:07:23,550 So, having a good foothold and then from there, pushing out and finding new things. 87 00:07:27,640 --> 00:07:28,660 So, who are we? 88 00:07:28,660 --> 00:07:29,160 Erwin? 89 00:07:29,160 --> 00:07:30,460 Yeah, so I'm Erwin. 90 00:07:30,460 --> 00:07:32,020 I'm a security researcher. 91 00:07:32,020 --> 00:07:35,960 I'm experienced in hardware and software reverse engineering as well as RF exploitation. 92 00:07:36,260 --> 00:07:47,140 My mission is essentially what's shown on the screen as well as the overall mission to protect this nation and citizens by identifying and mitigating threats before those threats are even known to these people. 93 00:07:47,140 --> 00:07:52,680 So, this is one example of that mission to protect the people that serve us. 94 00:07:52,940 --> 00:07:54,320 My name's Woody. 95 00:07:54,320 --> 00:07:58,160 I'm staff for the RF Hacker Sanctuary or the RF Village. 96 00:08:00,340 --> 00:08:07,880 I was one of the co-authors of the original Gotenna attack, Raptor Captor, some other vehicle exploits and some things like that. 97 00:08:07,880 --> 00:08:12,460 I spent 20 years in special operations before I started playing in this world. 98 00:08:13,180 --> 00:08:19,420 And the reason that this is so important to both of us is we work with law enforcement. 99 00:08:19,420 --> 00:08:20,300 We work with government. 100 00:08:20,300 --> 00:08:22,380 We work with corporations. 101 00:08:23,220 --> 00:08:35,020 And we educate them on how to control and understand all the different aspects, not just the physical but also the digital and even the light aspects of what happens in your life and why it's important. 102 00:08:35,480 --> 00:08:37,840 So, that's what got us to this point. 103 00:08:41,050 --> 00:08:45,250 So, just having encryption is not enough. 104 00:08:45,250 --> 00:08:46,490 Configurations matter. 105 00:08:46,490 --> 00:08:56,510 Imagine having an amazing router with WPA3, an incredible password, and everything's good to go, but you just leave it as an open network. 106 00:08:56,610 --> 00:09:00,230 You still have encryption, but does it matter? 107 00:09:00,350 --> 00:09:01,850 Not at that point. 108 00:09:02,450 --> 00:09:04,950 Configurations, and that's what we're gonna talk about. 109 00:09:04,950 --> 00:09:07,090 Yeah, so this is our testing setup. 110 00:09:07,090 --> 00:09:12,650 So, we were testing in an anechoic chamber at the university where I'm pursuing my PhD in electrical and computer engineering. 111 00:09:12,710 --> 00:09:17,730 We used a representative sample of both iPhones and Androids connected with Gotenna Pros. 112 00:09:17,730 --> 00:09:20,130 And then we used just open source hardware and software. 113 00:09:20,130 --> 00:09:25,230 So, HackRF1 connected with open source software running on an Ubuntu laptop. 114 00:09:25,230 --> 00:09:26,930 So, very simple. 115 00:09:27,570 --> 00:09:33,830 So, the first step of any sort of RF analysis starts by identifying the frequency and capturing the signal. 116 00:09:33,830 --> 00:09:37,910 This can be done either by analyzing FCC documentation, by scanning the whole spectrum. 117 00:09:37,910 --> 00:09:39,250 In this case, it was configurable. 118 00:09:39,250 --> 00:09:46,290 Like, we figured out where it was configurable, so we set those frequencies and then we appropriately captured it in GQRX as seen on the waterfall on the right. 119 00:09:46,290 --> 00:09:48,290 And this doesn't take expensive equipment. 120 00:09:48,450 --> 00:09:55,170 $30 TV dongle, some $100 radios, you can really start moving along very quickly. 121 00:09:55,170 --> 00:09:56,110 100%. 122 00:09:56,110 --> 00:10:02,070 So then, we started analyzing the signal and figured out that Gotenna Pro was using 4FSK. 123 00:10:02,190 --> 00:10:04,450 That is four-level frequency shift keying. 124 00:10:04,450 --> 00:10:07,750 That's where the carrier shifted between four discrete frequencies. 125 00:10:07,750 --> 00:10:12,790 As we can see on the screen, it goes between negative 1.5 and positive 1.5. 126 00:10:12,790 --> 00:10:20,150 We implemented a custom GNU radio flow graph that can decode this exact type of 4FSK that Gotenna was using. 127 00:10:20,850 --> 00:10:28,770 Once we were confident that our demodulation was successful, we started analyzing raw bytes and their ASCII representation. 128 00:10:28,770 --> 00:10:36,510 In this case, in Gen 1 and Gen 2, we were able to see the GID, the call sign, and the payload all unencrypted. 129 00:10:36,590 --> 00:10:43,690 So this was sort of, like we're seeing here, it is encrypted somehow because we cannot see any of the data. 130 00:10:43,690 --> 00:10:45,750 It's more of an obfuscation, really. 131 00:10:46,950 --> 00:10:52,030 So then, we sent two identical messages and we compared them. 132 00:10:52,030 --> 00:10:55,510 So we see that in yellow color, they're mostly the same. 133 00:10:55,570 --> 00:10:58,590 They only differ in the red color. 134 00:10:58,590 --> 00:11:02,990 And red only is the one that changes from if the same packet is being sent. 135 00:11:02,990 --> 00:11:07,110 So this is very commonly some form of static encryption in use. 136 00:11:08,090 --> 00:11:13,310 This observation is actually data whitening, not to be confused with white shadowing. 137 00:11:20,250 --> 00:11:20,830 So... 138 00:11:20,830 --> 00:11:26,810 data whitening is a technique that ensures that there are no long sequences of zeros that can cause drops in communication. 139 00:11:27,270 --> 00:11:31,290 It uses XOR with a static set of bytes. 140 00:11:31,630 --> 00:11:36,570 Those bytes are typically generated by something called linear feedback shift register, and we're gonna talk about it later. 141 00:11:36,630 --> 00:11:43,730 It's important to note that while this is similar to XOR encryption, it is not cryptographically secure, as we will demonstrate in the next few slides. 142 00:11:45,250 --> 00:11:48,750 So our de-whitening process is shown in this algorithm. 143 00:11:48,750 --> 00:11:51,970 We transmit a handful of A's followed by a handful of B's. 144 00:11:51,970 --> 00:12:00,870 So for those who are not familiar with ASCII representation in hex, capital A is 41, so you'll see that a lot throughout our presentation, and B will be 42. 145 00:12:01,090 --> 00:12:13,710 So we transmit a handful of number of A's, we extract a byte from that transmission, and we XOR it with 0x41, which is capital A, and then that will give us our potential key stream. 146 00:12:14,010 --> 00:12:20,670 We then use that key stream against the second message, which is with B's, and then we repeat that for the length of the entire message. 147 00:12:20,670 --> 00:12:24,550 And then we only keep the bytes that produce the accurate result, i.e. 148 00:12:24,550 --> 00:12:26,350 we receive the B's. 149 00:12:28,350 --> 00:12:32,250 At that point, we found our offset at 42. 150 00:12:33,030 --> 00:12:41,730 This means that Gotenna is offsetting this, like the entire, probably the header, because we've seen in the beginning that the header and data are combined. 151 00:12:41,950 --> 00:12:53,890 So in this case, the payload was started off at 42, and we found all of the green bytes in the first green line, and when we apply that against the message, we get 42's, and we translate that to ASCII, those are B's. 152 00:12:53,890 --> 00:12:56,850 So we have a partial whitening key. 153 00:12:57,110 --> 00:12:59,510 Then we can use this against a different message. 154 00:12:59,510 --> 00:13:02,110 So here, we have the payload between 0 and 71. 155 00:13:02,190 --> 00:13:10,350 We can de-whiten everything after 42, so all part in orange, we de-whiten, and then we can receive that, okay, we have seen 10 A's. 156 00:13:10,350 --> 00:13:15,190 So we have 10 41's, and also the 0 A that's also represented as the lengths. 157 00:13:15,350 --> 00:13:22,290 However, Gotenna is using a custom header, so we do not know what the 0 to 41 is. 158 00:13:22,370 --> 00:13:28,030 And the only way to find a whitening key for something is you have to know what's there. 159 00:13:28,030 --> 00:13:29,690 So we keep looking. 160 00:13:30,410 --> 00:13:36,910 So we're investigating special conditions, so we reiterate that we cannot, we don't know what's below 42. 161 00:13:37,290 --> 00:13:41,830 So we observe a special condition when we said 100 A's. 162 00:13:41,830 --> 00:13:44,630 What happens there is that the message splits. 163 00:13:44,630 --> 00:13:48,430 As you can see here, our capture received two different messages. 164 00:13:48,610 --> 00:13:50,890 So then, let's investigate that. 165 00:13:51,590 --> 00:14:01,050 So we run the same exact script that was shown in that algorithm against the second message, and we see a potential XOR starting at byte 2 instead of 42. 166 00:14:01,050 --> 00:14:07,430 So this means this is a fragment split, the message split, and the payload started at offset 42. 167 00:14:07,430 --> 00:14:16,010 So we now have extra 40 bytes shown in green, we combine them with the already existing key that we found earlier between 42 and 96. 168 00:14:16,390 --> 00:14:20,050 And then that gives us a key between 2 and 96. 169 00:14:20,750 --> 00:14:31,550 Now we use that, we use that key, so we take our packet, we apply the key between 2 and 96, and now we're seeing the payload, but we're not only seeing the payload, we're also seeing the call sign. 170 00:14:31,550 --> 00:14:34,810 So my call sign is $hide, and we can see that in blue. 171 00:14:34,990 --> 00:14:36,450 That is very critical. 172 00:14:37,330 --> 00:14:41,590 So another part that Gotenna was using was Gotenna identifier, or GID. 173 00:14:41,670 --> 00:14:43,830 So in this case, we could not easily identify there. 174 00:14:43,830 --> 00:14:46,450 It was not, like, easily seen. 175 00:14:46,550 --> 00:14:50,190 So, but we do have a known value, and this is very important against known values. 176 00:14:50,190 --> 00:14:51,630 If we have a known value, i.e. 177 00:14:51,630 --> 00:14:55,930 in the app, it told us the very bottom part at 1029, that's our GID. 178 00:14:55,930 --> 00:14:56,850 So we're looking for that. 179 00:14:56,850 --> 00:15:01,610 So eventually, we discover it in the green, in the orange part in the packet. 180 00:15:02,050 --> 00:15:05,090 It is encoded in a very special way. 181 00:15:05,090 --> 00:15:13,510 So first, the 7 bits that are containing the actual number, and then the most significant bit indicates where another byte is following. 182 00:15:13,510 --> 00:15:21,350 So that's how they avoid the use of essentially, for example, as you can see, the 0A in both the payload and the call sign, that's the length. 183 00:15:21,350 --> 00:15:26,730 That's how they can sort of avoid, like, be more efficient of the use of the data stream within the radio. 184 00:15:26,930 --> 00:15:28,150 So that's simple enough. 185 00:15:28,150 --> 00:15:34,750 We can write this Python decode script to decode the GID, and then we can take the orange bytes at the top and get the orange bytes at the bottom. 186 00:15:34,750 --> 00:15:35,850 Relatively simple. 187 00:15:36,990 --> 00:15:41,070 So now, our next part was like, OK, let's discover the byte 0. 188 00:15:41,270 --> 00:15:42,950 So FCC comes to the rescue. 189 00:15:42,950 --> 00:15:44,710 They have a lot of useful information. 190 00:15:44,710 --> 00:15:47,010 I highly recommend FCC documentation. 191 00:15:47,350 --> 00:15:57,170 So that says, the FCC essentially says that GoTenna is using SI4460 radio, and that radio, based on its documentation, adds length as byte 0. 192 00:15:57,510 --> 00:15:59,190 So that means that we can find our node. 193 00:15:59,190 --> 00:16:02,370 We take our packet, we take the length, we get that 69. 194 00:16:02,550 --> 00:16:06,030 So then we have to subtract 1, because that is the length byte. 195 00:16:06,030 --> 00:16:07,130 So we get 68. 196 00:16:07,130 --> 00:16:11,070 We convert decimal 68 to hex, and we get 44. 197 00:16:11,110 --> 00:16:13,590 And then the ciphertext was 47. 198 00:16:13,590 --> 00:16:15,270 We extorted 2, and we get 3. 199 00:16:15,270 --> 00:16:18,790 So that is our whitening byte at byte 0. 200 00:16:19,650 --> 00:16:24,230 For byte 1, we did a lot of testing, and eventually we figured out it was 96. 201 00:16:24,250 --> 00:16:27,450 So we'll kind of skip all the detail there, because it's a short presentation. 202 00:16:27,990 --> 00:16:32,130 So in our current de-whitening status, we have pretty much everything from byte 0 to 96. 203 00:16:32,130 --> 00:16:35,190 We do not, unfortunately, know what last 10 are. 204 00:16:35,190 --> 00:16:37,630 So, of course, we do more investigation. 205 00:16:38,510 --> 00:16:45,910 We find that the two bytes immediately following the message are a result of CRC16 CCITT variant. 206 00:16:46,270 --> 00:16:48,830 CRC16 stands for Cyclered Redundancy Check. 207 00:16:48,830 --> 00:16:56,970 It's used as error correcting code that is capable of determining whether or not the payload has been corrupted in the transmission. 208 00:16:56,970 --> 00:16:59,310 So that's a very quick way to determine that. 209 00:16:59,490 --> 00:17:01,130 So we also do more analysis. 210 00:17:01,130 --> 00:17:06,190 We figure out that this CRC is initialized with 0s, and it uses 1021 as the polynomial. 211 00:17:06,290 --> 00:17:10,770 So then we take the entire packet up to those 10 bytes, and we compute the CRC16. 212 00:17:10,910 --> 00:17:14,030 So here on this slide, you can see the Python script that we implemented. 213 00:17:14,030 --> 00:17:16,850 So it's using 0s and 1021 as the polynomial. 214 00:17:17,650 --> 00:17:26,610 So then we run it through that function, we put the packet that we saw earlier through that function, and then we get the CRC16 value is DCD2. 215 00:17:26,610 --> 00:17:29,810 And then our whitened message, the ciphertext, was BCAA. 216 00:17:30,110 --> 00:17:35,690 So then we take, we XOR the two, and we get that the key at that offset is 6078. 217 00:17:35,710 --> 00:17:36,810 Okay, pretty great. 218 00:17:37,150 --> 00:17:41,930 So then the last 8 bytes are a result of Reed-Solomon error correcting scheme. 219 00:17:42,090 --> 00:17:47,270 So Gotenna is using both CRC and Reed-Solomon for error detection and correction. 220 00:17:47,270 --> 00:17:54,510 So a very powerful part about Reed-Solomon is that it can not only detect the errors, it can also correct them. 221 00:17:54,510 --> 00:17:58,410 So they are using 8 error correction symbols and first consecutive root set to 1. 222 00:17:58,410 --> 00:18:04,510 So we're using Reed-Solomon library and these four lines to essentially compute the Reed-Solomon against the packet we found earlier. 223 00:18:05,270 --> 00:18:09,810 Once we do that, we get the line in the first bullet. 224 00:18:09,810 --> 00:18:11,690 So those are those 8 bytes. 225 00:18:11,690 --> 00:18:16,030 We get the whitened message, the ciphertext, we XOR the two, and we have the entire key. 226 00:18:16,030 --> 00:18:19,670 We have now the entire sequence from zero to the end. 227 00:18:19,950 --> 00:18:21,670 So that's pretty awesome, right? 228 00:18:26,790 --> 00:18:35,530 So now a big part here that we want to note is that this entire sequence has been generated by something called linear feedback shift register or LFSR polynomial. 229 00:18:35,530 --> 00:18:39,430 A very powerful thing about this algorithm called Berlikamp-Massey. 230 00:18:39,430 --> 00:18:43,170 So we can use this sequence within Berlikamp-Massey to retrieve this polynomial. 231 00:18:43,170 --> 00:18:45,810 The polynomial is shown at the bottom. 232 00:18:45,810 --> 00:18:48,210 But there is more to here. 233 00:18:48,210 --> 00:19:02,330 So in case that we could not determine something like byte 1 or any other part, like we could have a very partial sequence, we could use Berlikamp-Massey and mathematical techniques to determine this polynomial and the associated sequence even if we don't know things. 234 00:19:02,330 --> 00:19:11,110 So we could technically wait enough time and enough brute force using Berlikamp-Massey, only knowing the payload, figure out the header, even if they were not being split. 235 00:19:11,110 --> 00:19:13,230 So math is pretty awesome thing. 236 00:19:13,230 --> 00:19:14,670 So we can do that. 237 00:19:15,910 --> 00:19:17,830 So yeah, so this is the polynomial. 238 00:19:17,830 --> 00:19:19,430 So they're using x to the 23. 239 00:19:19,430 --> 00:19:27,690 So you know that, you know, and this is not, this is just meant to ensure that the receiver and the transmitter do not lose connection. 240 00:19:27,690 --> 00:19:29,490 So this is not meant as encryption. 241 00:19:29,670 --> 00:19:35,650 Yeah , this is really acting almost like a form of two party authentication to make sure yes, they received the message. 242 00:19:35,650 --> 00:19:41,010 Yes, I've received the message and using that as a way to almost have a packet count. 243 00:19:43,370 --> 00:19:47,930 So in our current decoding process, so this is done in green radio and we're doing this essentially live. 244 00:19:47,930 --> 00:19:51,210 And this is just a screen capture of my console. 245 00:19:51,210 --> 00:19:54,490 So we get the raw bytes and we automatically extract the GID. 246 00:19:54,490 --> 00:19:55,570 We apply the function. 247 00:19:55,570 --> 00:19:57,330 We can translate that to ASCII. 248 00:19:57,330 --> 00:20:01,530 We get the call sign, the payload, including multi-fragmented messages. 249 00:20:01,530 --> 00:20:04,110 So even in multi-fragmented we can still extract the payload. 250 00:20:04,950 --> 00:20:06,610 So what Gotenna chose to encrypt. 251 00:20:06,610 --> 00:20:10,610 So we played a bit with encryption and we see that it's only the payload. 252 00:20:10,610 --> 00:20:14,390 So what does it mean essentially once we can read all of the other signs? 253 00:20:14,390 --> 00:20:18,150 Because in encrypted, unencrypted mode, all of these are visible. 254 00:20:18,150 --> 00:20:25,750 So everything you see in red here means that at this point where we currently are, we are able to see the message length. 255 00:20:25,890 --> 00:20:26,990 That can be pretty valuable. 256 00:20:26,990 --> 00:20:32,470 That can definitely add up to things in the future, especially with long term collection techniques. 257 00:20:32,930 --> 00:20:42,890 The GID, the GID is going to be your unique identifier, which used to be your cell phone number and you had to pick for it to be a randomized one, which we found out was just actually epoch. 258 00:20:43,190 --> 00:20:47,390 But you now can still, with this, they don't do the phone number. 259 00:20:47,390 --> 00:20:49,190 So that's a much better improvement there. 260 00:20:49,190 --> 00:20:52,110 But that GID tells me that is that exact same device. 261 00:20:52,110 --> 00:20:59,570 And you can change it, but understand that that GID is a unique identifier like a MAC address that follows you. 262 00:20:59,590 --> 00:21:01,170 Now the call sign's a little bit different. 263 00:21:01,170 --> 00:21:04,110 This goes back to my former community. 264 00:21:04,230 --> 00:21:17,610 When you have call signs involved that can be read in the clear, now I possibly know how many people are in an organization because typically they have a numerical sequence after it and I can start telling more about that individual organization. 265 00:21:17,770 --> 00:21:27,410 So by having the equipment and the call sign, I can now start linking equipment to not only organizations , but individuals to who was using the equipment at what time. 266 00:21:28,390 --> 00:21:31,330 Payload length, again, much like message length. 267 00:21:31,330 --> 00:21:36,570 That gives us really valuable things to know what is it that we need to focus on and what are they saying. 268 00:21:36,570 --> 00:21:37,610 Is it short messages? 269 00:21:37,610 --> 00:21:38,370 Long messages? 270 00:21:38,370 --> 00:21:39,610 Are they using brevity? 271 00:21:41,210 --> 00:21:46,670 And the CRC and the Reed-Solomon, we're gonna look and see that those become fairly valuable in the end. 272 00:21:46,730 --> 00:21:49,250 But these are the reasons this really concerned me. 273 00:21:49,850 --> 00:21:50,250 100%. 274 00:21:50,250 --> 00:21:54,390 So now in this case, we've shown what we discovered so far. 275 00:21:54,390 --> 00:21:55,890 So we go more in our analysis, right? 276 00:21:55,890 --> 00:21:56,990 So that's what happens, right? 277 00:21:56,990 --> 00:21:58,770 So we analyze the remaining fields. 278 00:21:58,770 --> 00:22:00,390 We see the highlighted in blue. 279 00:22:00,590 --> 00:22:02,170 We decode that and figure out that's the time stamp. 280 00:22:02,170 --> 00:22:05,910 So you see here January 12th, that's we did the very initial capture. 281 00:22:05,910 --> 00:22:06,950 So that's pretty awesome. 282 00:22:07,310 --> 00:22:11,470 So, um, we also discovered these tags. 283 00:22:12,610 --> 00:22:14,050 So, ha ha. 284 00:22:18,520 --> 00:22:19,540 Ha ha. 285 00:22:20,000 --> 00:22:20,420 There we go. 286 00:22:20,420 --> 00:22:23,380 And we knew we were on our way to something great at this point. 287 00:22:23,460 --> 00:22:23,480 Yeah. 288 00:22:24,660 --> 00:22:30,040 So an additional thing with this presentation that we want to do is we want to teach you how we do reverse engineering. 289 00:22:30,040 --> 00:22:32,680 So we discovered that this protocol is using tags. 290 00:22:32,680 --> 00:22:36,200 So they're using tag 57, tag 24, and others. 291 00:22:36,200 --> 00:22:37,860 So this is important to note. 292 00:22:37,860 --> 00:22:49,420 So we'll use this in the rest of the presentation, but it's important to note how we discovered that, okay, so 57 or 39 hex, after that, there is the, um, UTC time stamp. 293 00:22:49,720 --> 00:22:52,720 So then we use this in tag-based identification in our script. 294 00:22:52,980 --> 00:23:00,520 So, uh, we take the tag is equal to 57 and then we appropriately, uh, apply, uh, the Python code to decode that. 295 00:23:00,600 --> 00:23:01,740 So that's what we're doing. 296 00:23:02,260 --> 00:23:03,840 So at this point we're a bit stuck, right? 297 00:23:03,840 --> 00:23:08,700 So we could keep going the same things over and over again and like eventually we'll, we'll get everything. 298 00:23:08,700 --> 00:23:12,020 Maybe we won't, but we're, you know, what happened in the B1 here? 299 00:23:12,260 --> 00:23:18,520 So this is where I kind of fell back to the version 1 when I worked with Tim Kerster on that. 300 00:23:19,020 --> 00:23:21,220 And he and I had kind of a light bulb moment. 301 00:23:21,220 --> 00:23:23,200 He's an engineer, I'm a knuckle dragger. 302 00:23:23,200 --> 00:23:25,420 So we looked at it two totally different ways. 303 00:23:25,500 --> 00:23:41,640 So he went home that night to start working on an automatic, um, demodulator for the FSK and I started seeing what I could find so we could try to compare knowledge and he comes back the next day and goes, Woody, I really hope that, you know, this demodulator that I made is working. 304 00:23:41,640 --> 00:23:47,560 I wish there was some way that I could check against what the actual code that's coming out is to make sure that everything's correct. 305 00:23:47,620 --> 00:23:53,300 And I said, well, hey, we can just compare it to the stuff that I've been looking at through the UART and then we'll just know, right? 306 00:23:53,400 --> 00:23:55,920 At which point he said, what do you mean you have UART? 307 00:23:56,680 --> 00:23:58,460 I just assumed he'd check. 308 00:24:00,240 --> 00:24:04,120 Yeah, so we don't have UART in this case with GoTenna Pro, but we have something better. 309 00:24:04,120 --> 00:24:07,300 So Clayton just casually mentions, um, why don't you read from the app? 310 00:24:07,300 --> 00:24:08,600 It was useful when I did Mesh. 311 00:24:08,600 --> 00:24:09,580 Um, wait, what? 312 00:24:09,580 --> 00:24:10,920 We had code the entire time? 313 00:24:10,920 --> 00:24:11,700 Like, what? 314 00:24:11,700 --> 00:24:14,380 I go online and like, I'm supposedly this like reverse engineer, right? 315 00:24:14,380 --> 00:24:16,120 And like, I didn't look at the app. 316 00:24:16,120 --> 00:24:16,760 What? 317 00:24:17,540 --> 00:24:21,320 So everything in the app is plain text. 318 00:24:21,440 --> 00:24:21,660 Yeah. 319 00:24:21,740 --> 00:24:22,600 Look at this. 320 00:24:22,600 --> 00:24:23,900 So we go in, decompile it. 321 00:24:23,900 --> 00:24:24,180 Boom. 322 00:24:24,180 --> 00:24:25,500 We can see the firmware in there. 323 00:24:25,500 --> 00:24:26,780 We can see the source code. 324 00:24:26,780 --> 00:24:30,480 Like I was looking for this, but like, it's right there. 325 00:24:30,620 --> 00:24:31,420 Wow. 326 00:24:31,560 --> 00:24:32,020 Yeah. 327 00:24:32,020 --> 00:24:33,860 So companies really don't think it's like hackers. 328 00:24:33,860 --> 00:24:39,900 So like hackers, like, like the guys in these pictures, they can find full source code and firmware available completely unencrypted and unobfuscated. 329 00:24:39,900 --> 00:24:41,060 It exists. 330 00:24:41,920 --> 00:24:42,520 Yeah. 331 00:24:42,660 --> 00:24:52,060 And this is where we said, oh, I think things are going to be a little bit better now because in version one, we just had to kind of bare knuckle through it and hope we were close. 332 00:24:52,060 --> 00:24:53,820 We just knew that our demodulation was working. 333 00:24:53,820 --> 00:24:56,800 We didn't have tags yet, which I think we're going to get to. 334 00:24:56,820 --> 00:24:57,280 Yeah. 335 00:24:57,280 --> 00:24:58,980 So we go back and we'll look through a source code. 336 00:24:58,980 --> 00:24:59,840 We find these tags. 337 00:24:59,840 --> 00:25:01,720 Remember that we were talking about reverse engineering tags. 338 00:25:01,720 --> 00:25:03,040 We see 57 right here. 339 00:25:03,040 --> 00:25:04,100 So we were spot on. 340 00:25:04,120 --> 00:25:07,140 Our reverse engineering, like methodology was very spot on. 341 00:25:07,140 --> 00:25:08,600 So that's what we want to show you. 342 00:25:08,900 --> 00:25:10,300 We find more tags, right? 343 00:25:10,300 --> 00:25:12,940 PB broadcast, we see key data coordinates. 344 00:25:13,280 --> 00:25:15,180 So, you know, we have a bunch of tags, right? 345 00:25:15,180 --> 00:25:19,700 So you're assuming that we use this Java source code, essentially slowly update our script. 346 00:25:19,700 --> 00:25:24,020 This may take like a couple of months and eventually we'll have a better product. 347 00:25:24,020 --> 00:25:25,180 Well, not quite. 348 00:25:25,180 --> 00:25:26,740 Ain't nobody got time for that. 349 00:25:27,600 --> 00:25:30,140 So we find an interesting observation. 350 00:25:30,260 --> 00:25:33,760 There's a file descriptor and we find something called Proto 3. 351 00:25:34,040 --> 00:25:35,880 Some of you are familiar with that already. 352 00:25:35,880 --> 00:25:37,120 But we weren't, right? 353 00:25:37,360 --> 00:25:39,760 So we look this up and it's a protocol buffer. 354 00:25:39,760 --> 00:25:46,800 It's used as an open source library developed by Google to help companies and other people to develop custom protocols. 355 00:25:46,860 --> 00:25:48,900 And they're supported by all kinds of languages. 356 00:25:48,900 --> 00:25:50,960 Python, Java, C. 357 00:25:50,960 --> 00:25:52,260 All kinds of things. 358 00:25:52,260 --> 00:25:52,740 Right? 359 00:25:52,780 --> 00:26:01,240 So we go online and we kind of take the string, the binary string, and we kind of figure out, okay, these may be the fields, right? 360 00:26:01,240 --> 00:26:02,420 The sender, the call sign. 361 00:26:02,620 --> 00:26:03,700 And then let's try it. 362 00:26:03,700 --> 00:26:05,480 So we put in the hex at the bottom. 363 00:26:05,480 --> 00:26:08,000 And then, wow, the whole thing is there. 364 00:26:08,820 --> 00:26:14,340 But literally, you just put it in the program on one side, push a button, and it gives you everything on the other. 365 00:26:14,880 --> 00:26:16,000 It's automatic. 366 00:26:16,000 --> 00:26:18,180 Like, this did not happen in V1 or Mesh. 367 00:26:18,180 --> 00:26:19,900 This is way easier. 368 00:26:20,600 --> 00:26:21,320 So, yeah. 369 00:26:21,320 --> 00:26:24,340 So we then go in and then let's do this for real. 370 00:26:24,340 --> 00:26:27,960 So we go through all of the decompiled stuff. 371 00:26:28,140 --> 00:26:30,140 We take the file extractors. 372 00:26:30,140 --> 00:26:32,600 We put in our own custom file called Proto extraction. 373 00:26:32,640 --> 00:26:35,200 And that will generate a binary file. 374 00:26:35,560 --> 00:26:36,960 And then we use PBTK. 375 00:26:36,960 --> 00:26:38,340 This is an open source tool. 376 00:26:38,820 --> 00:26:41,220 We use this against this binary file. 377 00:26:41,220 --> 00:26:43,580 And that gives us all of these things at the bottom. 378 00:26:43,580 --> 00:26:44,920 Like, all the proto files. 379 00:26:45,220 --> 00:26:47,980 So the base header essentially sets up the message. 380 00:26:47,980 --> 00:26:49,940 This imports the header protobuf. 381 00:26:50,000 --> 00:26:52,860 The header protobuf was what we were doing in reverse engineering in Blackbox. 382 00:26:54,540 --> 00:26:57,540 What's important here is this data type, right? 383 00:26:57,540 --> 00:27:00,580 This enum would be very difficult to reverse engineer. 384 00:27:00,580 --> 00:27:07,260 Like, we would have to take so many samples and then hope that we can maybe figure out the text is 3 and then ping is 5. 385 00:27:07,260 --> 00:27:08,680 That would be very difficult. 386 00:27:09,440 --> 00:27:11,400 So let's go back full circle. 387 00:27:11,400 --> 00:27:12,360 What were those tags, right? 388 00:27:12,360 --> 00:27:17,280 So if we compile this protobuf in Java, because that's what Gotenna is using, we can see these cases. 389 00:27:17,280 --> 00:27:21,940 So these cases are used as different parts of the protocol to essentially define different things. 390 00:27:21,940 --> 00:27:24,280 So we were spot on, right? 391 00:27:24,280 --> 00:27:25,400 These tags were cases. 392 00:27:25,400 --> 00:27:26,100 That's pretty awesome. 393 00:27:26,100 --> 00:27:28,300 And we got 57 and the rest of them. 394 00:27:28,580 --> 00:27:33,460 And you also noticed that you could see things like when they requested, I don't know, keys. 395 00:27:33,460 --> 00:27:35,920 You could see the code of how to request a key. 396 00:27:36,400 --> 00:27:36,780 100%. 397 00:27:36,780 --> 00:27:41,280 So yeah, so a cool part about protobuf is they can be compiled for Python. 398 00:27:41,280 --> 00:27:42,860 What else is using Python? 399 00:27:44,160 --> 00:27:46,580 I believe there's a little thing called GNU radio. 400 00:27:46,780 --> 00:27:47,580 Yeah, that might be cool. 401 00:27:47,580 --> 00:27:49,400 It's so easy, even I can do it. 402 00:27:49,580 --> 00:27:50,060 Yeah. 403 00:27:50,060 --> 00:27:58,220 So we go in and we import a base message data type and we make a statement to associate everything and perfect decode! 404 00:27:59,300 --> 00:28:00,420 Victory! 405 00:28:02,640 --> 00:28:05,200 But wait, we haven't found a single vulnerability yet. 406 00:28:05,200 --> 00:28:06,500 We just decoded the thing. 407 00:28:06,500 --> 00:28:08,840 There's 30 more slides of actual vulnerabilities. 408 00:28:08,840 --> 00:28:10,580 So, you know, stay seated. 409 00:28:11,580 --> 00:28:22,540 So with this decode, now that we can read things, we get the we can do frequency decoding, shared location, we can do emergency messages, all kinds of things. 410 00:28:22,540 --> 00:28:26,940 The only thing where we received a challenge was in, um, coordinate decoding. 411 00:28:26,940 --> 00:28:39,520 So in the app, we can make, for example, like around this island, we can make coordinates and then when we're capturing it, we see binary data represented as base64 and JSON and in this case, there, there isn't much, right? 412 00:28:39,520 --> 00:28:40,860 So like, like we can't see here. 413 00:28:40,860 --> 00:28:46,640 So we go back to proto, they're defined as bytes, so that means that decoding on our side has not been added. 414 00:28:46,640 --> 00:28:47,800 So that's very simple. 415 00:28:47,800 --> 00:28:51,840 We just use decode as little nd and double double and then boom, we get the coordinates. 416 00:28:51,840 --> 00:28:53,060 So that's fixed. 417 00:28:53,460 --> 00:28:56,080 So now we found our true first vulnerability, right? 418 00:28:56,080 --> 00:28:58,920 It's like, like we encrypt the message and we're just kind of looking at things. 419 00:28:58,920 --> 00:29:03,540 So, so what can you do when somebody can capture yes or no and tell the differences? 420 00:29:03,780 --> 00:29:14,660 When you start dealing with organizations that are using brevity for communication, simple things like the length of a message become very easy, even without going into advanced steps to be able to tell what kind of communication may be happening. 421 00:29:14,800 --> 00:29:16,180 Are they only sending coordinates? 422 00:29:16,180 --> 00:29:17,600 Are they sending commands? 423 00:29:17,600 --> 00:29:19,560 Are they just sending comms checks? 424 00:29:19,560 --> 00:29:23,440 So this starts becoming really important, being able to understand these message lengths. 425 00:29:23,960 --> 00:29:25,240 Yeah, so it's crucial. 426 00:29:25,240 --> 00:29:28,340 So then let's go look at how they're doing encryption. 427 00:29:28,340 --> 00:29:31,180 So one of, one form of encryption is encrypting the broadcast. 428 00:29:31,300 --> 00:29:33,180 So this is the process how it works in the app. 429 00:29:33,180 --> 00:29:38,220 So we generate the new key, we put in the name, it can be either broadcast or QR code, and we're going to get to that, right? 430 00:29:38,220 --> 00:29:41,160 That's not important, but what we go in is the validation thing. 431 00:29:41,860 --> 00:29:43,060 It's kind of interesting, right? 432 00:29:43,060 --> 00:29:46,720 We do this a bunch of times, like they're kind of short. 433 00:29:47,060 --> 00:29:52,320 So, and it's all lowercase or numbers, and that's it. 434 00:29:52,320 --> 00:29:57,780 But there is a space, so I guess we have nine, but the space is consistent, so nope, really just eight. 435 00:29:58,180 --> 00:30:04,280 So you have lowercase numbers, or I'm sorry, lowercase letters and numbers, and that's all you have to figure out. 436 00:30:04,280 --> 00:30:07,260 And you only have to figure out eight of them, put a space in the middle for your dictionary. 437 00:30:08,200 --> 00:30:09,440 Yeah, so very interesting. 438 00:30:09,440 --> 00:30:12,100 So then we go in, okay, we capture this QR broadcast, right? 439 00:30:12,100 --> 00:30:17,220 QR broadcast gets sent unencrypted over the air, so this key data is actually encrypted, right? 440 00:30:17,220 --> 00:30:25,400 So what we have here is encrypted, but you know, we do some of our analysis, and then long story short, to make the fit in the presentation, we were able to decrypt it. 441 00:30:25,920 --> 00:30:34,700 And the nice thing too is it told us where the IV and the salt was, because we were able to find where they were, so it made it much easier because we knew which was which. 442 00:30:34,700 --> 00:30:40,100 So then essentially the key data is fed into the PBKDF HMAC with 10,000 orations. 443 00:30:40,100 --> 00:30:43,900 This is a very good hashing, but it's protected by state character password. 444 00:30:43,900 --> 00:30:53,020 So let's say password is known, it's going to give us the encryption key, and encryption key along with the IV and the GID can decrypt the cipher text. 445 00:30:53,020 --> 00:30:56,500 AES-GCM will give us the plain text and HMAC. 446 00:30:56,740 --> 00:31:02,660 We also, you know, to be good communications people, we can compute our own HMAC and verify the message was correct, right? 447 00:31:02,660 --> 00:31:07,700 So now one may ask, like, how complex, how complicated is it to get this password? 448 00:31:07,700 --> 00:31:10,300 So in MD5 this will be very quick. 449 00:31:10,520 --> 00:31:12,520 PBKDF2 is pretty strong. 450 00:31:12,680 --> 00:31:16,160 So we do hashcat and we essentially analyze. 451 00:31:16,160 --> 00:31:18,380 This is an actual engineering analysis. 452 00:31:18,380 --> 00:31:23,960 So with RTX4090 one card, one can figure this out in 15.33 days. 453 00:31:23,960 --> 00:31:29,880 A very common commercial cracking rig can have 12 of these, so in 1.27 days, one can determine this password. 454 00:31:29,920 --> 00:31:32,460 Now we look at more well-funded adversaries. 455 00:31:32,600 --> 00:31:36,960 A100 is used by chat GPT, neural nets, AI, that's the whole thing now, right? 456 00:31:37,020 --> 00:31:39,360 This one card is actually worse, right? 457 00:31:39,700 --> 00:31:43,320 But if you have 10,000 of them, you can figure out in 5.31 seconds. 458 00:31:43,340 --> 00:31:50,540 It's important to know that all of these times here... It's important to know that all of these are kind of worst case scenarios. 459 00:31:50,540 --> 00:31:53,760 That means that your script found the password the very last time. 460 00:31:53,760 --> 00:31:56,220 So it's likely it's going to be like about half the time. 461 00:31:57,000 --> 00:32:03,760 So we go in and we can essentially, if we know the key, we wrote our little script and then we can decode it. 462 00:32:03,760 --> 00:32:09,340 We can get the hex key and now we can add this to our automatic decoding script and now we can decrypt live. 463 00:32:09,620 --> 00:32:10,340 Awesome. 464 00:32:10,340 --> 00:32:12,340 And we can also decrypt everything that happened in the past. 465 00:32:12,340 --> 00:32:14,260 So now we have it all. 466 00:32:15,080 --> 00:32:16,400 Yeah, but there's more. 467 00:32:16,720 --> 00:32:21,980 So another form of communication is point-to-point and that uses public key encryption. 468 00:32:21,980 --> 00:32:24,860 So public key encryption on its own is a lot more secure. 469 00:32:24,860 --> 00:32:29,000 It uses PKI, or public key encryption, to share the symmetric key. 470 00:32:29,000 --> 00:32:31,300 It doesn't require any of this manual key sharing. 471 00:32:31,880 --> 00:32:36,960 However, in our code, we, the message receiver class was not, did not cleanly decompile. 472 00:32:36,960 --> 00:32:43,340 So we could spend some time, do that, but in help with some Craigslist, eBay and Freedom, maybe we can figure it out without it. 473 00:32:43,680 --> 00:32:46,620 So initial conversation starts with public key sharing. 474 00:32:46,620 --> 00:32:49,000 So here we get the GIDs and the public keys. 475 00:32:49,000 --> 00:32:49,860 Pretty cool. 476 00:32:50,300 --> 00:32:52,860 So then we get to the source code. 477 00:32:52,860 --> 00:33:01,180 Uh, we figured out that the, uh, public key and the private key are, uh, generated using ECDH384R1 curve to generate the share key. 478 00:33:01,180 --> 00:33:05,540 The share key is used as first input to HMAC SHA-256. 479 00:33:05,540 --> 00:33:07,280 The second input is not known here. 480 00:33:07,280 --> 00:33:09,440 So we could not figure out what are the parameters here. 481 00:33:09,440 --> 00:33:14,740 So using Freedom, uh, we can essentially intercept this Cryptomagdo final. 482 00:33:15,120 --> 00:33:20,620 So we, we essentially instrument this phone right here, which is an Android phone. 483 00:33:20,960 --> 00:33:26,640 We, this is connected with Gotenna and then, uh, we cap, we send a P2P and then we capture this. 484 00:33:26,640 --> 00:33:34,160 And then from this kind of hex string, we can figure out, okay, the second parameter is actually concatenated GID public key and the private, uh, and the share key. 485 00:33:34,720 --> 00:33:36,580 We do know the public key and the GID. 486 00:33:36,580 --> 00:33:38,100 We just found that earlier in the slide earlier. 487 00:33:38,100 --> 00:33:39,200 We don't know the share key. 488 00:33:39,200 --> 00:33:40,440 So let's look for that. 489 00:33:40,620 --> 00:33:47,480 We go in the device and we find the Gotenna folder in that same phone and we find something called Gotenna key encryption. 490 00:33:47,800 --> 00:33:50,400 I wonder if that's used for encryption. 491 00:33:51,620 --> 00:33:58,840 So we go in and okay, it's using private keys, share keys, but now to, you know, the best luck, this, all of this is encrypted, right? 492 00:33:58,960 --> 00:34:00,980 Fully encrypted, we, we can't read it. 493 00:34:00,980 --> 00:34:02,320 But let, let's verify. 494 00:34:02,700 --> 00:34:03,260 Okay. 495 00:34:04,240 --> 00:34:07,420 So we go in and we find the file that's using Gotenna key encryption. 496 00:34:07,420 --> 00:34:09,880 We see at the top something called as an IV. 497 00:34:10,600 --> 00:34:12,380 But we can't tell from that function. 498 00:34:12,380 --> 00:34:19,300 So we track this over two different functions and figure out it's not only used as a static hi- as an IV, it's used as a static IV to AES-GCM. 499 00:34:19,940 --> 00:34:26,140 So, keys are AES-GCM encrypted, but static IV allows complete encryption bypass. 500 00:34:26,380 --> 00:34:30,520 This is when AES is doing what not, what, what AES is not meant to do, right? 501 00:34:30,520 --> 00:34:39,220 And then using the public key as a known plain text and the encrypted, uh, public key, we can XOR them to get the key stream and then we can decrypt essentially everything else. 502 00:34:39,220 --> 00:34:45,960 And, and what's stored in a database are public keys, shared keys, broadcast keys, the top two, the pin, pretty much everything. 503 00:34:45,960 --> 00:34:47,260 So we have a lot of stuff here. 504 00:34:47,620 --> 00:34:50,920 So then, yeah, there is AES. 505 00:34:51,220 --> 00:34:52,280 There is. 506 00:34:52,280 --> 00:34:59,820 However, there's also AES sitting here and then implementation or configuration sitting here. 507 00:34:59,860 --> 00:35:11,160 This is kinda like having a really nice blast proof, bullet proof door at your house and then realizing that when the bad guys come, they just cut a hole through the siding and the dry wall right next to it. 508 00:35:11,420 --> 00:35:12,220 Yeah. 509 00:35:12,320 --> 00:35:16,080 So, let's now summarize this just so kinda everybody can be on the same page. 510 00:35:16,080 --> 00:35:19,020 We get the public key and the public key cipher text in the XML. 511 00:35:19,060 --> 00:35:25,100 We XOR them to get the key stream and then we take the key stream and XOR that with the private key cipher text to get the private key. 512 00:35:25,420 --> 00:35:30,180 Then, when we have the p- public key and the private key, we use ZCDH to get the shared key. 513 00:35:30,300 --> 00:35:36,040 Shared key is used within HMAC SHA-256 along with GID public key and the shared key to get the encryption key. 514 00:35:36,060 --> 00:35:40,960 That along with the IV and the GID can decrypt the cipher text of P2P encryption. 515 00:35:41,340 --> 00:35:43,480 Group encryption is another form of encryption. 516 00:35:43,520 --> 00:35:45,540 It's the last one that we'll talk about. 517 00:35:45,560 --> 00:35:47,540 Uh, or the last one supported really. 518 00:35:47,540 --> 00:35:53,740 Um, so it's using the very same method, so same exact attack against P2P works against this and we can show here that we have done it. 519 00:35:54,220 --> 00:35:58,020 So this are, this are true vulnerability summary, right, of encryption summary findings. 520 00:35:58,020 --> 00:36:00,740 So broadcast is vulnerable and allows unauthorized decryption. 521 00:36:00,740 --> 00:36:05,200 Using set up QR message, which is captured over the air, and brute force password, we can decrypt it. 522 00:36:05,200 --> 00:36:08,920 We can also get it if the phone is compromised and we get the, the key from there. 523 00:36:09,080 --> 00:36:15,580 P2P and group are both vulnerable to unauthorized decryption if, again, the phone is compromised and we get some of these. 524 00:36:15,640 --> 00:36:21,140 Um, so if you want to know the feasibility, you can check out our DEF CON talks and things like that to sort of really know that. 525 00:36:21,260 --> 00:36:24,180 There's no authentication public key, so man in the building is possible. 526 00:36:24,220 --> 00:36:30,360 Short messages, less than one fragment used, less secure AES CTR, so less than 35, 45 characters, depending on the message. 527 00:36:30,740 --> 00:36:35,040 Uh, are using CTR, so that has integrity concerns, even though it is encrypted. 528 00:36:35,420 --> 00:36:40,980 And then longer messages use more secure ACM, uh, GCM, but you need to be sending like 50 characters to get to that. 529 00:36:41,860 --> 00:36:47,960 So we also, you know, we could also transmit directly from the GNU radio, uh, from, from our GNU radio. 530 00:36:47,960 --> 00:36:49,700 We can spoof GID call sign the message. 531 00:36:49,700 --> 00:36:51,300 We can get into the existing... 532 00:36:51,300 --> 00:37:02,600 So I could take a HackRF or an NES or a Blade and I can actually make my own Gotenna out of it and just start using my computer. 533 00:37:02,600 --> 00:37:05,080 We also added support for Wireshark. 534 00:37:05,340 --> 00:37:10,040 So we have, um, essentially that, so, so, so all the messages are fed into Wireshark. 535 00:37:10,040 --> 00:37:13,380 We don't have the decode there currently, but we'll add it eventually. 536 00:37:13,760 --> 00:37:16,160 Um, so now let's get to live demos. 537 00:37:16,160 --> 00:37:23,280 So if you want to, if you have a Gotenna Pro, then you can get the frequency on the left and the encryption in the middle and validation on the right. 538 00:37:23,280 --> 00:37:26,060 So we have six minutes, so let's be quick. 539 00:37:27,780 --> 00:37:31,800 I wouldn't scan it because we're both sketchy guys, but still. 540 00:37:37,760 --> 00:37:39,440 So it's firing up live right now. 541 00:37:39,440 --> 00:37:41,180 He's just turning the program on. 542 00:37:41,180 --> 00:37:43,500 You can see it's already starting to sniff and listen. 543 00:37:44,080 --> 00:37:48,040 We'd like to have a little waterfall so we can see when we are or not capturing. 544 00:37:48,040 --> 00:37:51,740 Now he's going to send a message and there you go. 545 00:38:00,180 --> 00:38:01,400 There we go. 546 00:38:02,860 --> 00:38:05,740 We have enough time, so let's see if we can decrypt something. 547 00:38:06,760 --> 00:38:12,120 So now being able to do the same type of process for an encrypted message. 548 00:38:12,120 --> 00:38:13,140 So that was a broadcast . 549 00:38:13,140 --> 00:38:18,100 Now broadcast means it's sent out so that anyone that has one of these devices is able to catch it. 550 00:38:18,100 --> 00:38:22,580 It's meant for an emergency situation or you're just looking for other people around you. 551 00:38:22,700 --> 00:38:36,140 But the next step is all those things we talked about by combining that information, can you take an encrypted message for a group or a person to person and actually decrypt and see it? 552 00:38:36,460 --> 00:38:40,620 So when you think about this, this is where everyone feels safe. 553 00:38:44,040 --> 00:38:44,560 So 554 00:39:00,720 --> 00:39:07,360 while we're going through this, he's going to set the demo up, you're going to be able to see it. 555 00:39:08,520 --> 00:39:17,530 And we'll go ahead, are there any questions right now while he's setting this up? 556 00:39:17,690 --> 00:39:19,310 We have a minute or so. 557 00:39:19,690 --> 00:39:22,590 Any questions over anything that we've seen so far? 558 00:39:24,070 --> 00:39:24,850 Okay. 559 00:39:26,210 --> 00:39:27,270 Here we go. 560 00:39:29,170 --> 00:39:39,470 Now one of the things that I want to make sure that we cover in this is that when we reached out to Gotenna for the version one exploit, they were, had zero response. 561 00:39:39,470 --> 00:39:41,970 Other than the fact that they said, that's fine, we don't care. 562 00:39:42,050 --> 00:39:45,070 Under the new management, Gotenna was extremely receptive. 563 00:39:45,070 --> 00:39:47,050 We got a call back within one day. 564 00:39:47,050 --> 00:39:55,710 Uh, they were happy to take the advice that we gave them and they are actively working to try to fix these issues. 565 00:39:55,710 --> 00:40:02,410 That's why we are going to make sure we wait at least two months from today before we release the full code publicly, but then we will. 566 00:40:03,250 --> 00:40:06,230 Now for gen one and two, the code's already out there. 567 00:40:07,030 --> 00:40:08,550 Okay, so now we're ready. 568 00:40:08,550 --> 00:40:12,370 So I'm going to, we're going to send something encrypted just so we can see that messages are indeed encrypted. 569 00:40:12,370 --> 00:40:14,410 So we can see they're, they're encrypted now. 570 00:40:29,530 --> 00:40:31,390 Now this part here decrypted. 571 00:40:31,750 --> 00:40:34,310 So this was added to our local database. 572 00:40:34,610 --> 00:40:36,930 So we're going to run our script again. 573 00:40:36,930 --> 00:40:39,790 So this is going to now pull the keys from there immediately. 574 00:40:40,610 --> 00:40:42,530 And then we will transmit again. 575 00:40:48,280 --> 00:40:49,820 Boom, this was encrypted. 576 00:40:51,420 --> 00:40:53,340 So now it's full circle. 577 00:40:59,220 --> 00:41:03,800 So, you know, live demos are something that I'm a big fan of. 578 00:41:04,020 --> 00:41:08,580 So Irwin did an amazing job of writing all this crazy code. 579 00:41:08,580 --> 00:41:11,540 I don't want anyone to misconstrue that. 580 00:41:11,700 --> 00:41:21,620 The big thing that we want to make sure that everyone takes away from this is it is up to everyone in this community to test equipment. 581 00:41:21,620 --> 00:41:24,620 Just because something says it's secure, don't believe it. 582 00:41:24,620 --> 00:41:25,500 Challenge it. 583 00:41:25,500 --> 00:41:28,100 And when you find it, see if the manufacturer's willing to listen. 584 00:41:28,120 --> 00:41:29,520 Occasionally they are. 585 00:41:29,520 --> 00:41:30,580 Gotenna was. 586 00:41:30,580 --> 00:41:32,560 Most of the ones I've dealt with aren't. 587 00:41:32,820 --> 00:41:39,140 So if something's been done in the past, don't be afraid to try to recreate it when something new comes out. 588 00:41:39,140 --> 00:41:43,860 You might find that they didn't change a lot of the things and then you can move forward and do well with it. 589 00:41:45,040 --> 00:41:50,200 Yep , so let's talk about, I mean you already mentioned this, so they were very receptive. 590 00:41:53,340 --> 00:41:54,820 And yeah, the conclusion. 591 00:41:54,900 --> 00:42:01,600 Yeah, so the big things we wanted to say about this is, you know, we reached out to industry. 592 00:42:01,700 --> 00:42:04,580 We were able to have a good relationship with them doing this. 593 00:42:04,580 --> 00:42:05,860 They took away key points. 594 00:42:06,040 --> 00:42:09,040 Acknowledgements of what we want to make sure we talk about here. 595 00:42:09,120 --> 00:42:17,500 So we want to reach out to White Shadow, who unfortunately couldn't be here because he's actually doing some responsible things for his family, but he is going to be here later. 596 00:42:17,500 --> 00:42:19,320 But don't tell him I said anything nice. 597 00:42:19,460 --> 00:42:23,080 What the Freak, which is the wireless CTF team that... 598 00:42:23,080 --> 00:42:23,900 Let's do a shout. 599 00:42:23,900 --> 00:42:25,020 We got a win today. 600 00:42:25,860 --> 00:42:29,440 Which I'm glad they're here because now all the other teams are jumping ahead of them. 601 00:42:30,020 --> 00:42:32,480 Yep, so we also want to thank EFF and CISA. 602 00:42:32,940 --> 00:42:36,780 Both of them were amazing organizations and very easy to work with. 603 00:42:36,800 --> 00:42:40,420 The RF Hacker Sanctuary, please go there, try some challenges. 604 00:42:40,660 --> 00:42:45,740 It's everything from Wi-Fi, Bluetooth, tire pressure sensors, go tennis. 605 00:42:45,740 --> 00:42:49,940 All of these challenges will be there as well for you to solve for all the go tennis stuff. 606 00:42:50,320 --> 00:42:52,540 We want to make sure that, you know... 607 00:42:52,540 --> 00:42:54,360 Yeah, Jason Rojas and Cisco Systems. 608 00:42:54,360 --> 00:43:00,500 I want to thank them for making my trip here possible and Potify Media for making this team for this presentation. 609 00:43:00,780 --> 00:43:04,720 And Buffalo Trace, because without them, I probably wouldn't get done as much work as I do. 610 00:43:07,380 --> 00:43:08,560 Thank you for your time. 611 00:43:08,560 --> 00:43:09,800 Are there any questions? 612 00:43:13,280 --> 00:43:15,100 Well, thank you and enjoy the con!