start	end	text
0	4000	Welcome to DEF CON. First speaker is up. Let's give him a big hand.
12870	19710	Thank all of you for being here. Really appreciate it. So, the first thing we want to talk about is
20250	25390	this whole talk has really been pushed because of how much the technology out there is moving
25390	32390	to mesh technology. Everything's meshed. From cellular, we have mesh-tastic, LoRa,
32390	36910	all these different creations. But one of the creations that has been around for quite a while
36910	41810	that we're going to talk about is Gotenna. And we're going to talk about all three stages that
41810	48210	we've seen it go through. My name's Woody. This is Erwin. Yeah, I'm Erwin Korenczyk. I go by
48210	53330	Dollar Hyde. And we also want to make sure that we gave credit to Clayton Smith, who
54650	59450	really did a ton of work on the second generation and made this talk possible. So,
59450	62970	thank you very much for that. Awesome. Yeah, thank you, Clayton.
67610	71810	So, mobile mesh networks, the way that they typically work is one device will talk to
71810	76430	another. You're able to go through and pivot. And that way you can get extended range.
76510	80970	You can have multiple people communicate at the same time. There's a lot of things that you can
80970	85230	do. Now, one of the things with a traditional network is the way that your data and your
85230	91430	controls are handled versus the way that Gotenna mesh does it. So, the Gotenna's capability of
91430	97610	meshing is actually really efficient. And that's one of the things that makes it fairly unique is
97610	105790	because they've combined that and made it pretty controllable. So, some of you seven years ago
105790	115320	may have seen the talk that I did in the RF Hacker Sanctuary. It was on the Gotenna version
115320	121840	one. This one right here. So, what you're seeing on the screen right now is as he goes through
121840	128700	and does the Gotenna or his script, this was our original exploit. And what we figured out was
129280	134140	the Gotenna is designed over Bluetooth to communicate with a phone, at least the gen one
134140	140820	and two were. Once that happens, then you can send a message that can be either open in a broadcast
140820	146780	or person to person or in a group, but you can encrypt it. And that's what you're seeing here on
146780	153900	the screen. But we were able to see seven years ago that it was broadcasting some things plain
153900	159440	text. And when it broadcasted things plain text, the things that you could see even in encrypted
159440	165580	mode were the unique identifier. Which for the unique identifier for the gen one and two by
166020	172320	default, can anyone tell me what it was? Your cell phone number. So, this script is demonstrating how
172320	178340	we could run against a Gotenna version one and pull your phone number out of the air. Even if
178340	185400	you were using encrypted mode. Now, they fixed that since, well, they've evolved since then. Um,
185400	190700	and the new management has really made an effort to try to fix some of the issues that have
190700	195040	happened in the past. But this on the screen is actually what it looks like when we're able to
195040	199300	come in here and pull this data. Yeah, and you can see the phone number, call sign, and the
199300	203500	message in unencrypted mode. In encrypted mode, payload is not visible. But the phone number
203500	208800	still is. So this was gen one. And if you want to see a live demo of this, come to RF Hackers. We're
208800	217760	showing just the video here. So, gen one, we see how it communicates. Now, gen two, they changed
217760	223660	some things. Instead of using two FSK, they moved to four FSK. But by default, there were still a
223660	228760	couple things that were the same that we were able to start exploiting. Uh, Clayton specifically
228760	234040	found some really great things that were vulnerable here. A lot of them were similar to
234040	240000	version one, but you needed a four FSK demodulator to do it. But you could still find the phone
240000	245580	number. You could still find some of those unique identifiers. And as we're gonna discuss, those
245580	250040	unique identifiers, even if they're not your phone number, can be a bad day. So this is an
250040	255600	example of exactly what we could pull while you think you're doing encrypted messages. And we
255600	260220	start getting your phone number, we can start seeing some of your messages depending on how
260220	272880	you're using it. And we're gonna talk how that can be effective for other things as well. Now,
272880	279100	the current version of Gotenna, the Gotenna Pro, we started working with, one of the things
279100	283720	that I do is I'm staffed in the RF Hacker Sanctuary, the RF village, so please come and try
283720	288020	some of our challenges out later. That's actually how a lot of these things get discovered is
288020	293820	people trying them in challenges. Some things that were fixed. You did not have to connect via
293820	297980	Bluetooth because we all know that Bluetooth by itself can be a unique identifier that can be
297980	304100	used to find somebody or come after them. They improved it so you could use either Bluetooth or
304100	308720	you could actually hardline to your phone with the device. And then the only thing that was
308720	317660	communicating was either at, you know, the 140 to 170 megahertz band or 445 to 480. They also
317660	323920	improved the channels you could use, you had some bandwidth things you could control. So, on
323920	330100	initial viewing of this, it looked like it was a much more secure device. But this is what we're
330100	344300	going to be talking about. This is basically the Gen 3. Why is it important for us to worry about
344300	349780	what we give out? Well, we have some representatives from Wiggle here and I'm sure that
349780	354820	they can tell you how important it is to protect your MAC addresses. In fact, the industry has
354820	358780	already started making sure that unique identifiers start rolling and that it's much more
358780	365340	difficult to track them because you can be tracked over space and time, geographical location, and it
365340	370300	can be used to fingerprint. So, that's why we're worried about this. It also gives out unique
370300	375940	identifiers about you. What if I couldn't just tell that you were using that MAC book, but I could
375940	382440	tell you whether Tim was using it or whether Jeff was using it, right? That's even more refined and
382440	386540	that's what we're going to start getting into in here and that is why to us it was so important.
387000	392580	Both of us, our primary jobs, when we're not doing this stuff for fun, is to actually help people
392580	399140	protect their RF signature and to help people have good cyber security in vehicles, in
399140	409870	equipment that they use, and global travels. So, some of the problems that we started wondering
409870	414750	about, is there any chance that we can find some of the same vulnerabilities in a Gen 3 that we
414750	416210	find in a Gen 1?
416210	420110	Yeah, so basically we're looking for those GIDs for the call signs. We're looking, are they
420110	422310	present? Have they fixed it?
422410	427690	Yeah, because it's been seven years, we wanted to see whether or not all those things had been
427690	434170	fixed or not. And some things had and some things we found were still somewhat vulnerable. But,
434170	439190	having that base is what we moved from to be able to do all the rest of this. So, having a good
439190	449160	foothold and then from there, pushing out and finding new things. So, who are we? Erwin?
449160	453480	Yeah, so I'm Erwin. I'm a security researcher. I'm experienced in hardware and software
453480	458340	reverse engineering as well as RF exploitation. My mission is essentially what's shown on the
458340	464040	screen as well as the overall mission to protect this nation and citizens by identifying and
464040	468080	mitigating threats before those threats are even known to these people. So, this is one
468080	472680	example of that mission to protect the people that serve us.
472940	481420	My name's Woody. I'm staff for the RF Hacker Sanctuary or the RF Village. I was one of the
481420	486820	co-authors of the original Gotenna attack, Raptor Captor, some other vehicle exploits and some
486820	492460	things like that. I spent 20 years in special operations before I started playing in this world.
493180	499640	And the reason that this is so important to both of us is we work with law enforcement. We work
499640	505860	with government. We work with corporations. And we educate them on how to control and
505860	510940	understand all the different aspects, not just the physical but also the digital and even the
510940	516700	light aspects of what happens in your life and why it's important. So, that's what got us to
516700	528050	this point. So, just having encryption is not enough. Configurations matter. Imagine having an
528050	534630	amazing router with WPA3, an incredible password, and everything's good to go, but you just
534630	540950	leave it as an open network. You still have encryption, but does it matter? Not at that
540950	544950	point. Configurations, and that's what we're gonna talk about.
544950	549930	Yeah, so this is our testing setup. So, we were testing in an anechoic chamber at the
549930	554030	university where I'm pursuing my PhD in electrical and computer engineering. We used a
554030	558550	representative sample of both iPhones and Androids connected with Gotenna Pros. And then we
558550	563810	used just open source hardware and software. So, HackRF1 connected with open source software
563810	570330	running on an Ubuntu laptop. So, very simple. So, the first step of any sort of RF analysis
570330	574790	starts by identifying the frequency and capturing the signal. This can be done either by
574790	578430	analyzing FCC documentation, by scanning the whole spectrum. In this case, it was
578430	582790	configurable. Like, we figured out where it was configurable, so we set those frequencies and
582790	586290	then we appropriately captured it in GQRX as seen on the waterfall on the right.
586290	593390	And this doesn't take expensive equipment. $30 TV dongle, some $100 radios, you can really
593390	595170	start moving along very quickly.
595170	600890	100%. So then, we started analyzing the signal and figured out that Gotenna Pro was using
600890	606730	4FSK. That is four-level frequency shift keying. That's where the carrier shifted between four
606730	611550	discrete frequencies. As we can see on the screen, it goes between negative 1.5 and positive
611550	618550	1.5. We implemented a custom GNU radio flow graph that can decode this exact type of 4FSK
618550	624390	that Gotenna was using. Once we were confident that our demodulation was successful, we
624390	631110	started analyzing raw bytes and their ASCII representation. In this case, in Gen 1 and Gen 2,
631110	637350	we were able to see the GID, the call sign, and the payload all unencrypted. So this was
637350	643050	sort of, like we're seeing here, it is encrypted somehow because we cannot see any of the
643050	650850	data. It's more of an obfuscation, really. So then, we sent two identical messages and we
650850	657150	compared them. So we see that in yellow color, they're mostly the same. They only differ in
657150	663150	the red color. And red only is the one that changes from if the same packet is being sent. So
663150	669870	this is very commonly some form of static encryption in use. This observation is actually
669870	680830	data whitening, not to be confused with white shadowing. So...
680830	685290	data whitening is a technique that ensures that there are no long sequences of zeros that can
685290	692170	cause drops in communication. It uses XOR with a static set of bytes. Those bytes are
692170	695570	typically generated by something called linear feedback shift register, and we're gonna talk
695570	700450	about it later. It's important to note that while this is similar to XOR encryption, it is not
700450	706450	cryptographically secure, as we will demonstrate in the next few slides. So our de-whitening
706450	712030	process is shown in this algorithm. We transmit a handful of A's followed by a handful of B's. So
712030	717050	for those who are not familiar with ASCII representation in hex, capital A is 41, so you'll
717050	722950	see that a lot throughout our presentation, and B will be 42. So we transmit a handful of
722950	730330	number of A's, we extract a byte from that transmission, and we XOR it with 0x41, which is
730330	735410	capital A, and then that will give us our potential key stream. We then use that key stream
735410	739490	against the second message, which is with B's, and then we repeat that for the length of the
739490	744730	entire message. And then we only keep the bytes that produce the accurate result, i.e. we
744730	754950	receive the B's. At that point, we found our offset at 42. This means that Gotenna is
755510	759710	offsetting this, like the entire, probably the header, because we've seen in the beginning
759710	764910	that the header and data are combined. So in this case, the payload was started off at 42, and
764910	770050	we found all of the green bytes in the first green line, and when we apply that against the
770050	775790	message, we get 42's, and we translate that to ASCII, those are B's. So we have a partial
775790	780390	whitening key. Then we can use this against a different message. So here, we have the
780390	786310	payload between 0 and 71. We can de-whiten everything after 42, so all part in orange, we
786510	792090	de-whiten, and then we can receive that, okay, we have seen 10 A's. So we have 10 41's, and
792090	798050	also the 0 A that's also represented as the lengths. However, Gotenna is using a custom
798050	805870	header, so we do not know what the 0 to 41 is. And the only way to find a whitening key for
805870	811810	something is you have to know what's there. So we keep looking. So we're investigating special
811810	819310	conditions, so we reiterate that we cannot, we don't know what's below 42. So we observe a
819310	824790	special condition when we said 100 A's. What happens there is that the message splits. As you
824790	832390	can see here, our capture received two different messages. So then, let's investigate that. So we
832390	837350	run the same exact script that was shown in that algorithm against the second message, and we see
837570	843530	a potential XOR starting at byte 2 instead of 42. So this means this is a fragment split, the
843530	850190	message split, and the payload started at offset 42. So we now have extra 40 bytes shown in green,
850190	857090	we combine them with the already existing key that we found earlier between 42 and 96. And then
857090	864890	that gives us a key between 2 and 96. Now we use that, we use that key, so we take our packet, we
864890	869510	apply the key between 2 and 96, and now we're seeing the payload, but we're not only seeing the
869510	874810	payload, we're also seeing the call sign. So my call sign is $hide, and we can see that in blue.
874990	882070	That is very critical. So another part that Gotenna was using was Gotenna identifier, or GID. So in
882070	887750	this case, we could not easily identify there. It was not, like, easily seen. So, but we do have a
887750	891910	known value, and this is very important against known values. If we have a known value, i.e. in
891910	897010	the app, it told us the very bottom part at 1029, that's our GID. So we're looking for that. So
897010	904230	eventually, we discover it in the green, in the orange part in the packet. It is encoded in a very
904230	910490	special way. So first, the 7 bits that are containing the actual number, and then the most
910490	915950	significant bit indicates where another byte is following. So that's how they avoid the use of
915950	920890	essentially, for example, as you can see, the 0A in both the payload and the call sign, that's the
920890	925650	length. That's how they can sort of avoid, like, be more efficient of the use of the data stream
925650	930630	within the radio. So that's simple enough. We can write this Python decode script to decode the
930630	934750	GID, and then we can take the orange bytes at the top and get the orange bytes at the bottom.
934750	942390	Relatively simple. So now, our next part was like, OK, let's discover the byte 0. So FCC comes to
942390	947750	the rescue. They have a lot of useful information. I highly recommend FCC documentation. So that
947750	953890	says, the FCC essentially says that GoTenna is using SI4460 radio, and that radio, based on its
953890	960250	documentation, adds length as byte 0. So that means that we can find our node. We take our packet,
960250	966030	we take the length, we get that 69. So then we have to subtract 1, because that is the length byte.
966030	973750	So we get 68. We convert decimal 68 to hex, and we get 44. And then the ciphertext was 47. We
973750	981530	extorted 2, and we get 3. So that is our whitening byte at byte 0. For byte 1, we did a lot of
981530	986130	testing, and eventually we figured out it was 96. So we'll kind of skip all the detail there,
986130	990230	because it's a short presentation. So in our current de-whitening status, we have pretty much
990230	996230	everything from byte 0 to 96. We do not, unfortunately, know what last 10 are. So, of course,
996230	1002850	we do more investigation. We find that the two bytes immediately following the message are a
1002850	1009630	result of CRC16 CCITT variant. CRC16 stands for Cyclered Redundancy Check. It's used as error
1009630	1016290	correcting code that is capable of determining whether or not the payload has been corrupted in
1016290	1021130	the transmission. So that's a very quick way to determine that. So we also do more analysis. We
1021130	1026830	figure out that this CRC is initialized with 0s, and it uses 1021 as the polynomial. So then we
1026830	1032010	take the entire packet up to those 10 bytes, and we compute the CRC16. So here on this slide, you
1032010	1038110	can see the Python script that we implemented. So it's using 0s and 1021 as the polynomial. So
1038110	1042810	then we run it through that function, we put the packet that we saw earlier through that function,
1042810	1049810	and then we get the CRC16 value is DCD2. And then our whitened message, the ciphertext, was BCAA.
1050110	1056150	So then we take, we XOR the two, and we get that the key at that offset is 6078. Okay, pretty
1056150	1062670	great. So then the last 8 bytes are a result of Reed-Solomon error correcting scheme. So Gotenna
1062670	1067870	is using both CRC and Reed-Solomon for error detection and correction. So a very
1067870	1073890	powerful part about Reed-Solomon is that it can not only detect the errors, it can also correct
1073890	1078650	them. So they are using 8 error correction symbols and first consecutive root set to 1. So we're
1078650	1082950	using Reed-Solomon library and these four lines to essentially compute the Reed-Solomon against
1082950	1090610	the packet we found earlier. Once we do that, we get the line in the first bullet. So those are
1090610	1095390	those 8 bytes. We get the whitened message, the ciphertext, we XOR the two, and we have the
1095390	1100950	entire key. We have now the entire sequence from zero to the end. So that's pretty awesome,
1100950	1111590	right? So now a big part here that we want to note is that this entire sequence has been
1111590	1116070	generated by something called linear feedback shift register or LFSR polynomial. A very
1116070	1120710	powerful thing about this algorithm called Berlikamp-Massey. So we can use this sequence
1120710	1125810	within Berlikamp-Massey to retrieve this polynomial. The polynomial is shown at the bottom.
1125810	1131430	But there is more to here. So in case that we could not determine something like byte 1 or any
1131430	1135550	other part, like we could have a very partial sequence, we could use Berlikamp-Massey and
1135550	1141590	mathematical techniques to determine this polynomial and the associated sequence even if we
1141590	1145650	don't know things. So we could technically wait enough time and enough brute force using
1145650	1150390	Berlikamp-Massey, only knowing the payload, figure out the header, even if they were not
1150390	1154670	being split. So math is pretty awesome thing. So we can do that.
1155910	1161130	So yeah, so this is the polynomial. So they're using x to the 23. So you know that, you know, and
1161130	1167210	this is not, this is just meant to ensure that the receiver and the transmitter do not lose
1167210	1169490	connection. So this is not meant as encryption.
1169670	1174470	Yeah, this is really acting almost like a form of two party authentication to make sure yes, they
1174470	1180330	received the message. Yes, I've received the message and using that as a way to almost have a
1180330	1181010	packet count.
1183370	1187050	So in our current decoding process, so this is done in green radio and we're doing this
1187050	1192870	essentially live. And this is just a screen capture of my console. So we get the raw bytes and
1192870	1197630	we automatically extract the GID. We apply the function. We can translate that to ASCII. We get
1197630	1202590	the call sign, the payload, including multi-fragmented messages. So even in multi-fragmented
1202590	1207930	we can still extract the payload. So what Gotenna chose to encrypt. So we played a bit with
1207930	1213510	encryption and we see that it's only the payload. So what does it mean essentially once we can read
1213510	1218150	all of the other signs? Because in encrypted, unencrypted mode, all of these are visible.
1218150	1224010	So everything you see in red here means that at this point where we currently are, we are able to
1224010	1228850	see the message length. That can be pretty valuable. That can definitely add up to things in
1228850	1235170	the future, especially with long term collection techniques. The GID, the GID is going to be your
1235170	1239970	unique identifier, which used to be your cell phone number and you had to pick for it to be a
1239970	1246290	randomized one, which we found out was just actually epoch. But you now can still, with this,
1246290	1250770	they don't do the phone number. So that's a much better improvement there. But that GID tells me
1250770	1257650	that is that exact same device. And you can change it, but understand that that GID is a unique
1257650	1261310	identifier like a MAC address that follows you. Now the call sign's a little bit different. This
1261310	1267650	goes back to my former community. When you have call signs involved that can be read in the clear,
1267650	1272730	now I possibly know how many people are in an organization because typically they have a
1272730	1278310	numerical sequence after it and I can start telling more about that individual organization. So by
1278310	1284110	having the equipment and the call sign, I can now start linking equipment to not only
1284110	1289870	organizations, but individuals to who was using the equipment at what time. Payload length, again,
1289870	1295090	much like message length. That gives us really valuable things to know what is it that we need
1295090	1299610	to focus on and what are they saying. Is it short messages? Long messages? Are they using brevity?
1301210	1306070	And the CRC and the Reed-Solomon, we're gonna look and see that those become fairly valuable in the
1306070	1312410	end. But these are the reasons this really concerned me. 100%. So now in this case, we've
1312410	1316670	shown what we discovered so far. So we go more in our analysis, right? So that's what happens,
1316670	1321150	right? So we analyze the remaining fields. We see the highlighted in blue. We decode that and
1321150	1325170	figure out that's the time stamp. So you see here January 12th, that's we did the very initial
1325170	1339540	capture. So that's pretty awesome. So, um, we also discovered these tags. So, ha ha. Ha ha.
1340000	1345480	There we go. And we knew we were on our way to something great at this point. Yeah. So an
1345480	1349120	additional thing with this presentation that we want to do is we want to teach you how we do
1349120	1354000	reverse engineering. So we discovered that this protocol is using tags. So they're using tag
1354000	1359460	57, tag 24, and others. So this is important to note. So we'll use this in the rest of the
1359460	1365660	presentation, but it's important to note how we discovered that, okay, so 57 or 39 hex, after
1365660	1372160	that, there is the, um, UTC time stamp. So then we use this in tag-based identification in our
1372160	1378700	script. So, uh, we take the tag is equal to 57 and then we appropriately, uh, apply, uh, the
1378700	1383680	Python code to decode that. So that's what we're doing. So at this point we're a bit stuck,
1383680	1388100	right? So we could keep going the same things over and over again and like eventually we'll, we'll
1388100	1392980	get everything. Maybe we won't, but we're, you know, what happened in the B1 here? So this is
1392980	1399760	where I kind of fell back to the version 1 when I worked with Tim Kerster on that. And he and I
1399760	1404100	had kind of a light bulb moment. He's an engineer, I'm a knuckle dragger. So we looked at it two
1404100	1409840	totally different ways. So he went home that night to start working on an automatic, um,
1409840	1415000	demodulator for the FSK and I started seeing what I could find so we could try to compare
1415000	1419760	knowledge and he comes back the next day and goes, Woody, I really hope that, you know, this
1419760	1423980	demodulator that I made is working. I wish there was some way that I could check against what the
1423980	1428800	actual code that's coming out is to make sure that everything's correct. And I said, well, hey,
1428800	1432180	we can just compare it to the stuff that I've been looking at through the UART and then we'll
1432180	1437780	just know, right? At which point he said, what do you mean you have UART? I just assumed he'd
1437780	1444120	check. Yeah, so we don't have UART in this case with GoTenna Pro, but we have something better.
1444120	1448000	So Clayton just casually mentions, um, why don't you read from the app? It was useful when I did
1448000	1452800	Mesh. Um, wait, what? We had code the entire time? Like, what? I go online and like, I'm
1452800	1457900	supposedly this like reverse engineer, right? And like, I didn't look at the app. What? So
1457900	1464400	everything in the app is plain text. Yeah. Look at this. So we go in, decompile it. Boom. We can
1464400	1469020	see the firmware in there. We can see the source code. Like I was looking for this, but like,
1469020	1474480	it's right there. Wow. Yeah. So companies really don't think it's like hackers. So like hackers,
1474480	1477780	like, like the guys in these pictures, they can find full source code and firmware available
1477780	1484980	completely unencrypted and unobfuscated. It exists. Yeah. And this is where we said, oh, I
1484980	1490140	think things are going to be a little bit better now because in version one, we just had to kind
1490140	1493480	of bare knuckle through it and hope we were close. We just knew that our demodulation was
1493480	1498000	working. We didn't have tags yet, which I think we're going to get to. Yeah. So we go back and
1498000	1500640	we'll look through a source code. We find these tags. Remember that we were talking about
1500640	1505160	reverse engineering tags. We see 57 right here. So we were spot on. Our reverse engineering,
1505160	1509880	like methodology was very spot on. So that's what we want to show you. We find more tags,
1509880	1514700	right? PB broadcast, we see key data coordinates. So, you know, we have a bunch of tags,
1514700	1519320	right? So you're assuming that we use this Java source code, essentially slowly update our
1519320	1524400	script. This may take like a couple of months and eventually we'll have a better product. Well,
1524400	1530940	not quite. Ain't nobody got time for that. So we find an interesting observation. There's a
1530940	1535500	file descriptor and we find something called Proto 3. Some of you are familiar with that
1535500	1540380	already. But we weren't, right? So we look this up and it's a protocol buffer. It's used as an
1540380	1545780	open source library developed by Google to help companies and other people to develop custom
1545780	1552260	protocols. And they're supported by all kinds of languages. Python, Java, C. All kinds of things.
1552260	1559540	Right? So we go online and we kind of take the string, the binary string, and we kind of figure
1559540	1563700	out, okay, these may be the fields, right? The sender, the call sign. And then let's try it.
1563700	1568000	So we put in the hex at the bottom. And then, wow, the whole thing is there.
1568820	1573220	But literally, you just put it in the program on one side, push a button, and it gives you
1573220	1579180	everything on the other. It's automatic. Like, this did not happen in V1 or Mesh. This is way
1579180	1585880	easier. So, yeah. So we then go in and then let's do this for real. So we go through all of the
1586760	1591820	decompiled stuff. We take the file extractors. We put in our own custom file called Proto
1591820	1598340	extraction. And that will generate a binary file. And then we use PBTK. This is an open source tool.
1598820	1603780	We use this against this binary file. And that gives us all of these things at the bottom. Like,
1603780	1608920	all the proto files. So the base header essentially sets up the message. This imports the header
1608920	1614980	protobuf. The header protobuf was what we were doing in reverse engineering in Blackbox. What's
1614980	1620760	important here is this data type, right? This enum would be very difficult to reverse engineer. Like,
1620760	1626060	we would have to take so many samples and then hope that we can maybe figure out the text is 3
1626060	1631820	and then ping is 5. That would be very difficult. So let's go back full circle. What were those
1631820	1636080	tags, right? So if we compile this protobuf in Java, because that's what Gotenna is using,
1636080	1640700	we can see these cases. So these cases are used as different parts of the protocol to essentially
1640700	1646280	define different things. So we were spot on, right? These tags were cases. That's pretty awesome. And
1646280	1651200	we got 57 and the rest of them. And you also noticed that you could see things like when they
1651200	1657740	requested, I don't know, keys. You could see the code of how to request a key. 100%. So yeah, so
1658280	1662860	a cool part about protobuf is they can be compiled for Python. What else is using Python?
1664160	1668220	I believe there's a little thing called GNU radio. Yeah, that might be cool. It's so easy,
1668220	1673380	even I can do it. Yeah. So we go in and we import a base message data type and we make a
1673380	1680420	statement to associate everything and perfect decode! Victory!
1682640	1687260	But wait, we haven't found a single vulnerability yet. We just decoded the thing. There's 30 more
1687260	1693480	slides of actual vulnerabilities. So, you know, stay seated. So with this decode, now that we can
1693480	1701120	read things, we get the we can do frequency decoding, shared location, we can do emergency
1701120	1706000	messages, all kinds of things. The only thing where we received a challenge was in, um,
1706000	1710500	coordinate decoding. So in the app, we can make, for example, like around this island, we can make
1710500	1715560	coordinates and then when we're capturing it, we see binary data represented as base64 and JSON
1716180	1721360	and in this case, there, there isn't much, right? So like, like we can't see here. So we go back
1721360	1726780	to proto, they're defined as bytes, so that means that decoding on our side has not been added. So
1726780	1731140	that's very simple. We just use decode as little nd and double double and then boom, we get the
1731140	1736460	coordinates. So that's fixed. So now we found our true first vulnerability, right? It's like,
1736460	1740460	like we encrypt the message and we're just kind of looking at things. So, so what can you do when
1740460	1744660	somebody can capture yes or no and tell the differences? When you start dealing with
1744660	1748700	organizations that are using brevity for communication, simple things like the length
1748700	1753020	of a message become very easy, even without going into advanced steps to be able to tell what kind
1753020	1757700	of communication may be happening. Are they only sending coordinates? Are they sending commands? Are
1757700	1762060	they just sending comms checks? So this starts becoming really important, being able to understand
1762060	1768340	these message lengths. Yeah, so it's crucial. So then let's go look at how they're doing encryption.
1768340	1772760	So one of, one form of encryption is encrypting the broadcast. So this is the process how it works
1772760	1777320	in the app. So we generate the new key, we put in the name, it can be either broadcast or QR code,
1777320	1780360	and we're going to get to that, right? That's not important, but what we go in is the validation
1780360	1786720	thing. It's kind of interesting, right? We do this a bunch of times, like they're kind of short.
1787060	1794660	So, and it's all lowercase or numbers, and that's it. But there is a space, so I guess we have nine,
1794660	1800940	but the space is consistent, so nope, really just eight. So you have lowercase numbers, or I'm sorry,
1800940	1804920	lowercase letters and numbers, and that's all you have to figure out. And you only have to figure
1804920	1809900	out eight of them, put a space in the middle for your dictionary. Yeah, so very interesting. So then
1809900	1814380	we go in, okay, we capture this QR broadcast, right? QR broadcast gets sent unencrypted over
1814380	1819340	the air, so this key data is actually encrypted, right? So what we have here is encrypted, but
1819340	1824160	you know, we do some of our analysis, and then long story short, to make the fit in the presentation,
1824160	1829620	we were able to decrypt it. And the nice thing too is it told us where the IV and the salt was,
1829620	1834200	because we were able to find where they were, so it made it much easier because we knew which was
1834200	1840200	which. So then essentially the key data is fed into the PBKDF HMAC with 10,000 orations. This is
1840280	1845980	a very good hashing, but it's protected by state character password. So let's say password is known,
1845980	1851280	it's going to give us the encryption key, and encryption key along with the IV and the GID
1851280	1857700	can decrypt the cipher text. AES-GCM will give us the plain text and HMAC. We also, you know,
1857700	1862040	to be good communications people, we can compute our own HMAC and verify the message was correct,
1862040	1867880	right? So now one may ask, like, how complex, how complicated is it to get this password? So
1868540	1875480	in MD5 this will be very quick. PBKDF2 is pretty strong. So we do hashcat and we essentially
1875480	1882440	analyze. This is an actual engineering analysis. So with RTX4090 one card, one can figure this out
1882440	1888380	in 15.33 days. A very common commercial cracking rig can have 12 of these, so in 1.27 days,
1888380	1893540	one can determine this password. Now we look at more well-funded adversaries. A100 is used by
1893540	1898780	chat GPT, neural nets, AI, that's the whole thing now, right? This one card is actually worse,
1898780	1904160	right? But if you have 10,000 of them, you can figure out in 5.31 seconds. It's important to
1904160	1909880	know that all of these times here... It's important to know that all of these are kind of worst case
1909880	1914400	scenarios. That means that your script found the password the very last time. So it's likely it's
1914400	1921200	going to be like about half the time. So we go in and we can essentially, if we know the key, we
1921200	1925960	wrote our little script and then we can decode it. We can get the hex key and now we can add this to
1925960	1931040	our automatic decoding script and now we can decrypt live. Awesome. And we can also decrypt
1931040	1937160	everything that happened in the past. So now we have it all. Yeah, but there's more. So another
1937160	1942460	form of communication is point-to-point and that uses public key encryption. So public key
1942460	1948020	encryption on its own is a lot more secure. It uses PKI, or public key encryption, to share the
1948020	1954320	symmetric key. It doesn't require any of this manual key sharing. However, in our code, we, the
1954320	1958420	message receiver class was not, did not cleanly decompile. So we could spend some time, do that,
1958420	1964120	but in help with some Craigslist, eBay and Freedom, maybe we can figure it out without it. So
1964120	1968540	initial conversation starts with public key sharing. So here we get the GIDs and the public
1968540	1974880	keys. Pretty cool. So then we get to the source code. Uh, we figured out that the, uh, public key
1974880	1981420	and the private key are, uh, generated using ECDH384R1 curve to generate the share key. The
1981420	1987700	share key is used as first input to HMAC SHA-256. The second input is not known here. So we
1987700	1992660	could not figure out what are the parameters here. So using Freedom, uh, we can essentially
1992660	1999420	intercept this Cryptomagdo final. So we, we essentially instrument this phone right here, which
1999420	2005740	is an Android phone. We, this is connected with Gotenna and then, uh, we cap, we send a P2P and
2005740	2009960	then we capture this. And then from this kind of hex string, we can figure out, okay, the second
2009960	2015340	parameter is actually concatenated GID public key and the private, uh, and the share key. We do
2015340	2018620	know the public key and the GID. We just found that earlier in the slide earlier. We don't know
2018620	2023280	the share key. So let's look for that. We go in the device and we find the Gotenna folder in that
2023280	2029080	same phone and we find something called Gotenna key encryption. I wonder if that's used for
2029680	2036420	encryption. So we go in and okay, it's using private keys, share keys, but now to, you know,
2036420	2040980	the best luck, this, all of this is encrypted, right? Fully encrypted, we, we can't read it.
2040980	2046880	But let, let's verify. Okay. So we go in and we find the file that's using Gotenna key
2046880	2052440	encryption. We see at the top something called as an IV. But we can't tell from that function. So
2052440	2056600	we track this over two different functions and figure out it's not only used as a static hi- as
2056600	2064460	an IV, it's used as a static IV to AES-GCM. So, keys are AES-GCM encrypted, but static IV allows
2064460	2069960	complete encryption bypass. This is when AES is doing what not, what, what AES is not meant to
2069960	2074440	do, right? And then using the public key as a known plain text and the encrypted, uh, public
2074440	2079220	key, we can XOR them to get the key stream and then we can decrypt essentially everything else.
2079220	2084200	And, and what's stored in a database are public keys, shared keys, broadcast keys, the top two,
2084200	2090920	the pin, pretty much everything. So we have a lot of stuff here. So then, yeah, there is AES.
2091220	2099180	There is. However, there's also AES sitting here and then implementation or configuration sitting
2099180	2105080	here. This is kinda like having a really nice blast proof, bullet proof door at your house and
2105080	2109740	then realizing that when the bad guys come, they just cut a hole through the siding and the dry
2109740	2115320	wall right next to it. Yeah. So, let's now summarize this just so kinda everybody can be on
2115320	2119980	the same page. We get the public key and the public key cipher text in the XML. We XOR them to
2119980	2123600	get the key stream and then we take the key stream and XOR that with the private key cipher
2123600	2128300	text to get the private key. Then, when we have the p- public key and the private key, we use
2128300	2134240	ZCDH to get the shared key. Shared key is used within HMAC SHA-256 along with GID public key
2134240	2138420	and the shared key to get the encryption key. That along with the IV and the GID can decrypt
2138420	2143740	the cipher text of P2P encryption. Group encryption is another form of encryption. It's the
2143740	2148400	last one that we'll talk about. Uh, or the last one supported really. Um, so it's using the
2148400	2152680	very same method, so same exact attack against P2P works against this and we can show here
2152680	2157320	that we have done it. So this are, this are true vulnerability summary, right, of encryption
2157320	2161180	summary findings. So broadcast is vulnerable and allows unauthorized decryption. Using set up
2161180	2165280	QR message, which is captured over the air, and brute force password, we can decrypt it. We
2165280	2169780	can also get it if the phone is compromised and we get the, the key from there. P2P and group
2169780	2174600	are both vulnerable to unauthorized decryption if, again, the phone is compromised and we get
2174600	2178880	some of these. Um, so if you want to know the feasibility, you can check out our DEF CON talks
2178880	2182680	and things like that to sort of really know that. There's no authentication public key, so
2182680	2186520	man in the building is possible. Short messages, less than one fragment used, less secure
2186520	2192440	AES CTR, so less than 35, 45 characters, depending on the message. Uh, are using CTR, so that
2192440	2197220	has integrity concerns, even though it is encrypted. And then longer messages use more secure
2197220	2203160	ACM, uh, GCM, but you need to be sending like 50 characters to get to that. So we also, you
2203160	2208080	know, we could also transmit directly from the GNU radio, uh, from, from our GNU radio. We can
2208080	2211300	spoof GID call sign the message. We can get into the existing...
2211300	2221280	So I could take a HackRF or an NES or a Blade and I can actually make my own Gotenna out of it and
2221280	2222600	just start using my computer.
2222600	2228780	We also added support for Wireshark. So we have, um, essentially that, so, so, so all the
2228780	2232540	messages are fed into Wireshark. We don't have the decode there currently, but we'll add it
2232540	2238640	eventually. Um, so now let's get to live demos. So if you want to, if you have a Gotenna Pro,
2238640	2242680	then you can get the frequency on the left and the encryption in the middle and validation on the
2242680	2246060	right. So we have six minutes, so let's be quick.
2247780	2259440	I wouldn't scan it because we're both sketchy guys, but still. So it's firing up live right now.
2259440	2264480	He's just turning the program on. You can see it's already starting to sniff and listen. We'd
2264480	2269060	like to have a little waterfall so we can see when we are or not capturing. Now he's going to send a
2269060	2284980	message and there you go. There we go. We have enough time, so let's see if we can decrypt
2284980	2292900	something. So now being able to do the same type of process for an encrypted message. So that was a
2292900	2297560	broadcast. Now broadcast means it's sent out so that anyone that has one of these devices is able
2297560	2302140	to catch it. It's meant for an emergency situation or you're just looking for other people around
2302140	2308960	you. But the next step is all those things we talked about by combining that information, can
2308960	2316140	you take an encrypted message for a group or a person to person and actually decrypt and see it?
2316460	2342800	So when you think about this, this is where everyone feels safe. So while we're going through
2342800	2354870	this, he's going to set the demo up, you're going to be able to see it. And we'll go ahead, are
2354870	2360490	there any questions right now while he's setting this up? We have a minute or so. Any questions
2360490	2370670	over anything that we've seen so far? Okay. Here we go. Now one of the things that I want to make
2370670	2375470	sure that we cover in this is that when we reached out to Gotenna for the version one
2375470	2381250	exploit, they were, had zero response. Other than the fact that they said, that's fine, we don't
2381250	2386410	care. Under the new management, Gotenna was extremely receptive. We got a call back within one
2386410	2393470	day. Uh, they were happy to take the advice that we gave them and they are actively working to
2393470	2399110	try to fix these issues. That's why we are going to make sure we wait at least two months from
2399110	2404910	today before we release the full code publicly, but then we will. Now for gen one and two, the
2404910	2409530	code's already out there. Okay, so now we're ready. So I'm going to, we're going to send
2409530	2412910	something encrypted just so we can see that messages are indeed encrypted. So we can see
2412910	2433610	they're, they're encrypted now. Now this part here decrypted. So this was added to our local
2433610	2438630	database. So we're going to run our script again. So this is going to now pull the keys from
2438630	2452440	there immediately. And then we will transmit again. Boom, this was encrypted. So now it's full
2452440	2466640	circle. So, you know, live demos are something that I'm a big fan of. So Irwin did an amazing job
2466640	2472780	of writing all this crazy code. I don't want anyone to misconstrue that. The big thing that we
2472780	2480560	want to make sure that everyone takes away from this is it is up to everyone in this community to
2480560	2485580	test equipment. Just because something says it's secure, don't believe it. Challenge it. And
2485580	2489960	when you find it, see if the manufacturer's willing to listen. Occasionally they are. Gotenna
2489960	2496520	was. Most of the ones I've dealt with aren't. So if something's been done in the past, don't be
2496520	2500400	afraid to try to recreate it when something new comes out. You might find that they didn't
2500400	2503860	change a lot of the things and then you can move forward and do well with it.
2505040	2510200	Yep, so let's talk about, I mean you already mentioned this, so they were very receptive.
2513340	2514820	And yeah, the conclusion.
2514900	2521760	Yeah, so the big things we wanted to say about this is, you know, we reached out to industry. We
2521760	2525860	were able to have a good relationship with them doing this. They took away key points.
2526040	2530380	Acknowledgements of what we want to make sure we talk about here. So we want to reach out to
2530380	2534440	White Shadow, who unfortunately couldn't be here because he's actually doing some responsible
2534440	2539320	things for his family, but he is going to be here later. But don't tell him I said anything nice.
2539460	2543080	What the Freak, which is the wireless CTF team that...
2543080	2545020	Let's do a shout. We got a win today.
2545860	2549440	Which I'm glad they're here because now all the other teams are jumping ahead of them.
2550020	2552480	Yep, so we also want to thank EFF and CISA.
2552940	2558280	Both of them were amazing organizations and very easy to work with. The RF Hacker Sanctuary,
2558280	2564400	please go there, try some challenges. It's everything from Wi-Fi, Bluetooth, tire pressure
2564400	2568920	sensors, go tennis. All of these challenges will be there as well for you to solve for all the go
2568920	2572540	tennis stuff. We want to make sure that, you know...
2572540	2577420	Yeah, Jason Rojas and Cisco Systems. I want to thank them for making my trip here possible and
2577420	2580500	Potify Media for making this team for this presentation.
2580780	2584720	And Buffalo Trace, because without them, I probably wouldn't get done as much work as I do.
2587380	2589800	Thank you for your time. Are there any questions?
2593280	2595100	Well, thank you and enjoy the con!
