1 00:00:00,000 --> 00:00:04,880 Well, hello, everybody. Good afternoon. I know it's lunchtime, so I really appreciate you all being here. 2 00:00:05,400 --> 00:00:10,460 If you made your way to this room, that means you want to hear about how to hack Bluetooth low-energy devices. 3 00:00:10,600 --> 00:00:12,540 So hopefully I get to answer some of those questions today. 4 00:00:13,360 --> 00:00:17,660 My name is Jose Gutierrez. Oh, shit. This is funny. 5 00:00:18,080 --> 00:00:23,320 The title of my presentation is actually, How Do I Have BLE Hacking But Really, Truly Underground? 6 00:00:23,600 --> 00:00:27,040 It's called How to Make Nick Cage Rich Again, and I'll tell you why in a second. 7 00:00:27,040 --> 00:00:30,000 My name is Jose Gutierrez. I'm a researcher. 8 00:00:30,760 --> 00:00:34,960 My background is electrical and computer engineering, and I like to consider myself a perpetual dabbler. 9 00:00:35,000 --> 00:00:36,540 I dabble all over the place. 10 00:00:38,060 --> 00:00:40,300 Most recently, I did that. 11 00:00:41,760 --> 00:00:46,780 Most recently, home automation and definitely Bluetooth low-energy security. 12 00:00:48,120 --> 00:00:51,580 Our research director is Ben Ramsey. Unfortunately, he couldn't be here today. 13 00:00:51,640 --> 00:00:53,140 He's recovering from surgery out east. 14 00:00:53,340 --> 00:00:56,940 But some of his most recent work is all sorts of Z-Wave. 15 00:00:57,040 --> 00:01:00,480 Z-Wave stuff, which I know a lot of guys here have worked with, and he's talked at DerbyCon, ShmooCon, 16 00:01:00,660 --> 00:01:07,060 and he has most recently a POC or GTFO article, which is really cool about reading EEPROM 17 00:01:07,060 --> 00:01:09,020 and extracting some private keys out of it. 18 00:01:09,080 --> 00:01:09,600 So it's pretty awesome. 19 00:01:11,240 --> 00:01:12,140 All right. Cool. 20 00:01:12,360 --> 00:01:16,080 So some housekeeping slash expectation management. 21 00:01:17,000 --> 00:01:22,900 What I will be presenting today is a basic, basic overview of how Bluetooth low-energy works. 22 00:01:23,100 --> 00:01:26,520 I'll be talking about some of the most basic. 23 00:01:26,520 --> 00:01:29,320 Bluetooth low-energy tools and how to use them and when to use them. 24 00:01:29,400 --> 00:01:35,680 Most importantly, I won't be presenting an in-depth, you know, down-in-the-weeds Bluetooth low-energy talk. 25 00:01:35,840 --> 00:01:36,740 I don't have enough time. 26 00:01:36,820 --> 00:01:38,820 So go read the specs and you'll get all that information. 27 00:01:39,320 --> 00:01:41,420 And I'm not going to present every single tool out there. 28 00:01:41,560 --> 00:01:44,960 So there's plenty of approaches to do some of the stuff that we're talking about today. 29 00:01:45,080 --> 00:01:48,660 But I'm just going to present what we have done, what we've used. 30 00:01:49,780 --> 00:01:50,580 Some nomenclature. 31 00:01:50,740 --> 00:01:52,620 Whenever I say tablet, think mobile. 32 00:01:52,860 --> 00:01:55,740 So smartphones, tablets, 33 00:01:55,740 --> 00:02:02,840 tablets, tablets, whatever is whenever I say Cali, think Linux machine with a bluesy Bluetooth stack. 34 00:02:03,040 --> 00:02:08,400 OK, so most of most of the time you'll be able to do all of these things with those two types of devices. 35 00:02:08,600 --> 00:02:10,180 OK, so let's get started. 36 00:02:11,260 --> 00:02:13,740 Let's go into a little bit of a story here. 37 00:02:14,940 --> 00:02:23,700 We know that Bluetooth low-energy is a forefront technology in smart devices slash IoT because it's super easy to use. 38 00:02:23,760 --> 00:02:24,540 It's super low energy. 39 00:02:24,660 --> 00:02:25,020 Um. 40 00:02:25,740 --> 00:02:32,000 And we knew that it was pretty available, but we didn't actually know how much it was being used. 41 00:02:32,240 --> 00:02:34,380 People use this on everything. 42 00:02:35,280 --> 00:02:44,220 OK, we're talking like, we're talking smartwatches, outlets, pressure cookers out there. 43 00:02:44,280 --> 00:02:50,280 You can buy you can buy a a a bid and sorry, what's that called? 44 00:02:50,980 --> 00:02:51,380 Pacifier. 45 00:02:51,520 --> 00:02:51,920 Oh, my God. 46 00:02:52,340 --> 00:02:54,960 You can buy a pacifier that basically reports on a baby's temperature. 47 00:02:54,960 --> 00:02:56,120 I'm using Bluetooth energy. 48 00:02:56,320 --> 00:02:57,520 There's all sorts of shit out there. 49 00:02:57,560 --> 00:02:58,500 You can buy all right. 50 00:02:58,520 --> 00:03:02,180 Um, some of them has some has some has implications, security implications. 51 00:03:02,280 --> 00:03:03,820 So there's Bluetooth locks on. 52 00:03:03,920 --> 00:03:09,360 Actually, one of my co-workers, Anthony Rose, is going to give a talk later today and tomorrow about how to hack Bluetooth low-energy locks. 53 00:03:09,440 --> 00:03:10,600 So if you're interested, go check that out. 54 00:03:11,700 --> 00:03:13,920 Um, there's also industrial sensors. 55 00:03:14,000 --> 00:03:15,100 So this is a pressure sensor. 56 00:03:15,240 --> 00:03:15,920 You can go buy online. 57 00:03:16,180 --> 00:03:23,280 We decided to focus on a data logger, temperature and humidity data logger, specifically the onset MX 1101. 58 00:03:23,900 --> 00:03:24,940 Why did we focus on that? 59 00:03:24,940 --> 00:03:29,820 Well, the manufacturer actually is really proud to include some testimonials. 60 00:03:30,060 --> 00:03:31,680 Um, this is one of them. 61 00:03:31,780 --> 00:03:40,660 So this lady's claiming that she uses this to monitor the temperature and humidity of the Magna Carta, one of the four copies of the Magna Carta in England. 62 00:03:40,980 --> 00:03:43,280 Um, and there's no way that's actually happening, right? 63 00:03:43,420 --> 00:03:44,520 Well, I don't know. 64 00:03:44,620 --> 00:03:46,300 I haven't been to England recently. 65 00:03:46,580 --> 00:03:51,660 Uh, and I couldn't get them to pay for a trip, but we do know that this picture exists. 66 00:03:52,680 --> 00:03:54,800 And this is like a, you know. 67 00:03:54,940 --> 00:04:04,480 Uh, a marketing picture, if you will, but it's her holding an app that's controlling the temperature sensor that's inside the case of the Magna Carta. 68 00:04:04,640 --> 00:04:06,720 So there are some potential implications. 69 00:04:07,000 --> 00:04:08,440 So let's talk about, uh, this. 70 00:04:08,860 --> 00:04:13,940 Yeah, that's how you make them rich again, right? 71 00:04:14,020 --> 00:04:17,640 Uh, let's talk about this sensor a little bit more closely. 72 00:04:18,160 --> 00:04:21,120 Um, specifically it's a, it's a data logger. 73 00:04:21,180 --> 00:04:24,820 So essentially you put this thing out there, um, and it just tracks temperature. 74 00:04:24,940 --> 00:04:26,120 Humidity and just logs it. 75 00:04:26,220 --> 00:04:30,480 And you can walk by with a companion app to actually pull off that information. 76 00:04:30,860 --> 00:04:35,600 Um, there's a password that you can set up on the sensor so that not anybody can walk by and pull off your data. 77 00:04:35,760 --> 00:04:42,380 Um, and you can also do firmware updates over the air that the manufacturer has enabled on this device, which are both very interesting things that we'll talk about in a little bit. 78 00:04:42,860 --> 00:04:43,300 Okay. 79 00:04:43,420 --> 00:04:50,860 So before we move on, I want to draw a clear line in the sand between Bluetooth classic and Bluetooth low energy. 80 00:04:51,000 --> 00:04:51,260 Okay. 81 00:04:51,440 --> 00:04:54,860 Um, when you hear Bluetooth, it kind of covers all these. 82 00:04:54,940 --> 00:04:55,080 Things. 83 00:04:55,180 --> 00:04:57,220 So I want to make sure that we're, we're talking about the same thing here. 84 00:04:57,300 --> 00:05:05,000 Um, classic is a high over head, fast data rate, something that you might use to listen to music, uh, to make phone calls, right? 85 00:05:05,100 --> 00:05:07,640 So your car is using Bluetooth classic type of communications. 86 00:05:07,780 --> 00:05:17,700 Uh, Bluetooth low energy is a completely different protocol, um, that is designed specifically for low energy transmissions, specifically state full type of transmission. 87 00:05:17,800 --> 00:05:24,640 So whether a door is open or closed, whether a light is on or off or acting a command to turn a light on or off. 88 00:05:24,660 --> 00:05:24,740 So. 89 00:05:24,740 --> 00:05:30,080 So it's very quick, very short bursts of transmissions, and that's what Bluetooth low energy is primarily, uh, used for. 90 00:05:30,200 --> 00:05:33,860 And that's where that's the type of, uh, communications that we're gonna be talking about today. 91 00:05:34,040 --> 00:05:34,360 Okay. 92 00:05:35,400 --> 00:05:42,520 So our basic hacking process, if you will, kind of follows the traditional hackers methodology that you can just go Google. 93 00:05:42,740 --> 00:05:47,100 Um, basically you have to find a target first, then you enumerate its services and characteristics. 94 00:05:47,380 --> 00:05:48,200 We'll talk about what those mean. 95 00:05:48,360 --> 00:05:53,640 Um, and then we'll, you, you kind of have to reverse the application protocol and try to figure out what the application is trying to do. 96 00:05:53,700 --> 00:05:54,420 Um, specifically. 97 00:05:54,420 --> 00:05:55,660 Like the app on your phone. 98 00:05:55,760 --> 00:05:57,640 What's it trying to do when it communicates to the device? 99 00:05:57,800 --> 00:05:58,040 Okay. 100 00:05:58,160 --> 00:06:04,220 And if you complete these three steps, then you can, of course, uh, do whatever you want, attack, profit, whatever. 101 00:06:04,360 --> 00:06:05,840 Okay, cool. 102 00:06:06,080 --> 00:06:07,700 So step one, select the target. 103 00:06:07,880 --> 00:06:13,200 Uh, as of yesterday, there wasn't really a, a clear way to do this. 104 00:06:13,240 --> 00:06:15,180 Thanks to, uh, zero and his team. 105 00:06:15,260 --> 00:06:20,260 They, they put out a tool called blue Hydra, which helps you find Bluetooth low energy devices out in the wild. 106 00:06:20,340 --> 00:06:22,560 So, uh, there you go. 107 00:06:22,660 --> 00:06:24,400 Uh, so go down. 108 00:06:24,400 --> 00:06:25,160 Download that and use it. 109 00:06:25,220 --> 00:06:27,680 If you don't have that, here's some of the other ways that you can do it. 110 00:06:28,300 --> 00:06:37,120 Basically every Bluetooth learning low energy device, um, advertises some sort of, some sort of, uh, uh, information specifically advertises connectability. 111 00:06:37,280 --> 00:06:38,080 Am I connectable? 112 00:06:38,160 --> 00:06:44,680 Um, it advertises, uh, optionally available services that it's providing or, um, some manufacturer specific data. 113 00:06:44,760 --> 00:06:45,080 Okay. 114 00:06:45,140 --> 00:06:49,080 So if you can listen to those advertisements, you can generally see that there's a device out there. 115 00:06:49,180 --> 00:06:51,620 Your other option is to do a scan request. 116 00:06:51,700 --> 00:06:53,020 So a scan request is just. 117 00:06:53,020 --> 00:06:59,440 A broadcast asking for what devices are out and they all respond with, with scan responses and then there you go. 118 00:06:59,480 --> 00:07:00,680 You have what, what devices are out there. 119 00:07:00,760 --> 00:07:00,860 Okay. 120 00:07:00,920 --> 00:07:06,760 To do it, uh, on a tablet, you can use an app called light blue or NRF connect. 121 00:07:06,940 --> 00:07:10,800 If you just download it right now, you can, you can find what Bluetooth learning devices are, are around here. 122 00:07:11,000 --> 00:07:15,660 Um, if you're on Cali, you can use, uh, HCI tool. 123 00:07:15,860 --> 00:07:18,680 So anybody heard of HCI tool ever used it? 124 00:07:18,760 --> 00:07:19,080 Yeah. 125 00:07:19,200 --> 00:07:19,460 Right. 126 00:07:19,540 --> 00:07:22,660 So it's, it's, it comes available with a, with a bluesy. 127 00:07:22,660 --> 00:07:22,880 Bluetooth. 128 00:07:23,020 --> 00:07:23,120 Learning stack. 129 00:07:23,220 --> 00:07:28,360 So you just use it, run an Ellie scan and you can see all the, the Bluetooth learning devices in the area. 130 00:07:28,480 --> 00:07:33,420 If you just want to listen to those advertisements without sending scan requests, you can use these, uh, passive option. 131 00:07:33,920 --> 00:07:40,380 Now, every time I, anytime I do anything, Bluetooth or energy on my Cali box, I have BT mon running on a different window. 132 00:07:40,480 --> 00:07:44,780 And BT mon essentially is wire shark for, uh, Bluetooth. 133 00:07:44,960 --> 00:07:52,800 So anything that your computer sends down to the Bluetooth dongle and anything that comes back from the dongle back to your machine, uh, gets displayed on. 134 00:07:53,020 --> 00:07:54,240 By BT mon actually. 135 00:07:54,360 --> 00:08:00,180 And I think blue Hydra actually uses BT mon and parses BT mon to provide you information about what devices are, are in the area. 136 00:08:00,340 --> 00:08:01,000 So cool. 137 00:08:01,060 --> 00:08:01,300 Awesome. 138 00:08:02,020 --> 00:08:02,380 Okay. 139 00:08:03,140 --> 00:08:04,860 If all else fails, you can always use a sniffer. 140 00:08:04,940 --> 00:08:08,780 So we're going to talk three, three different types of sniffer or three sniffers that are out there. 141 00:08:08,860 --> 00:08:10,540 Uh, number one, Uber tooth one. 142 00:08:11,000 --> 00:08:12,560 It's probably the most popular one. 143 00:08:12,640 --> 00:08:20,100 It's one of the most, um, it's one of the first dongles I could actually sniff Bluetooth classic communications, uh, for the cheap. 144 00:08:21,100 --> 00:08:22,740 So, uh, it's really, um, 145 00:08:23,640 --> 00:08:25,300 well known and widely available. 146 00:08:25,440 --> 00:08:27,020 So you can find that for a hundred, about a hundred bucks. 147 00:08:27,280 --> 00:08:38,080 Um, if you don't have a hundred bucks and you only want to slip snip, Bluetooth, low energy, low energy devices, you can use something like the, uh, CC 2540 eval kit, which actually comes preloaded with a sniffer. 148 00:08:38,260 --> 00:08:48,240 And then you just download TI software that to run on your machine that displays all the sniff packets, or you can use the Bluetooth or I'm sorry, the blue fruit Ellie sniffer, which is about 30 bucks. 149 00:08:48,700 --> 00:08:52,660 Um, again, or these types of sniffers are actually, those two are. 150 00:08:53,020 --> 00:08:55,520 They're actually meant for, uh, debugging purposes, right? 151 00:08:55,600 --> 00:09:06,320 So if you're building a Bluetooth low energy application and you want to know what kind of communications are occurring between your devices and, and, uh, like your app and your device or something, these sniffers will help you debug that communication. 152 00:09:06,600 --> 00:09:07,760 We're just taking advantage of it. 153 00:09:07,860 --> 00:09:10,460 Cause hell we, that's the information that we're looking for. 154 00:09:10,560 --> 00:09:19,920 So, um, you can use those now you might come across packets that are actually encrypted, and this is kind of what an encrypted packet looks like in Wireshark. 155 00:09:20,000 --> 00:09:22,900 So most notably, you'll see the start encryption request. 156 00:09:23,020 --> 00:09:29,620 At the top, that, that's kind of a giveaway that the packets are, or the communication was encrypted at, uh, the link layer. 157 00:09:30,060 --> 00:09:34,220 Um, if you see a lot of L2 cap fragments like that, it's also probably means that it's encrypted. 158 00:09:34,380 --> 00:09:35,800 So you're not shit out of luck. 159 00:09:35,940 --> 00:09:44,720 If, uh, if there's encryption, Mike Ryan gave us a tool called a tool called crackle, which takes advantage of a vulnerability that he found, um, with the pairing process. 160 00:09:44,820 --> 00:09:47,900 If you're using either six digit pin pairing or just works pairing. 161 00:09:48,160 --> 00:09:52,900 Um, so if you use his tool, you can, and you can capture the sniffing process. 162 00:09:52,920 --> 00:09:53,000 Okay. 163 00:09:53,020 --> 00:10:04,340 Which only happens once at the very beginning, whenever you first get the device, um, you capture us that, that sniff pairing, you, you feed the encrypted traffic to the tool and outcomes out unencrypted traffic. 164 00:10:04,540 --> 00:10:08,040 So we've run a lot of this, we've tested this tool and it works really great. 165 00:10:08,100 --> 00:10:12,180 If you're using those two types of, uh, either one of those two types of pairing modes. 166 00:10:12,620 --> 00:10:22,180 Now, uh, the Bluetooth gods, if you will put out another type of pairing, um, which actually was recommended by Mike Ryan, which mitigates this, this attack. 167 00:10:22,180 --> 00:10:28,820 But what we found is that actually most devices don't even use link layer encryption, um, because you have to pair. 168 00:10:28,980 --> 00:10:31,880 So that's harder for the user to do. 169 00:10:31,960 --> 00:10:39,080 So they just avoid it altogether and they either don't encrypt their communication or the encrypt at a higher level application level or something like that. 170 00:10:39,220 --> 00:10:39,640 Okay. 171 00:10:40,620 --> 00:10:44,040 So, uh, we actually prefer not to use any snippers at all. 172 00:10:44,080 --> 00:10:47,020 If we, if we can avoid it because sniffer still do drop a lot of packets. 173 00:10:47,180 --> 00:10:51,900 So what we prefer to do is just if there's an Android app available for this. 174 00:10:51,900 --> 00:11:05,600 The specific thing that we're trying to interact with, we'll download the Android app, we'll enable, uh, developer options, enable that Bluetooth HCI snoop log option, and then it just does the same thing that BT Mon does, except for in your Android tablet. 175 00:11:06,180 --> 00:11:09,640 So you just pull that file off and you can read it in water shark, super easy. 176 00:11:11,920 --> 00:11:13,440 So step one was finding devices. 177 00:11:13,720 --> 00:11:14,840 Step two, enumerate. 178 00:11:14,860 --> 00:11:18,600 We're trying to figure out what service and services and characteristics are running on our target. 179 00:11:18,860 --> 00:11:21,460 If you, um, want to do it actively. 180 00:11:21,580 --> 00:11:21,880 You can. 181 00:11:21,900 --> 00:11:23,160 Use your tablet to connect. 182 00:11:23,360 --> 00:11:29,840 So as soon as, as soon as you connect with NRF connect or light blue, it's just going to tell you what services are available on the device and what characteristics are on there. 183 00:11:29,920 --> 00:11:34,720 Um, if you're on Cali, you can use a tool called gap tool, which is also included with the bluesy stack. 184 00:11:35,380 --> 00:11:39,280 Um, you can use commands, primary and characteristics to get all of that information. 185 00:11:41,140 --> 00:11:44,280 If you want to do it passively, you can always sniff it. 186 00:11:44,340 --> 00:11:51,400 So at the very beginning of a, of a Bluetooth connection, you'll see some of these service discovery messages, which essentially is a device talking to each other. 187 00:11:51,400 --> 00:11:56,160 They're saying, Hey, I have the, I'm, I'm providing these types of services and here's my characteristic handles and all that stuff. 188 00:11:56,360 --> 00:12:00,960 So at this point, you're probably wondering, uh, what the hell is a service and what the hell is a characteristic? 189 00:12:01,180 --> 00:12:01,900 And why don't you tell me? 190 00:12:01,940 --> 00:12:02,380 I will. 191 00:12:04,420 --> 00:12:06,080 So I want to do it through an example. 192 00:12:06,220 --> 00:12:08,500 So let's, let's pretend that we're working out. 193 00:12:08,700 --> 00:12:15,840 Um, I have a phone and a heart rate monitor, and essentially my phone is asking my heart rate monitor through Bluetooth low energy. 194 00:12:16,100 --> 00:12:17,920 Um, Hey, what's this guy's heart rate. 195 00:12:17,980 --> 00:12:18,260 Okay. 196 00:12:18,320 --> 00:12:21,180 So this is a type of communication that we might see during a. 197 00:12:21,180 --> 00:12:21,480 Workout. 198 00:12:21,600 --> 00:12:32,680 Now what's actually happening is the heart rate monitor is a Bluetooth low energy server in this case, serving three different services, two that are required by Bluetooth low energy that I'm not going to go into today. 199 00:12:32,800 --> 00:12:40,060 Um, and one that's application specific and actually those, any, any other ones that you see besides those two are going to be application specific. 200 00:12:40,260 --> 00:12:48,520 So what's really happening is my phone is contacting the heart rate service inside the Bluetooth low energy server and asking for my heart rate. 201 00:12:49,460 --> 00:12:50,760 Pull back one layer. 202 00:12:51,180 --> 00:12:59,900 Really what's happening is my phone is contacting the, the heart rate measurement characteristic inside of the, inside of the heart rate service asking for my heart rate. 203 00:13:00,500 --> 00:13:02,960 You can actually pull one, one more layer back. 204 00:13:03,460 --> 00:13:14,920 Um, the BLE client is actually sending a read request to the value attribute inside the heart rate measurement characteristic inside the heart rate service inside the Bluetooth low energy server. 205 00:13:15,280 --> 00:13:21,060 But I've pulled the wool over your eyes because really the Bluetooth low energy server is just a list. 206 00:13:21,060 --> 00:13:21,840 Of attributes. 207 00:13:22,080 --> 00:13:22,240 Okay. 208 00:13:22,300 --> 00:13:24,880 The whole thing is just one giant database of attributes. 209 00:13:25,120 --> 00:13:30,980 Now the GATS, um, profile is what assigns, um, meaning to those attributes. 210 00:13:31,180 --> 00:13:31,560 Okay. 211 00:13:31,620 --> 00:13:34,040 So it says this is a service or this is a characteristic. 212 00:13:34,200 --> 00:13:41,460 So really, uh, at the end of the day, all, all Bluetooth low energy communications are reads and writes to these attributes. 213 00:13:42,040 --> 00:13:42,580 That's it. 214 00:13:42,660 --> 00:13:43,380 That's all it is. 215 00:13:43,480 --> 00:13:48,680 So if you can break the communication down to those, to that level, you know, what's going on between the app and the device. 216 00:13:48,800 --> 00:13:49,080 Okay. 217 00:13:49,920 --> 00:13:51,040 So here's how it works. 218 00:13:51,060 --> 00:13:54,220 Here's how it looks for the MX 1101 data logger that we talked about earlier. 219 00:13:54,660 --> 00:13:54,860 Okay. 220 00:13:54,920 --> 00:13:57,980 This is literally all of the attributes on that device. 221 00:13:59,020 --> 00:14:04,580 The first 11 attributes define those two services that I talked about that we're not going to talk about for the rest of the talk. 222 00:14:04,740 --> 00:14:14,380 The next 11 attributes define the device ID service, which includes stuff like manufacturer name and model number string. 223 00:14:14,580 --> 00:14:18,400 This specific service is actually defined by the Bluetooth SIG, the Bluetooth gods, if you will. 224 00:14:18,480 --> 00:14:19,220 So these guys. 225 00:14:19,440 --> 00:14:20,400 Took their specs. 226 00:14:20,400 --> 00:14:23,080 And just applied it here and, and created that service on the device. 227 00:14:23,620 --> 00:14:30,380 And then the last 11 are actually the application specific stuff that onset the, the manufacturer developed and put on the server. 228 00:14:30,580 --> 00:14:30,880 Okay. 229 00:14:31,060 --> 00:14:36,440 And this, the most interesting thing about, about these attributes is the command and control attribute. 230 00:14:36,720 --> 00:14:36,920 Okay. 231 00:14:36,980 --> 00:14:43,680 So as, as we'll talk about in a sec, um, they use this one single handle to control it and to pull data off of it. 232 00:14:43,780 --> 00:14:46,040 And we'll talk about, um, all that in a little bit. 233 00:14:47,280 --> 00:14:47,720 Okay. 234 00:14:47,780 --> 00:14:50,380 So once you've, you've, you've, uh, found. 235 00:14:50,380 --> 00:14:55,660 Find your, found your device and you've enumerated all the services and characteristics and found that attribute table. 236 00:14:55,880 --> 00:15:04,160 Then you have to understand, like I said, what the application is actually doing, how it's communicating with those handles to figure out what kind of data it's pulling, how it's pulling that data. 237 00:15:04,240 --> 00:15:04,360 Okay. 238 00:15:04,520 --> 00:15:06,060 So the strategies for this are endless. 239 00:15:06,180 --> 00:15:08,440 I mean, it's just a reversing project. 240 00:15:09,500 --> 00:15:18,660 Um, one of our favorite things to do is once you figure out what the, what the handles are and how they relate to services and characteristics, you just impersonate the device. 241 00:15:18,800 --> 00:15:20,240 So we pretend it after we found. 242 00:15:20,240 --> 00:15:28,200 Found that got that database, we implemented our own device with that same database, and then we use the app to communicate with our device. 243 00:15:28,380 --> 00:15:33,920 And because of that, we were, we were able to extract a lot of functionality that the app, um, had that the device maybe didn't have. 244 00:15:34,120 --> 00:15:36,440 So just an interesting thing to do here. 245 00:15:37,040 --> 00:15:43,080 Um, so let's talk about the MX 1101, our target and Nick's favorite item here. 246 00:15:43,180 --> 00:15:45,920 Uh, the password that I talked about that protects your device. 247 00:15:46,100 --> 00:15:49,740 It's sent from the app to the device in clear text. 248 00:15:49,740 --> 00:16:03,300 To that command control handle, literally just sit here with an Uber tooth and you will know my password, which is ridiculous because that command control handle, um, does everything from configuring the device, setting alarms, pulling data off, whatever. 249 00:16:03,460 --> 00:16:04,540 And you can do all of it. 250 00:16:04,580 --> 00:16:08,260 If you've authenticated with the device using the password that, oh, you just sniffed. 251 00:16:08,260 --> 00:16:08,600 Okay. 252 00:16:08,880 --> 00:16:14,900 Now, the most interesting thing for me is the fact that they allow, uh, that, okay. 253 00:16:15,000 --> 00:16:18,700 Uh, this is an example of you would send a command to that, to that handle. 254 00:16:19,220 --> 00:16:19,660 And. 255 00:16:19,740 --> 00:16:21,480 Everything that comes back is data. 256 00:16:21,680 --> 00:16:21,840 Okay. 257 00:16:21,920 --> 00:16:22,820 That's kind of what that looks like. 258 00:16:23,200 --> 00:16:32,380 Now, the most interesting thing to me is that you can send a specific command that's just unhandled right after you've authenticated, you spend the specific command and it just stops logging. 259 00:16:32,580 --> 00:16:41,380 It just breaks down, which is a problem because in order to get it to start logging again, you have to reconnect with your app and you have to reconfigure the device and then restart it. 260 00:16:41,460 --> 00:16:42,300 And then I'll just do it again. 261 00:16:42,380 --> 00:16:43,080 And then you're offline. 262 00:16:43,280 --> 00:16:43,640 Cool. 263 00:16:44,040 --> 00:16:48,300 Um, but even more interesting than that, you can perform over the air updates. 264 00:16:48,460 --> 00:16:49,720 So I thought, well, okay. 265 00:16:49,720 --> 00:16:52,480 Well, can I perform over the air update with my own firmware? 266 00:16:52,760 --> 00:16:55,200 Um, and this is just as a proof of concept. 267 00:16:55,300 --> 00:16:58,680 Remember I said they had a device information service running in that device. 268 00:16:58,840 --> 00:17:05,240 Um, I just changed where the Mac manufacturer name, string and model number string were, and then I uploaded my own firmware and I changed it. 269 00:17:05,480 --> 00:17:05,840 Right. 270 00:17:05,940 --> 00:17:10,560 So proof of concept, you can change, you can add your own firmware to this thing. 271 00:17:10,620 --> 00:17:17,640 And actually, um, if you, if you guys pull out the app right now, you'll see that the device, which is, I meant to pull it out. 272 00:17:18,460 --> 00:17:18,820 Yeah. 273 00:17:19,340 --> 00:17:19,700 Yeah. 274 00:17:23,080 --> 00:17:24,020 Uh, yeah, right. 275 00:17:24,380 --> 00:17:25,300 I'm not Nick cage. 276 00:17:25,480 --> 00:17:25,760 All right. 277 00:17:26,080 --> 00:17:33,300 Um, if you guys find this device right now, um, it's actually a heart rate monitor or it's pretending to be a heart rate monitor. 278 00:17:33,420 --> 00:17:37,700 So I, yeah, I literally rewrote the whole firmware for this thing and just added my own, whatever the hell I wanted to do. 279 00:17:37,760 --> 00:17:43,320 So, so not good, but this is the type of stuff that you'll find out there once you start looking into Bluetooth low energy devices. 280 00:17:44,640 --> 00:17:49,160 So once you've figured out the application, do something with it. 281 00:17:49,200 --> 00:17:49,420 Okay. 282 00:17:49,720 --> 00:18:00,480 So if you want to write, write stuff on your Cali machine, you can use scapy and scapy has a lot of nice libraries that you can just use to send, send, write commands and read commands and pull data off. 283 00:18:00,600 --> 00:18:02,500 Again, all you're doing is interacting with these handles. 284 00:18:02,560 --> 00:18:04,300 So as long as you can code that up, you're good to go. 285 00:18:04,520 --> 00:18:12,980 Um, if you're on a tablet, you can actually just like pull it up, tap handle 19, tap, write this set of hex characters, go. 286 00:18:13,720 --> 00:18:14,180 That's it. 287 00:18:14,380 --> 00:18:19,120 Now, you know, most of these communications will take like 20 or 30 back and forth. 288 00:18:19,720 --> 00:18:20,900 You know, handle writings and reads. 289 00:18:21,040 --> 00:18:24,880 So you probably want to implement a lot of it on, on your, on your Cali box. 290 00:18:25,020 --> 00:18:31,760 If you can, um, proof of concept, we built a password sniffer and a brute forcer, a password brute forcer. 291 00:18:31,780 --> 00:18:32,740 We built a data dumper. 292 00:18:32,800 --> 00:18:35,220 So you can just pull the data off of that device arbitrarily. 293 00:18:35,340 --> 00:18:38,420 Uh, we built that device impersonator that I was talking about earlier. 294 00:18:38,560 --> 00:18:44,440 So that's, um, and a firmware uploader and all those tools are available on our GitHub as proof of concept tools. 295 00:18:44,600 --> 00:18:49,600 Um, now you probably don't have an MX 1101 to play with. 296 00:18:49,720 --> 00:18:57,360 But, uh, what you can, if you look through that code, you'll see how we're actually writing to handles and reading from handles and then, you know, go forth and conquer. 297 00:18:59,820 --> 00:19:01,760 Um, so some more resources for you. 298 00:19:01,840 --> 00:19:06,740 If you're interested at all in Bluetooth low energy hacking, read the developer's handbook by Robin Hayden. 299 00:19:06,820 --> 00:19:11,200 He's one of the original developers for the Bluetooth low energy protocol and he wrote this book and it's awesome. 300 00:19:11,420 --> 00:19:14,360 So read through it and a lot of this will make more sense. 301 00:19:14,860 --> 00:19:18,820 Um, Mike Ryan, the guy who made Crackle, he's done a lot of Bluetooth low energy research. 302 00:19:18,860 --> 00:19:19,580 So you can go find it. 303 00:19:19,580 --> 00:19:28,920 His sites, um, some people to thank, a lot of, some of them in the audience, Ben Ramsey, Anthony Rose, Caleb Mays, Mike Ryan, and directly the folks at Wireless Village for letting me come here and talk. 304 00:19:29,080 --> 00:19:30,640 Um, and of course the lady at home. 305 00:19:30,720 --> 00:19:34,100 Now, does anybody have any questions for me at this time? 306 00:19:36,700 --> 00:19:37,240 Ma'am. 307 00:19:37,360 --> 00:19:47,800 So Bluetooth low energy specs, I thought it defined a security layer that was different from classic Bluetooth and that it came more towards the Wi-Fi security. 308 00:19:48,340 --> 00:19:58,820 But it's not mandatory for implementation, so is this the product only that don't implement Bluetooth low energy, uh, security or is it, am I missing something? 309 00:19:59,680 --> 00:20:09,760 Maybe, maybe not, maybe I'm not familiar with it, but the only, the only security protocol, I guess, that I would know about is, is the link layer encryption, which is all handled by a security manager service, basically. 310 00:20:10,120 --> 00:20:13,820 Um, and I, yeah, so I'm not really familiar with, with what you mean, but maybe we can talk offline about it. 311 00:20:14,440 --> 00:20:15,080 Anybody else? 312 00:20:17,800 --> 00:20:23,680 All right, hopefully this was helpful, I'll be around, um, come ask me questions, grab me a beer if you want, it'd be cool. 313 00:20:24,360 --> 00:20:25,240 Appreciate it, thank you very much.