1 00:00:00,740 --> 00:00:01,460 Jeez. 2 00:00:04,440 --> 00:00:06,300 Hi, my name is Zero Chaos. 3 00:00:06,300 --> 00:00:07,720 Welcome to the Wireless Village. 4 00:00:07,720 --> 00:00:09,080 Do I really need an amplifier? 5 00:00:09,080 --> 00:00:10,660 I am loud enough on my own. 6 00:00:10,900 --> 00:00:13,480 But unfortunately, the man behind me is very shy. 7 00:00:13,600 --> 00:00:15,400 He's a little new to the industry. 8 00:00:15,760 --> 00:00:21,280 As a matter of fact, he's so new to the world in general that the first time we met, he thought that I was actually Yosemite Sam. 9 00:00:21,560 --> 00:00:25,820 We spent a lot of time talking online and he said, you know, I thought you'd look different. 10 00:00:26,020 --> 00:00:30,620 I imagine kind of a cartoon man of some kind with a cowboy hat. 11 00:00:31,460 --> 00:00:43,020 Fortunately, his weird predilections for cartoon characters do not spill over into the wireless world, so he actually knows a few things about Bluetooth, but we're going to have to give him this microphone because he's so shy. 12 00:00:43,240 --> 00:00:44,360 He's so shy. 13 00:00:44,760 --> 00:00:45,940 It's really sad. 14 00:00:46,280 --> 00:00:48,340 But he's got awesome hair, so here you go, Mike. 15 00:00:49,000 --> 00:00:51,480 Thank you, Zero Chaos. 16 00:00:51,740 --> 00:00:53,100 Oh, this is weird. 17 00:00:53,680 --> 00:00:54,900 Hey, good morning, everybody. 18 00:00:54,900 --> 00:00:56,260 Who here likes Bluetooth? 19 00:00:56,280 --> 00:00:57,600 I like Bluetooth. 20 00:00:57,600 --> 00:00:58,980 Bluetooth is awesome. 21 00:00:59,140 --> 00:01:00,640 I know a thing or two about Bluetooth. 22 00:01:00,640 --> 00:01:01,600 He wasn't lying. 23 00:01:01,600 --> 00:01:04,020 But let's get right into it. 24 00:01:04,040 --> 00:01:05,620 Oh, yeah, my name is Mike. 25 00:01:05,620 --> 00:01:07,420 I'm a pen tester. 26 00:01:07,420 --> 00:01:08,860 I work for iSEC Partners. 27 00:01:08,860 --> 00:01:10,320 Anybody from iSEC here? 28 00:01:10,880 --> 00:01:12,640 Hey, iSEC Partners. 29 00:01:12,640 --> 00:01:14,380 Yay, part of NCC group. 30 00:01:14,700 --> 00:01:21,220 So before we get started, my standard note, you're going to hear me say Bluetooth Smart, BLE, maybe Bluetooth Low Energy. 31 00:01:21,220 --> 00:01:24,000 They're all interchangeable names for the same thing. 32 00:01:24,000 --> 00:01:26,860 So don't get confused. 33 00:01:28,600 --> 00:01:32,340 So this is an NSA playset talk. 34 00:01:33,040 --> 00:01:37,380 The NSA leaks... sorry. 35 00:01:37,380 --> 00:01:38,600 Game face. 36 00:01:38,600 --> 00:01:39,020 Okay. 37 00:01:39,020 --> 00:01:50,620 So, as everybody here knows, last July, there were some minor leaks, and we got a partial copy of the NSA ant catalog. 38 00:01:50,700 --> 00:01:57,440 And that is pretty much a catalog of all their capabilities for attacking targets. 39 00:01:57,640 --> 00:02:02,140 And the best thing from the catalog is, of course, the codenames. 40 00:02:02,140 --> 00:02:05,020 A couple codenames from the actual catalog. 41 00:02:05,020 --> 00:02:15,160 Deity Bounce is a Dell BIOS and RAID controller software implant that allows them to remotely take control. 42 00:02:16,040 --> 00:02:25,520 Night Stand is a portable system that wirelessly installs Microsoft Windows exploits from a distance of up to 8 miles. 43 00:02:25,520 --> 00:02:28,680 A very remarkably specific distance. 44 00:02:29,100 --> 00:02:34,760 And so these are some of the tools that the NSA uses in their SIGINT work to attack targets. 45 00:02:34,760 --> 00:02:38,320 Well, the NSA, they're not magical. 46 00:02:38,340 --> 00:02:42,240 They're not privy to any technology that we're not privy to. 47 00:02:42,420 --> 00:02:49,800 So we thought it would be a great idea to reimplement some of their capabilities and maybe introduce a few capabilities of our own. 48 00:02:49,800 --> 00:02:56,400 So here are a couple other playset... other codenames from the NSA playset. 49 00:02:56,400 --> 00:03:00,900 These are created and released by humans, just like you and me. 50 00:03:01,020 --> 00:03:05,760 So Twilight Vegetable, that's a GSM interceptor. 51 00:03:05,800 --> 00:03:12,720 I think it's like a Kali image that you just boot up and plug in a hack RF and boom, you can intercept GSM. 52 00:03:13,020 --> 00:03:20,080 And Slot Screamer, which is a tool for accessing memory on exposed buses. 53 00:03:20,080 --> 00:03:25,260 So like Thunderbolt exposed on Mac, you can get into PCI Express, that sort of thing. 54 00:03:26,420 --> 00:03:32,700 So fundamentally, the playset is about... well, fundamentally the Ant Catalog and the playset are about capabilities. 55 00:03:33,160 --> 00:03:42,100 And before we dig into new material, I actually wanted to talk about the capabilities that we already have in tools that already exist today. 56 00:03:42,160 --> 00:03:44,700 You can plug them in and use them. 57 00:03:45,500 --> 00:03:50,920 So here are kind of the tools of the trade when it comes to Bluetooth and BLE exploitation. 58 00:03:50,980 --> 00:03:56,560 You've got Ubertooth, you've got Crackle, and you've got BlueZ, the standard Linux Bluetooth stack. 59 00:03:57,260 --> 00:04:05,040 So Ubertooth 1 is a great device made by this guy up in the front row who's tweeting instead of paying attention. 60 00:04:06,420 --> 00:04:11,600 It is capable of some pretty cool stuff, like discovering undiscoverable devices. 61 00:04:11,600 --> 00:04:17,860 So even if your Bluetooth is on, even if you're undiscoverable, in a lot of cases, we can still find you. 62 00:04:18,600 --> 00:04:21,020 Undiscoverability is not a security mitigation. 63 00:04:21,280 --> 00:04:23,520 It can do some rudimentary BR sniffing. 64 00:04:23,520 --> 00:04:25,200 I don't think I'm telling a lie. 65 00:04:25,320 --> 00:04:30,260 And it has very robust BLE sniffing capabilities, which I've spent the last year and a half talking about. 66 00:04:30,260 --> 00:04:31,740 So I'm not going to talk about them today. 67 00:04:31,740 --> 00:04:39,460 And actually right now I'm working on some work in progress of having a complete Bluetooth dongle on the Ubertooth. 68 00:04:39,460 --> 00:04:41,240 So stay tuned for that. 69 00:04:41,440 --> 00:04:46,320 You buy an Ubertooth today, you can do at least the top three right out of the box. 70 00:04:46,980 --> 00:04:48,060 That's right, Dominic, right? 71 00:04:48,180 --> 00:04:50,160 Rudimentary BR sniffing? 72 00:04:50,420 --> 00:04:50,980 Rudimentary. 73 00:04:50,980 --> 00:04:52,520 He says it's fair. 74 00:04:52,640 --> 00:04:54,100 So ruling on the field. 75 00:04:54,860 --> 00:04:57,660 Crackle is something I talked about a lot last year. 76 00:04:57,660 --> 00:05:00,820 This cracks the BLE key exchange. 77 00:05:01,220 --> 00:05:13,280 And once you have the key, it doesn't matter that they're using really good crypto, because once you've got the key, whatever, if you've got the best lock in the world on your door, somebody with a key can still open it. 78 00:05:13,440 --> 00:05:16,780 And on top of that, it can also decrypt data if you give it the key. 79 00:05:16,780 --> 00:05:18,160 It's not that useful on its own. 80 00:05:18,160 --> 00:05:20,320 It needs to be paired with some kind of a sniffer. 81 00:05:20,880 --> 00:05:22,560 It works great with Ubertooth. 82 00:05:22,560 --> 00:05:26,240 If you've got a fancier, more expensive sniffer, it will work with that, too. 83 00:05:26,660 --> 00:05:33,800 So again, today, you go out, you download Crackle, shove some data into it, you can do all this stuff. 84 00:05:34,600 --> 00:05:35,960 And then finally, Blue Z. 85 00:05:35,980 --> 00:05:37,440 That's not their actual logo. 86 00:05:37,440 --> 00:05:39,320 That's a logo from some club in L.A. 87 00:05:39,320 --> 00:05:43,260 But they don't have a real logo, so I thought this was good. 88 00:05:44,400 --> 00:05:49,240 So Blue Z is actually the best Bluetooth stack in existence, in my opinion. 89 00:05:49,240 --> 00:05:51,120 It's better than anything else. 90 00:05:51,340 --> 00:06:00,360 And it is fully functional, basic rate, BLE, and it's able to act as a BLE master and a slave, which is kind of cool. 91 00:06:00,360 --> 00:06:08,280 You think of a laptop as a BLE master, like, oh, you're going to use the laptop to connect to some peripheral device. 92 00:06:08,280 --> 00:06:11,260 But that's not actually the only thing you can do. 93 00:06:11,260 --> 00:06:17,180 You can actually use a regular Linux laptop as a BLE peripheral. 94 00:06:17,180 --> 00:06:22,740 You can, say, pretend to be, like, a smartwatch or a Fitbit or anything. 95 00:06:22,740 --> 00:06:24,960 And that's all built into Blue Z. 96 00:06:24,960 --> 00:06:27,680 You have to write a little bit of code, but it's all there. 97 00:06:27,680 --> 00:06:28,940 So that's awesome. 98 00:06:28,940 --> 00:06:41,120 And it also comes with some multipurpose utilities for... they're intended to do things like debugging and, you know, general Bluetooth stuff, but it turns out they're great for doing recon. 99 00:06:41,440 --> 00:06:47,100 And if you want to learn more about that, you should check out my blog or Josh Wright's got a book coming out this year, which is excellent. 100 00:06:47,100 --> 00:06:48,540 I highly recommend it. 101 00:06:49,160 --> 00:06:51,860 So that's it for existing capabilities. 102 00:06:52,160 --> 00:06:53,060 Zero effort. 103 00:06:53,060 --> 00:06:56,560 You can do all this stuff today, which is really cool. 104 00:06:56,780 --> 00:07:04,980 But moving back on to the Ant Catalog, what kind of Bluetooth capabilities does the NSA have today? 105 00:07:05,560 --> 00:07:14,380 Well, it turns out they don't have any, at least according to the Ant Catalog that we have, which might lead you to think that even the NSA doesn't care about Bluetooth. 106 00:07:16,260 --> 00:07:19,560 But that's what's called wishful thinking. 107 00:07:19,860 --> 00:07:28,160 I'm pretty sure they've got some pretty nasty Bluetooth capabilities, partially because we probably don't have the full catalog. 108 00:07:28,160 --> 00:07:31,060 We didn't get a complete copy with the leaks. 109 00:07:31,320 --> 00:07:35,180 And also the catalog that we have is really old. 110 00:07:35,180 --> 00:07:37,380 It's from like 2008, I want to say. 111 00:07:37,400 --> 00:07:40,220 And that's like, you know, it's like internet years. 112 00:07:40,220 --> 00:07:41,240 It's crazy. 113 00:07:42,300 --> 00:07:50,840 And one of the main reasons I think that this is the case is because there's a company called Ellasys, and they make pretty much the Cadillac of Bluetooth sniffers. 114 00:07:50,840 --> 00:07:56,120 It can sniff basic grade, it can sniff EDR, it can sniff basically anything. 115 00:07:56,120 --> 00:08:01,740 It's got built-in capabilities for cracking pins and decrypting audio from headsets. 116 00:08:01,740 --> 00:08:07,500 So the fact that this is available commercially, I'm pretty sure the NSA's got like ten of these. 117 00:08:07,500 --> 00:08:11,520 The only problem for you and me is they cost like $30,000. 118 00:08:11,600 --> 00:08:13,940 So, you know, more like Ellasys, right? 119 00:08:13,940 --> 00:08:15,100 See what I did there? 120 00:08:16,720 --> 00:08:19,260 So we're in kind of a unique position. 121 00:08:19,600 --> 00:08:20,520 One sec. 122 00:08:24,980 --> 00:08:27,120 Everybody look at me while I swallow. 123 00:08:27,820 --> 00:08:37,080 So we're in a unique situation where we kind of have to guess at what the NSA can do based on the capabilities that they have in other areas and what they're likely to do. 124 00:08:37,080 --> 00:08:39,160 So actually, it's kind of a fun exercise. 125 00:08:39,840 --> 00:08:43,080 So I'm guessing they probably have the ability to intercept headsets. 126 00:08:43,080 --> 00:08:48,020 Like if you've got a Bluetooth headset paired with your phone, they can probably listen into your audio that way. 127 00:08:48,020 --> 00:08:55,600 And it's probably easier than trying to listen in on it through a GSM network, because Bluetooth is pretty simple, even VR Bluetooth. 128 00:08:56,520 --> 00:09:00,760 They probably do some surveillance, some movement, just tracking you based on Bluetooth. 129 00:09:01,740 --> 00:09:05,780 I'm going to assume they do some stack exploitation and remote code execution. 130 00:09:05,780 --> 00:09:11,460 And if you're interested in that at all, check out my handset talk where I did some of that on Android's Bluetooth stack. 131 00:09:13,040 --> 00:09:21,320 Remote keystroke surveillance jumps out at me as something they probably do, because a lot of people use Bluetooth keyboards. 132 00:09:21,320 --> 00:09:24,320 You type a lot of sensitive information in on Bluetooth keyboards. 133 00:09:24,320 --> 00:09:27,100 They can probably do something with that. 134 00:09:27,240 --> 00:09:33,100 And as long as they're doing surveillance, it's probably true that they're doing some injection too. 135 00:09:33,880 --> 00:09:42,980 So let's kind of focus on keyboards and mice, because they're one of the more common Bluetooth peripherals out there. 136 00:09:42,980 --> 00:09:47,320 I'm sure a lot of people in this room use a Bluetooth keyboard or a Bluetooth mouse. 137 00:09:47,740 --> 00:09:49,300 So the protocol they use is HID. 138 00:09:49,300 --> 00:09:53,140 It's pretty much the exact same protocol as HID over USB. 139 00:09:53,240 --> 00:09:55,580 It's just adapted to work over Bluetooth. 140 00:09:55,580 --> 00:10:00,220 And in fact, the specs for it constantly refer back to the USB HID spec. 141 00:10:00,220 --> 00:10:01,720 So it's basically the same thing. 142 00:10:01,720 --> 00:10:04,360 And when you do it over BLE, it's called HID over GAT. 143 00:10:04,360 --> 00:10:09,620 So if you see H-O-G-P or HID over GAT, that's all HID over BLE. 144 00:10:09,860 --> 00:10:19,420 So again, keystroke surveillance, if you can capture the Bluetooth packets that contain these HID reports, you can tell what people are typing. 145 00:10:19,520 --> 00:10:35,820 And furthermore, if you have any Bluetooth injection capabilities, it's pretty easy to inject HID reports and pretend that you're a keyboard, which is kind of like a rubber ducky, like a USB rubber ducky, except a blue ducky. 146 00:10:39,000 --> 00:10:46,520 So, the next question that you should be asking is, do BLE keyboards actually exist? 147 00:10:46,520 --> 00:10:49,200 And the answer is, no, not yet. 148 00:10:49,200 --> 00:10:58,360 There are some companies producing prototypes that you can get that work with certain OSs, but there are no commercially available ones that I've been able to find yet. 149 00:10:58,360 --> 00:11:01,740 But these guys are going to exist very soon. 150 00:11:01,740 --> 00:11:06,680 Because BLE is cheaper, it's lower power and it has longer battery life. 151 00:11:07,640 --> 00:11:09,580 And the thing is, BLE might totally exist. 152 00:11:09,580 --> 00:11:23,000 Like, this is a commercial BLE mouse that I got off of Amazon and works with any OS that has BLE capabilities and also comes with a little dongle in case your OS doesn't support it. 153 00:11:23,260 --> 00:11:27,640 It speaks BLE and then turns that into USB HID for the OS. 154 00:11:27,880 --> 00:11:36,160 And the pretty amazing thing about this is that this thing runs off of two AAA batteries for six months. 155 00:11:36,160 --> 00:11:39,960 That kind of power consumption is not possible with classic Bluetooth. 156 00:11:40,160 --> 00:11:47,260 And these chips are cheap enough that they give you a Bluetooth chip inside a dongle that you might not even need to use. 157 00:11:47,260 --> 00:11:48,660 It's like $2. 158 00:11:48,920 --> 00:11:53,780 So, from my perspective, BLE keyboards are an inevitability. 159 00:11:53,780 --> 00:11:56,860 I mean, the classic Bluetooth keyboards are going to die out. 160 00:11:56,860 --> 00:11:58,320 Everything is going to be BLE. 161 00:12:00,080 --> 00:12:03,180 And the thing about HID is that HID is HID is HID. 162 00:12:03,180 --> 00:12:04,440 It doesn't matter if you're a mouse. 163 00:12:04,440 --> 00:12:06,020 It doesn't matter if you're a keyboard. 164 00:12:06,260 --> 00:12:13,300 From the OS's perspective, if you speak HID, even if you're just a mouse, it's likely that you can act like a keyboard. 165 00:12:13,460 --> 00:12:19,300 So despite the fact that BLE keyboards don't yet exist, there's still a lot of possibility in this space. 166 00:12:21,100 --> 00:12:24,320 So, let's talk about targets. 167 00:12:24,740 --> 00:12:33,780 If you're trying to attack BLE keyboards and do surveillance and injection, you have to have an OS that supports HID over GAT. 168 00:12:33,780 --> 00:12:36,780 Or you have to deal with one of these little dongles that comes with it. 169 00:12:36,780 --> 00:12:38,320 But this is less interesting. 170 00:12:38,320 --> 00:12:43,220 The OS's that actually have support for this are Android 4.4, BlueDroid. 171 00:12:43,220 --> 00:12:44,480 I tested that. 172 00:12:44,480 --> 00:12:49,920 You compare this BLE mouse with an Android tablet, and you get a mouse pointer on the screen. 173 00:12:49,920 --> 00:12:50,960 And it's really weird. 174 00:12:50,960 --> 00:12:53,120 I've never seen anything quite like it. 175 00:12:54,040 --> 00:12:57,000 iOS 7, only on the iPad. 176 00:12:57,220 --> 00:12:58,880 Kind of an odd limitation. 177 00:12:59,020 --> 00:13:03,920 All iOS 7 devices are running pretty much the same OS with pretty much the same hardware. 178 00:13:04,120 --> 00:13:08,240 But only the iPad has keyboard and mouse support. 179 00:13:08,300 --> 00:13:14,840 Because, you know, Mac OS 10.9, native BLE mouse support. 180 00:13:14,840 --> 00:13:18,620 You can pair this guy with Mac OS 10.9 and use it as a mouse. 181 00:13:18,620 --> 00:13:20,000 You don't have to use a little dongle. 182 00:13:20,940 --> 00:13:23,000 Linux, BlueZ5. 183 00:13:23,360 --> 00:13:26,120 So Fedora 20, Arch Linux, not Ubuntu. 184 00:13:26,120 --> 00:13:30,160 These guys all have native BLE over GAT support, or HID over GAT support. 185 00:13:30,300 --> 00:13:32,220 And Windows 8 and Windows Phone 8. 186 00:13:33,840 --> 00:13:36,860 Blackberry 10 and Android less than 4.4 don't have support. 187 00:13:36,860 --> 00:13:43,640 So we've got five major OSs that could be used as targets for this type of attack. 188 00:13:43,740 --> 00:13:50,000 And these five major OSs pretty much represent the next couple years of computing, in my opinion. 189 00:13:52,740 --> 00:13:58,220 The one thing about HID is that the HID spec requires encryption. 190 00:13:58,560 --> 00:13:59,700 For obvious reasons. 191 00:13:59,700 --> 00:14:03,700 You don't want your keystrokes sent over in plain text, and you need authentication as well. 192 00:14:03,700 --> 00:14:06,840 And the link layer in BLE provides authenticated encryption. 193 00:14:06,840 --> 00:14:09,760 Not just encryption, but actual authentication. 194 00:14:11,600 --> 00:14:18,280 And I wanted to take a moment to talk about pairing versus encryption, because this is a really common confusion point. 195 00:14:18,780 --> 00:14:21,580 Pairing and encryption are not the same thing. 196 00:14:21,580 --> 00:14:25,120 Not in classic Bluetooth, and certainly not in BLE. 197 00:14:25,120 --> 00:14:31,680 You can have a link layer connection between two BLE devices, no encryption whatsoever, no authentication. 198 00:14:31,680 --> 00:14:35,420 They can just talk to each other and speak at. 199 00:14:35,420 --> 00:14:42,420 Now, if the device is properly secured, it will reject most requests unless the encryption is enabled. 200 00:14:42,440 --> 00:14:49,280 But it's totally possible to have an unencrypted connection pretty much between any two devices. 201 00:14:49,340 --> 00:14:59,000 Now, if you want to have a secured connection between two devices, the first thing you have to do is pair the devices, which is a fancy term for doing a key exchange process. 202 00:14:59,580 --> 00:15:11,700 Once you've done that pairing and you've got a shared key between the two devices, then after two devices establish a link layer connection, either end of the conversation can say, let's start doing encryption now. 203 00:15:11,700 --> 00:15:18,020 And then at that point, they both provide their secret keys and they do all sorts of little magic. 204 00:15:18,020 --> 00:15:26,400 And then since it's authenticated encryption, they can tell that both ends are using the same key, both ends are encrypted, and that part of the process is actually pretty secure. 205 00:15:26,400 --> 00:15:30,740 The pairing process, as I've discussed in the past, totally broken, totally crackable. 206 00:15:30,740 --> 00:15:32,600 Check out Crackle if you're interested in that. 207 00:15:32,600 --> 00:15:44,200 But the main takeaway is you can have BLE connections without encryption, you can have encrypted connections after you've paired, but pairing and encryption are not the same thing. 208 00:15:44,200 --> 00:15:45,280 Is that clear? 209 00:15:45,400 --> 00:15:46,760 Anybody confused? 210 00:15:47,700 --> 00:15:49,980 This guy shook his head no, gave me a thumbs up. 211 00:15:49,980 --> 00:15:50,820 Excellent. 212 00:15:50,860 --> 00:15:52,200 I like the feedback. 213 00:15:53,160 --> 00:15:56,360 So here's the life cycle of a typical HID device. 214 00:15:56,360 --> 00:15:58,480 Say this mouse, you're talking about this mouse. 215 00:15:58,600 --> 00:16:01,700 So a user pairs the HID device with a host. 216 00:16:01,960 --> 00:16:06,940 There's a special button sequence that you can press with this guy that puts it into pairing mode. 217 00:16:06,940 --> 00:16:17,840 Then on your host, you search for devices, you click the mouse, you pair with it, and at that point a key exchange occurs and the host and the mouse both have the same shared key. 218 00:16:18,340 --> 00:16:26,060 There's an authentication step that, depending on your device's capabilities, you may or may not be able to do more advanced authentication. 219 00:16:26,060 --> 00:16:31,820 Like if you've got a display and a keypad, you can do a numeric comparison to make sure nobody's man-in-the-middle view. 220 00:16:31,820 --> 00:16:33,620 This mouse is not capable of that. 221 00:16:33,620 --> 00:16:40,420 It only uses the just works pairing method, which pretty much provides no man-in-the-middle protection even in the best case. 222 00:16:41,420 --> 00:16:42,700 Sorry, tangent. 223 00:16:43,080 --> 00:16:46,500 Then after that, the host will connect to the HID device. 224 00:16:46,500 --> 00:16:49,240 It'll make a link layer connection, which is unencrypted. 225 00:16:49,240 --> 00:16:52,000 Then the host attempts to start encryption. 226 00:16:52,000 --> 00:16:53,940 It says, hey, let's start encryption. 227 00:16:53,940 --> 00:16:56,520 The devices set their controllers to do encryption. 228 00:16:56,520 --> 00:16:57,620 They set the key. 229 00:16:57,680 --> 00:17:04,820 And once that encrypted, authenticated connection is established, the HID device sends HID reports. 230 00:17:04,820 --> 00:17:09,220 The HID device will not send HID reports unless the connection is encrypted. 231 00:17:10,900 --> 00:17:20,040 There are a couple attack techniques that exploit weaknesses either in BLE or the host OS or other things. 232 00:17:20,040 --> 00:17:23,340 And I'll talk about all three of those in detail right now. 233 00:17:24,180 --> 00:17:28,840 So the first technique, you sniff the pairing and you crack the key. 234 00:17:28,840 --> 00:17:29,840 That's nothing new. 235 00:17:29,840 --> 00:17:34,460 That's just using uber teeth to sniff the pairing, using crackle to crack the key. 236 00:17:34,460 --> 00:17:40,440 Once you do that, you can impersonate the mouse and do all sorts of nasty stuff. 237 00:17:41,000 --> 00:17:43,080 Exploiting OS weaknesses is cool. 238 00:17:43,240 --> 00:17:47,380 And I'll explain that after I do a little diagram of the first one. 239 00:17:47,380 --> 00:17:50,040 And finally, forcing on pairing, which a lot of people have been asking me about. 240 00:17:50,040 --> 00:17:50,940 It's totally possible. 241 00:17:50,940 --> 00:17:51,860 It's pretty cool. 242 00:17:52,300 --> 00:17:54,440 So first, sniffing the pairing. 243 00:17:55,240 --> 00:17:56,520 You've got your laptop. 244 00:17:58,260 --> 00:18:00,540 You've got a BLE keyboard. 245 00:18:00,540 --> 00:18:03,020 I'm using keyboards and mice kind of interchangeably here. 246 00:18:03,020 --> 00:18:04,460 Just go with it. 247 00:18:05,000 --> 00:18:13,220 They establish a connection and they do their pairing and they do a key exchange and everything's golden. 248 00:18:13,880 --> 00:18:26,380 Meanwhile, the NSA is listening in with an uber tooth or an ELISA sniffer and they feed that data into crackle, which gives them, so at this point the NSA knows the Bluetooth address of the keyboard. 249 00:18:26,380 --> 00:18:30,440 They know the key that's used to secure the connection. 250 00:18:31,860 --> 00:18:43,960 Then an evil keyboard comes in, uses the same Bluetooth address, and the same key, and is able to talk to the host device. 251 00:18:44,360 --> 00:18:49,660 At this point, the host device can't tell that it's not talking to the original keyboard. 252 00:18:49,740 --> 00:18:56,360 And the NSA, or whoever is using this play set tool, can inject keystrokes into the host OS. 253 00:18:56,980 --> 00:19:00,780 This is all something that you can do today with stuff that exists. 254 00:19:00,780 --> 00:19:03,240 You don't have to write any code to do this. 255 00:19:04,640 --> 00:19:07,360 This is the least invasive technique. 256 00:19:07,360 --> 00:19:11,520 You cannot distinguish the fake keyboard from the real keyboard. 257 00:19:11,540 --> 00:19:16,240 The downside is that you must observe the pairing, and normally that only happens once. 258 00:19:16,260 --> 00:19:26,980 And furthermore, even if you do observe the pairing, it's pretty likely that you're going to miss one of the packets that gets transmitted during pairing, and if you don't have every single packet from pairing, you can't crack it. 259 00:19:27,100 --> 00:19:31,150 However, as a bonus, you get keystroke surveillance for free. 260 00:19:31,370 --> 00:19:37,270 All the data is encrypted with that same key that is exchanged during the pairing. 261 00:19:37,290 --> 00:19:41,810 So if you're the NSA and you want to passively observe people, this is the way to do it. 262 00:19:43,110 --> 00:19:45,870 So the second technique is OS exploitation. 263 00:19:46,110 --> 00:19:53,790 You've got your keyboard and your laptop, they're talking to each other, the NSA did not observe the pairing, everything is hunky-dory. 264 00:19:55,690 --> 00:19:59,890 The regular keyboard goes to sleep because you haven't typed on it in a long time. 265 00:20:01,010 --> 00:20:13,110 Meanwhile, an evil keyboard comes along, purporting to be this keyboard by using the same Bluetooth address, and it's about as hard to spoof a Bluetooth address as it is to spoof a Mac address, which is, say, trivial. 266 00:20:13,450 --> 00:20:20,210 So this guy claims to be this keyboard, and establishes a link layer connection with the host OS. 267 00:20:20,370 --> 00:20:26,090 The host OS, the first thing it's going to do is say, hey, let's start encryption. 268 00:20:26,950 --> 00:20:31,750 Meanwhile, the keyboard says, sorry, I don't have that encryption key. 269 00:20:31,930 --> 00:20:39,530 A properly behaved host OS at this point should disconnect the connection and say, fuck off, we're not friends. 270 00:20:39,930 --> 00:20:48,710 Certain host OSes say, nah, don't worry about it, we'll just do unencrypted, unauthenticated communication. 271 00:20:49,570 --> 00:20:54,770 And the evil keyboard can inject keystrokes into such a host OS. 272 00:20:56,610 --> 00:20:58,710 So this is more invasive. 273 00:20:58,710 --> 00:21:04,610 It's distinguished, the evil keyboard is distinguishable from a legitimate keyboard in that it doesn't have the key. 274 00:21:04,610 --> 00:21:09,170 So if you're trying to detect this attack, it's actually possible. 275 00:21:09,170 --> 00:21:11,450 And it also relies on OS bugs. 276 00:21:11,450 --> 00:21:19,610 So it's not universally applicable, but there are two major OSes on that list of targets that have this weakness. 277 00:21:20,130 --> 00:21:27,310 And unfortunately I can't name names at this point because disclosures are still in process, but, yeah, it's kind of nasty. 278 00:21:28,010 --> 00:21:30,650 And then finally, the last attack is the unpairing attack. 279 00:21:30,650 --> 00:21:38,910 This is the hardest attack to do, because most devices don't support unpairing, but some devices do. 280 00:21:38,910 --> 00:21:56,770 So you've got your keyboard and your host, they've got a Bluetooth connection going on, evil keyboard comes along, jams the connection, and then forces the devices to unpair by establishing a link layer connection with the host and saying, I don't have that key. 281 00:21:57,490 --> 00:22:05,670 Well, certain hosts in this situation will not try to do an unencrypted connection, will not say buzz off, they'll say, you don't have the key? 282 00:22:05,670 --> 00:22:07,070 Let's pair again. 283 00:22:07,650 --> 00:22:17,790 The only host I've found that has this problem is the little dongle that comes with a mouse, but if you're using a little dongle that comes with a mouse, you've got this problem. 284 00:22:18,990 --> 00:22:21,050 This is the most invasive attack. 285 00:22:21,050 --> 00:22:24,750 You can totally detect it because you're pairing with some wrong person. 286 00:22:24,750 --> 00:22:28,730 You just paired with the NSA, which is bad times. 287 00:22:29,050 --> 00:22:30,870 It's also the least broadly applicable. 288 00:22:30,870 --> 00:22:34,890 Like I said, this is the only device that I've found that this works with. 289 00:22:35,590 --> 00:22:38,910 So the user could notice that this is happening. 290 00:22:39,250 --> 00:22:45,970 Do you think the user is more likely to blame the NSA or their shitty Bluetooth keyboard? 291 00:22:48,740 --> 00:22:55,060 So that brings us to Tiny Alamo, my entry into the NSA play set. 292 00:22:55,060 --> 00:22:59,440 And because every NSA play set thing needs to have a sweet code name, I came up with mine. 293 00:22:59,440 --> 00:23:01,780 It actually handles all three scenarios. 294 00:23:02,000 --> 00:23:14,460 So I've got keystroke injection working in all three of the scenarios that I just described, and I even implemented DuckyScript from the USB rubber ducky, so you can reuse all of your favorite USB rubber ducky scripts. 295 00:23:15,240 --> 00:23:18,420 And now that brings us to the demo. 296 00:23:18,420 --> 00:23:23,400 So I have a victim laptop up here, very nicely provided by Dominic. 297 00:23:23,400 --> 00:23:32,180 So I'm going to switch the projector over to that keyboard, and I'm going to plug in the dongle that came with this Bluetooth mouse. 298 00:23:33,160 --> 00:23:35,520 And yeah, that works. 299 00:23:42,300 --> 00:23:50,300 So what's going to happen here is, so this mouse is paired with the dongle that he's plugging in right now. 300 00:23:50,360 --> 00:23:58,680 What I'm going to do from this laptop here is do the last attack, the forced unpairing attack that I just described. 301 00:23:58,680 --> 00:24:02,100 So I'm going to run some code on this laptop. 302 00:24:02,100 --> 00:24:13,180 It's going to impersonate this mouse using its Bluetooth address, and it's going to say, hey, I'm not just a mouse, I'm actually a keyboard, and try to inject keystrokes. 303 00:24:13,300 --> 00:24:15,400 So let's see if that works. 304 00:24:21,120 --> 00:24:24,100 So this is all pretty much turn key. 305 00:24:24,480 --> 00:24:27,440 It takes about 15 seconds right now. 306 00:24:27,640 --> 00:24:30,240 And oh, there it's connected, there it's sent the key. 307 00:24:33,380 --> 00:24:35,080 So yeah. 308 00:24:42,620 --> 00:24:44,780 So yeah. 309 00:24:44,780 --> 00:24:46,780 Yeah, can you just switch it back? 310 00:24:50,020 --> 00:24:51,300 Yeah. 311 00:24:51,580 --> 00:24:53,280 The code's not available yet. 312 00:24:53,280 --> 00:24:54,600 We're working on it. 313 00:25:01,940 --> 00:25:03,520 Thank you, Dominic. 314 00:25:05,600 --> 00:25:06,620 Great. 315 00:25:06,620 --> 00:25:09,540 This is the best projector I've ever used. 316 00:25:11,280 --> 00:25:13,100 So I can't name any names right now. 317 00:25:13,100 --> 00:25:18,060 I really wish I could tell you which host OSes are broken, but we just got the disclosures out to them. 318 00:25:18,060 --> 00:25:23,860 I'm probably going to get in trouble for demonstrating as much as I have, but I'll take that risk. 319 00:25:24,380 --> 00:25:27,280 So these are the ingredients that made that attack possible. 320 00:25:27,380 --> 00:25:39,800 It took one regular Bluetooth dongle, a Linux kernel capability called HCI user socket, SCAPI, some new code called PyBT, a little bit of Python glue, and optionally you can use an Ubertooth. 321 00:25:40,880 --> 00:25:49,060 And before I go on, the neat thing about this is you can use, you could actually implement this attack on a phone. 322 00:25:49,060 --> 00:25:51,460 It doesn't require any specialized hardware. 323 00:25:51,460 --> 00:25:54,340 All it needs is a regular Bluetooth dongle. 324 00:25:54,460 --> 00:25:57,980 So this is a pretty nasty attack. 325 00:25:58,800 --> 00:26:02,780 So HCI and HCI user socket are kind of key to this. 326 00:26:02,820 --> 00:26:05,920 HCI is the language that all Bluetooth dongles speak. 327 00:26:05,960 --> 00:26:15,140 It's sort of a high level language for telling the Bluetooth dongle to do things like set the Bluetooth address, enable advertising, try to connect to this guy, that sort of thing. 328 00:26:15,140 --> 00:26:16,440 It's all high level operations. 329 00:26:16,440 --> 00:26:18,860 They all speak pretty much the same language. 330 00:26:19,120 --> 00:26:22,900 And you can actually sniff this using a recent version of Wireshark. 331 00:26:22,900 --> 00:26:29,280 You can fire up Wireshark and see all the HCI commands that your Bluetooth stack is sending out to your dongle. 332 00:26:30,880 --> 00:26:33,680 So you can also send totally illegal stuff this way. 333 00:26:33,680 --> 00:26:42,120 And if you're interested in that, check out my CanSecWest talk where I use this to fuzz some Android stacks and actually implement an attack using it. 334 00:26:43,200 --> 00:26:46,560 HCI user socket is the magic that makes it easy. 335 00:26:46,560 --> 00:26:53,020 Normally the kernel does a lot of HCI for you on Linux and it kind of gets in the way if you're trying to break the rules. 336 00:26:53,020 --> 00:26:57,700 So HCI user socket is a capability that just tells the kernel, get out of the way. 337 00:26:57,700 --> 00:27:00,580 I will handle all the details of talking HCI. 338 00:27:00,740 --> 00:27:01,900 I don't need you. 339 00:27:02,540 --> 00:27:13,200 And this is something that a guy named Marcel Holtman, the BlueZ maintainer, implemented about eight months ago and it's finally made it into the main line Linux kernel. 340 00:27:13,220 --> 00:27:16,540 So if you're running a recent Linux distro, you have this. 341 00:27:16,540 --> 00:27:28,680 You can just with a Linux 3.15, which is available on Ubuntu 14.04 and Fedora 20 and Arch Linux, you can use HCI user socket to do low-level Bluetooth attacks. 342 00:27:28,880 --> 00:27:34,540 I will note that Kali is still using 3.14, so you're not going to have this capability there. 343 00:27:35,580 --> 00:27:40,680 And this is actually a screenshot of Wireshark sniffing some of the HCI that's going into the controller. 344 00:27:40,680 --> 00:27:49,520 So you can see it's writing some extended inquiry requests and setting BLE scan parameters and stuff like that. 345 00:27:49,520 --> 00:28:01,000 So if you're interested in playing with HCI and doing these low-level attacks, fire up Wireshark and see if you've got an interface like Bluetooth zero and just start sniffing it and you'll learn a heck of a lot about it. 346 00:28:01,000 --> 00:28:07,020 And if you don't have a recent enough Wireshark, you can use HCI dump, which comes with BlueZ since like ten years ago . 347 00:28:07,040 --> 00:28:09,960 And that'll produce capture files that Wireshark can open. 348 00:28:10,260 --> 00:28:12,560 The next ingredient is SCAPI. 349 00:28:12,560 --> 00:28:14,920 Who here has used SCAPI before? 350 00:28:15,180 --> 00:28:18,500 If you didn't raise your hand, get out of this room. 351 00:28:19,800 --> 00:28:21,140 No, but seriously, check it out. 352 00:28:21,140 --> 00:28:25,320 SCAPI is really, really, really good for not just Bluetooth stuff. 353 00:28:25,320 --> 00:28:29,780 It's actually really good for any kind of IP packet construction. 354 00:28:29,780 --> 00:28:35,420 It makes it really easy to construct both valid and totally invalid packets. 355 00:28:35,500 --> 00:28:36,820 So definitely check it out. 356 00:28:36,820 --> 00:28:44,160 It actually had some Bluetooth capabilities before, but I added a whole ton of crap to really flesh it out and make all this possible. 357 00:28:44,160 --> 00:28:47,820 So before, it had some rudimentary HCI and L2 cap support. 358 00:28:47,820 --> 00:28:49,000 I added tons of commands. 359 00:28:49,000 --> 00:28:58,120 I added support for the security manager protocol, which is how you do BLE pairing, and ADD and GATT, which are the high-level Bluetooth protocols. 360 00:28:58,380 --> 00:29:01,320 And I also added support for the Bluetooth user socket. 361 00:29:01,320 --> 00:29:05,300 So if you want to use HCI user socket, that's how much code it takes. 362 00:29:05,540 --> 00:29:07,760 It's super, super awesome. 363 00:29:08,080 --> 00:29:18,560 So I pushed the Bluetooth stuff to those guys in a pull request, and I think eventually it will make it into their main branch. 364 00:29:18,560 --> 00:29:22,600 But if you want to check this out, just talk to me after the talk. 365 00:29:23,240 --> 00:29:24,460 Or be patient. 366 00:29:25,000 --> 00:29:30,260 And then the other ingredient that makes this work is some software that I haven't released yet called PyBT. 367 00:29:30,300 --> 00:29:39,380 So in the process of doing this, I was just kind of hacking on Scappy and adding HCI commands and stuff, and it turns out I accidentally had a Bluetooth stack. 368 00:29:39,380 --> 00:29:49,100 So PyBT is pretty much a pure Python Bluetooth stack that uses Scappy for constructing packets and sends them off to HCI user socket. 369 00:29:49,100 --> 00:29:55,740 And this guy supports... right now it only supports BLE, but it has full pairing and key management support. 370 00:29:55,740 --> 00:29:57,760 It has a rudimentary GATT server. 371 00:29:57,760 --> 00:30:01,240 And this software is coming soon, once the disclosures get cleared up. 372 00:30:01,240 --> 00:30:04,700 It will probably be on my company's GitHub, but I'll tweet about it when it's available. 373 00:30:04,700 --> 00:30:12,960 But this is... so BlueZ is already a really good, really hackable Bluetooth stack, but it's too well behaved. 374 00:30:12,960 --> 00:30:19,720 It tries to handle all the edge cases in a way that won't cause your system to crash, instead of making it super hackable. 375 00:30:19,720 --> 00:30:24,020 So having this all available in Python makes that a lot easier. 376 00:30:24,040 --> 00:30:26,880 So check this out once this is available. 377 00:30:26,880 --> 00:30:30,100 And some people were asking about unpairing attacks earlier. 378 00:30:30,200 --> 00:30:36,580 This is where I've done all my implementations of BLE unpairing attacks. 379 00:30:36,720 --> 00:30:39,080 So you can try doing it in BlueZ. 380 00:30:39,080 --> 00:30:40,340 I don't recommend it. 381 00:30:40,340 --> 00:30:42,740 Hack on PyBT instead. 382 00:30:43,620 --> 00:30:51,660 And then the last thing is Ubertooth, which is an optional component that makes it really, really a lot easier. 383 00:30:51,660 --> 00:30:55,860 So what Ubertooth can do is pull addresses out of the air. 384 00:30:55,920 --> 00:30:57,840 It's not always necessary. 385 00:30:57,840 --> 00:31:09,040 A lot of times you can get away with just doing a regular BLE scan using HCI tool, which comes with BlueZ, but that will miss a lot of addresses that are otherwise right for the picking. 386 00:31:09,040 --> 00:31:14,740 So I recommend using an Ubertooth, because nobody uses BLE private addresses correctly. 387 00:31:14,740 --> 00:31:21,040 There are some super awesome privacy features that are a part of BLE, but literally nobody is using them properly. 388 00:31:21,420 --> 00:31:27,740 So you can just pull addresses out of thin air, which makes it super, super easy to impersonate devices. 389 00:31:29,360 --> 00:31:40,520 So kind of wrapping it all up and putting it all together to do the attack that I just demonstrated, use an Ubertooth to grab the Bluetooth address out of the air. 390 00:31:40,540 --> 00:31:43,780 I didn't do that because I just know this mouse's Bluetooth address. 391 00:31:43,920 --> 00:31:45,300 I kind of cheated. 392 00:31:45,540 --> 00:31:47,120 But there are enough moving parts. 393 00:31:48,180 --> 00:32:01,380 You launch PyBT, and that will talk to your legitimate Bluetooth dongle via HCI user socket that builds up all the packets using Scappy, and it pretty much acts like a regular Bluetooth stack up until this point. 394 00:32:01,380 --> 00:32:07,460 It's like, oh, set my advertising parameters, set my Bluetooth address, all that sort of stuff. 395 00:32:08,740 --> 00:32:11,820 And then it starts to advertise with the address of the mouse. 396 00:32:11,820 --> 00:32:14,300 You just send a couple of HCI commands and it will do that. 397 00:32:14,880 --> 00:32:24,840 You wait for the connection from the host, and then when the host says, hey, let's start doing encryption, you say, you send a message that says, sorry, I don't have the key. 398 00:32:26,320 --> 00:32:29,200 At that point, you start sending key strokes and you profit. 399 00:32:30,040 --> 00:32:31,000 That clear? 400 00:32:31,000 --> 00:32:33,860 Any steps that you need more explanation on, please let me know. 401 00:32:34,420 --> 00:32:38,460 I had like eight pieces of sushi for lunch, so I'm not firing on all eight cylinders. 402 00:32:40,100 --> 00:32:40,760 Okay. 403 00:32:41,420 --> 00:32:42,060 Yeah. 404 00:32:45,460 --> 00:32:46,560 That's a really good question. 405 00:32:46,560 --> 00:32:52,920 So the question was, if the other mouse is active, do you have to wait for that connection to die or kick it off or what? 406 00:32:52,920 --> 00:32:55,380 So, yes. 407 00:32:55,460 --> 00:33:01,880 The other mouse cannot be connected when you're trying to do this attack, but there are two ways you can get around that. 408 00:33:01,880 --> 00:33:09,520 The first is that these guys tend to put themselves to sleep after there hasn't been movement for a little while to save battery life. 409 00:33:09,720 --> 00:33:18,900 And the other thing is, I've got some pretty robust jamming code that I haven't published yet, but it's pretty easy to jam a Bluetooth connection or BLE connection, rather. 410 00:33:22,600 --> 00:33:24,560 That was a really fast presentation. 411 00:33:24,560 --> 00:33:25,720 I'm wrapping it up. 412 00:33:25,720 --> 00:33:28,320 So these are some URLs that you should check out. 413 00:33:28,660 --> 00:33:40,420 We've got Ubertooth, we've got Crackle, we've got Scaffy, we've got Blues, and I'm going to give a tweet for PyBT as soon as that's available, which will probably be not too long from now. 414 00:33:40,420 --> 00:33:41,120 I don't know. 415 00:33:43,000 --> 00:33:52,220 I was trying to send out disclosures during the week where everyone is at Black Hat and doesn't have their word computer, so maybe next time I should start a little bit earlier. 416 00:33:54,320 --> 00:33:57,720 I see lots of cameras, so I'm going to sit on this slide for a little while. 417 00:33:58,160 --> 00:33:59,700 I see more Isaac people show up. 418 00:33:59,700 --> 00:34:00,840 Hey Isaac! 419 00:34:02,500 --> 00:34:03,620 Question? 420 00:34:07,060 --> 00:34:09,560 A full MAC address is 6 bytes. 421 00:34:17,730 --> 00:34:26,530 So the question was, does Ubertooth get you the full MAC address or only the upper portion and the lower portion? 422 00:34:26,590 --> 00:34:28,930 That's only in classic Bluetooth. 423 00:34:28,930 --> 00:34:35,410 Since we're talking about BLE, you get all 6 bytes of the Bluetooth address. 424 00:34:35,850 --> 00:34:36,270 Yeah. 425 00:34:37,730 --> 00:34:43,010 BLE doesn't have the same UIP and LAP that classic Bluetooth does. 426 00:34:44,210 --> 00:34:45,330 Okay. 427 00:34:45,810 --> 00:34:47,150 That's actually pretty much it. 428 00:34:47,150 --> 00:34:49,510 I just want to give a lot of people thanks before we clap. 429 00:34:49,510 --> 00:34:51,110 Marcel Holtman is awesome. 430 00:34:51,110 --> 00:34:56,730 He's the best Bluetooth maintainer in the world and just totally added HCI user socket when I asked him to. 431 00:34:56,730 --> 00:35:01,490 Obviously need to thank Mike Osman, Dominic Spill, and the rest of the Ubertooth team for being awesome. 432 00:35:01,490 --> 00:35:07,370 I want to thank Marcel Holtman again because he really, without him this would not have been possible. 433 00:35:07,370 --> 00:35:10,830 Of course, thank you Zero Chaos and the DEF CON Wireless Village. 434 00:35:10,830 --> 00:35:15,790 I forgot to add thanks to Isaac Partners because they actually funded a ton of this stuff. 435 00:35:16,430 --> 00:35:17,950 And thank you. 436 00:35:18,210 --> 00:35:20,170 And that's it. 437 00:35:26,030 --> 00:35:29,310 So this time slot has about 20 minutes left in it. 438 00:35:29,310 --> 00:35:32,370 So if anyone wants to beat box, just come on up. 439 00:35:33,790 --> 00:35:35,250 Any questions? 440 00:35:36,270 --> 00:35:37,790 More from the back. 441 00:35:43,970 --> 00:35:50,770 So the question was, does BLE have the same channel hopping problems that classic Bluetooth had? 442 00:35:50,770 --> 00:35:53,630 And no, it's way, way, way easier to sniff. 443 00:35:53,670 --> 00:35:59,850 Way simpler channel hopping, way easier to sniff, like Ubertooth is a turnkey BLE sniffer, more or less. 444 00:36:00,850 --> 00:36:02,010 Mike Osman. 445 00:36:13,680 --> 00:36:22,280 So if you crack and spoof the first attack using Ubertooth and Crackle, can you inject keys while the original device is active? 446 00:36:22,280 --> 00:36:23,040 No, you can't. 447 00:36:23,040 --> 00:36:27,180 You have to either wait for it to go to sleep due to inactivity or jam the connection. 448 00:36:29,710 --> 00:36:31,450 More questions. 449 00:36:31,510 --> 00:36:33,170 More comments. 450 00:36:39,990 --> 00:36:45,830 Have I tried porting any of the existing Bluesey tools over to Pi BT? 451 00:36:45,830 --> 00:36:54,210 The other Bluetooth hacking tools, like BT pin crack and stuff from the Stone Age? 452 00:37:03,390 --> 00:37:07,390 I haven't tried implementing any other attacks on top of this, but I'm interested in it. 453 00:37:07,390 --> 00:37:10,150 So if you come up with a list of capabilities, shoot them my way. 454 00:37:12,470 --> 00:37:17,710 I wasn't planning on doing it, but I can try to sniff a pairing conversation since I've got some time to kill here. 455 00:37:18,490 --> 00:37:18,890 Unless... 456 00:37:19,550 --> 00:37:20,350 Okay. 457 00:37:21,290 --> 00:37:23,770 Show off some Ubertooth and Wireshark. 458 00:37:25,050 --> 00:37:25,890 Sorry? 459 00:37:26,110 --> 00:37:27,730 I've got... 460 00:37:27,730 --> 00:37:37,630 So up here I've got three Ubertooth, because in a BLE there are three advertising channels, so a connection can start on any one of those three. 461 00:37:37,630 --> 00:37:46,330 You need at minimum three Ubertooth to capture a given connection, under the assumption that these guys can capture every single packet. 462 00:37:46,330 --> 00:37:48,290 Which they can't, but this is better. 463 00:37:48,330 --> 00:37:50,690 So I'm going to go ahead and plug these guys in. 464 00:37:59,210 --> 00:38:00,810 Is Wireshark coming? 465 00:38:02,970 --> 00:38:12,770 Okay, so I've got Wireshark set up over here, and I've actually got it capturing from pipes right now, which you can kind of see down here. 466 00:38:13,030 --> 00:38:14,050 Wow, this is really hard. 467 00:38:14,050 --> 00:38:17,630 I use a track point most of the time, so this touchpad sucks. 468 00:38:18,850 --> 00:38:27,770 So Wireshark can capture from pipes, so if you've got anything that produces PCAP files, you can plug it into Wireshark directly, just by having it use pipes. 469 00:38:27,790 --> 00:38:31,530 The next version of Wireshark should actually have an interface that simplifies this a whole bunch. 470 00:38:31,530 --> 00:38:36,550 It's something I worked on with Mike Hershaw, but that still hasn't made it into the main branch yet. 471 00:38:36,570 --> 00:38:40,130 So I'm going to start these guys capturing. 472 00:38:44,150 --> 00:38:45,630 Give me one second. 473 00:39:14,490 --> 00:39:23,230 Okay, so what you're looking at now are just tons of Bluetooth packets that are flying by, from BLE advertising packets from devices that are in the room. 474 00:39:23,910 --> 00:39:26,750 I could put up some Wall of Sheep stuff if you want. 475 00:39:29,940 --> 00:39:33,320 So I just turned on this mouse, and I'm going to put it into advertising mode. 476 00:39:36,430 --> 00:39:39,830 And you'll see some packets just start screaming by in a second. 477 00:39:40,530 --> 00:39:43,090 They're not screaming, but... oh yeah, they are. 478 00:39:43,090 --> 00:39:44,210 You just can't see it. 479 00:39:44,210 --> 00:39:47,190 So I'm going to plug this into Dominic's laptop. 480 00:39:48,790 --> 00:39:52,850 And now, if we're lucky, we'll actually see a connection. 481 00:39:55,390 --> 00:39:57,710 I don't know if we caught it this time. 482 00:39:59,330 --> 00:40:01,410 I don't think it's actually paired yet. 483 00:40:05,410 --> 00:40:08,570 I know it's thrilling watching packets come by in Wireshark. 484 00:40:12,210 --> 00:40:13,450 Okay, so it paired. 485 00:40:13,450 --> 00:40:15,410 I don't think we caught the conversation. 486 00:40:15,410 --> 00:40:22,290 So Wireshark 1.12 has BLE support built in. 487 00:40:22,290 --> 00:40:27,030 So you can actually expand this and look at what the actual BLE packet looks like. 488 00:40:27,030 --> 00:40:32,470 And you can see somebody's... oh, this looks like somebody's tracking beacon. 489 00:40:32,470 --> 00:40:34,650 I mean, Fitbit. 490 00:40:40,220 --> 00:40:46,700 Okay, so right now I'm filtering on the pairing protocol for BLE, and that's not working. 491 00:40:46,700 --> 00:40:51,520 So I didn't catch an actual connection. 492 00:40:51,620 --> 00:40:52,940 So I'll try this again. 493 00:40:53,840 --> 00:40:59,700 So, Ubertooth is a pretty robust BLE sniffer, but it's not as good as a dedicated device. 494 00:40:59,960 --> 00:41:03,080 So I'll try that one more time before giving it up. 495 00:41:08,320 --> 00:41:10,420 So these guys should be pairing now. 496 00:41:10,420 --> 00:41:15,000 I got a pairing request, but it's not all the packets. 497 00:41:23,060 --> 00:41:29,660 So if this works, we should see about ten packets come by that are all the pairing packets. 498 00:41:29,660 --> 00:41:34,120 I don't think this is working right now, because we're only seeing the one. 499 00:41:36,080 --> 00:41:38,180 Try one last time. 500 00:41:38,180 --> 00:41:38,940 One more try. 501 00:41:38,940 --> 00:41:40,440 Third time's the charm, right? 502 00:41:40,660 --> 00:41:42,120 Kill this. 503 00:41:43,480 --> 00:41:45,040 Kill this. 504 00:41:46,620 --> 00:41:54,680 But I highly recommend anybody who wants to do some BLE sniffing, you should get not one, but three Ubertooth. 505 00:41:56,280 --> 00:41:59,020 And by the way, Mike, I'll be accepting beers later. 506 00:42:04,920 --> 00:42:08,320 Yeah, if you really want to go overboard, you could get 79 Ubertooth. 507 00:42:10,500 --> 00:42:14,040 I highly encourage everyone to get 79 Ubertooth. 508 00:42:16,160 --> 00:42:17,680 Yeah, and call Dominic. 509 00:42:18,840 --> 00:42:20,560 What's your day rate, Dominic? 510 00:42:22,920 --> 00:42:24,860 More than 79 Ubertooth. 511 00:42:27,200 --> 00:42:28,820 79 Ubertooth, one laptop. 512 00:42:28,820 --> 00:42:30,300 That sounds like a shock site. 513 00:42:34,720 --> 00:42:35,600 Okay. 514 00:42:36,600 --> 00:42:40,280 If anybody has like a lucky rabbit's foot or something, throw it at me. 515 00:42:44,840 --> 00:42:46,660 A lucky rabbit's foot? 516 00:42:48,320 --> 00:42:49,640 Lucky beer bottle? 517 00:42:50,700 --> 00:42:53,540 Maybe something a little bit less solid. 518 00:42:59,720 --> 00:43:03,460 Actually, I'd also appreciate it if somebody played Yackety Sax right now. 519 00:43:06,220 --> 00:43:10,080 We got every packet that we needed, except for one. 520 00:43:10,080 --> 00:43:19,520 So a full pairing conversation consists of a pairing request, a pairing response, two pairing confirms, and two pairing randoms. 521 00:43:19,520 --> 00:43:26,520 And unless we get all of those packets, we cannot actually decrypt the key. 522 00:43:26,520 --> 00:43:34,480 But what I can show you is what the actual unencrypted and encrypted data looks like. 523 00:43:37,140 --> 00:43:40,240 .dataheader.length greater than zero. 524 00:43:40,400 --> 00:43:42,700 Oh, that's not what I want to do. 525 00:43:54,850 --> 00:43:58,130 So you can see all the packets that we've captured here. 526 00:43:58,130 --> 00:44:01,070 These are the non-zero length packets. 527 00:44:01,790 --> 00:44:03,230 Long story. 528 00:44:03,230 --> 00:44:07,930 So this is the encryption request that we get immediately following the pairing conversation. 529 00:44:07,930 --> 00:44:14,830 And then these unknown packets, unknown data, these are the encrypted L2CAP packets. 530 00:44:14,830 --> 00:44:21,270 So if we had that one missing packet, we could crack the key and decrypt all these guys. 531 00:44:21,430 --> 00:44:23,850 And Crackle does that totally automatically. 532 00:44:24,130 --> 00:44:26,090 It's pretty nice. 533 00:44:26,390 --> 00:44:28,870 So I gave it three tries. 534 00:44:28,890 --> 00:44:36,130 If you guys want to see it again, we should sit down somewhere where I don't have a microphone, and we can try this until it works. 535 00:44:36,570 --> 00:44:38,230 But yeah, I'm done. 536 00:44:38,230 --> 00:44:39,250 Thank you very much. 537 00:44:39,250 --> 00:44:39,650 .