Hello everyone and thank you for coming. What we're about to speak next is blue tooth security and focusing on Android smart phone. Interesting stuffer. So the talk will be divided into 2 parts. And how does it work. The second part we focus on the new stuff, all right. So action. I'm Matteo -- I'm a student and my friend the other Matteo. >> Hello I'm Matteo Collura from same -- you can make some confusion maybe sometimes. I am a students at -- and researching different fields such as blue tooth and -- and okay. You'll find some info about my contact. >> Okay, so let's start this talk. From the name of the tooth because is nice to spark this humor. The name blue tooth comes from -- 12th century and his name was Hara and name blue tooth. And as you can see that -- H and B. They match together and this is the name of blue tooth the logo of blue tooth. Telling about that and it is a cable replacement proto call and it works the same for -- as Wi-Fi more or less, you try high frequency -- 79 channels usually. Helps transmission. This is info regarding the architecture. Actually is not so useful from the point of view of the user. Maybe from the designer because we can see a lot of proto calls we may use in order to build our stock and our architecture and first you start from the physical layer which you select your proper radio and then at the top your base band and here come some very let say important and -- proto call. And is comes along with this the logical link controlling and the other proto call and link the devices together and then the service discover proto call is another monitoring one. But is not from the use of point of it. So -- there has been so many updates on regard from blue tooth. And first of all they started the introduce the physical address from the blue tooth because obviously you cannot target this decide about without knowing is address so then it became up a -- hopping spectrum. That was in order to make it resist tent and is dropping after that they know how it was made and it was not so simple but it was easy to east drop in communication. And after that -- professor so two devices actually were it was easily to transfer the amount of data to the devices -- and face shift king where introduce. So this is just for telecom people and then from version 2.1. A very -- update regarding your single pairing because before this update the pairing mechanism was not so was secure let say. We will see later. And from version 3 some updates regarding data transfer because when you have very high data to be transfer you use the blue tooth connection in order to make the pairing and exchange some keys while you're transferring data using a -- proto call. Update for the use of blue tooth for examples in museums or places where you need to send little pieces of information of data in some devices and this was done while passing -- well -- just sending little pieces of information. From version 4 Bluetooth low energy was introduce. Is called smart blue tooth it depends and from version 4.1 they lower the consumption. Maybe you heard about the low energy blue tooth as the proto call which is consuming fuel power because the UT cycle has been improve and so the discover time has been limited so the transfer is not so long and you're lowering the -- from version 4.2 the data packet of low energy has be reduce from 22 to 27 bytes to be transfer. And we will talk about low energy -- and regarding blue tooth. And the let start with blue now. It was establish in the late 2013 but -- Lorry. Some papers will find online and actually it is exploiting the old X proto call. And the goal of this. This exploits you can make some ease gift request to come on file at the time you apply this -- and pocket -- because the most common device with blue tooth enable and where the devices you get some information exploiting this. And if you get some get request. Sump as calendar or contacts you know the name and the part and you actually for right passing the security channel and just going through this of, changing files so the user was not seeing any prompt on its device and no authentication needed. Then I would -- nice exploit by -- and where the we're lucky because he is sitting here right now and -- he will be glad I think to explain as more of course better than me because the discover this. So it was present DEFCON 12 in -- it was regarding the blue tooth implementation of iPhone. How many of you -- so few of you? No one of you actually -- smart phone? >> Mark you don't count. >> Sorry. >> Really? Bad thing because I remember when I was I think 13 years was the time. I'm young maybe I'm just 21. At the time I was 13 or 14 years old and I remember it was funny to play with those nice because they collect all the -- it was so funny to hack your friend phone because when I leave their blue tooth on and you just connect to them. It was possible to control some device. Send an S MS to another number. Or calling other people so when we were in school for example you were also to bring their phone and like fuck what is happening right now and the teacher, oh what are you doing with your phone. So fun. So you were also able to down loan items. So sometimes you were getting pictures, it was the first time smart phones had camera. At the time we were -- guys so it was not legal but for just our fun you find some pictures of people and say, what were you going with your mom or doing something in kitchen I don't know. Hey I got this from you. How come? And it was so fun. And so thank Lorian for -- and another one I want to call blue chop and it was useful to break the connection between some devices and this was possible provided this master device was supporting multiple connections. Peak connect and is address and contact the master at the time. The master will think. I have 2 devices the same, what the hell. And it will update and then I will quote other known exploits like blue bomb. In order in push the link but there are a lot of things I will leave the reference if you want to, let say know more about them. So a little bit explanation ability the pairing and -- about -- and then I will leave for the new stuff. More interesting and funny to hear. Okay. This is how the legacy pairing procedure work before version 2.0. So there are two devices. Initiated device and device B as responder. So -- I want to connect you, this is my random number. And device -- thank you for giving me and just computer. The E 22 -- and it takes as inputs the address of the bias B a pin number inserted and the length of the pin and random previously created -- there is no check if the link created is the same. Actually this check happens later when is the authentication procedure? And at that time it works in this way. Just sends random number to the claim meant. And -- device A which computes the same exact applies the same exact and check it is if the two are equals. This time if they are equals the authentication happens. But this is the link previously generated but here a lot of exploits. And after version 2.1 it comes the simple pairs. Device A generates a number and device B makes it the same. But another random number then they previous and this pairing mechanism the two devices have already exchange -- PKA. So device B will send the result of this computation of this -- to device A. And work welled and some result and check. Each one computes a number and the users the last step on their display they visualize the final number and they have to say, okay, it is the same in both sides in order to compare the pairing. The last thing about blue tooth energy. There are 3 different keys to establish that connection and the nice thing about this is that after the temporary key -- the way is generated is written in plain text. The problem is that if I'm able to decrypt the PK I'm actually to get the start term key and the long term key from this procedure and it is a problem. If the pairing -- just works. The pairing -- the PK is set to 0 so simple. If it is 6 digit pin -- and it is can be easily blue force using the -- less than one second. EPT is out of band it means is that the passage is transmitted in spectrum band. It is not so easily to be detected. So I just wrote, fuck yourself because it will be kind of impossible -- but never say never. So if we get the short term key and the long term key and answer to all questions or -- so that's it for this part. I will leave one sentence, my professor used to say in his lecture. The out band, because if you are sure you're fucking someone, the saying well you will never find it. Look at your back because sometimes there someone who is going to fuck before you so be careful doing this. So I leave this, my friend. >> Okay. So -- [ APPLAUSE ] >> Okay let's go on some new stuff. So a little over view of what's smart lock is. Is a -- introducing Android 5.0 lollypop and it enables the user to unlock his smart phone -- this condition could be locational lock where the user can set like Joe -- the Android smart phone is automatically unlock. The device -- previously safe -- and then we have the face unlock which is just your metric face scanner of course and the safe must be saved before. And then we have body unlock. I have no idea what it is. The smart phone is in contact with a body not your body. So your smart phone will be unlocked also with my hand. Any way. And then we have the blue tooth unlock which we are interesting now. So the blue tooth unlock maybe is the most use feature when I'm in my car and I'm driving and I should not text. I can bypass lock screen and text. And practically the user must say okay I have this pair device and I can mark one of them or more of them one or them as trusted and then from this moment every time I am connected to this device I don't have to do pin code, what's the problem. The problem is that in Android version 5.1 the link -- is not checked. What does that mean? It means that I ever have previous safe connection. I mean the link is not necessary for the connection. So basically out of blue tooth unlock works. I have to initiate the connection by the smart phone or blue tooth device itself and we have 2 possibilities. If the -- blue tooth device is known we do not have to check link and get details from the device. Like what kind of device is it or you know -- enable something like that. Otherwise it is not known and we have to start authentication process and then we can do all the other stuff and then the connection. So from this picture you can see there is only one thing we need to know to create a connection to the Android device which is -- Mac address. You just need to know 4 bytes in blue tooth. The least significant in order to establish the connection. We have 2 possible solutions. The problem -- expensive and after all is not that good either. Solution as some comes to require -- the victim. The target can become aware of you which you try to -- your computer and you need to authentication process no order to get the 4 device of the net address. So we said the blue force is low because the mac address cannot -- we have establish a new connection with a new address and it takes time each time. It is expensive because if we try to speed up the process -- and create new connection with each and so we have to buy all those numbers and as I said before is not a good idea because we have 32 bits of data is not possible after all. And the other idea is sniffing. As I said before also problems. Have you to be near the victim and in order you are you're -- the connection to intercept and you need to intercept an authentication process to get the whole megabytes you need and is not that easy and the target can become aware. Because you know we are not normal people. They saw strange way. I mean if you are in Starbucks playing around -- it can become a problem. I saw -- I won't become this guy. [ LAUGHTER ] >> If anyone know who he is, please -- any, let's go on. So our solution is like enable approach. We know another thing about Android device. Also this thing is true for other devices. Like in my car, Android automatically sends -- wireless Wi-F solution and Android does the same thing. Sending out part of your mac address. So since the trusted device must be already been paired with the Android device the B con contain -- so we can intercept those -- retrieve free bytes with the mac address -- more over the only the last byte we need is also the part of the manufacture part of the mac address so the real possibility are much way less. Okay know we have a little demo showing you how it works. I'm sorry that the video is a little messed up. I -- >> You fucked up. >> Yeah, I'm sorry. And we recorded up that night so you know, Vegas, parties. Okay so I tried to explain it. Okay so how does it start? I have this Window solution. Just a second. Okay. Basically what we are doing now okay, go on and back sorry. Okay. We have our mac address for our computer and what you are doing now scanning if there are some device actually we are looking for specific device which is our my ahead phone. Come on. Okay. And so the highlight mac address is my headphone -- with my ahead -- please. And okay so we need to spoof this address in order to create a connection. So we use -- in order to do that and after some glitch of the video we should see that the mac address is now changing. Interface to apply the change and when you -- just to make yeah, the device the computer blue tooth visible so they Android phone can scan us and try to connect. So we start HCI down with just intercept and HCI pockets in order to see what's going on and then from, this is my -- my tablet --.0.1. And we start blue tooth get automatic connect my tablet. Just a second. My tablet -- after the connection starts. You can see tablet you let you see here at the bottom open and I lost -- browse it and this works for a fix amount of time and after that the Android device tries to send it out and since the link is not the same because we do not have the same link. The connection is dropped. Okay I got notification and here we are. Pretty much -- so that's the way it works. Actually we didn't root force anything because we did not have time to create proof of concept. We will try to produce that in the near future. Okay so is nice we only have one problem that our Android device sends out -- out to fix it. When actually Android 5.0 has -- a nice feature from the last screen I can choose which device I want to connect to so I can send B codes for just device. So if I see a computer -- as Mark or something that has more possibility. So another little demo for you which actually just showed this thing. Let's open it works. Okay so this is my computer with Uber tooth scanning. Intercepting -- from my smart phone I just enable blue tooth and we will see that okay. We will see that automatically try to connect to my headset and LAP which is the part of the free bytes of the mac address we need to establish that connection. And now we need of course one byte and this is done without the hand set near the smart phone. So there is no need to have both of the devices together. Okay so this is fixed actually in Android 5.1 I think. Android security fixed it. So the link checked it. And by there is problem because the API is not fix yet. So if your Android device with a version prior 5.1 you have a smart unlock feature. So don't enable it and otherwise the only the API are -- so that means there no me today to check that the blue tooth device and your Android device is in an encrypt channel. There is no way to check that the link is correct. We told Android -- check it is link and this is the method actually. But is not present in the SDK yet and the -- so actually thing they probably implemented in Android A or probably whatever. So Android smart phone is fixed so we are pretty face, right? No because we have third part application and actually there is some application which use speaker, smart unlock Android device. So if you don't have lollipop. You can down load the application and set all the things so then we're like, this video is really messed up I think we really drunk, really drunk. You probably won't see any of that. We should not tell them what time we recorded that video? >> No? It was in the morning it was totally fine. >> I'm sorry I tried to explain what you should see. Okay actually we have our completely -- Coca Cola and start interface and we see that the device -- so we just need to make the computer in visible to other devices. That's what I'm talking about. Is what we were seeing maybe. >> Don't say that. He was recording. Okay so wow. Okay we put the device in visible mode and then we start an HCI dam again to see what's going on and we move to my tablet with Android.4.4 something. Down load the blue tooth it tried to automatically connect to the blue tooth. You see? Very shitty video. We have the connection is terminated right after that but we actually have time to unlock to tablet and you know browse the video browse the photo. We have picture, whatever. You know. Is not your device. So after that the connection so drop the lock screen is enable again but if you already unlock the device you can just don't lock it again, browse it bring it hope and whatever. So okay, thank God the video is over. And let's go to future works. >> Suggest a few things about our future works. [ APPLAUSE ] >> Thank you. >> Yeah. Okay, something about your future, as you know probably the I of the word is growing up very fast and quick. So if the devices are going to be more and more maybe they're following something like more slowly. Everything is more spread over the word and so we are focusing our next research. Those devices. And by -- by the time right now we have some concepts about smart locks which are those kinds of locks. >> Is smart locks. >> Yeah. So please choose those locks for your door. They're completely secure. Send us where you live and we will make a check if is working. >> We can have dinner together. >> Bring coffee yeah, so smart lock we have one and we just bought. And we are going to spend some time on it and then some other devices like -- band and like Joe band and fit these bands that are working on low energy. So maybe you will see us next month with new things I hope so and just want to thank you for your patient and willing to come here and look at our -- >> Really thank you. >> And now is QA time. Q and A time, you have to ask question, you know. >> Not go away time. >> Go turn off your blue tooth. >> Question over there. Yeah the white paper all this lights I think I won't put the videos but everything else will be online. Probably on the DEFCON web site. Other questions? Don't be shy. >> We got time for a couple of more question but if you are leaving leave with the right through the backside. Not this way. The right side. >> Can we have microphone for that guy over there? I can't hear you sorry. Oh. Windows phone. Is new brand you know? Sorry. Smart phone. Is called Vanalock. And we both is quiet expensive I think. I paid like 300 dollars or something like that but we actually try to get some money to buy other locks as well. I don't remember the other names but we want to try 3 to 4 locks. Some things we have in mind. Anything else? O yes? Smart car? I never saw smart car with blue tooth? >> You have one? Machine, sorry. No. Because I'm poor I don't have a car. I'm joking I don't have a car with the possibility to unlock it with blue tooth. Yeah. Okay can we have a microphone, please? Because I'm -- I can hear -- thank you. >> Have you guys worked with the Apple home kit yet? They are trying like -- IOT stuff to qualify for home kit? >> No we actually don't, sorry. >> I recently ran across a new target for you guys, blue tooth vending machines paying system for you. >> There is no vending machines in Italy, sorry. >> There is one if you want to go mess around with it in the comic -- >> Just give me the answer. >> Anybody else? We will bring -- if there is any other questions. I'm not done talking yet. Okay now you can clap. >> Thank you once again.