1 00:00:00,000 --> 00:00:04,640 Hi, this is Into the Droid. My name is Thomas Cannon. So thanks for turning up to this talk. 2 00:00:05,680 --> 00:00:10,760 I'm presenting this on an iPad for the first time, an Android talk on an iPad. So I've got my 3 00:00:10,760 --> 00:00:18,160 hipster bases and my geek bases fully covered today. So why is this talk useful? Why should 4 00:00:18,160 --> 00:00:23,520 you care about it? So I'm going to talk about how to get into an Android device. This is 5 00:00:23,520 --> 00:00:31,360 important if you live in an oppressive regime like the U.K., for instance, where you can be 6 00:00:31,360 --> 00:00:36,260 stopped and searched on the street. And the U.K. recently acquired some forensic equipment so 7 00:00:36,260 --> 00:00:42,460 that when they stop you on the street, they can access your mobile phone and take your data 8 00:00:42,460 --> 00:00:48,160 off to then later see if it's useful. So I'm going to talk a bit about how some of the 9 00:00:48,160 --> 00:00:52,720 technologies work there, how these devices might work, how you can do it manually. Also 10 00:00:52,720 --> 00:00:53,500 important, if you live in a country where you live in a country where you live in a country 11 00:00:53,500 --> 00:00:57,300 where you live in, if you lose your device, what techniques Black Hats have available to 12 00:00:57,300 --> 00:01:04,500 them. I can't really talk about how to defend against these. The company I work for, the 13 00:01:04,500 --> 00:01:09,200 clients, wouldn't really appreciate us telling you how to prevent them getting at the data. 14 00:01:09,660 --> 00:01:14,800 But hopefully it will give you some ideas. Okay. So the company, I work for Via Forensics 15 00:01:14,800 --> 00:01:23,260 based in Chicago. I work in the U.K., but the headquarters is in Chicago. It's a mobile 16 00:01:23,260 --> 00:01:30,020 security and digital forensics. We've got a strong R&D team, quite talented. And you may have 17 00:01:30,020 --> 00:01:37,980 heard my colleague Jonathan Jarski speak at Black Hat last week. My name is Thomas Cannon. I'm 18 00:01:37,980 --> 00:01:44,320 the director of breaking things internally. That's what I'm known as. But my corporate title 19 00:01:44,320 --> 00:01:52,840 is director of research and development. So yeah, you may have guessed I'm over from jolly old 20 00:01:52,840 --> 00:01:59,880 England. I came over for this talk and missed the Olympics ceremony, the opening ceremony, which 21 00:01:59,880 --> 00:02:04,280 was last night. I don't know if any of you guys saw it. I was quite interested to see how we could 22 00:02:04,280 --> 00:02:12,220 match the epic Chinese opening ceremony. And so what did we do? Well, the Queen stepped up and 23 00:02:12,220 --> 00:02:18,440 they flew the Queen over the Olympic stadium in a helicopter in her pink dress and with James 24 00:02:18,440 --> 00:02:22,820 Bond. And she jumped out of the helicopter and parachuted into the Olympic stadium. And she 25 00:02:22,820 --> 00:02:28,960 flew into the Olympic stadium. That's true. I think that really captures the British spirit, you 26 00:02:28,960 --> 00:02:36,960 know. Our best ideas really come after about nine pints of beer. So this presentation may or may 27 00:02:36,960 --> 00:02:45,360 not speak to that. Okay. And my day job is reverse engineering Android applications for 28 00:02:45,360 --> 00:02:52,740 government, corporate, blah, blah, blah. Challenges. Challenges of getting into Android 29 00:02:52,820 --> 00:02:58,140 devices. So ADB, I'm not going to go into detail about what that is, Android debug bridge, but 30 00:02:58,140 --> 00:03:03,940 it's if it's enabled, it's a method of accessing your Android device over USB. You can do you can 31 00:03:03,940 --> 00:03:08,460 get a shell up. You can get the data off. It's off by default. And from experience of dealing 32 00:03:08,460 --> 00:03:15,580 with real devices, from real cases, it's usually off. Screen lock is usually a screen lock on as 33 00:03:15,580 --> 00:03:22,800 well. And they can be they can be a pain. Code signing for updates. I'm going to talk a little bit 34 00:03:22,800 --> 00:03:27,140 about that. So some of the techniques we're going to talk about require code signing to be 35 00:03:27,140 --> 00:03:32,240 disabled, because you can't just load an update or load your own boot image. And encryption. I'm 36 00:03:32,240 --> 00:03:38,260 going to cover encryption and how we attack it, how we crack it, Android full device encryption. 37 00:03:39,900 --> 00:03:44,960 And there's a golden rule here. Android devices are very different at the level that we're talking 38 00:03:44,960 --> 00:03:52,520 about between the manufacturer, operating system version, model. A Galaxy S2 isn't just a Galaxy S2. 39 00:03:52,520 --> 00:03:56,300 There are different versions of them. So the golden rule here is when I talk about a technique, 40 00:03:56,520 --> 00:04:05,760 the implementation can actually vary. Your experience may differ from our experience. So bootloader 41 00:04:05,760 --> 00:04:13,900 essentials. We use a bootloader to gain access to the device before the system fully boots. We can 42 00:04:13,900 --> 00:04:19,620 use this under certain conditions to load our own boot image from where we can image the device and 43 00:04:19,620 --> 00:04:21,120 get the data off the device. 44 00:04:21,720 --> 00:04:22,400 To get 45 00:04:22,400 --> 00:04:27,520 into the bootloader, accessing the bootloader, there's a number of ways. It usually requires a special 46 00:04:27,520 --> 00:04:33,540 combination of buttons, like a three-finger combo, which may be power up, hold it down, press the 47 00:04:33,540 --> 00:04:41,420 volume up, hold the power down, and you get into bootloader mode. Devices vary. It may require an 48 00:04:41,420 --> 00:04:46,680 extra hand or a Vulcan deaf grip. But you just Google it and you find out how to get into the 49 00:04:46,680 --> 00:04:52,380 bootloader. Also from ADB, you can do ADB reboot bootloader, fastboot reboot. You can also get 50 00:04:52,380 --> 00:04:55,100 into the bootloader and have a bootloader service. There's a few ways. 51 00:04:57,560 --> 00:05:03,200 Protocols. Again, lots of different Android devices, different protocols, different methods of 52 00:05:03,200 --> 00:05:10,320 flashing them, loading RAM images. You've got RSD light, Motorola, SBF flash, Motorola, fastboot, 53 00:05:10,400 --> 00:05:18,840 HTC, Google, Odin, or Heimdall for Samsung. Flash tool for Sony. It's pretty challenging to support 54 00:05:19,260 --> 00:05:20,140 Android devices. 55 00:05:22,380 --> 00:05:27,080 So protection. There's either no protection or there's signature checks. You can only load the 56 00:05:27,080 --> 00:05:33,240 images that are signed by the manufacturer. If the device is rooted, there's a good chance that 57 00:05:34,020 --> 00:05:38,660 it's unlocked as well. It's nice back door access. But from experience, it's not common for 58 00:05:38,660 --> 00:05:43,340 devices to be rooted. I don't know, maybe criminals are not really into rooting their devices. 59 00:05:46,660 --> 00:05:50,280 Defeating the bootloader. I'm going to give an HTC example here. 60 00:05:52,480 --> 00:06:02,520 So in HTC land, they have S off and S on. That's security off and security on. If you boot into the 61 00:06:02,520 --> 00:06:07,300 bootloader, you can see if your device is S off or S on. S on by default, meaning it's secure. 62 00:06:09,380 --> 00:06:17,120 Assuming we don't have access to modify or patch the bootloader, sorry, SECU flag. It's the flag. 63 00:06:17,180 --> 00:06:22,360 It's in radio firmware. This flag is then used in the bootloader stage to determine if it's a good 64 00:06:22,380 --> 00:06:27,920 security on or off. So if we don't have access to modify the radio firmware or patch the 65 00:06:27,920 --> 00:06:33,140 bootloader, which you can do, you can patch the bootloader to ignore SECU flag, how do we get in? 66 00:06:34,120 --> 00:06:40,480 Well, there's a gold card. It's a specially formatted micro SD card. You can use it to bypass 67 00:06:40,480 --> 00:06:46,180 the carrier ID check when you're flashing custom ROMs. So this is one part of the equation. 68 00:06:46,500 --> 00:06:52,260 Also a white card. This is a manufacturer SIM card. It's really difficult to get ahold of one. 69 00:06:52,840 --> 00:06:58,440 It's used as a sort of authentication token challenge response to get into the device 70 00:06:58,440 --> 00:07:08,620 diagnostics used by the factories. Okay. So got a picture up on the screen. You can ignore most of 71 00:07:08,620 --> 00:07:18,060 this. It was part of something else that I mentioned later. But let's see. We've got a laser pointer. 72 00:07:18,280 --> 00:07:20,560 Right. So here's the SIM card. 73 00:07:22,380 --> 00:07:30,080 And this is going off to a device that's emulating a SIM card in hardware. You've got a micro SD 74 00:07:30,080 --> 00:07:36,720 card just up here. This whole long thing here in this circuit is actually emulating a micro SD 75 00:07:36,720 --> 00:07:44,880 card. But you can actually use a real micro SD card. This was used for a race condition attack 76 00:07:44,880 --> 00:07:50,500 on the micro SD card I'll mention later. And then just some power over here. Connect it up. 77 00:07:52,920 --> 00:08:00,000 Okay. So we're emulating the white card and we've got a micro SD card in. Then when you go into 78 00:08:00,000 --> 00:08:06,380 bootloader mode, it will automatically pick this up. And you can clear security. You can clear S 79 00:08:06,380 --> 00:08:14,700 on. White card is obviously not needed for CDMA phones because they don't have SIM cards. Once you 80 00:08:14,700 --> 00:08:20,560 have security off, you can RAM load a custom boot image which I'll mention later. This technique wipes 81 00:08:20,560 --> 00:08:21,940 most devices. Wow. 82 00:08:22,380 --> 00:08:29,120 That's a bit of a problem. But we actually tested it. You know, never believe everything you 83 00:08:29,120 --> 00:08:35,300 read. We tested it on some real devices and we were able to S off certain HTC devices such as an 84 00:08:35,300 --> 00:08:44,920 HTC Desire and the data was intact. You can try it yourself with an HTC clip. It's an 85 00:08:45,580 --> 00:08:51,320 enterprising hacker has produced a device to do just this for modding your phone and you can 86 00:08:51,320 --> 00:08:51,880 purchase it. 87 00:08:55,560 --> 00:09:02,440 So we have an unlocked or compliant bootloader. What do we do now? Okay. So some forensics 88 00:09:02,440 --> 00:09:08,900 devices use this. Next technique. They create a custom boot image, a forensics boot image. You 89 00:09:08,900 --> 00:09:14,820 plug the phone into the device. It loads its custom boot image and it pulls the data off. So we 90 00:09:14,820 --> 00:09:22,320 use a boot image to boot the device early in the chain before the system loads. We get a root 91 00:09:22,320 --> 00:09:28,440 shell over USB where we can load our tools and pull the data off. And importantly, because this is 92 00:09:28,440 --> 00:09:33,320 forensics, we don't want to modify anything. If you use a custom recovery image or custom boot 93 00:09:33,320 --> 00:09:39,780 image like clockwork mod, that's not forensically designed and it will modify data on some of the 94 00:09:39,780 --> 00:09:44,500 partitions, particularly the cache partition which it automounts. So we need to be able to disable 95 00:09:44,500 --> 00:09:51,860 that if possible. And devices with raw NAND that typically have a YAS2 file system, the wear leveling 96 00:09:52,320 --> 00:09:57,160 system that spreads the data across the NAND flash to stop it wearing out is implemented in 97 00:09:57,160 --> 00:10:05,580 software in YAS2. And that means that if we get to it before YAS2 loads, we can prevent the wear 98 00:10:05,580 --> 00:10:10,580 leveling and prevent the modification of data. So if you're creating an image and you hash it one 99 00:10:10,580 --> 00:10:18,540 time, when you come back later, that hash is the same. Forensic analysts love that. On the screen 100 00:10:18,540 --> 00:10:22,300 there is just a, okay. It's not going to show up. It's just something that we're trying to do. 101 00:10:22,320 --> 00:10:27,000 give me a laser pointer now. There we go. On the screen there is our custom boot image that we 102 00:10:27,000 --> 00:10:33,160 developed for a project. You can actually put a micro SD card in and press the menu button, it's 103 00:10:33,160 --> 00:10:40,220 point and click and it will image the device onto the micro SD card. So let's build our own boot 104 00:10:40,220 --> 00:10:46,020 image. I can tell you it's really simple. There's an open source tool called A boot image for 105 00:10:46,020 --> 00:10:52,340 modifying boot images. So you get your custom recovery or your stock recovery and the first 106 00:10:52,340 --> 00:10:59,560 command there extracts it. The second command unpacks the RAM disk. Then you change into the RAM 107 00:10:59,560 --> 00:11:06,060 disk directory. You edit the RAM disk contents which is on the next slide. And then you pack it 108 00:11:06,060 --> 00:11:15,080 up again and then you update the stock recovery and insert your custom RAM disk. So the RAM disk 109 00:11:15,080 --> 00:11:15,500 contents. 110 00:11:16,040 --> 00:11:20,800 You've got slash dev slash proc which are empty directories. They're just used when it boots up to 111 00:11:21,380 --> 00:11:27,400 mount things off. You've got the S bin directory. All you need in there is ADBD which is the ADB 112 00:11:27,400 --> 00:11:32,960 demon which is going to give you that shell over USB. Busy box if you like. If you know what busy 113 00:11:32,960 --> 00:11:40,540 box is, it's just a collection of tools, common Linux tools in one binary. And we put NAND 114 00:11:40,540 --> 00:11:45,480 dump on as well which is used for dumping partitions. We have our own modified version of NAND 115 00:11:45,480 --> 00:11:50,320 dump with some improvements that we're going to be contributing back because it's an open source 116 00:11:50,320 --> 00:11:57,700 program. Slash sys, empty directory, init, don't have to touch that. Then there's a file called 117 00:11:57,700 --> 00:12:06,640 default dot prop. So you edit that and you change RO dot secure to zero and that will give you a 118 00:12:06,640 --> 00:12:11,820 root shell. Init RC, you just change that. You comment everything out so it doesn't mount 119 00:12:11,820 --> 00:12:14,180 partitions. All you need to do is start ADBD. 120 00:12:14,180 --> 00:12:20,280 And then you have U event D. You don't need to modify that. And that's it. That's the contents of 121 00:12:20,280 --> 00:12:28,960 our RAM disk. That combined with the kernel and there's your boot image. Flash and RAM load. 122 00:12:29,980 --> 00:12:37,640 Didn't sound that dirty when I wrote it. All right. Samsung. Just a little aside here. 123 00:12:37,740 --> 00:12:43,920 There's a Samsung tool called Odin or there's the open source Heimdall and Odin version 124 00:12:44,180 --> 00:12:50,120 1.52 or less. There's a command to dump partitions which sounds awesome. We've never actually 125 00:12:50,120 --> 00:12:55,600 got it to work. All it seems to do is brick our phones. But if anybody does get it to work, 126 00:12:55,700 --> 00:13:03,600 please let me know because we've got a stack of phones. Okay. So with Odin or Heimdall, you can 127 00:13:03,600 --> 00:13:10,180 flash your custom recovery. I mean, you know, this being Android, even Samsung devices, there 128 00:13:10,180 --> 00:13:14,160 are different ways of doing that. You can see the two commands there. HTC, we're going to use that. 129 00:13:14,160 --> 00:13:19,980 has fast boot and the really cool thing about HTC with the fast boot or even Google devices is 130 00:13:19,980 --> 00:13:26,140 you can RAM load it. That means you send your image over USB into RAM and it loads it. You 131 00:13:26,140 --> 00:13:32,980 don't have to flash or modify any data. Motorola has SBF flash. You can flash your image to the 132 00:13:32,980 --> 00:13:39,020 recovery partition. I should have pointed out not to the user data partition obviously. Be 133 00:13:39,020 --> 00:13:46,300 careful when you flash Motorola that your SBF file only contains the recovery partition. 134 00:13:46,760 --> 00:13:55,980 Otherwise you'll just wipe all the data off it. JTAG. So this is what the government labs use. 135 00:13:56,240 --> 00:14:02,360 You know, this is really good stuff. So you have direct access to NAND chips via the CPU. I can't 136 00:14:02,360 --> 00:14:08,880 go into too much detail. You could have a whole day workshop just on JTAG. But there are on many 137 00:14:08,880 --> 00:14:09,000 days, you can get a lot of data from the CPU. You can get a lot of data from the CPU. You can 138 00:14:09,000 --> 00:14:15,900 get a lot of data on many devices. I'm just going to get my laser pointer up. On many devices you 139 00:14:15,900 --> 00:14:23,260 see these solder pads here. Six points. So you solder some wires there or you use a jig to 140 00:14:23,260 --> 00:14:30,420 connect to that and you connect a flasher box. Those flasher boxes are some examples there. 141 00:14:30,620 --> 00:14:38,520 ORT, riff box, et cetera. And it allows you to image the NAND flash directly through the CPU 142 00:14:38,520 --> 00:14:45,740 and you don't have to boot the device at all. So it helps to preserve data integrity. They can be 143 00:14:45,740 --> 00:14:51,960 pretty flaky. Support is somewhat lacking. You know, these devices used in mobile repair shops 144 00:14:51,960 --> 00:15:01,080 and often come out of Eastern Europe, Russia and other very clever places. So if you don't have 145 00:15:01,080 --> 00:15:05,820 JTAG, are there some other options? Well, there's a serial debug cable. This is pretty cool. It's 146 00:15:05,820 --> 00:15:07,180 like JTAG, only a lot easier. 147 00:15:09,360 --> 00:15:15,300 This is an S2 example. And as I mentioned earlier, not all S2s are the same. This also works for 148 00:15:15,300 --> 00:15:21,640 Galaxy Note. So in later ones, they've disabled the secondary boot loader that gives us this 149 00:15:21,640 --> 00:15:26,700 access. It hasn't been bundled. So it's probably a mistake by Samsung and they fixed it because 150 00:15:26,700 --> 00:15:38,420 hackers were taking advantage of it. So on the S2 and the Note, you sold a 523 kilo ohms 151 00:15:38,520 --> 00:15:43,680 resistor, doesn't have to be exact, I've tried various values and it seems to work, between the 152 00:15:43,680 --> 00:15:54,120 ground pin, the ground ID pin, sorry, sold it between the ID pin and ground. And then you get TTL 153 00:15:54,120 --> 00:16:00,080 serial access over a couple of pins of the USB connector. You can use a bus pirate, which is a very 154 00:16:00,080 --> 00:16:06,540 cool way, or any kind of USB to serial converter. You attach directly and you get a serial console 155 00:16:07,220 --> 00:16:08,500 over USB. Or a mixing console. If you are doing field work, if you're using a disk drive, you can use a 156 00:16:08,500 --> 00:16:16,320 over the USB connector. So there's a picture here of a bus pirate and a little USB, micro USB 157 00:16:16,320 --> 00:16:24,040 breakout board and a resistor on a breadboard there. That's all you need. So you set the bus 158 00:16:24,040 --> 00:16:36,000 pirate to 115 200 board, 8 stop bits, no parity, sorry, 8 bits, no parity, 1 stop bit. The 159 00:16:36,000 --> 00:16:40,540 output type is normal. If you're using a bus pirate, there's an option. And you just plug the 160 00:16:40,540 --> 00:16:44,660 device into the micro USB and it will automatically start booting. First you see the 161 00:16:44,660 --> 00:16:50,000 primitive boot loader flash up and then you see the secondary boot loader go crazy and then the 162 00:16:50,000 --> 00:16:54,680 device boots. If you hold down the enter key on the terminal while you plug the device in, you 163 00:16:54,680 --> 00:17:01,580 end up at a SPL prompt. This whole long list here to the right is a list of all the commands that 164 00:17:01,580 --> 00:17:05,920 you then have access to. So you essentially have a terminal on the secondary boot 165 00:17:05,920 --> 00:17:10,800 loader before the device is booted, which allows you access to the device. You can carry on 166 00:17:10,800 --> 00:17:14,780 booting the device. You just run the load kernel command, load modem command and then boot 167 00:17:14,780 --> 00:17:22,880 command and away it goes. It's a pretty cool way of accessing the device. Okay. So some 168 00:17:23,800 --> 00:17:29,240 forensics devices used by law enforcement, they have this built in. It's plug and play. They 169 00:17:29,240 --> 00:17:34,420 plug your S2 in, plug the USB cable in and they can image your device straight off. Doesn't 170 00:17:34,420 --> 00:17:35,900 matter if it's locked or not. It's just a plug and play. They plug your S2 in, plug the USB 171 00:17:35,900 --> 00:17:37,400 cable in and they can image your device straight off. Doesn't matter if it's locked or not. Not 172 00:17:37,400 --> 00:17:43,040 the case if it's encrypted. We'll come to that later. Okay. So you've managed to get access to 173 00:17:43,040 --> 00:17:50,220 the device and image it. Why not crack the PIN or password? Well, a lot of people say, well, 174 00:17:50,240 --> 00:17:54,000 that's silly. You've already got the data. Why would you want to crack the lock screen PIN or 175 00:17:54,000 --> 00:17:59,940 password? But we got a lot of requests from customers wanting to do this. Maybe it's a time 176 00:17:59,940 --> 00:18:05,880 sensitive investigation, such as a kidnapping and they just want to have access to the device. 177 00:18:05,880 --> 00:18:10,100 They want access to the device itself to get the data off it, export the data from the 178 00:18:10,100 --> 00:18:14,620 applications on the device. So there are a number of reasons why you want to do that. We first 179 00:18:14,620 --> 00:18:18,560 published this technique in digital forensics magazine. It's a paid journal so not everybody 180 00:18:18,560 --> 00:18:24,420 has access to it. There are now a number of blog posts about it. And what I'm going to show here 181 00:18:24,420 --> 00:18:29,960 is also GPU acceleration just to speed it up a bit. So the components, you've got a salt. That's 182 00:18:29,960 --> 00:18:35,860 stored in the file up there. Settings.db. It's an integer. And then you've got a file that's 183 00:18:35,860 --> 00:18:41,260 salted. So if you get the settings.db, you can do a SQL lookup on it and get the lock screen 184 00:18:41,260 --> 00:18:48,320 salt. The PIN or password is actually stored in a password.key file. Again, golden rule, this is 185 00:18:48,320 --> 00:18:55,540 Android. Locations can vary. And then the password file is actually a salted SHA-1 of the 186 00:18:55,540 --> 00:19:01,280 password and that's added to a salted MD5. So you have a SHA-1 and you have an MD5 and they're 187 00:19:01,280 --> 00:19:05,840 put together. I don't know, maybe that looked more secure because it's longer. But it's a lot of 188 00:19:05,860 --> 00:19:14,780 work. But all you need is the MD5 portion, right? So cracking it. First transform it into the 189 00:19:14,780 --> 00:19:19,320 format we need which is lower case hex and no padding. There's a Python command there for you. 190 00:19:20,080 --> 00:19:26,520 Copy the 32 bytes of password.key. That's the MD5 hash in hex. Add a colon and then add the 191 00:19:26,520 --> 00:19:35,600 salt. And then you can just put it into software such as OCL hash cat light. There's a screenshot of 192 00:19:35,860 --> 00:19:43,420 it. You can see the five positions where you configure it there. This is for cracking a PIN 193 00:19:43,420 --> 00:19:54,200 number. So we're looking at sort of a short four to nine digit PIN. And then there's a screenshot 194 00:19:54,200 --> 00:19:59,160 of PINs actually cracked. For a PIN, it takes seconds. For a password, it can take longer 195 00:19:59,160 --> 00:20:04,940 depending on the length of the password. So that's the weakness there. But it's fairly easy. 196 00:20:07,460 --> 00:20:11,660 Here's brute force. You know, when I'm talking to people, they often say, oh, why don't you make 197 00:20:11,660 --> 00:20:16,620 a device that automatically types in the PIN lots of times? And I say, well, yeah, it's 198 00:20:16,620 --> 00:20:21,340 probably not going to work. And this keeps happening in this conversation. So I thought, 199 00:20:21,400 --> 00:20:26,260 well, you know, why not do it and demonstrate why it does or does not work. So I've recorded a 200 00:20:26,260 --> 00:20:35,720 little video here. So you've got my Galaxy Note up on the screen. Plugged into that is a USB OTG 201 00:20:35,860 --> 00:20:41,480 cable because the Galaxy Note has USB host support. And then a little thing that looks like a thumb 202 00:20:41,480 --> 00:20:48,440 drive is actually a chip which I've programmed to emulate a keyboard. So if I'm going to click 203 00:20:48,440 --> 00:21:00,040 this, hopefully we get a video. Okay. Didn't play. Let's try again. 204 00:21:09,000 --> 00:21:17,020 Sorry. On my screen, the video is not playing. On yours it is. Once more. Okay. So there I'm 205 00:21:17,020 --> 00:21:23,860 plugging the USB key in. It's automatically typing the password or a PIN many, many times from 206 00:21:23,860 --> 00:21:35,580 zero to 999. And then it locks out and you get a countdown timer. So it gives you ten tries. 207 00:21:35,860 --> 00:21:41,320 And then it brings up a countdown timer. So it's not really a very feasible attack. Maybe it is 208 00:21:41,320 --> 00:21:52,280 on some Android devices that don't lock out. And a little tip here, if you want to try that, if 209 00:21:52,280 --> 00:21:56,820 you're trying to prepare slides and you forget about it and leave it plugged in, it gets to the 210 00:21:56,820 --> 00:22:01,060 point where it's about to wipe your data. So don't try it on your real device either like I did. 211 00:22:04,360 --> 00:22:05,840 Yeah. Yeah. So this one is a little bit more complicated. It's a little bit more complicated. 212 00:22:05,860 --> 00:22:11,380 It was actually at the pre-boot authentication because my device is encrypted. So it's right at 213 00:22:11,380 --> 00:22:18,580 the start. And, yeah, it will wipe your device after a certain number of times. So it rate 214 00:22:18,580 --> 00:22:24,000 limits it. It's not really a practical attack, but, hey, it's cool. Android encryption. Here we 215 00:22:24,000 --> 00:22:29,260 go. So this is how we can or can we protect against this. So actually Android encryption is 216 00:22:29,260 --> 00:22:35,840 pretty good. You'll notice somewhere on here, this is a little bit more complicated than the 217 00:22:35,860 --> 00:22:43,900 previous one. Somewhere on here it mentions a pin. So this is a Galaxy Nexus, sorry, this is a 218 00:22:43,900 --> 00:22:48,980 Nexus S. And I'm setting up encryption on this device and it allows you to enter a pin, a four 219 00:22:48,980 --> 00:22:55,680 digit pin for encryption. Okay. And then it takes a while and it goes ahead and encrypts your 220 00:22:55,680 --> 00:23:01,940 device. It's been supported since Android 3. Based on DM Crypt standard Linux, 128-bit AES, 221 00:23:03,140 --> 00:23:05,840 cipher block chaining. Implemented on Android 3.0. So it's a little bit more complicated than the 222 00:23:05,860 --> 00:23:09,400 previous one. The limitations vary. We're looking at Samsung devices. They have their own key 223 00:23:09,400 --> 00:23:17,000 management module. It's done in a slightly different way. Okay. I think I'll have a beer for 224 00:23:17,000 --> 00:23:31,560 this. Right. Android encryption. Okay. Let's get my laser pointer. Password or pin. So this is 225 00:23:31,560 --> 00:23:35,840 where your password or pin comes in. It then runs through the network. It runs through your 226 00:23:35,860 --> 00:23:40,300 password. And it derives your password, sorry, derives your key based on your password, runs 227 00:23:40,300 --> 00:23:47,260 that through 2000 iterations. The input is the key length 32. It's going to give you a 32 bytes of 228 00:23:47,260 --> 00:23:57,720 output. You also need a salt. A salt is derived from dev U random. So it's a random salt. The 229 00:23:57,720 --> 00:24:05,440 output of this, 32 bytes, is the key and IV. It's split down the middle. So you end up with 128 230 00:24:05,860 --> 00:24:16,680 bit key and 128 bit IV. That feeds into AS 128 CBC along with a master key which is also derived 231 00:24:16,680 --> 00:24:29,560 from dev U random. The output is an encrypted 128 bit master key. Okay. So we have a master 232 00:24:29,560 --> 00:24:35,740 key. It's encrypted. Once it's decrypted by the system, after you enter your password, this is 233 00:24:35,740 --> 00:24:44,280 how it uses it. It's DM crypt with ESS IV. So ESS IV is encrypted salt sector initialization 234 00:24:44,280 --> 00:24:51,740 vector. It's used in block encryption for disks. Each sector here is 512 bytes regardless of the 235 00:24:51,740 --> 00:24:57,300 file system. The IV for the first block of each sector is the sector number encrypted with a 236 00:24:57,300 --> 00:25:02,620 hash of the key. It prevents water marking attacks, that kind of thing. And then subsequent blocks 237 00:25:02,620 --> 00:25:05,720 in that sector use the IV of the previous block in the first block. And then for the rest, it's a 238 00:25:05,720 --> 00:25:12,320 blocks cypher text because it's cypher block chaining. Also your data goes in, user data 239 00:25:12,320 --> 00:25:20,940 partition, what comes out is encrypted user data partition. Cracking the encryption. So the 240 00:25:20,940 --> 00:25:26,740 encrypted master key in the salt is stored in a footer. That footer can be stored in a 241 00:25:26,740 --> 00:25:33,520 footer file on a partition or part of the start of a partition itself. Depends on the 242 00:25:33,520 --> 00:25:40,840 device. So what we need to do is image the device, locate the footer and get the encrypted 243 00:25:40,840 --> 00:25:49,960 user data partition as well. So if you're using J tag or USB serial attack or even ship off a 244 00:25:49,960 --> 00:25:53,740 number of attacks like that or a number of processes like that, so you have your encrypted 245 00:25:53,740 --> 00:26:03,100 user data partition and you have your encrypted key, yeah, your encrypted key. So we pass the 246 00:26:03,100 --> 00:26:08,920 footer, we locate the salt and the encrypted master key. We run the password guess through 247 00:26:09,600 --> 00:26:15,140 PBKDF2 again with the salt that we've got and we use the resulting key in IV to decrypt the 248 00:26:15,140 --> 00:26:19,860 master key, use that resulting master key to decrypt the first sector of the encrypted 249 00:26:19,860 --> 00:26:27,760 image. If the password is correct, the plain text will be revealed. So this is a screenshot 250 00:26:27,760 --> 00:26:32,480 from the initial tool. Don't worry if you can't see it too well. But you can definitely 251 00:26:32,480 --> 00:26:37,520 see the pattern there. The one on the left is being decrypted successfully. It's a bunch of 252 00:26:37,520 --> 00:26:42,980 zeros. The one on the right looks like random data. It's still encrypted. Cracking the pin 253 00:26:42,980 --> 00:26:53,440 takes seconds. That's the weakness here. Cracking a password may not take much longer. This 254 00:26:53,440 --> 00:26:58,000 password for encryption is the same password that's used for the lock screen. So people 255 00:26:58,000 --> 00:27:01,980 aren't going to want to enter a 32 character password every time they want to make a phone 256 00:27:01,980 --> 00:27:02,240 call. 257 00:27:05,240 --> 00:27:11,580 So with patterns, easy short passwords, it's definitely possible to brute force this. This is 258 00:27:11,580 --> 00:27:16,840 just a proof of concept Python script. We've released it open source. I'll mention the link 259 00:27:16,840 --> 00:27:25,360 at the end. We've actually got a guy, Andre Belenko from Russia joining our team very soon. 260 00:27:25,560 --> 00:27:30,640 He's the brains behind the Elcom soft GPU cracking software. So you can expect this to get a 261 00:27:30,640 --> 00:27:31,000 lot better. 262 00:27:35,100 --> 00:27:37,720 Actually, I just want to mention, there's a mistake on this screen shot. 263 00:27:37,940 --> 00:27:44,660 You'll see at the start of the data, it's all zeros except for the first sector. That's because I 264 00:27:44,660 --> 00:27:51,280 got the ESS IV wrong. So it was able to decrypt the rest of the sector because cipher block 265 00:27:51,280 --> 00:27:56,280 chaining depends on the cipher text of one block being fed as the IV into the next block. We 266 00:27:56,280 --> 00:28:02,460 obviously have the cipher text. So we can still decrypt the data. That ESS IV is still in the 267 00:28:02,480 --> 00:28:09,000 issue will be actually fixed in the real thing. Let's talk about some other ones. Evil maid 268 00:28:09,000 --> 00:28:14,260 attack. I actually thought this was called French maid attack. I don't know where I got that 269 00:28:14,260 --> 00:28:23,060 from. Okay. So you leave your device in a hotel room. That's the idea. And while you're out, the 270 00:28:23,060 --> 00:28:27,480 evil maid comes in and they have physical access to your device. But maybe they can't decrypt 271 00:28:27,480 --> 00:28:33,980 it. So they load an app on to your system partition because that's not encrypted. They wait 272 00:28:33,980 --> 00:28:37,900 for you to boot your phone and then they have remote access to your decrypted user data if 273 00:28:37,900 --> 00:28:44,940 their app has remote access. Easy to compile for Android. Just compile a Linux 274 00:28:44,940 --> 00:28:50,300 kernel module for Android. It's no big deal. And that, you know, you can hide yourself in the 275 00:28:50,300 --> 00:28:55,800 system really easily. It's very hard to detect for the average user especially. Evil USB 276 00:28:55,800 --> 00:28:57,100 charger. It's been done. 277 00:28:57,260 --> 00:28:57,460 . 278 00:28:57,480 --> 00:29:04,780 You plug your device into an outlet. Maybe you don't trust it. Behind it is an evil device that 279 00:29:04,780 --> 00:29:10,680 maybe it charges your phone. But it also runs these attacks we've been talking about and gets 280 00:29:10,680 --> 00:29:22,400 access to your device. Reverse shell. I did this demo a little while ago. Concept based on 281 00:29:22,400 --> 00:29:27,460 presentation by lookout guys a while back. It's quite an old concept. You know, it's a 282 00:29:27,460 --> 00:29:32,220 pretty old concept. And basically we created an app that had no permissions. It looked pretty safe 283 00:29:32,220 --> 00:29:38,960 to install. You install it and even though it has no permissions, as soon as the user locks their 284 00:29:38,960 --> 00:29:45,160 phone screen or perhaps on a timer sometime at night, it will connect back to us and give us a 285 00:29:45,160 --> 00:29:50,840 reverse shell. Uses no exploits. It uses a web browser to transmit data by calling a web 286 00:29:50,840 --> 00:29:57,360 browser with data in the URL. It's able to pass data out. It then retrieves data from the web browser 287 00:29:57,360 --> 00:30:04,900 and uses URL handlers to pass the data back to the malicious Android app. There's a video of it 288 00:30:04,900 --> 00:30:10,120 online. If you want to try it out or have a look at that. It's called no permissions reverse shell. 289 00:30:15,240 --> 00:30:20,040 There are lots of techniques. We could run a whole day workshop on this stuff. So I just thought I'd 290 00:30:20,040 --> 00:30:27,080 do a couple of fun ones. Hard reset. Unbelievable. You hard reset your device, it wipes your data. On 291 00:30:27,080 --> 00:30:37,940 some devices prior to 3.0, the wipe didn't work properly. So you hard reset the device. You then 292 00:30:37,940 --> 00:30:42,940 have access to it. There's no lock screen anymore. You root it and then you image it and you get the 293 00:30:42,940 --> 00:30:47,380 person's data. Takes balls though because you might just destroy the evidence and somebody's not 294 00:30:47,380 --> 00:30:54,240 going to be very happy. Chip off. This is really hard core stuff. This is where you desolder the 295 00:30:54,240 --> 00:30:57,060 NAN chips and you put them into a special reader. And this is very, very important. We're not 296 00:30:57,060 --> 00:31:05,440 Very tiny, very hard, pretty easy to destroy the NAND flash chips while you're trying to desolder them, 297 00:31:05,500 --> 00:31:06,620 especially after a few beers. 298 00:31:09,300 --> 00:31:11,900 But it's definitely a technique, takes expertise. 299 00:31:12,880 --> 00:31:16,500 There's kind of not much defense to that other than encryption with a strong passphrase, right? 300 00:31:17,200 --> 00:31:18,040 Screen smudges. 301 00:31:18,220 --> 00:31:23,120 Hey, if you're desperate, look at the screen smudges and see if you can work out what the pattern was that they entered. 302 00:31:29,520 --> 00:31:31,120 Custom update.zip. 303 00:31:34,560 --> 00:31:38,420 So an update.zip, this is a method for Android devices to update. 304 00:31:39,140 --> 00:31:44,220 You have the update in a zip file, and you put it onto the micro SD card, if your device has a micro SD card. 305 00:31:44,720 --> 00:31:51,040 And then when you boot it up into the recovery, you can apply that update. 306 00:31:52,040 --> 00:31:56,580 The problem is, on a stock device, these devices need to be signed by the manufacturer. 307 00:31:59,240 --> 00:32:04,980 If you haven't unlocked the bootloader or anything like that, it's not going to run your custom update.zip. 308 00:32:05,020 --> 00:32:10,700 If you could run your custom update.zip, you can put your own binaries in it, give yourself a shell or copy the data off. 309 00:32:10,820 --> 00:32:11,280 It's pretty cool. 310 00:32:11,740 --> 00:32:13,500 So the question is, can you get one signed? 311 00:32:15,360 --> 00:32:21,320 You know, hey, has anybody here got a universally signed update.zip? 312 00:32:23,240 --> 00:32:23,700 No? 313 00:32:24,200 --> 00:32:25,360 Yeah, one over there? 314 00:32:26,140 --> 00:32:27,040 I don't. 315 00:32:27,060 --> 00:32:28,360 I just put my hand up. 316 00:32:28,580 --> 00:32:35,020 I was watching this American show, The Mentalist, and he was using these mental techniques. 317 00:32:35,300 --> 00:32:36,120 That doesn't sound right. 318 00:32:36,980 --> 00:32:41,860 No, he was social engineering people, and what he would do is he would ask a question, 319 00:32:41,980 --> 00:32:44,080 who murdered Jane Doe, and then he'd put his hand up. 320 00:32:44,240 --> 00:32:47,120 And it would be more likely that the murderer would put their hand up. 321 00:32:48,240 --> 00:32:55,100 So a few months ago, I gave a similar talk to this in London, and it was attended by a lot of law enforcement personnel. 322 00:32:55,620 --> 00:32:56,980 FBI, Met Police. 323 00:32:57,860 --> 00:33:01,960 So I was curious if anybody had a universally signed update.zip. 324 00:33:03,540 --> 00:33:07,380 Put my hand up, and one guy actually put his hand up and admitted that he did. 325 00:33:09,580 --> 00:33:12,140 Yeah, he was a nice chap. 326 00:33:12,160 --> 00:33:17,860 He was from Israel, and he came up to the end, and we had a good talk. 327 00:33:18,820 --> 00:33:23,080 And the third point there about owning a CA, who doesn't these days, right? 328 00:33:24,620 --> 00:33:26,100 Where you man in the middle of connection. 329 00:33:26,100 --> 00:33:27,300 You can push an update. 330 00:33:27,660 --> 00:33:28,700 You know, it's a joke. 331 00:33:28,820 --> 00:33:31,720 I mean, yeah, okay, CAs are getting owned, but really, who owns a CA? 332 00:33:32,780 --> 00:33:35,600 This guy from Israel, he's pretty interested in this technique. 333 00:33:40,340 --> 00:33:41,780 So maybe it's possible. 334 00:33:42,280 --> 00:33:50,860 And actually, I have seen update.zip signed, and they're locked to specific IMEI numbers or specific serial numbers of the device. 335 00:33:51,160 --> 00:33:56,040 I can't say where you can get them from, but in a legitimate law enforcement investigation, 336 00:33:56,100 --> 00:34:08,440 it may be possible, I'm choosing my words carefully here, it may be possible to get one of these update.zips to gain access with a warrant to a suspect's device. 337 00:34:10,080 --> 00:34:17,700 Race condition, I mentioned this earlier when I had the diagram up on the screen, so we thought we'd try a race condition, 338 00:34:17,880 --> 00:34:25,080 because we were looking at the Android source code in the recovery image, and we noticed when applying an update, 339 00:34:25,260 --> 00:34:26,000 what it would do. 340 00:34:26,100 --> 00:34:30,480 is it would read the update.zip and check the signature. 341 00:34:30,720 --> 00:34:31,860 If the signature was correct, 342 00:34:32,060 --> 00:34:34,040 it would then read it again and apply the update. 343 00:34:35,100 --> 00:34:38,780 So we thought, hey, why don't we create a device 344 00:34:38,780 --> 00:34:40,380 that emulates a microSD card? 345 00:34:40,560 --> 00:34:42,820 When it reads it the first time, we'll give it a legitimate one. 346 00:34:43,020 --> 00:34:44,560 When it reads it a second time, 347 00:34:44,660 --> 00:34:49,640 we'll supply our malicious one and get our update applied. 348 00:34:50,640 --> 00:34:53,340 This was actually fixed quite early on, so it didn't work, 349 00:34:53,420 --> 00:34:55,160 and there were issues around caching as well. 350 00:34:55,160 --> 00:34:57,580 It was definitely possible on some devices. 351 00:34:59,760 --> 00:35:01,260 Entry via Google Play. 352 00:35:02,620 --> 00:35:06,880 If you leave your computer logged on at home 353 00:35:06,880 --> 00:35:09,540 and your Google Play credentials are cached 354 00:35:09,540 --> 00:35:11,720 so people can get onto your desktop 355 00:35:12,860 --> 00:35:15,900 and they can automatically log into Google Play, 356 00:35:16,040 --> 00:35:20,440 they can push an app out to your phone. 357 00:35:20,660 --> 00:35:23,000 I actually made an app called Screen Lock Bypass. 358 00:35:23,140 --> 00:35:24,440 It's free, it's in the market. 359 00:35:25,460 --> 00:35:27,800 And you can push this app out to a phone, 360 00:35:27,980 --> 00:35:30,960 and what it will do is it will call an API call 361 00:35:30,960 --> 00:35:32,600 to disable the lock screen. 362 00:35:33,500 --> 00:35:35,140 It's a legitimate API call. 363 00:35:35,260 --> 00:35:38,100 If an app needs to disable the lock screen 364 00:35:38,100 --> 00:35:39,320 because you've got an incoming call, 365 00:35:39,560 --> 00:35:40,740 that's how it does it. 366 00:35:41,680 --> 00:35:43,860 This doesn't work on newer Android devices, 367 00:35:43,940 --> 00:35:46,000 Ice Cream Sandwich and on, 368 00:35:46,880 --> 00:35:49,180 because it's a security issue, so they fixed it. 369 00:35:56,760 --> 00:36:00,560 Okay, so some of the tools that I mentioned earlier. 370 00:36:01,740 --> 00:36:03,780 We've created, or we are creating, 371 00:36:03,860 --> 00:36:06,660 an open source Linux distribution called Santoku. 372 00:36:07,220 --> 00:36:08,840 You can go and download it now. 373 00:36:09,080 --> 00:36:10,180 It's just the alpha version. 374 00:36:11,500 --> 00:36:14,040 Had some technical issues trying to get this ready 375 00:36:14,040 --> 00:36:16,420 for the con, so at the moment it's a remix 376 00:36:16,420 --> 00:36:20,940 of OWASP's Mobiseq, but we're gonna continue forking it 377 00:36:20,940 --> 00:36:21,820 or expanding it. 378 00:36:22,160 --> 00:36:24,960 And there's a bunch of tools on there that you can use to play 379 00:36:24,960 --> 00:36:25,760 about with Android. 380 00:36:30,420 --> 00:36:32,660 And iOS, and BlackBerry. 381 00:36:32,760 --> 00:36:34,880 So it's a community project. 382 00:36:35,620 --> 00:36:38,040 There's a bunch of security pros from other companies 383 00:36:38,040 --> 00:36:39,220 that are contributing to it. 384 00:36:40,020 --> 00:36:45,220 And we want to use it for mobile app security, 385 00:36:45,560 --> 00:36:46,940 malware analysis, and forensics. 386 00:36:46,960 --> 00:36:48,020 It's what we do in our day job. 387 00:36:48,220 --> 00:36:51,460 So let's create a distro, we use it in our day job, 388 00:36:51,540 --> 00:36:53,060 and we'll give it away to the community as well, 389 00:36:53,180 --> 00:36:54,880 and hopefully people will contribute to it. 390 00:36:58,560 --> 00:37:01,000 Okay, I think I'm gonna step back a few slides, hang on. 391 00:37:25,300 --> 00:37:29,320 Okay, so I forgot to mention a few things on this screen 392 00:37:29,320 --> 00:37:30,440 I just recalled. 393 00:37:33,920 --> 00:37:34,400 Whoops. 394 00:37:40,860 --> 00:37:44,260 So I'm just gonna leave it there so I can see it 395 00:37:44,260 --> 00:37:44,760 on my screen. 396 00:37:45,520 --> 00:37:49,760 The second screenshot below is actually of a Nexus S, 397 00:37:49,800 --> 00:37:52,700 so you can actually see how we're mounting the apps partition 398 00:37:52,700 --> 00:37:54,380 after we get access to the device. 399 00:37:54,960 --> 00:37:57,580 And the user data footer is actually a file in there. 400 00:37:59,520 --> 00:38:04,860 In Santoku Linux, we have the script to automatically 401 00:38:04,860 --> 00:38:09,880 brute force the pin, we're hoping to work on a GUI version 402 00:38:09,880 --> 00:38:15,720 to make this nice and easy too, and work on the Samsung tool 403 00:38:15,720 --> 00:38:17,580 as well, because Samsung is different, 404 00:38:17,720 --> 00:38:18,620 their encryption is different. 405 00:38:20,760 --> 00:38:22,200 Okay, sorry about that. 406 00:38:34,260 --> 00:38:36,860 Okay, so I'm finishing early here, I'm just wondering 407 00:38:36,860 --> 00:38:40,640 if there's any questions, anybody wants to share experiences 408 00:38:40,640 --> 00:38:42,200 or ask questions on the floor? 409 00:38:44,620 --> 00:38:45,100 Yeah? 410 00:38:49,900 --> 00:38:50,380 Okay. 411 00:38:51,960 --> 00:38:53,140 Yeah, pattern lock? 412 00:38:53,300 --> 00:38:53,780 Okay. 413 00:38:53,780 --> 00:38:59,020 So the question was how is the pattern lock stored 414 00:38:59,020 --> 00:39:00,840 and how do you crack it? 415 00:39:01,340 --> 00:39:04,640 We've done this before, we've also released a script to do this. 416 00:39:04,820 --> 00:39:07,720 The pattern lock is nine points on the screen, 417 00:39:09,380 --> 00:39:13,040 and it's stored as numbers zero to eight. 418 00:39:13,320 --> 00:39:15,760 These are stored as bytes in a pattern lock file. 419 00:39:17,480 --> 00:39:22,900 And that byte is then hashed, and if you can retrieve the hash, 420 00:39:23,380 --> 00:39:24,620 you can then crack it. 421 00:39:24,660 --> 00:39:27,640 It's not salted either, so you can do a dictionary attack on this. 422 00:39:27,880 --> 00:39:31,180 Or just brute force it, there are less than a million combinations, 423 00:39:31,640 --> 00:39:33,480 so you can brute force it in seconds. 424 00:39:34,060 --> 00:39:37,480 It's a similar principle, it's called gesture.key, 425 00:39:37,680 --> 00:39:39,880 stored on the Android system. 426 00:39:42,160 --> 00:39:43,280 Does that answer your question? 427 00:39:45,240 --> 00:39:45,720 Yeah? 428 00:39:46,160 --> 00:39:49,100 Have you guys come up with any countermeasure programs 429 00:39:49,100 --> 00:39:52,720 that when you try looking into the phone causes you to immediately wipe? 430 00:39:54,240 --> 00:39:54,720 Yes. 431 00:39:55,400 --> 00:39:57,480 So the idea being that, 432 00:39:57,560 --> 00:39:59,820 so what's the first thing a forensic investigator does? 433 00:40:00,080 --> 00:40:01,800 Maybe they plug the USB cable in. 434 00:40:01,960 --> 00:40:03,520 Well, you can detect that, right? 435 00:40:03,580 --> 00:40:05,820 You can detect that the USB cable has been plugged in 436 00:40:05,820 --> 00:40:07,160 and power has been applied. 437 00:40:07,680 --> 00:40:16,260 So if you have an app that uses a standard API broadcast intent, 438 00:40:16,560 --> 00:40:19,180 so when it detects power being applied to the phone, 439 00:40:19,280 --> 00:40:20,500 it then triggers some code. 440 00:40:20,700 --> 00:40:22,520 You could either reboot the device 441 00:40:22,720 --> 00:40:23,220 if it's encrypted, 442 00:40:23,680 --> 00:40:25,640 or even better, if it's a rooted device, 443 00:40:25,940 --> 00:40:29,120 you could actually wipe the master key, 444 00:40:29,320 --> 00:40:30,900 so that even if you know the password 445 00:40:30,900 --> 00:40:32,220 and you're forced to give it up, 446 00:40:32,340 --> 00:40:35,140 nobody's going to be able to decrypt that data on your device. 447 00:40:37,880 --> 00:40:38,280 Yeah? 448 00:40:39,440 --> 00:40:39,840 Yeah. 449 00:40:43,520 --> 00:40:44,760 The encryption's the same. 450 00:40:45,240 --> 00:40:47,580 We actually did this on a Jelly Bean device as well, 451 00:40:47,760 --> 00:40:49,820 a Galaxy Nexus, I think it was. 452 00:40:50,100 --> 00:40:51,560 The encryption is actually good. 453 00:40:51,560 --> 00:40:54,060 It's just depending on the strength of your passphrase. 454 00:40:55,860 --> 00:40:58,100 On Samsung devices, it actually, 455 00:40:58,280 --> 00:40:59,500 well, at least on my Galaxy Note, 456 00:40:59,600 --> 00:41:01,300 it forces you to use a secure password. 457 00:41:01,420 --> 00:41:02,420 You can't use a PIN number. 458 00:41:03,700 --> 00:41:05,920 But again, people use patterns on their keyboard, 459 00:41:06,040 --> 00:41:06,740 that kind of thing. 460 00:41:10,760 --> 00:41:11,240 Yeah? 461 00:41:13,620 --> 00:41:18,500 First, have you ever met a password on the phone 462 00:41:18,500 --> 00:41:20,580 that you could not get? 463 00:41:20,580 --> 00:41:23,860 And second, how much of what you're presenting 464 00:41:24,340 --> 00:41:27,100 would apply to current iOS? 465 00:41:28,140 --> 00:41:30,280 Okay, so the question was, 466 00:41:30,340 --> 00:41:32,580 was there a password we've encountered we couldn't crack? 467 00:41:34,320 --> 00:41:36,900 We're still new on cracking passwords on Android. 468 00:41:37,400 --> 00:41:38,860 It's still emerging. 469 00:41:39,060 --> 00:41:40,680 So no, there hasn't been any thus far, 470 00:41:40,820 --> 00:41:41,980 but maybe there will be. 471 00:41:42,360 --> 00:41:44,880 And the second question's about iOS devices. 472 00:41:45,080 --> 00:41:47,860 So iOS devices, I'm not an expert, 473 00:41:47,980 --> 00:41:49,080 but we have them in our company. 474 00:41:49,800 --> 00:41:50,760 They're a bit different, 475 00:41:50,880 --> 00:41:53,760 because that automatically decrypts itself on boot. 476 00:41:54,020 --> 00:41:56,140 So Android encryption, in my opinion, 477 00:41:56,200 --> 00:41:56,820 is actually better, 478 00:41:56,980 --> 00:41:58,380 because it's full device encryption 479 00:41:58,380 --> 00:41:59,780 with a pre-boot authentication. 480 00:42:00,420 --> 00:42:03,000 On an iOS device, you turn it on, it boots up, 481 00:42:03,040 --> 00:42:04,200 and it's decrypting the data. 482 00:42:04,720 --> 00:42:06,860 You need to enter your lock screen password 483 00:42:06,860 --> 00:42:08,520 to actually get into it. 484 00:42:08,660 --> 00:42:10,760 But there are techniques to get into the device 485 00:42:10,760 --> 00:42:12,280 and start pulling the data off, 486 00:42:12,360 --> 00:42:13,820 and it will decrypt itself automatically 487 00:42:13,820 --> 00:42:15,320 as you're pulling the data off. 488 00:42:16,380 --> 00:42:17,640 So it's different. 489 00:42:19,080 --> 00:42:22,760 With iOS devices, you obviously have the encryption. 490 00:42:23,500 --> 00:42:25,220 The AES is actually on the chip, 491 00:42:25,420 --> 00:42:26,720 and it's rate limited, 492 00:42:26,860 --> 00:42:27,760 so it takes a while. 493 00:42:28,000 --> 00:42:30,640 But yeah, it's possible in a different way. 494 00:42:32,020 --> 00:42:32,140 Yeah. 495 00:42:38,820 --> 00:42:39,720 Sorry, what was the question? 496 00:42:43,540 --> 00:42:43,980 Okay. 497 00:42:44,420 --> 00:42:45,460 So the question was, 498 00:42:45,460 --> 00:42:46,980 is there a way to decouple 499 00:42:46,980 --> 00:42:49,100 the pre-boot pin or password 500 00:42:49,100 --> 00:42:49,940 from the lock screen? 501 00:42:50,560 --> 00:42:52,500 Not that I know of in stock Android. 502 00:42:52,800 --> 00:42:54,800 Obviously, you've got custom Android distributions. 503 00:42:55,080 --> 00:42:56,240 That's the beauty about it. 504 00:42:56,480 --> 00:42:59,120 And you can modify it 505 00:42:59,120 --> 00:43:00,560 to do that if you wanted. 506 00:43:01,320 --> 00:43:03,220 That would be the ideal thing to do, 507 00:43:03,260 --> 00:43:04,880 because you could enter your secure password, 508 00:43:05,720 --> 00:43:06,880 passphrase, long and complicated 509 00:43:06,880 --> 00:43:08,680 when you boot up, which you do infrequently, 510 00:43:09,300 --> 00:43:11,260 and then an easier one on the lock screen. 511 00:43:11,680 --> 00:43:12,120 Yeah. 512 00:43:14,200 --> 00:43:15,220 Have you looked into 513 00:43:15,460 --> 00:43:16,320 using custom keyboards? 514 00:43:18,080 --> 00:43:20,080 So you saw the video earlier 515 00:43:20,080 --> 00:43:21,460 where we used the HID device 516 00:43:21,460 --> 00:43:23,320 to automatically enter information. 517 00:43:24,360 --> 00:43:25,500 We haven't found 518 00:43:27,240 --> 00:43:28,260 any vulnerabilities 519 00:43:28,260 --> 00:43:30,220 on the HID protocol itself. 520 00:43:31,120 --> 00:43:31,400 I mean, 521 00:43:32,220 --> 00:43:33,900 because you can replace the keyboard 522 00:43:33,900 --> 00:43:34,520 as an app, 523 00:43:34,600 --> 00:43:36,720 and that will run to allow the user 524 00:43:36,720 --> 00:43:38,140 to enter their passwords, right? 525 00:43:39,160 --> 00:43:39,700 Yeah. 526 00:43:39,860 --> 00:43:41,260 Well, so there's a keyboard 527 00:43:41,260 --> 00:43:43,980 on the pre-boot authentication screen, right? 528 00:43:45,460 --> 00:43:46,640 There's an app that runs that, 529 00:43:46,720 --> 00:43:48,220 but that doesn't have access to 530 00:43:48,220 --> 00:43:50,700 the passphrase or it doesn't cache it 531 00:43:50,700 --> 00:43:51,640 or anything like that. 532 00:43:52,540 --> 00:43:54,280 It's not saved to the user dictionary 533 00:43:55,180 --> 00:43:57,200 because the user data partition 534 00:43:57,200 --> 00:43:59,160 is only... 535 00:43:59,160 --> 00:44:00,720 When you enter your password or PIN, 536 00:44:00,780 --> 00:44:02,860 it tries to decrypt the user data partition 537 00:44:03,480 --> 00:44:05,520 and it knows if it's successful 538 00:44:05,520 --> 00:44:07,360 or not by whether 539 00:44:07,360 --> 00:44:08,580 or not it decrypts or not. 540 00:44:08,820 --> 00:44:09,880 That's how it works. 541 00:44:10,320 --> 00:44:12,880 So unless I misunderstand your question, 542 00:44:12,980 --> 00:44:14,760 I don't think there's a way to do that. 543 00:44:15,460 --> 00:44:16,380 Good question. 544 00:44:16,940 --> 00:44:17,080 Yeah. 545 00:44:23,220 --> 00:44:25,660 So the question was, 546 00:44:25,780 --> 00:44:26,560 have you ever encountered 547 00:44:26,560 --> 00:44:28,000 a law enforcement rootkit? 548 00:44:29,980 --> 00:44:31,860 I can't answer that one. 549 00:44:39,760 --> 00:44:41,080 Okay, guys. 550 00:44:41,680 --> 00:44:42,340 Anymore? 551 00:44:44,500 --> 00:44:45,160 Okay. 552 00:44:45,460 --> 00:44:46,680 But thanks for coming 553 00:44:46,680 --> 00:44:48,380 and for staying till the end. 554 00:44:48,720 --> 00:44:50,080 Sorry, I got through a bit quicker 555 00:44:50,080 --> 00:44:51,280 than I expected. 556 00:44:52,080 --> 00:44:53,560 I'd like to thank a few people, 557 00:44:53,640 --> 00:44:56,540 Google for making an awesome phone 558 00:44:57,160 --> 00:44:58,680 and the other guys there 559 00:44:58,680 --> 00:44:59,960 and Tim as well 560 00:44:59,960 --> 00:45:01,420 for having a look at my slides. 561 00:45:02,940 --> 00:45:03,380 Yeah. 562 00:45:04,040 --> 00:45:04,480 Thanks.