Maybe. We'll see how much feedback I can get for the next five minutes. Yo! How's it going? It's 11 o'clock. It's Friday. It's Vegas. It's DEF CON. And everybody's sober, so hopefully we can remedy that today. My name's Bruce Potter. I'm here to talk about blue sniff and war driving of Bluetooth devices and things of that nature. If this isn't your right flight or you happen to be standing, you have to leave the facility. Brian Caswell, who's a schmoo as well as I, worked on this project with me. Unfortunately, he's off in Germany somewhere right now, so he's unable to attend. Anyway, I like to open all my talks with a basic statement of you shouldn't believe anything I say. We're either security professionals or the people that security professionals don't like. You call them hackers, crackers. I really don't care. But we get paid or for fun. We're paranoid people, you know, and we shouldn't believe what people are spoon feeding us. Don't come to DEF CON and watch people stand up on stage and believe the shit that they say. Challenge it. Ask questions. Attack them. Whatever it takes. Throw stuff at them. I mean, come on. Have some fun. But challenge what you're hearing for the next three days and you're going to walk out of here with a lot more knowledge than if you just sit there and take it. So, that said, I should probably justify as to why you should listen to what I have to say. By day, I'm a security consultant in Northern Virginia. I did work at VeriSign for a while. The network solutions division of VeriSign even, so feel free to flog me for that later. I worked for some startups in Anchorage, Alaska as well with a great group of people who basically were the foundation of the SHMU group that we started in Anchorage and now is an ad hoc security group of about 30 or so security, crypto, and privacy wonks. And there's many of us around this weekend and we've got little badges thanks to one of our esteemed colleagues. So, that's nuts and bolts. And if you don't want to believe me now, it's up to you. We've got a lot of ground to cover today. I'm going to go over Bluetooth basics because shockingly, you know, a lot of people don't know what Bluetooth is or how it works. I could probably find half the people in this room to give me a decent litany about 802.11 security, but Bluetooth security, I don't know there's many people I can talk about it. I know in my talks when I've been speaking to people in the last three days, most people are just kind of, what's this Bluetooth security you speak of? We're going to go over the security aspects of the protocol. We're going to go over device discovery. That's the big meat of this thing. How do you find Bluetooth devices? And we'll go over our tool that we created. So, first and foremost, I want to get this out of the way. 802.11 and Bluetooth are not related in any way, shape, or form. I've given talks on Bluetooth and we got done. People have asked me, how do I configure my 802.11 radio to do that? No, you can't. They operate in the same band. 802.11b, 802.11g operate in a 2.4 gigahertz ISM band as does Bluetooth. That's about the only thing they got going. They use the air and other than that, 802.11 is a LAN protocol unless you talk to community wireless folks and suddenly it's become a man protocol. Bluetooth is a PAN protocol, a personal area network, designed to be a cable replacement for devices that you would normally hook together kind of near you, like your phone to your earpiece or your phone to your laptop or something of that nature. There are actually, according to some studies, more Bluetooth radios in existence in the field today than 802.11 radios. So, a little survey. A year ago, how many people had a Bluetooth device that they owned? Today, how many people have a Bluetooth device that they own? Okay, so about half as many there. I anticipate if you come back next year, it'll be damn near the whole room. You see everybody running around with the T68i's or the Nokia 3650's, all these phones are Bluetooth enabled. This fricking laptop is Bluetooth enabled. You know, PDA's come with Bluetooth now. It's everywhere. And 802.11 is going to be tied to some kind of device like a PC or a router. Bluetooth is going to be tied to just about every damn piece of electronic device that you can put on your personal device. And your PC and potentially your router. So, it's easy to see where the numbers are going to get astronomical quick. In Europe, Bluetooth has a lot more penetration than domestic. I believe in Asia as well. The US is just starting to catch on. Go try and buy a P800 Sony cell phone right now. You won't find it. And one of the reasons people want these, besides they're so damn cool, is the fact that they've got Bluetooth. They have a master-slave architecture. Think of it kind of hub and spoke. You've got somebody in the center controlling all the comms. And then you've got a bunch of slaves hanging off of it. As I said, it uses the ISM band. There's a misconception that all Bluetooth devices are low power. One of the tenets of the protocol was to design a low power protocol that could be nice to batteries. You know, you've got your Bluetooth earpiece. It would be a real shame to have two D-cells hanging off that thing. So, a lot of them have been, you know, there is the capability to have low power consumption modes. But there are some people, just as the 802.11 people shoved their technology out to the man, there are people that are taking Bluetooth and shoving it out to a LAN environment. There is actually Bluetooth LAN access devices. And these are class one type radios that will go up to 100 milliwatts. There's a Belkin USB dongle. It's the first gen that they made. I think it's 810 is the model number. That's a 30 milliwatt Bluetooth dongle. It works under Linux. It's a great thing. That's what I use for my development. I highly recommend it. I don't work for Belkin. I never have. And they make everything, by the way. I mean, I don't know if you realize, but Belkin now makes, it's got electrons. They make this stuff. Bluetooth uses something called frequency hopping spreads. Whatever. FHSS. Basically, frequency hopping means, in 802.11, you've got something that's just living in a band. It's just basically transmitting the same section of the frequency at the same time. With FHSS, it's bouncing around. You're hammering around. You're picking different frequencies. And basically, you create a hop pattern. And you hop between all the locations in this hop pattern. I've got a diagram later that's going to show this. But back in the day, meaning like World War II, FHSS was a security mechanism. Because you had to know the hop pattern. In order to be able to intercept the traffic. You could potentially intercept little bits and pieces here, but you couldn't catch everything. Since then, it's become declassified. Mere mortals can use it. But it's a dramatically different way of transmitting radio than 802.11. And this becomes really key, really key later on when we start talking about device discovery. In the case of Bluetooth, each little band that it jumps into is megahertz wide. It sits there for a pretty small amount of time. And it's very resistant to interference because it's hopping around. So if somebody's interfering in a band, you know, maybe the time when they're in that band they're getting interfered. And they hop out and they go somewhere else. And they're able to move around interference with FHSS. Bluetooth is, I encourage you to go out and download the Bluetooth protocol specification. It's a thousand pages. Just the core spec. That doesn't include a lot of supporting documentation. We could fill this podium, probably to the breaking point, with Bluetooth specifications that exist. But the basic spec is over a thousand pages. And it's like, you know, you take a pizza and you throw it on the floor and there's just pieces everywhere. That's kind of what the protocol stack ends up looking like. You've got nice layers that look very OSI-y. And then you've got things that cross-cut layers, you know. And from a security perspective, things that cross-cut network layers, bad. Bad things are going to happen. High points in the protocol, basically RF, you know, all the way down to the physical layer. Here's how I sync up. Here's how I find these people. And I'm able to determine where they are in their hopping pattern. There's an inquiry and an inquiry request, basically. This is where I say, who's here? You know, I want to find a device. And I'm sending this inquiry. And someone will respond and say, hey, it's me. This is known as discoverable mode. This is a configurable option usually on devices, whether or not they want to be found. This is the way that a public device, a device you want others to find, is going to be found. Once you find the device, then the protocol specifies ways of discovering services as well. So this is where, you know, we're getting higher up the stack. And this is all in the Bluetooth specification. So, you know, here, what are you? What kind of device? Okay, now, what applications are you running? Are you running file sharing? Are you a phone? What's the deal? Like I said, it's got low power modes. Here's a URL for the Linux stack. It's bluez.sourceforge.net. There's a lot of, I think there's four competing Bluetooth stacks for Linux. This one is by far the most robust and the one that's been kind of accepted by the distributions. If you're going to play around with it, I recommend, if you're doing Linux, God help you, I recommend using BlueZ. So Bluetooth security. There's this idea of pairing. And there's a lot of confusion about what this is in general because it's not described well by the manufacturers when you get your swank little phone and it says you have to pair it. Pairing is not required. Let's just get that out of the way. You can talk to a Bluetooth device and not be paired with it. Pairing is effectively creating a trust relationship. The pairing is an activity when you go to pair the phone, there's a pin on both sides. And you enter in the pin into both devices. They are able to basically, one side creates a random number, does some cryptography with a pin. And sends that random number with the crypto across to the other device. The other device has to be able to basically undo it and shift the random number back and then it's all good. We'll talk about why that's vulnerable in a minute so people may see holes in this already. But once that's done, they have this cryptographic key that they can then use basically forever. So the pair key will then derive session keys later on. So this pairing activity happens once. It doesn't happen every time these two trusted devices talk. But you do not need to be paired in order to talk. Bluetooth security. Bluetooth has, as you would expect, AA and E. It has authentication and authorization services. This can be done on a per connection basis. Basically all traffic between two devices or per basic session between two services on a device. So you could have your file transfer be authenticated and your voice traffic not be authenticated or something like that. Encryption is the same way. So this is a classic problem in software engineering. I've given you options. I'm the Bluetooth protocol designer. And here's some options on security. What are you going to do? Screw it all the hell up. And think about this. It's one thing to screw it up like on a server. Like I'm making a web server and I've botched the security. I don't use SSL. I don't pay any attention to how my architecture is created, whatever. This is an embedded device a lot of times. How much horsepower can you really put in that earbud? Do you really have enough spare cycles to be able to encrypt? Or if encryption is a requirement for you, how expensive is your device going to be? So a lot of developers will be like, out of hell with it. We're just not going to do it. And even if they do it, they may decide security's hard and I'll give you a checkbox to turn it off. Or maybe by default, I'll have the checkbox off and you have to go in and check it to make yourself secure. Excellent. This is the way it should work. So you've got two people that can shoot themselves in the foot. You and the people who wrote the application for you. So now there's this idea of profiles. If the early 802.11 days taught us anything, or at least taught me something, interoperability can be a real bitch when you give people options or when you don't really specify how you're supposed to plan things. It's very nice together. Bluetooth has this idea of profiles where you can say, hey look, I'm your keyboard and I'm going to talk in this manner. This is how I'm going to communicate to you. And you can formalize this into a profile. And these profiles are publicly available. And anyone that wants to make a Bluetooth keyboard to interact with you or a device to understand your keyboard will just go implement that profile and then you're able to talk to them. It helps interoperability, except there are a lot of profiles out there. If you go to the Bluetooth website, there are just scads of profiles. And secondarily, there are multiple profiles for the same types of things. I had a Sony Ericsson T68i and I had a Belkin earpiece. And the Sony Ericsson T68i, I hated. It was a really crappy phone with a bad antenna and I basically kicked it until it broke and then I upgraded to a Nokia 3650. And I thought, great, I'll just keep my earpiece and I'll be all dapper and whatnot. Well, the problem is the T68i understood both the hands-free and headset profile. Note, there's two different ones that basically do the same thing. But the Nokia only understands the headset profile and my earpiece implemented the hands-free profile. So, I'm SOL. I have this swank little thing that I had to sell on eBay because I have no use for it. I hope someone in this room bought it and is enjoying it. So, what's the deal? I keep referencing 802.11 and the reason I'm doing it is because it's kind of a reference. There's a lot of people that understand it and I hope that when I reference it, it's not that I'm a real zealot about this, but I'm trying to use it as an analog. One thing that's important to understand is that there's more at stake. Because of the way the protocol is basically this mishmash of verticals, when you compromise an 802.11 network, you're able to potentially sniff at the network layer, but if you want to get after a host, you've got to go after a port. You've got to be an IP port, boom. You've got to break into the application, whatever. With Bluetooth, if I own basically any part of that stack, I'm going to take over everything. If I can subvert the network, hey, I'm going to have victory. I'm going to go after the application. It's just going to be laying there. Potentially, there's some higher order authentication encryption on top of it, but it's not nearly the same layered approach that Ethernet networks have. So there's a lot more at risk when you expose and have a weak Bluetooth device. It's also more personalized. Think about this. This laptop, many of us have laptops, the 802.11. When we're done, today I'm going to shut this laptop down, and I'll walk outside, and I'm going to start talking to people, have a cigarette, whatever. My phone, on the other hand, is going to be on. And that's got a Bluetooth radio on it. So if I'm looking to track me, or someone is looking to track me, they will be able to key into my phone and determine where I am all the time with really cheap gear. This is really neat. This is tracking with like $50 radios. And this is tracking potentially on a metropolitan scale. I can make a little sensor network in downtown DC, figure out who's got what Bluetooth devices, and track them everywhere. I can determine what's going on, what senators are speaking to each other. Oh God, all the national security advisors just got together. What's going on? This is really kind of scary. There are more Bluetooth radios in existence than 802.11 radios. Here's this huge tracking problem. This really hasn't been covered. I mean, this has not hit the press. How many people have an information security policy that covers wireless? How many people have one that covers Bluetooth explicitly? Excellent. Congratulations. That's really unfortunate that these numbers are so small. This is something information security professionals have to think about. And in the interim, the attackers are going to have a blast with. There's going to be a lot of executives out there wondering what the hell is happening and why people are listening in on their phone calls from three miles away. So here's my mad vizio foo. If you think of this from earlier, direct sequence is basically just eating up this huge band and broadcasting all the time in the same place. Frequency hopping spread spectrum, you can see where it's basically creating this pattern and hopping all over. I'm about to talk about service discovery, and I decided this is probably the time to kind of give you a visualization so you understand why Bluetooth is important. Bluetooth is so much different than things like 802.11b and g. So 802.11, like I said, uses DSSS. Transit's always in the same place, which makes it great to find. If I know you're on channel one, I'm going to find you. I'm going to find you right then, because I'm going to start listening on channel one, and that's all that's going to happen. 802.11 channel one's like 2.4 to 2.41, some nonsense, whatever. You can get there. There's no confusion about where channel one is. So you may have multiple channels. Like in 802.11, you've got, you know, domestically 11, overseas, you know, 13 or 14. But all you've got to do is cycle through, what, a handful? You know, we're talking in the order of 10 channels. So there's some cards out there that do this real well. Cisco's got an RF mod mode that's basically transparent channel switching. It runs through all the channels constantly in hardware. This isn't like a, you know, firmware kind of thing. I mean, this is just hardware channel switching, and it basically looks like it's promiscuously sniffing on all channels all the time. That's why Cisco cards kick so much ass when you're doing wireless 802.11 security work. Prism 2-based cards like Linksys and Netgear cards don't have that functionality in hardware, but they have it in firmware. So they can run through, but they don't run through as fast, it turns out. The Orinoco cards, for those that have used them, like with something like Kismet, you know you have to have basically an external channel hopper to say, I'm going to have to run through the channels in hardware, or in software, and just kind of tell it flip, flip, flip, flip, flip. You do about three a second or so, it turns out, on the cards before they start to basically miss a lot of traffic. Another nice thing about 802.11 finding it, so not only do you know where they are in the frequency band, but they're also, there's this idea of beacons in 802.11. And this is basically an access point saying, I'm here, I'm here, I'm here, I'm here. In general, it's 100 milliseconds, it's configurable. You know, you can crank it way down, you can crank it way up. But nonetheless, a lot of people have these beaconing networks. You can turn it off. Most access points now give you the ability to create a cloaked or closed, or all these different names for a network. And that fools some more driving utilities. NetStumbler, you know, kind of the original granddaddy of these things, unfortunately, really all it's doing is querying the card and seeing what beacons are there. It's not promiscuously listening to say, who doesn't want to be found? Airstore and Kismet, though, however, will. They allow you to access the card promiscuously and go in and just listen. So even if they're not beaconing, you're going to catch traffic that's going across. So what you need to have in that case is some other manner of regular traffic to focus in on. And the beautiful thing about modern-day PCs, especially like Windows Boxing, they're pretty goddamn noisy. Windows has got this SMB crap going all the time. Now with OS X, you've got rendezvous, so you've got all this multicast traffic flying out of the box. These machines are not quiet. You will find them in a heartbeat, as long as you know, hey, I've only got ten channels to run through. You're periodically going to be doing a rendezvous request. I'm going to find you in about two minutes. Let there be no confusion. So anyway, 802.11, when it comes right down to it, it's pretty easy to find stuff. I mean, everybody here has gone war driving, I've got to assume, or at least been with friends who have been war driving. You go out there, and it's just instant gratification. It's the greatest thing in the world. You're driving up, bing, bing, bing, bing, you know, whatever. Bluetooth is not going to be that way. Frequency Hopping Spread Spectrum is a lot harder to find. First off, at the RF level, Bluetooth is a pain in the butt. Because you've got to line up with that hopping pattern, and you've got no idea where the transmitters are in the hopping pattern. So if you know the MAC address of this PC, and you want to ask it a question or tell it to do something, first thing you've got to do is line up with the hopping pattern, which basically means I'm going to run through the hopping pattern really damn fast in an effort to catch up to you. Well, that's a real pain in the butt, considering the hopping pattern is about two seconds long in the first place. And maybe because you're transmitting something and you're eating up more time slices than you should, I miss you the first time, and I've got to do it again, and then I've got to do it again. And after ten seconds, usually, statistically, you will have found the device you were looking for. Okay? This is not, like, abnormal. This is the way the protocol works. You will find devices between two and ten seconds on average. I mean, for those that have Bluetooth devices, when you try to get them to pair or you're trying to do something, they don't show up right away. And the reason is they're trying to align on this hopping pattern and figure out what the hopping pattern is. So as you can imagine, you're not going to get the instant gratification where before in AR211 you had a couple of milliseconds to find it, microseconds even. Here you're just running around, looking, looking, looking. And if he's not there or he goes out of range for a second, you're going to just keep doing it. You're going to retry. It's a real pain in the butt. Thankfully, devices can be discoverable, and you can actually, you know, send it the inquiry request I talked about earlier. And you would think, well, most people wouldn't have this on unless they were, like, in the process of doing something active with their machine. And for those that have the T68i, you could put it in discoverable mode, but it would only stay there for about three minutes, and then it would go away. This was not a security feature, mind you. This was a power feature. When you're in discoverable mode, it sucks up a lot more power because it's listening much more actively to requests on the network than it normally would. So I was at Black Hat, and I've got my little phone, and a buddy of mine is a race car driver, and I crew for him. And last weekend, his tire rolled off his rim, and I took a picture of it with my phone. And so at Black Hat, I figured, well, I want to see how many people will just take the picture of this freaking tire. And so I'm going around in all the rooms, and I'm scanning Bluetooth devices, and, you know, there's just, you know, probably per room, a dozen phones are just sitting there in discoverable mode. Some people actually took the picture. It says, some unknown person is trying to send you a file and people are going, oh, yeah, that seems like a rational idea. I think I'll do that. Devices can, thankfully, you can turn off this idea of discoverable mode. And in that case, you need to be, you need to directly probe the Mac in order to talk to it. So once you've turned, you know, you've discovered each other, say, you know, this is a legitimate situation. I'm trying to get my phone to talk to my laptop. And I've done the pairing. You know, do the pairing. One side was discoverable, the other side didn't need to be. I paired. I could turn discoverable mode off, but now that they know each other's Macs, Mac addresses, all they're going to do is when one wants to talk to each other, it's basically going to start walking around through that hop pattern until, with that Mac address, targeting at that Mac address until he finds that guy. Bluetooth also has the problem of service discovery at the application layer. There's potentially a lot less traffic going on. When I'm standing here and I'm not making a call, I'm not syncing my calendar, I'm not doing anything of that, the phone's pretty damn quiet, my laptop's pretty damn quiet. There's not a lot of traffic going around. Given the problem that you have, that there has to be some kind of traffic for you to sync up on on this pattern, that makes it kind of difficult to be able to sniff promiscuously for this data. Sophisticated RF gear solves a lot of these problems. If you've got a spectrum analyzer and you're just sitting there, you're going to see little burps as this thing's bouncing around in the spectrum. However, a lot of us can't afford spectrum analyzers. Secondly, they're kind of big. They don't look quite as impressive like laying on the table. Lastly, it would be real nice if cards did this, if you had some greater flexibility into how the cards interact at the RF level. As of yet, no one's been able to make a standard kind of run-of-the-mill card do it. You can buy PC cards. They're about between $500 and $2,000 that are effectively software spectrum analyzers. I'm not really certain what the differences are between those cards and the basically $50 commodity Bluetooth gear. That's kind of what I'm working on right now is digging through firmware on all these Bluetooth devices, trying to figure out what options are there that aren't being exposed in open source drivers. Obviously, I've gone past. Okay, so a fun attack. This is one of those red herrings. I'm going to throw this one out there, but in practice, it's not going to be much of an issue. If during the pairing process, I can intercept your traffic, I own you, I know your keys, I'm able to basically get your random number, and then maybe I'm being a little over the top, but the PIN is usually a four-digit number. There's a search space there that's pretty easy to brute force your way in. There's no way through until you find the right thing. And on top of this four-digit PIN that most people use, most people think PIN and they think four digits just like it's in our brain. But secondarily, when you have a device like an earpiece that doesn't have a keypad, there's no way to enter the PIN in. So it's hard set. So Belkin earbuds have one, two, three, four as the PIN. So if I know you just paired with a Belkin earbud and I'm able to intercept that traffic, I can create your keys on my own, and from that point on, I can decrypt, authenticate, I can do anything I want to your traffic. This is a bad thing. It's recognized by the specification creators, but there's really not a lot of way around it right now. Basically, if you're going to pair and you're really paranoid going to a Faraday cage or some nonsense, in general, it's going to be a pretty safe activity. More likely, the attacks that you see right now are these poorly designed software, people with optional security. I had a card from my iPac. I don't recall what vendor it was. And it installed the driver for the Bluetooth card. But then it installed a whole bunch of profiles and the software that supports it. First of all, the software that supports the network access profile is actually a PPP server. So there was a PPP server installed on my PDA. This was non-trivial. This is like a 3 meg piece of software in and of itself. The whole driver was like 9 megs. Secondarily, it had a file sharing profile, and the file sharing profile was turned on by default, without encryption, without authentication, and it was sharing the root of my PDA's file system, world writable. It was awesome. It was potentially the worst possible thing anyone could have done to a driver, and it was just the default installation. This is real similar to the early days of 802.11 wireless security problems. A lot of you probably remember Lucent's access points back in the day, where their serial number was their web key was their SSID. So when you drove down the road and you saw a six-digit hex SSID, and it had the Lucent octet in front of it, you're like, oh, great. I know the web key. I can sniff your traffic. There's no point of even running web crack or something. These defaults are going to be the first thing that the vendors solve. They're going to go out there, and they're going to get pushback, I think, probably from corporate security folks mostly, because those are the people with the real money, and say, hey, why don't you fix your shit? Come back when you've got better defaults, and then we can talk. Low-carb devices like Class 3 devices can be intercepted at a distance with reasonable antennas. If you're a Class 1 device, it's even easier. To this laptop for my phone, I was able to do a distance from basically the back of the room to here in a session the other day. That's a pretty substantial difference. Basically, I'm not sure what this is. I think the thing on my phone is only a Class 3 device. That's an appreciable distance just for how it's supposed to be used. If you're really trying, you're going to be picking it up for many number of meters. Basically, it's like your own Rift ID tag. People can follow you around. I want to just reinforce this. It's not expensive. The cell phone companies can follow you. E911, great. I'm in distress. The cell phone towers can triangulate me. Great. I'm sure there's no privacy concerns about my phone company and I don't know where the hell I am. Now, not just the phone company, but anyone who's really interested in your activity can create a pretty cheap little network of Bluetooth devices and they can track you everywhere you go. For most of us, that's not an issue. For some people, it's paranoia. For others, it's a fact of life, something they need to be concerned about. Bluetooth war driving. War driving is probably a bad term because if you're driving by and given this nature of it and it takes a long time to pick up the device, you're probably not going to see it. I mean, everyone's war driven at like 60 miles an hour. You keep picking these things up, you're not going to have that here with Bluetooth. So it's more like war walking. The original way that I did this was in New York about a year and a half ago and just roaming around with my PDA and the little device and just keeping scanning. It said no devices found. Yes, yes, yes. And there weren't a lot of devices at the time that had Bluetooth, so it was a pretty boring endeavor. And it turned out you probably needed a better UI to be able to pull this off successfully. By default, just doing that mechanism like your phone or your PDA is not going to define non-discoverable devices. So if you're really looking to have a good time with somebody, if they're not discoverable, your life just got a lot more miserable. I'll get into how you can overcome it, but it's not going to be pretty. New tools really need to catch on in order to draw out these concerns. And I think that we're going to see in the next year or two a kind of explosive growth, not only in Bluetooth device penetration, but also in the security community's interest in it. At the same time, the number of tools are going to be created. Today, there's just a handful of tools. Only a couple of them are really security-related. It's going to become a lot more proficient. Now, anticipate next year at DEF CON, there'll be two or three Bluetooth talks instead of one like there is this year. There, of course, is the wonderful voyeuristic appeal of 802.11 war driving where you get to go around and see who's doing what. The problem is right now, the devices that I'm aware of don't have clear interfaces to allow you to promiscuously sniff traffic. So because of that, it's not quite as voyeuristic. Like, you know, with 802.11, I could read your email. In theory, with Bluetooth, I can listen to your phone conversations, but that kind of alien technology doesn't exist for us mortals yet. And hopefully, at the end of the day, there's some software developers back in the room who are going to get this all figured out and solve some problems. So... Yeah, here. Oh, one thing I do want to mention on this slide. Errors in implementation are going to be a problem. That's kind of the next generation problem I think we're going to see. The analog to what I'm trying to describe here is, you know, like an outlook when you can kind of bomb in some HTML and have something bad inside of the HTML that gets interpreted by some piece of Windows and bad things happen. And so you always tell people, don't open HTML mail. It wasn't just, you know, don't open attachments. Like, okay, any idiot, you know, can figure out don't open the attachment. But then there was all this kind of line, like, don't open the emails you don't trust because maybe there's a problem with the HTML interpreter or RTF interpreter or whatever. Whatever, rich text format. Yeah. RTF interpreter that's going to allow you, someone to own the box. And I think the last kind of HTML interpreter problem was about two or three years ago. And then, like, three weeks ago, there was another one. So just when everyone was getting used to opening their mail, now suddenly people can just bomb in HTML again and own your box without you having to do anything. Wonderful. We're going to see the same kind of problems as the next generation problems in Bluetooth where someone at a conference accepts a picture from someone and inside that picture I've embedded some malware. And that malware is gunning for some kind of vulnerability in the parsing engine or whatever of whatever OS that phone's running. These phones run, you know, Symbian, Palm, Windows. I mean, my God. Windows frickin' 2002 Pocket PC, whatever the hell they call the thing, is... Damn, I have a firewall in my basement that's not as powerful as that box. I mean, that's ridiculous. There's a lot of functionality there. They still don't get the security thing, you know. Windows Pocket PC 2002, at least, didn't understand how to handle, like, certificate revocation, how to load a new root cert. I mean, the thing was pretty angry. I haven't played with 2003 much yet. But, you know, that's not gonna change. You know, these guys are thinking they're unembedded OS. They got bigger concerns. Power consumption and size. They're really not caring about security as much as they should. So the moral of this is, I think in the next year or two, you're gonna see these kind of malware attacks. And this is gonna be kind of analogous, I think, to what happened in Japan with SMS, where people were sending in SMS viruses to people on their phones. You know, SMS was coming in-band, in the phone, you know, over the GSM network or whatever network they're connected to. This is gonna come from the guy next to you walking past you in the mall. So the first tool that was released that I want to talk about was Red Fang. It was released by AtStake two months ago, maybe three months ago. And this is really the first, you know, security tool that goes out and looks for devices that don't want to be discovered. I applaud them for what they did, but unfortunately the process that you have to go through is not pretty. Because of this deal where it takes a long time to find a device even when you know its MAC address, but you don't know its MAC address ahead of time, means that you're gonna go through and you're gonna brute force guess MAC addresses. And for every MAC address you're trying to guess, you gotta wait probably up to 10 seconds while you're trying to find the device. If there's nothing there, you go to 000001. You wait for 10 more seconds and you do it again. This is a long process. The one thing that's nice, you know, these MAC addresses are the OUI registered IEEE MAC addresses. You know, these are global unique MAC addresses that come from that same listing. So we're able to create lists of MAC prefixes for various vendors. I'm working on putting up just a list of the devices that I'm aware of, you know. What's the MAC prefix for Apple's? What's the MAC prefix for Ericsson phones? What's the MAC prefix for Nokia phones? And maybe we'll be able to find the ranges that these companies are using for their MAC addresses. And that will allow you to kind of jump start the process. So you should be able to determine the three octets right off the bat. And then maybe through some work and some collaboration we'll be able to say, these companies are using these smaller ranges. Which will make finding, you know, this MAC a lot easier process than the hours and hours that it's going to be right now when you're trying to look like it, trying to find it. Doesn't that sound exciting? Going off and looking for one device for hours on end, and God help you if you're at Starbucks and that guy gets up after, you know, 30 minutes and walks away and that scan was just useless. You can, right next to the scan, the guy with the funky hat, if he ever comes back, I ended with 000100. The question is, is there broadcast or multicast traffic for it? Bluetooth is, I guess, the way to describe it, and I've seen it publicized, is not a promiscuous protocol, meaning everything's pretty much what you would analog to Unicast. The closest thing to this broadcast is this idea of the inquiry request. I'm unaware of anything else that basically doesn't specify, have to cause you to go right at the MAC address. The only thing that's kind of generic, i.e. a broadcast, is this inquiry request. By turning off discoverable mode, that thing's dead. So, you know, this takes a long time, but this is the only way. And so if you're an angry adversary, you know, you're looking and you're targeting someone specifically, this kind of thing's gonna work out for you. If you're not an angry adversary, well, then, you're probably not gonna really go down this road. It's fun and it's neat and all, but I think, academically, that's about all we got. Oh, yeah. The way that the hopping pattern works is it's a seed off the MAC address of the master in the Pyconet. The Pyconet's basically the pan. You've got all your devices talking to each other, and you've got the master, you've got all these slaves, and they form this thing called a Pyconet. And so in the Pyconet, the master's MAC address determines the hopping pattern. And this is kind of interesting. If the master in your Pyconet is discoverable, he's basically pimped out everything in its Pyconet. Because you're able to see the master, you're able to find his MAC address, you're able to determine the hopping pattern, and at that point, hey, great, I can now listen to everybody because I know exactly what their hopping pattern is. If one of the members of the Pyconet is indiscoverable, you know he's there, and that's good, but you don't know what hopping pattern he's on yet, so you still gotta work like hell to try to find other devices. So, you know, just from an architectural perspective, my God, you have to architect your personal area network. Who's my master, and is he going to be in discoverable mode? Make sure he's not, and you'll probably be a lot happier. So we ripped together this thing, and I will caveat this really heavily right now and say it's not the prettiest piece of code, and I'll be real happy if anyone downloads it and it actually works successfully out of the box. It was kind of a last minute. We were going down the road that at stake had gone down, and then they released, and we just kind of sat on our hands and felt a little dejected, and we decided, oh, we'll tackle the usability problem, because, you know, usability's a big issue in security, and so we made a really wonderful, useful end curses application that periodically just kind of disappears, so it's real usable. I'm sure a lot of you have heard this study called Why Johnny Can't Encrypt, and it was a study done by some researchers, I think in California a couple years ago, where they took a bunch of people in a room who weren't computer savvy and locked them together and said, here's encrypted email. Here's how you do it, okay? First, without telling them anything, can you send encrypted email to each other? And a few people succeeded, and most people failed. Then they spent the day explaining this to them and said, okay, now send encrypted email to each other, and a few more people figured it out, and the rest of the people still kind of scratched their butts and said, I don't get it. Usability is a big security issue, you know, and as application providers, as system integrators, as attackers, as whatever, you've got to care about usability, and potentially it's more important than the technology, because the technology, I can stand up here and hit you with a technology stick today, and most of you are going to get it, and you're going to walk out of here and say, I understand this shit. This is good stuff. But my god are the tools terrible. They just crater. I have no way to use them. They're ugly. I don't understand it. Whatever. Or I've got to compile some crazy LKM for Linux that takes like 50 other widgets to compile. I hate that. So we tried to solve the usability problem and made it an unusable tool. If you do download this and you fix it in any way, shape, or form, please email me the patch, and we'll get it integrated. We're going to try to rev this a little bit farther just as some proof of concept code, and then we're going to go off and do some better integration that will get it integrated. We'll get into it in a minute. So what this thing is, is a front-end red fang. So basically, you can just kind of stick the red fang on something and say, go find things, and it'll kind of graphically display. I'll get to a screenshot in a minute. You know, what devices it's found and the signal strength and things of that nature. And it's also a handy little UI. I think this is probably more convenient. That just continually looks for things in discoverable mode. So rather than walking around with your phone and hitting yes every time it stops scanning to rescan and look for more devices, you can just sit here with your laptop, and as people walk by your table by the pool, you'll see who's discoverable and who's not. That is probably a lot more useful than the red fang interface right now. And I shit you not, it will just do crazy things right now. So CAS wrote the UI. CAS actually wrote everything. I should never develop software. If anyone ever wants to give me money to actually write software for them, I've got a bridge to sell you, some swampland, and all the other typical cliches. This is, I think, from some other wireless tool. I think maybe CAS participated in it. Basically, you know, you can select your scan, normal or the brute force. And I think now it'll do both. It'll sit there and listen, it'll try finding discoverable things for a while, then it'll go and do brute force, and then it'll go back and go back. So, you know, you're getting kind of the best of both worlds. Hey, look, a pop-up window in Curses. This is the coolest ever. And then it'll show you, you know, when you saw it and all that kind of stuff. Those MAC addresses, for those that are wondering, are actually Cisco 802.11 MAC addresses. It just happened to be the ones we had. And so when you start the tool right now, you'll actually see these because they're still, like, the debug code is still in there. So they'll be pre-populated with two Cisco cards that are really not Bluetooth devices. So future work, and I think this is where, you know, things kind of get important. Integration with other Wi-Fi scanning tools. You know, usability is going to be an issue. The next step, after we work out some kinks from BlueSniff, is we're going to go to AirSnort, and we're going to implement it and merge it into AirSnort. So you'll have, you know, the Uber war-driving utility. As long as you have low-profile cards that can sit next to each other, you know, in your PC card slots, you'll be good to go. A note on that. Bluetooth and 802.11 interference. There's a few studies that have been out on it. I recommend reading them. I'm not going to make any claims about their qualities because people have come to kind of different conclusions. I think in general, the closer you have the two radios, the worse off you are. But it's not really going to necessarily be a terrible thing, but it may be for you. So before you say, damn it, I'm using my, you know, Bluetooth and my frickin' wireless network, it goes down, you know, go read it. You may have some other problem afoot. We've got to find new scanning methods. I mean, pure and simple. And I think what that's going to get to is finding what the capabilities of the current hardware are. You know, with NetStumbler, the person who wrote NetStumbler understood one piece of hardware, and that's what he used, and that's great. But then people were able to look at other types of hardware and say, man, this Cisco card really kicks ass. We should write something that uses this instead of the mechanism that we're using on this Orinoco card. People are going to have to start looking at all these vendors, and these vendors aren't yet quite as mainstream. I mean, Belkin, I think Linksys, and maybe some other of these kind of comp USAE brands are making this stuff. But if you go to the Blue Z supported hardware web page, there's a lot of vendors you've never heard of. And a lot of them are in a language that I cannot speak very effectively. You know, buy some cards. If you have experiences with cards and you are able to do something that you weren't able to do in other cards, let the community know about it, you know. Find a forum. I don't know if there are any decent Bluetooth security forums out there besides the standard issues, security focus, whatever that they got going on. Or, you know, email me and I'll help you work through issues and dig through firmware. We'll figure out which cards can do what. I think it's going to be really critical that we catalog these cards and figure out what the capabilities are and figure out what the best tools for the jobs are. And, you know, I stand up here as a daytime security consultant and kind of nighttime, I'm still like a white hat. I'm not throwing this out here to be an attack scenario, you know. There are attackers who will use this for evil, but there are also security professionals who will use this for good. You know, finding the idiot who's got their, you know, whatever printer discoverable on their desk and some guy outside is printing porn to his office and he can't figure out why all his porn's spewing out of his printer. So, you know, there are good uses. This is a whole full disclosure concept, you know. Use this tool as you will. I don't really care. Second thing is, I'm creating this MAC address table listing. I've got a start on it. I think it's on the website. I should have a lot more. As soon as I figure out, in OS X, where that is, there's a lookup table somewhere on the box that says, this is the device name, my phone, and here's its MAC address. And here's another device I'm aware about, and here's its MAC address. And I swear I went to the root of the file system, egrep-ri-nokia-star, waited an hour and a half, and I didn't find it. So, I was really ticked off to chew up all my battery life doing that grep and not finding it. If anyone knows where that table is, I've got just a litany of devices stored in this machine that I've got a MAC address for. And sniffing's gonna be another big one. Even though, like I said, if you know the master, and you know its MAC address, you know the hopping pattern for everyone in that pico net, there's no tools yet that will give you all the traffic in the pico net. The one tool that ships with Blue Z is called HCI Dump, I believe. And HCI Dump will only give you traffic to and from your own device. Bluetooth is not meant to be a promiscuous protocol, and the developers who write the drivers really don't intend to be thinking like this. They're thinking, you know, I only want the back and forth for me. And as security people, we want the back and forth for everybody, because that's where the real juice is. Because you probably don't want to be seen. You know, you'd rather be the quiet party in the group. So, you know, there's got to be some work put into that. And again, this is gonna come out of more firmware. Yo. Can you change your own MAC address for your own Bluetooth device? The question is, can you change your MAC address for your own Bluetooth device? Honest to God, I don't know. I really haven't tried. I mean, that's like, you know, this stealthy idea, like, you know, so people think you're something that you're not. And since most people aren't looking for you yet, I haven't ever thought to try and cloak myself. So, I have absolutely no idea. And if anyone finds out, please let us all know. I'm gonna open the floor up to some questions before I do, you know, shameless self-promotion. I helped out with a couple books that are gonna be in the vendor table. So, you know, if you feel like pitying me, I'd be happy to, you know, buy it, spit on it. I really don't care. Whatever. Anyway, questions? Wow. Fire. . . The question is, can you unpair devices and basically cause them to, in 802, 11 lingo, re-associate? First of all, the pairing concept is only kind of this trust relationship that occurs. So, the way that you would break a pairing is you basically delete the keys off to both sides and they're unaware of each other anymore. And as far as the re-association, there are various control frames that you can send. The hard part isn't sending them, it's just knowing how to send them, what part of the frequency to be on, and what MAC address to be. So there is that capability to break the connection, but it's not, I mean, frankly, I just haven't examined it at all because I'm still fighting with this first part of the problem. Other questions? The question is, is it possible to force a device into discoverable mode? You're talking as an outsider, not as the person who owns the device. Right. That would involve subverting the device itself to be able to do it. There's no protocol bit that says, hey, flip yourself into discoverable, then let me discover you. It's not possible. That's the thing. It is listening. It's listening generally in a low power mode, and that's why you can still address it by MAC address. If it hears a frame for its MAC address on the right part of the pattern, it says, oh, this is for me, and I need to deal with it. So even when you're not discoverable, you can still talk to the device. And even, this is kind of neat, when I was sending pictures of these people's phones, you can scan these devices. You can find them, and nothing pops up. There's no security mechanism against discovering the device. And so there's nothing like watching you scanning or whatever. You can find out the device name. You can find out what services it offers. You can do all this nonsense, and there's really nothing that the device is going to do to try and stop you until you try to access one of those services. That's when authentication and encryption are going to kick in, and that's when you're going to have some kind of pop-up, hopefully, that says, oh, hey, do you want to accept this? And wonderfully, the phones and these other devices have it so you can just accept anything people send to you. So it'll just take it, and then maybe it'll ask you, do you want me to save this? Do you want me to execute it? Do you want me to rape it? Whatever. I mean, there's all kinds of options it can do, but you can do a lot to the device before it says, who are you, and what are you doing? Another question. The question is about the predictability, and the length of the pattern. I think the pattern's about two seconds. It sits on every part of the pattern for 625 microseconds, and there's 79 locations in the pattern. But it's a permutation of the MAC address of the master. So, you know, combinatorial mathematics say there's a lot of different patterns that are possible. You know, that mechanism that you go through to try and find someone when you don't know their pattern, that discovery mechanism, is kind of the best way to do it. At least, that's the people who designed it came up with the best way, and no one's been able to beat it yet. Other questions? The question is, if one device loses a pairing key, what happens? Basically, you can't talk anymore. You know, the one guy can't generate the proper keys and just kind of throws his head out. You know, there would be two conditions. There's one, you corrupt its pairing key, so that at the software level, it would say, this is still a valid key, but our keys aren't matching up. And there's a second when you delete it, and what happens is, at which point, the software would probably say, there's no key, I have nothing to do, and we'll just try to create a normal connection to it. Other questions? The question is regarding other specifications on Bluetooth besides the ones that I referenced. There's some IEEE work. I think it may be in the 802. Chained somewhere, I'm not really sure. The authoritative source is bluetooth.org.com. Bluetooth is a royalty-free protocol that was originally developed by Ericsson and then released in the public domain. You know, Ericsson actually kind of had a revelation that said, we can develop all this stuff, but unless we give people the ability to use it independently, no one's ever going to adopt it. It may be the greatest freaking piece of whatever in the world, but no one's going to pay us because until we get critical mass, nothing's going to happen. So, you know, you can go to the Bluetooth website, you can download miles of specs, and there's like little primers there that you can get that actually give you kind of a soft landing. There's also an application, Bluetooth application development book that I cannot for the life of me remember, but if you search on Amazon for Bluetooth application development, it's a really good book. It gives you a great head start in using BlueZ, explains the protocols more in-depth, explains the power consumption issues. As an application developer, you need to be concerned about power consumption and layer one issues. It's the greatest thing in the world. I need to worry about everything from layer one to layer seven, and I'm just this poor guy at a desk, and I don't know what to do. You know, there's going to be problems with this for a while, but, you know, through our diligence, I think we'll be able to tackle it. Anyway, I think I'm going to wrap it up. Well, I'll take one more. Fire. I have a question for you. You talked about three-course manufacturers. Is there a way to set a multiple standard so that you can get a little less multiple collections? Right. But I mean, how much does it cost to set a multiple standard to get a maximum? Right. Exactly. The question is, can you parallelize the scan? The Red Fang tool has been explicitly made to be able to be threaded, so you can kick off multiple instantiations of it at a time, and it's really going to be limited to how much crap you can shove on your box, you know? If you get a USB hub or string a couple USB hubs together and slam in a bunch of, you know, Bluetooth devices, in theory, you know, as much as they'll support, you can run off and scan. The issue is you need to make sure you're not scanning the same space. Like, if you've got 16 radios, you shouldn't all start them at 0, 0, 0, 0, 0, 0, because you're just going to waste a lot of time. So you can parallelize that. And I think, you know, that's probably the short-term technique that people are going to use when they're really interested in finding someone. You just stick a bunch of radios on it, you solve the problem, and obviously, so, you know, binary search blog gets shorter. Anyway, one more? Doctor, doctor. All right, excellent. I appreciate it. Thanks a lot, guys. Have a blast.