00:00:00.000-->00:00:06.773 >>Okay so. Good afternoon DefCon. Um thank you very much for taking the time to be here 00:00:06.773-->00:00:12.646 and I hope you’ll walk away from this talk having learned something interesting and new. 00:00:12.646-->00:00:17.651 And if you have please do let me know about it. So what this talk is about. Um, with the 00:00:21.855-->00:00:28.262 introduction of shared bicycles and it’s rise in popularity all around the world um I’ve seen 00:00:28.262-->00:00:35.269 bicycles all over the place regularly used by people who pay a token sum to use them. Um this 00:00:35.269-->00:00:41.275 got me wondering how the lock system works and how secure it would be. Would it be possible 00:00:41.275-->00:00:47.748 to hack the lock and get free rides? It doesn’t cost much to rent a shared bike but wouldn’t 00:00:47.748-->00:00:52.753 it be fun to hack a lock? My name is Vincent, I’m from Sunny Singapore. I’m currently a 00:00:55.155-->00:01:00.093 security consultant at MWR. And hacking mobile and wireless is my thing. In this talk I’ll 00:01:05.666-->00:01:11.638 first give a quick overview of the bike sharing economy. And the locks used on by shared 00:01:11.638-->00:01:16.643 bicycles. I’ll do a quick recap of BLE for those of you who unfamiliar. Then I’ll move onto 00:01:19.613-->00:01:25.018 walking you through how I analyze communications between my IOS device and the BLE lock. 00:01:25.018-->00:01:30.023 What worked, what didn’t and how a key can be built from what I’ve learned. And a small demo 00:01:32.092-->00:01:37.097 of a net I’ve built to get rides for free. So I’m sure by now uh we all know that smart locks are 00:01:41.835-->00:01:46.840 rubbish. Um, haha. The state of security now is terrible because and I could be wrong, companies 00:01:50.644-->00:01:55.549 only care about features and getting to market as soon as possible. They don’t care about 00:01:55.549-->00:02:01.455 designing a scale lock and they aren’t performing any tests to test the validate the security 00:02:01.455-->00:02:08.261 of the solution. Take for example, Tapplock the latest smart lock to be hacked. It 00:02:08.261-->00:02:13.500 talks about having all these incredible security features such as encrypted fingerprint 00:02:13.500-->00:02:19.840 reader, AES 128 bit encryption and tap lock alarm but ultimately it got hacked in 2 00:02:19.840-->00:02:24.845 seconds. So what is the situation of these guys? These are the 3 largest bike sharing 00:02:28.782-->00:02:33.787 companies in Singapore. Ofo and Mobike being companies from China and oBike a local 00:02:36.323-->00:02:41.128 Singapore start up, which unfortunately has just filed for bankruptcies not too long ago. 00:02:44.164-->00:02:49.636 These guys have operations all over the world and have pretty high valuations. Across all 00:02:49.636-->00:02:51.638 companies the cost of renting a bike is 50 sing dollars per half hour which roughly equates to 37 00:02:51.638-->00:02:53.640 cents USD. So before all the juicy bits, um a quick refresher on what Bluetooth low energy, 00:02:53.640-->00:02:58.645 aka BLE is. There are 2 key things to know to never get your way around. Um the first is GAP, 00:03:15.562-->00:03:20.567 or generic access profile. This basically defines what the device is. Devices are split 00:03:22.669-->00:03:28.241 into 2 categories. Peripheral device and central device A peripheral device is a low 00:03:28.241-->00:03:34.648 powered device, it could be a bicycle lock or a pacemaker. And the central device is your 00:03:34.648-->00:03:39.653 high-powered device such as your mobile phone or your laptop. Then comes the generic attribute 00:03:42.622-->00:03:48.862 profile or GAP. This defines the way that 2 Bluetooth low energy devices communicate with each 00:03:48.862-->00:03:53.867 other. Um, each BLE device will have 1 or more services and within each service it will have 00:03:56.536-->00:04:02.943 1 or more characteristics. Services are groups of character sticks and character stick is a 00:04:02.943-->00:04:07.948 data point, both of which are identified by a 16 bit or 128 bit UUID. In the case of a 00:04:10.550-->00:04:17.157 treadmill for example a data point can be the step climber data, speed, inclination or 00:04:17.157-->00:04:23.029 heart rate and in the case of a Bluetooth lock the data could be the battery life, or the unlock 00:04:23.029-->00:04:28.034 mechanism. So, uh let me give you an example uh an idea of what the bicycle lock this, how 00:04:38.245-->00:04:44.284 it looks like and how it operates. How do you pick a lock when you don’t actually own the 00:04:44.284-->00:04:50.323 lock? Um, my first trouble came when it was time to figure out properly how a bike lock would 00:04:50.323-->00:04:55.328 work. Since I pretty much zero experience in Bluetooth or lock mechanisms I decided I should go 00:04:57.430-->00:05:02.369 buy one instead. Quick search on China’s beloved shopping site TowPow quickly came upon this. 00:05:05.805-->00:05:10.810 One smart bike lock appears to operate the same way and apparently the company also OEMs 00:05:13.146-->00:05:19.953 the entire solution to bike sharing companies. Um maybe one of my targets will use it. In 00:05:19.953-->00:05:25.792 essence this is how the entire process of renting a bike works. You download one of the apps, 00:05:25.792-->00:05:32.299 all for mobi-mobile what have you, enable Bluetooth, find your account, scan the QR code on the 00:05:32.299-->00:05:38.104 bike and the bike will automatically unlock. These bikes have a small solar panel 00:05:38.104-->00:05:45.111 to charge the battery and the lock. And most of the locks do not come with built in GPS. GPS 00:05:45.111-->00:05:51.384 data is provided by a phone. Wherever you cycle to and finally dock the bike the app 00:05:51.384-->00:05:56.389 will record it and send it off to the cloud via HTTPS. The, there are cost more expensive 00:05:58.792-->00:06:03.730 locks which do have in built GPS. So the first thing I did like any good hacker does, is to 00:06:07.434-->00:06:14.207 tear apart upon receiving it. Um this is a tear down, the lock with the QR code on the left and 00:06:14.207-->00:06:19.212 the 4 cell battery inside. Um this lock charges via USB. This is the logic controller with 00:06:22.682-->00:06:27.687 Bluetooth radio and the motor that releases the lock. So it’s a spring-loaded lock and the 00:06:33.126-->00:06:38.131 lock is held in place with a pin in the notch. When the unlock command is received the motor 00:06:42.269-->00:06:47.274 will the engage to release the lock. So time to actually look at how the lock and app are 00:06:52.112-->00:06:57.117 communicating. Um again I had no idea where to begin, how Bluetooth works, uh etcetera. I 00:06:59.386-->00:07:04.557 turned to a great presentation by Slawomir Jasek, sorry if I mispronounced your name. Uh 00:07:04.557-->00:07:11.298 where it was, effectively man in the middling the Bluetooth connection, thus allowing the 00:07:11.298-->00:07:15.368 modification of packets um unfortunately I wasn’t able to get the setup working for that. 00:07:15.368-->00:07:20.006 Then I found another fantastic presentation by Anthony Rose and Ben Ramsey from DefCon 24 where 00:07:20.006-->00:07:25.011 they used an Ubertooth One to sniff BLE packets and then used the Wireshark to figure out what 00:07:29.749-->00:07:34.754 was going on. Um, but for the life of me I couldn’t figure out what was happening. So this is a 00:07:38.058-->00:07:43.063 example capture that I took. Um, this shows a capture from the Ubertooth One. Um, and the BLE 00:07:46.266-->00:07:52.005 write request and response. Again they land on the same rows I’m going on but after this a 00:07:52.005-->00:07:57.010 packet was sent the lock opened. So, I basically replayed the bytes on this packet with no 00:07:59.946-->00:08:05.418 result. Again I have no idea what’s going on. [laughter] So back to the drawing board. Um I 00:08:05.418-->00:08:11.858 forget I needed 2 things that be able to help me figure out what is going on. First I needed to 00:08:11.858-->00:08:17.897 figure out how to get communicated with the lock, what would the end points that are 00:08:17.897-->00:08:22.936 communicate with, what were the services and characteristics that the app communicated with 00:08:22.936-->00:08:28.108 and second how I could intercept the BLE traffic to understand what was going on. For the first 00:08:28.108-->00:08:34.314 problem, I needed a way to figure out and understand how the app communicated with the 00:08:34.314-->00:08:39.419 lock via Bluetooth. After doing a little more Googling I had found a tool written by Evil 00:08:39.419-->00:08:44.424 Socket BLEAH. You may know Evil Socket as the author of the more famous Better Kept toolkit. So 00:08:47.427-->00:08:52.766 what BLEAH does is that it essentially enumerates the services and characteristics of 00:08:52.766-->00:08:57.771 any BLE device. This allows one to see in a practical manner what services there are on a 00:09:00.140-->00:09:05.145 device and what characteristics can be written or read from. In this screen shot you can see at 00:09:07.714-->00:09:12.719 the bottom the different characteristics that can be read from or written to. For my 00:09:17.223-->00:09:23.329 second problem um, since I have the app and I have the lock it all comes down to understanding 00:09:23.329-->00:09:28.334 the process of what BLE messages are sent to unlock the lock. I turned to Frida and Frida-trace 00:09:31.070-->00:09:37.877 tool which allowed me to view in real time what the app was processing. Those of you who 00:09:37.877-->00:09:42.882 have not used Frida before it is a wonderful tool to allow instrumentation of applications 00:09:44.951-->00:09:51.357 across various platforms. In particular the Frida tool used on the iris platform allows 00:09:51.357-->00:09:58.164 users in essence to lock in relatively real time all objective C classes and methods 00:09:58.164-->00:10:03.169 and C functions which are accessed and executed by the application. Since we can use 00:10:05.538-->00:10:11.911 Frida to hook and view methods and messages we now need a way to f-ehm we now need to find 00:10:11.911-->00:10:18.084 which ones to hook. In IOS the CoreBluetooth framework is used to perform Bluetooth 00:10:18.084-->00:10:23.089 communications. The CBPeripheral and CBPeripheralDelegate classes are the most interesting and the 00:10:26.392-->00:10:33.366 readvalue, writevalue, and setnotifyvalue are methods of interest. Um, it is quite 00:10:33.366-->00:10:39.839 obvious what these methods do. Readvalue, reads a value from the characteristic. Write value, 00:10:39.839-->00:10:44.844 writes a value. And another interesting property of BLE is that it is possible to get a 00:10:47.147-->00:10:52.152 peripheral in this case, a lock, to push messages to the application. Um this is done 00:10:54.654-->00:10:59.158 through the notify property of the characteristic. And it can be enabled by the 00:10:59.158-->00:11:04.097 setnotifyvalue. We can then capture the push message by tracing the d-update methods of 00:11:08.401-->00:11:13.406 the CBPeripheralDelegate class. So after a lot of reversing of the app, um proxying of traffic 00:11:19.345-->00:11:23.950 and recording of BLE reads and writes, um I’ve come up with the following process to unlock the 00:11:23.950-->00:11:28.955 bicycle lock that I bought from China. Um, obviously scan the QR code, the app will again, will 00:11:31.124-->00:11:36.129 then get the unlock key from the server, the app makes a, the server responds with key, the 00:11:40.733-->00:11:47.373 app makes a request to the lock for an encrypted token by sending the write request, lock 00:11:47.373-->00:11:53.580 responds with the encrypted token through the notify property. The app decrypts the 00:11:53.580-->00:11:58.585 token with the key from the server, sends a write request and it unlocks. So this is the 00:12:01.988-->00:12:06.292 challenger response process where the lock will provide a token and if you have the 00:12:06.292-->00:12:11.164 corresponding key you’ll be able to decrypt the token and send the result back to the lock. Um, 00:12:11.164-->00:12:16.169 by the way if it isn’t already clear the security of the lock is horrible. Um I can retrieve 00:12:18.805-->00:12:25.111 any key for any lock from the server by just incrementing the lock ID for this company. 00:12:25.111-->00:12:30.116 [laughter] And they make a whole bunch of locks. [applause] So let’s try this again is 00:12:36.089-->00:12:41.094 available. Um, now we’ve seen how such a lock could work and the steps needed to understand 00:12:43.763-->00:12:49.736 how it works. What methods to hook and what kind of operations the app and the lock may 00:12:49.736-->00:12:54.741 perform. How does it compare to an actual lock used by oBike? For the most part the hardware 00:12:58.244-->00:13:04.217 looks pretty much the same. Um someone did a YouTube video tear down of the lock as you can see 00:13:04.217-->00:13:10.356 here we have a single cell battery, um the lock hardware and a Texas Instruments CC2541 00:13:10.356-->00:13:15.361 SOC chip. Now let’s find the service and characteristics UUID’s that could be of 00:13:19.999-->00:13:25.004 interest. Again with BLEAH um, we know what could be of interest but we don’t’ know how 00:13:28.441-->00:13:34.414 they are used. To figure this out I traced the entire flow of the app to identify which 00:13:34.414-->00:13:39.419 characteristics was most used. And as it turns out communications went to the FFF6 00:13:41.888-->00:13:46.893 characteristic. To guide you through the next couple of slides I have laid out the flow 00:13:48.961-->00:13:53.966 here um to show you the process in unlocking the lock. First you scan the QR code. The app checks 00:13:57.804-->00:14:02.775 the locks status with the server and also sends it your coordinates. The server responds 00:14:02.775-->00:14:07.780 with the locks status and if okay, the app will then proceed to request an unlock token from 00:14:10.249-->00:14:16.856 the lock. Within the app, and history view request made to the server this is known as the key 00:14:16.856-->00:14:21.861 source. So the app response, we have the key source, um sorry, the lock response or the key 00:14:24.197-->00:14:30.870 source. That then uses the key source to request an unlock key from the server, server replies 00:14:30.870-->00:14:35.875 with the unlock key from the lock. And app uses it to unlock the lock. So similar to the lock 00:14:39.746-->00:14:46.252 that I bought off PowPow, um it appears to use some sort of challenger response mechanism. 00:14:46.252-->00:14:53.025 Let’s go through all of that in a little bit more detail. Scanning the QR code provides 00:14:53.025-->00:14:59.332 the app with the ID number of the lock and as seen in point 1 um the QR code is essentially 00:14:59.332-->00:15:04.270 the URL with the bike ID at the end. Assuming you have used the oBike app to scan the QR code, a 00:15:06.439-->00:15:11.677 request is made to the server with the lock ID and the current coordinates of where the lock 00:15:11.677-->00:15:18.417 must scan. The server response to the status check with whether the lock is faulty or not based 00:15:18.417-->00:15:23.422 on reports from other users and if it’s not the app will proceed with next step. Share the app 00:15:27.059-->00:15:33.432 request for a key source from the lock um, this can be a little bit confusing so let me 00:15:33.432-->00:15:38.437 explain. As I mentioned earlier it is possible for a peripheral device to send push 00:15:41.541-->00:15:46.546 notifications also known as notify in BLE back to the app. As shown here the app helping 00:15:51.384-->00:15:57.824 the notify flag in the FFF6 characteristic. Next the app sends a request for the key 00:15:57.824-->00:16:02.762 source to the lock by performing a BLE write. Um, in this case a dump of the BLE write memory 00:16:04.964-->00:16:11.470 location shows that the write command is in the form of the fallen bytes. 67, 74, 0, 0, 81, 00:16:11.470-->00:16:16.475 81. And that it is being sent to the same FFF6 characteristic. So the app now waits. If the 00:16:21.380-->00:16:27.753 command sent was correct and accepted by the lock the lock will respond with the token or 00:16:27.753-->00:16:32.758 the key source. This is a response. You, we can see the response to the trace of the 00:16:39.398-->00:16:43.469 didUpdateValueforCharacteristic method. And we did a response, the app picks out the key source 00:16:43.469-->00:16:48.474 as shown. Um, what the data means I have no idea. But I don’t need to know, because 00:16:51.344-->00:16:57.516 every time this transaction happens the key source is always located in the same location it 00:16:57.516-->00:17:02.455 is always taken from the ninth to the twelfth bytes. The key source is then sent to the 00:17:05.258-->00:17:11.197 server through the unlock pass API and assuming there are no errors the server responds with 00:17:11.197-->00:17:16.202 a payoff keys. So now we’ve got the keys, uh how are they used? The unlock message is 00:17:23.609-->00:17:29.548 constructed and sent to the FFF6 characteristic in 2 parts. As you can see the 2 write value 00:17:29.548-->00:17:34.553 messages. And below is the dump of how the actual message is or what the actual message is. Um, 00:17:39.892-->00:17:43.729 this looks roughly like the message that we tried replaying earlier from the Wireshark which 00:17:43.729-->00:17:50.136 didn’t work. So I dug a little deeper into how the unlock message was constructed and 00:17:50.136-->00:17:55.141 tried to piece together what the different values meant. After looking at numerous unlock 00:17:57.376-->00:18:02.782 message um I found the following. IN the first tow messages, um sorry, in the 00:18:02.782-->00:18:07.787 f-first message the first 2 bytes are static throughout all messages sent from the app to 00:18:10.356-->00:18:15.361 the lock whether its’ an unlock message or any other form of message these 2 bytes are used. 00:18:17.964-->00:18:22.902 The next byte is a length of message which is also static from the unlock algorithm. Ehm. 00:18:22.902-->00:18:27.907 Next byte could be a command byte to unlock the lock together with the key index. Then the 00:18:35.114-->00:18:40.519 subsequent 6 bytes are static. Again I have no idea what they’re used for and the final 5 00:18:40.519-->00:18:47.393 bytes of the message are the date time stamp. Message 2 contains the key from the server 00:18:47.393-->00:18:53.366 however this has been truncated to 12 bytes um why this has been done, I’m not sure and the last 00:18:53.366-->00:18:58.371 byte is a checksum. Uh this is done by performing an XR of each byte across both messages. Now, 00:19:02.842-->00:19:07.847 um I had to jump through a couple of hoops along my journey. The first was trying to 00:19:12.051-->00:19:18.257 understand what was sent from the app to the server. And as you can see here the messages 00:19:18.257-->00:19:23.262 look to be encrypted. Why the programmers would encrypt the messages sent to the server is 00:19:23.262-->00:19:28.267 beyond me and they’re just wasting their time and my time. [laughter] With Frida hooking 00:19:31.037-->00:19:33.039 the right messages couldn’t be easier. Um I found that the messages were encrypted using 00:19:33.039-->00:19:35.041 AES with a combination of a static string and a version number of the application 00:19:35.041-->00:19:40.046 provided in the HTTP header. As seen here. So okay, encryption kill. Um for those of you who 00:19:52.525-->00:19:57.997 have noticed there is a string tacked to the met, ehm tacked to the back of the message sent to 00:19:57.997-->00:20:04.970 the server. Mmm, what the heck is that? Again, the developers implemented some form of 00:20:04.970-->00:20:09.775 integrity check, uh for some unknown reason to waste time uh with further assistance with 00:20:09.775-->00:20:14.780 Frida that string I found was a Sha1Sum of the following values. The data that’s actually to be 00:20:20.052-->00:20:25.057 processed by the server, aesthetic string and the application version. Now you 00:20:28.828-->00:20:33.833 must be wondering how users get charged. Um, after the bike is unlocked the app sends lock 00:20:36.569-->00:20:41.574 status to the server informing it, it has been unlocked. And to start a timer. Once you’re done 00:20:47.880-->00:20:52.885 writing the app will then send the lock status again to the server to stop the timer. Lastly 00:20:59.759-->00:21:04.697 you’re built for the amount of time that’s been used. So, um, if I actually write my own app, 00:21:07.133-->00:21:12.138 to perform the unlock and hop all further communications with the server after unlocking the 00:21:16.142-->00:21:21.147 bike, I get free rides. After the, whoops after jumping through the hoops uh and 00:21:29.455-->00:21:36.028 understanding how the BLE communication works and how the unlock command is built, I built 00:21:36.028-->00:21:41.033 my own key. Sorry the video is a little bit dark but here I am entering the lock ID into my 00:21:48.941-->00:21:53.946 app, waiting for the server [loud beep] that’s the unlock sound. [loud beep] [applause] 00:22:05.324-->00:22:10.329 Thank you. [applause] So, if you’ve, if you’ve not, noti- noticed um opening the lock 00:22:12.531-->00:22:18.304 depends on the connection to the server. Um, how can you then unlock it offline? Since oBike 00:22:18.304-->00:22:24.410 has recently gone bankrupt um someone dismantled the lock from the bike, retrieved the chip and 00:22:24.410-->00:22:29.548 sent it over to me. Haha, [laughter] my solution was to try and get the dump of the 00:22:29.548-->00:22:35.721 firmware uh to figure out how the unlock algorithm works offline. Unfortunately the 00:22:35.721-->00:22:41.193 readout fuse was set on the TI chip and it was not possible for me to dump the firmware. If 00:22:41.193-->00:22:46.198 anyone of you knows how to get around this, I like to hear from you. Okay, uh if was relatively 00:22:53.005-->00:22:58.010 easy to unlock the lock from 1 bike sharing company. Uh should be relatively easy f- to do it 00:23:00.679-->00:23:05.684 for another. No? I tested the process against MoBike. Same thing. We start off by finding 00:23:09.655-->00:23:15.995 the services and characteristic UUIDs that could be of interest. Um, looks to be a lot simpler 00:23:15.995-->00:23:22.067 here only 2 characteristics and it is obvious which we need to write to, to unlock the bike. 00:23:22.067-->00:23:27.072 Moving on. For MoBike the process in unlocking the lock is much simpler same as before. You 00:23:31.410-->00:23:36.415 scan the QR code, you get a bike ID, app sends the lock status to the server, also sends your 00:23:41.253-->00:23:46.258 coordinates, server responds with the lock status. However um this time if the lock is good 00:23:48.494-->00:23:53.499 the server will also send along the unlock key immediately. The app then uses the key to unlock 00:23:55.834-->00:24:02.675 the lock so no challenger response mechanism here, it’s just a direct unlock. As before 00:24:02.675-->00:24:07.680 let’s go to all of that in a little bit more detail. Similar to oBike after the bike is 00:24:10.683-->00:24:15.688 unlocked, lock status send to the server, timer starts, when you’re finished, you lock the 00:24:17.790-->00:24:22.795 bike, timer stops, user account is charged, again if we cut off the messages after the unlock 00:24:24.930-->00:24:29.935 you don’t get charged. Similarly, I encountered various crazy integrity checks 00:24:34.173-->00:24:39.178 implemented by the developers in this. The HTTP m-messages for the oBike app um there’s a sign 00:24:42.014-->00:24:47.019 parameter and there’s an EP data. How are these formed? In this case they used RS 00:24:52.324-->00:24:57.329 encryption to encrypt a user ID string to get the current date time. And the output of that is 00:24:59.531-->00:25:04.470 used in messages sent to the server. The sign parameter is the MD5 hash of the data that’s 00:25:06.538-->00:25:11.543 sent to the server. After going through all of that again the process starts out the same, 00:25:14.079-->00:25:21.019 user scans a QR code, QR code contains a URL with the bike ID at the end, assuming you’ve used 00:25:21.019-->00:25:27.025 the MoBike app to scan the QR code a request is made to the server with the lock ID and the 00:25:27.025-->00:25:32.030 current coordinates of where the lock is scanned. However, um here is the difference. The 00:25:34.299-->00:25:39.938 application server will respond with the faulty message if the lock has been reported faulty by 00:25:39.938-->00:25:46.645 a number of users. Or it will immediately respond with an unlock key if the lock is in 00:25:46.645-->00:25:51.650 condition. This differs from oBike in that it doesn’t require a challenger response. So what 00:25:59.925-->00:26:06.832 happens with the key from the server? First according to trace the app tells the lock to set a 00:26:06.832-->00:26:11.837 notification by setting the setnotifyvalue to 1 uh seen here for the FFFEE0 and FEE1 UU IDs. 00:26:20.145-->00:26:25.150 Then the app breaks up the key into 3, 9 byte pieces appends a 2 byte header to each and writes 00:26:29.588-->00:26:34.593 it to the lock via Bluetooth and they’re unlocks. Again um to make it clearer, the queue 00:26:39.031-->00:26:44.536 response from the server is broken into 3, 9 byte pieces and an incremental header is now 00:26:44.536-->00:26:49.541 added and written to the lock and it unlocks. Straightforward and simple. In testing however 00:26:52.578-->00:26:57.583 uh I face 1 problem. It seem that the lock was able to keep track of time because every key 00:26:59.885-->00:27:06.625 received from the server for the same lock is always different. Additionally if there was a 00:27:06.625-->00:27:11.630 delay in sending the key to the lock it would not work. So after all that trouble I modify my app 00:27:16.468-->00:27:21.473 and, this time around I only programmed this specific [loud beep] id, so it would save me 00:27:26.478-->00:27:31.483 time and trouble. Let’s play that again. [loud beep] Okay. [applause] So there were 2 types 00:27:46.398-->00:27:52.337 of lock schemes um across a 3 locks that I faced. Um the first was a challenge response scheme 00:27:52.337-->00:27:58.777 where a challenge was requested from the lock, this data was then sent to the server to 00:27:58.777-->00:28:03.715 process. Or data was processed on a client side. Output from this processing was then sent to 00:28:06.385-->00:28:12.558 unlock the lock. The other type was a direct unlock of the lock based on a key provided by the 00:28:12.558-->00:28:17.563 server. So w-when I started um this journey um I had no idea how BLE worked and how 1 would 00:28:24.670-->00:28:29.675 begin looking at BLE devices. There was no process or one that I was aware of when I started, 00:28:33.011-->00:28:38.016 on how to look at BLE stuff. Um I hope given the following repeatable process uh anyone who 00:28:42.087-->00:28:48.360 has wanted to start breaking BLE devices would have an easier time. As with any project, we 00:28:48.360-->00:28:53.365 first need to enumerate our tech surface and I found this to be done easily with BLEAH as shown 00:28:55.701-->00:29:00.372 previously we can use BLEAH to enumerate the services and characteristics of any BLE 00:29:00.372-->00:29:05.377 device and understand what we communicate with. Then we find out if the device does send 00:29:09.147-->00:29:14.152 notifications to the app and if so we enable notifications by setting the setnotifyvalue. 00:29:17.456-->00:29:21.827 Lastly we hook into the appropriate ready and write methods to figure out what 00:29:21.827-->00:29:26.832 messages are being r-read from and written to the BLE device. And we also hope the didupdate 00:29:29.568-->00:29:36.041 methods to find out what notifications if any the peripheral devices send to the 00:29:36.041-->00:29:41.046 central device. So I didn’t make use of any special hardware such as the Ubertooth 1 or develop 00:29:44.883-->00:29:51.690 any special app, man in the middeling app, I used a Frida bluetooth dongle to enumerate a 00:29:51.690-->00:29:56.695 BLE device. I used my iPhone to help run the app and Frida to help with understanding the 00:30:00.766-->00:30:05.771 communications between the app and the lock. That’s all for me. Thank you for listening. 00:30:15.547-->00:30:17.482 [applause]