1 00:00:00,000 --> 00:00:01,600 All right. 2 00:00:01,600 --> 00:00:03,240 So, hi everybody. 3 00:00:03,240 --> 00:00:05,440 I'm glad you guys are all here. 4 00:00:17,620 --> 00:00:19,960 So, I'm Craig Young. 5 00:00:19,960 --> 00:00:23,100 I'm a security researcher with Tripwire Vert. 6 00:00:23,120 --> 00:00:27,820 I write vulnerability checks for our IP360 vulnerability scanner. 7 00:00:27,820 --> 00:00:31,520 And I also do a lot of research on different vulnerabilities. 8 00:00:31,520 --> 00:00:42,020 Lately, I've been looking at a lot of different Android applications, and I've been noticing more and more that there's a lot of Android applications that don't implement SSL properly. 9 00:00:42,020 --> 00:00:57,060 And with the push that we've been seeing with more and more apps that are really having real-world integration, you have more and more situations where broken SSL doesn't just jeopardize privacy, but it's actually jeopardizing people's safety. 10 00:00:57,060 --> 00:01:02,480 So, for example, if you have a taxi application, you have the threat of kidnapping. 11 00:01:02,480 --> 00:01:08,540 If you have a smart car application, you have the threat of somebody being able to access or track your car. 12 00:01:08,900 --> 00:01:14,160 And, of course, the future, we're seeing more and more medical devices and plannable devices. 13 00:01:14,300 --> 00:01:17,760 There are all sorts of nasty situations which could arise. 14 00:01:18,160 --> 00:01:28,220 But to introduce the scenario that I'm going to talk about first, I have a little video clip, a dramatic video, a little play. 15 00:01:29,760 --> 00:01:32,360 Apparently, that's not the way to play it. 16 00:01:43,400 --> 00:01:51,100 Prevalence programs has individuals genuinely concerned with the privacy of their communications and personal data. 17 00:01:51,100 --> 00:01:57,580 The Snowden effect has brought SSL concerns and privacy issues to the forefront of conversations. 18 00:01:57,580 --> 00:02:06,320 What most of us don't realize is that there are real-world consequences to personal safety when cryptography is not implemented properly. 19 00:02:06,320 --> 00:02:13,160 Hackers can use a simple technique to abduct, stalk, spy, and murder, even physically harm unsuspecting victims. 20 00:02:13,160 --> 00:02:20,560 To exemplify, an attacker is at a bar hanging out with their hacking gear, a pineapple Wi-Fi, intercepting Wi-Fi connections. 21 00:02:20,560 --> 00:02:25,160 The attacker spots a potential victim who is using the Uber app to get a text. 22 00:02:25,160 --> 00:02:28,440 The attacker uses their smartphone to start the attack. 23 00:02:28,440 --> 00:02:32,240 The victim now receives a phone alert that an Uber car is on its way. 24 00:02:32,240 --> 00:02:35,460 The Uber driver is actually an accomplice to the attacker. 25 00:02:35,460 --> 00:02:37,960 The victim's Uber app shows the car driving up. 26 00:02:37,960 --> 00:02:41,940 The victim gets into the fake cabin and is now the attacker's captive. 27 00:02:41,940 --> 00:02:48,940 Security vulnerabilities in applications not only jeopardize data, but have devastating personal safety consequences. 28 00:02:49,480 --> 00:03:00,760 So, with that introduction, I'm sure a lot of people probably know what the vulnerability here is, but I'm going to explain it anyway, because that's what I'm talking to you guys about. 29 00:03:00,860 --> 00:03:07,080 So, basically, Uber locked the door, they used SSL, but they didn't quite implement it properly. 30 00:03:07,080 --> 00:03:18,680 They did not implement anything for checking the client's or the server's certificate, so the client Android application has no way of informing a user if you're not actually talking to the real Uber service. 31 00:03:18,920 --> 00:03:27,740 So, this is a real big problem, because anybody can generate a self-signed certificate, man-in-the-middle connection, start manipulating traffic. 32 00:03:27,860 --> 00:03:35,160 So, before I get into how I manipulate the Uber traffic, let's take a look at how you can test for this kind of issue. 33 00:03:35,340 --> 00:03:44,980 So, the easiest way that I've found to try and identify SSL certificate validation failures is by setting up a simple VPN. 34 00:03:44,980 --> 00:03:48,520 So, I use DigitalOcean as a VPS provider. 35 00:03:48,520 --> 00:03:50,780 I set up PPTP on there. 36 00:03:50,780 --> 00:03:53,580 I use my phone to connect into that. 37 00:03:53,660 --> 00:04:00,880 And then using Mox and Marlin Spikes SSL sniff, I found it was very easy to use IP tables, redirect traffic into there. 38 00:04:00,900 --> 00:04:13,760 And you can see very easily, if the application under test is not implementing SSL properly, you'll start getting requests like that, as opposed to getting an error on your device. 39 00:04:13,760 --> 00:04:18,180 Now, there's lots of applications that have this problem. 40 00:04:18,180 --> 00:04:24,280 When I started using this test methodology, I very quickly saw scary stuff coming off my phone. 41 00:04:24,280 --> 00:04:27,840 Like, for example, Google credentials in plain text. 42 00:04:27,840 --> 00:04:37,560 Not from an actual Google-made app, but from a third-party application that has millions of downloads and still has not fixed it, which is why I'm not naming them. 43 00:04:37,560 --> 00:04:43,140 I also saw that ISP credentials were coming out when using different media streaming applications. 44 00:04:43,140 --> 00:04:45,900 There's financial data that gets leaked. 45 00:04:46,400 --> 00:04:56,380 And we also, of course, there are libraries that get reused in a lot of different Android projects that do error reporting. 46 00:04:56,380 --> 00:05:07,080 And they will connect over SSL, but they won't do anything to validate the server, because typically your server might have a self-signed certificate in this situation. 47 00:05:07,120 --> 00:05:20,080 The result of this is that if somebody is man-in-the-middle-of-your-connection, they're able to see a lot of detailed information, like what intents you have registered on the device, sometimes what applications are actively running. 48 00:05:21,180 --> 00:05:28,180 There's a variety of data in there that could be used to further attacks, like JavaScript bridge attacks against Android. 49 00:05:28,760 --> 00:05:32,740 But back to this particular application. 50 00:05:33,220 --> 00:05:38,640 Of course, Android provides built-in functionality for doing SSL. 51 00:05:38,640 --> 00:05:44,920 There's no problems with the SDK here, but there are a lot of applications that are broken. 52 00:05:45,300 --> 00:06:02,900 And what I was finding is that it tends to be when you have an application that's not using a WebView, but instead making direct JSON requests, for example, the application developers very frequently implement kind of a naive trust model, which I'll get into in a minute. 53 00:06:03,180 --> 00:06:10,220 But the reason that this all happens, to understand this, you have to understand a little bit about the Android architecture. 54 00:06:10,700 --> 00:06:13,840 So Android is running on top of Linux. 55 00:06:14,540 --> 00:06:17,080 It's using a Dalvik VM. 56 00:06:17,080 --> 00:06:19,560 This is Google's own virtual machine. 57 00:06:19,560 --> 00:06:21,340 Now there's another one, ART. 58 00:06:21,620 --> 00:06:25,180 And applications are getting distributed essentially in a zip file. 59 00:06:25,180 --> 00:06:28,140 This zip file is renamed an APK. 60 00:06:28,140 --> 00:06:33,400 And you've got some Dalvik executable files, decks in there, all sorts of resources. 61 00:06:33,820 --> 00:06:36,780 And it's very, very easy to reverse. 62 00:06:36,780 --> 00:06:41,720 There's tools like Ddexer, APKtool, which uses backsmolly. 63 00:06:41,900 --> 00:06:51,840 And you can use these tools to start analyzing what it is that went wrong within an application, find out why the SSL is broken. 64 00:06:52,100 --> 00:06:54,900 So the tool that I like to use is APKtool. 65 00:06:54,900 --> 00:06:59,880 I like it because it's preloaded on Kali, very straightforward to use. 66 00:06:59,880 --> 00:07:01,860 It gives you a lot of flexibility. 67 00:07:01,860 --> 00:07:12,840 So all you have to do is put your APK file that you want to analyze into the user-share APKtool directory, on Kali Linux anyway. 68 00:07:12,840 --> 00:07:18,160 Run APKtoold, and you can disassemble that application. 69 00:07:18,160 --> 00:07:21,600 When you do that, you're going to get some data like this. 70 00:07:21,600 --> 00:07:25,060 This is not all-inclusive, but some of the highlights. 71 00:07:25,060 --> 00:07:30,700 You've got the manifest file, which anybody who's developed an Android application will know what this is. 72 00:07:30,700 --> 00:07:36,960 This has all of your permissions, information regarding certs for sharing data between applications. 73 00:07:37,240 --> 00:07:41,800 There's some metadata created by the application to help it rebuild itself. 74 00:07:41,800 --> 00:07:50,780 You've also got native libraries on there, which you could perform static analysis and start finding memory corruption vulnerabilities and things like that. 75 00:07:50,880 --> 00:07:56,220 You've also got your resources directory, which is full of strings, layouts, things like that. 76 00:07:56,220 --> 00:07:59,520 But the most interesting part is the smally code. 77 00:07:59,520 --> 00:08:08,720 Smally is... I believe it's Icelandic for assembly or something along those lines, because Dalvik is an Icelandic town. 78 00:08:09,180 --> 00:08:15,000 But anyway, so once you have this smally output, you can start searching through it. 79 00:08:15,000 --> 00:08:19,460 And what you're searching for is the TrustManager implementation. 80 00:08:19,920 --> 00:08:28,100 The TrustManager, you can see up here, it's javax.net.ssl.x509.trustmanager. 81 00:08:28,100 --> 00:08:31,540 You can do an fgrep through your smally directory. 82 00:08:31,640 --> 00:08:39,080 And you want to find any place where there's a definition for an implementation of this x509.trustmanager. 83 00:08:39,080 --> 00:08:43,500 And then you want to jump down to the checkServerTrusted. 84 00:08:43,500 --> 00:08:57,460 This checkServerTrusted function, this is what's supposed to actually do the work of figuring out whether or not the server that you're talking to has a properly signed certificate and whether it should be trusted. 85 00:08:57,460 --> 00:09:05,940 So you could have in here certificate pinning logic or trust logic for figuring out which CAs you trust. 86 00:09:05,980 --> 00:09:11,320 But if you look at this disassembly, there's not much to it here. 87 00:09:11,320 --> 00:09:15,180 You've got a declaration that we could throw an exception. 88 00:09:15,180 --> 00:09:21,300 That's the exception that you would have to throw if you wanted to tell the client that this is a bad connection to not be trusted. 89 00:09:21,440 --> 00:09:24,020 But all they're doing here is a return void. 90 00:09:24,020 --> 00:09:29,480 So there's absolutely no certificate that would not pass this validation check. 91 00:09:29,480 --> 00:09:32,900 So you could actually roll your own patch. 92 00:09:32,980 --> 00:09:39,300 When you find an application like this, you can go through these steps to find the x509.trustmanager. 93 00:09:39,300 --> 00:09:47,280 You can then take that checkServerTrusted function and put in code that actually does something. 94 00:09:47,620 --> 00:09:51,820 We'll talk a little bit about the things that you can do towards the end of this talk. 95 00:09:51,820 --> 00:09:53,960 But then use the APK tool. 96 00:09:53,960 --> 00:09:57,360 It will rebuild up your package to an APK file. 97 00:09:57,460 --> 00:10:01,420 You just need to sign it then, and you can load it onto your Android device. 98 00:10:01,420 --> 00:10:13,360 And even if an application developer is not fixing their application and keeping an SSL vulnerability in there, you could, in theory, continue to use the app without risking man-in-the-middle. 99 00:10:13,840 --> 00:10:19,360 So for the sake of comparison, this is also from the Uber app. 100 00:10:19,360 --> 00:10:24,240 By the way, I don't know if this was clear, but that first code sample, that was from the Uber app. 101 00:10:24,240 --> 00:10:26,100 That was the root of this problem. 102 00:10:26,820 --> 00:10:31,800 This is also from the Uber app, but this is part of the PayPal SDK. 103 00:10:32,060 --> 00:10:38,140 And if you see, this is just the beginning of the checkServerTrusted function, because it actually does stuff. 104 00:10:38,220 --> 00:10:45,860 And PayPal is smart enough to know that they don't want your PayPal credentials winding up on anybody who has access to your connection. 105 00:10:45,860 --> 00:10:54,240 So under normal operations, there's really no impact from not validating the SSL certificates. 106 00:10:54,240 --> 00:11:01,020 You have confidentiality, you have integrity, you have authenticity of the server you're going to, in theory. 107 00:11:01,020 --> 00:11:11,040 But really, this all gets thrown out the window if there is a man-in-the-middle, because you don't have any logic here checking whether the server has a trusted cert. 108 00:11:11,040 --> 00:11:28,120 So even that SSL is preventing that somebody just passively eavesdropping would be able to listen and see what your password is, or whatever other data is going across the stream, you still have the possibility of man-in-the-middle attacks. 109 00:11:28,120 --> 00:11:46,340 This is particularly a risk with smartphones and tablets, because we have this wonderful thing, 802.11 Wi-Fi, which you'll hear all day long in here has all sorts of flaws, and they make it quite easy to launch a man-in-the-middle attack. 110 00:11:46,340 --> 00:12:06,820 So, for example, most people, when they're using their smartphone, for example, you might go to a hotel, add the Marriott Wi-Fi hotspot, and even after you've left the Marriott, you're not deleting that, and so your phone is always going to be broadcasting looking for this open network. 111 00:12:06,820 --> 00:12:21,740 Also, you have the situation that people have tiered data plans, so they like to go and if they see a free Wi-Fi hotspot, they're going to use it, and that gives somebody else access to their data stream. 112 00:12:22,080 --> 00:12:26,940 And, of course, as I was saying, the 802.11 protocol has some shortcomings. 113 00:12:27,020 --> 00:12:37,380 Very briefly, there's issues, for example, the fact that your devices are generally going to send out probe requests, saying all of the SSIDs that they're looking for. 114 00:12:37,740 --> 00:12:55,480 Your deauthentication frames are never encrypted, so that means that any client that's connected to any wireless network, 802.11 that is, regardless of the security levels that are implemented, you can send a completely plain text message and boot them off of that network, 115 00:12:55,480 --> 00:12:57,700 and then it becomes a race condition. 116 00:12:57,700 --> 00:13:05,960 If you can get a network that they're going to connect to up first before they see the network they really want to connect to, you've got them. 117 00:13:05,960 --> 00:13:11,840 And clients really don't have any mechanisms for validating the access point. 118 00:13:11,840 --> 00:13:27,040 There have been some really great ideas in this field of using certificates to improve the situation, but unfortunately there has not been really the hardware vendor cooperation in this realm to make these kinds of changes happen. 119 00:13:27,040 --> 00:13:32,840 There are some complexity issues when you start talking about the average consumer trying to use this stuff. 120 00:13:33,280 --> 00:13:45,640 So, these flaws, of course, can get exploited using Pineapple Wi-Fi, which is available through Hackshop, and it's a nice little portable pen test tool. 121 00:13:45,640 --> 00:13:57,480 I won't talk too much about that since I'm sure all of you guys have seen that in this room, but you can easily plug in a 4G modem stick to it so you have out-of-band access to it. 122 00:13:57,480 --> 00:14:00,900 You have battery pack with it so you can travel with it. 123 00:14:00,900 --> 00:14:09,240 You can take it into a bar, wait for somebody using the Uber app, and then start launching your attack as I showed in that video. 124 00:14:09,420 --> 00:14:17,340 And also you have the ability to change some of the configuration settings on the fly through hardware dip switches on the Mark 5 model. 125 00:14:17,340 --> 00:14:32,480 But basically, the way that the interception is going to work in this scenario, the Pineapple Wi-Fi uses a tool called Karma, also referred to as Yasager, I suppose, but this process is circular. 126 00:14:32,480 --> 00:14:35,240 You're just listening for the probe request that you see. 127 00:14:35,240 --> 00:14:49,500 When there is a probe request sent, you take whatever SSID it was looking for, and you start broadcasting that SSID and wait for unassociated clients to connect to you. 128 00:14:50,340 --> 00:15:06,520 A slightly more sophisticated approach, if your target happens to already be connected to a wireless network, you can use the flaw in the 802.11 protocol, or limitation I should say, that you can send a deauth frame. 129 00:15:06,520 --> 00:15:22,320 And this deauth frame is going to tell the client, or it's going to make the client think that the AP is telling it, you can't use this network anymore, and then you listen to the probe request the device sends out, and rinse, repeat, you're back to where you were before. 130 00:15:22,500 --> 00:15:34,780 So now, in order to carry out this attack, we know that SSL is broken here, but that's not enough to kidnap somebody with an Uber taxi. 131 00:15:34,780 --> 00:15:39,780 So there were a couple of approaches that I thought about taking for how to go through this. 132 00:15:39,780 --> 00:15:54,040 Primarily I was looking at whether it would be better to completely impersonate the Uber backend server, since you can present any certificate and the phone will think that it is uber.com, or you can just tamper the responses. 133 00:15:54,440 --> 00:15:57,200 And clearly there are pros and cons for each of these. 134 00:15:57,200 --> 00:16:10,840 If you're completely impersonating the backend, like meaning reconstructing the server and making it behave the way the real Uber server would, you're going to have pretty good reliability with this approach, but it's going to take a while to develop. 135 00:16:10,840 --> 00:16:16,900 It's going to take longer than I felt like spending for this presentation when I'm not really planning on kidnapping anybody. 136 00:16:16,980 --> 00:16:20,360 So I went with the approach of response tampering. 137 00:16:20,360 --> 00:16:28,320 This is very quick to implement, but of course it could be a little more fragile, because backend changes could cause this to break. 138 00:16:28,880 --> 00:16:35,780 But the choice that I made, as I said, is to do the tampering method. 139 00:16:35,780 --> 00:16:41,100 With the tampering methods, you've got a couple of tools that are already available which you could use. 140 00:16:41,820 --> 00:16:43,720 Mallory is a great example. 141 00:16:43,720 --> 00:16:47,880 It was released by DefCon or BlackHat a few years back from the Intrepidus group. 142 00:16:47,880 --> 00:16:50,920 It's essentially a transparent TCP proxy. 143 00:16:50,920 --> 00:16:53,060 It has great support for SSL. 144 00:16:53,640 --> 00:16:57,040 It will do automatic regex replacements. 145 00:16:57,040 --> 00:17:08,140 So I've used it in the past, for example, to strip out gzip encoding from requests and change a user agent string from a flash player to do some things, let's just say. 146 00:17:09,000 --> 00:17:15,340 But it's also a little bit clunky for this kind of task, because I want it to run on the pineapple Wi-Fi. 147 00:17:15,340 --> 00:17:18,000 It's not really that beefy of a machine. 148 00:17:18,000 --> 00:17:27,160 And Mallory, you typically... it's a great tool for identifying vulnerabilities and working on pentest engagement, but it's not really so flexible. 149 00:17:27,160 --> 00:17:29,700 You've got a GUI that you're going through. 150 00:17:29,700 --> 00:17:37,140 I'm sure that you could script it out, but it's also not so context-aware in the way that we need to be for this approach. 151 00:17:37,380 --> 00:17:42,100 So another option out there, there's MITM dump, man-in-the-middle dump. 152 00:17:42,100 --> 00:17:45,180 This is strictly an HTTPS proxy. 153 00:17:45,380 --> 00:17:49,700 It has hooks in there so that you can do straight regex replacements. 154 00:17:49,940 --> 00:17:51,660 It's all command-driven. 155 00:17:51,940 --> 00:17:57,340 I believe there's even an infusion that you can get this pre-built for the pineapple Wi-Fi. 156 00:17:57,340 --> 00:18:03,680 Don't quote me on that, but I kind of didn't want to go with the off-the-shelf methodology. 157 00:18:05,720 --> 00:18:19,860 These tools, they're great for quick analysis, as I said, but you need... if you want to be able to pull off this kind of attack, you need to be aware of the application that you're attacking, and you have to be conscientious of the state that the application is in. 158 00:18:19,860 --> 00:18:28,140 You can't just do blind replacements of data and have something that's going to be meaningful output for the user in the end. 159 00:18:28,140 --> 00:18:38,620 You also have, with these off-the-shelf tools, perhaps some issues with dependencies that they're going to require on, and you're not necessarily going to be able to port it from one place to another. 160 00:18:38,740 --> 00:18:42,060 So I made a little Python script. 161 00:18:42,060 --> 00:18:52,380 It didn't take long to write, and it gave me a lot more flexibility because there's no license restrictions on it, other than the Python license restrictions, because I wrote it. 162 00:18:53,520 --> 00:19:05,460 It allows me to monitor the context of the application and do things statefully in an intelligent manner so that I can control the coordinates that are going in a meaningful way if I wanted to. 163 00:19:05,560 --> 00:19:10,920 And I made it as a single Py file that has all standard imports. 164 00:19:10,920 --> 00:19:18,020 So it runs right out of the box on the Pineapple Wi-Fi, or basically anything else that has Python on it. 165 00:19:18,020 --> 00:19:22,420 So this is kind of a block diagram of how this works. 166 00:19:23,140 --> 00:19:25,360 We have a listening socket. 167 00:19:25,360 --> 00:19:30,520 The listening socket wraps TCP connection with an SSL handler. 168 00:19:30,520 --> 00:19:33,220 We're using our self-assigned certificate. 169 00:19:33,320 --> 00:19:37,680 It spawns off a sub-process, which is doing our receive handling. 170 00:19:37,900 --> 00:19:46,270 And what I'm doing here, I used IP tables to redirect the traffic into the UberProxy Py file, or process. 171 00:19:46,270 --> 00:19:52,470 So we don't have knowledge of what the hostname you're trying to connect to is. 172 00:19:52,470 --> 00:19:59,730 So you have to look at the HTTP headers, and I use that information then with urllib to go out and fetch the resource. 173 00:20:00,010 --> 00:20:14,450 And then I can look at the response and decide... or actually, first I look at the request and decide, is this a request that I'm going to want to either forge a response to, tamper the response, or just send it back as-is? 174 00:20:15,370 --> 00:20:19,110 So we've got... the DS handler is the downstream handler. 175 00:20:19,110 --> 00:20:21,890 US handler, of course, is the upstream handler. 176 00:20:22,130 --> 00:20:27,110 And the DS handler is where the magic really works. 177 00:20:27,250 --> 00:20:37,710 But the way that the Uber app actually works, you are polling constantly for whatever the nearest vehicles are. 178 00:20:38,370 --> 00:20:43,410 These are JSON requests that indicate where you intend to be picked up. 179 00:20:43,410 --> 00:20:50,450 And you get back responses which are lists of coordinates of paths that the Uber cars have taken. 180 00:20:50,570 --> 00:21:01,810 So essentially it will give you a list of timestamp and latitude and longitude, timestamp, latitude, and longitude, so that the app is able to draw out on the screen how the cars are moving. 181 00:21:02,150 --> 00:21:06,570 So Python has great support for interpreting JSON. 182 00:21:06,570 --> 00:21:15,910 So I used the JSON module here to interpret these responses and manipulate them. 183 00:21:15,910 --> 00:21:25,590 I didn't want to inadvertently start getting Uber drivers coming out to my house while I was working on this, so I didn't actually go through the whole process of man-in-the-middling the purchase process. 184 00:21:25,590 --> 00:21:28,550 I also wanted to avoid any PCI complications. 185 00:21:28,550 --> 00:21:42,730 So I decided to do a demo to show that you can control the path of the vehicles simply by making it so that the vehicles would all converge upon the location where the request is being made to pick up the taxi. 186 00:21:42,810 --> 00:22:00,650 And of course, if you wanted to, or if somebody wanted to actually use this in a real-world environment, you would want to go through Google Maps or some other mapping service, take the coordinate where the victim is, and actually mark it so that you're having the taxis drive on the road. 187 00:22:02,310 --> 00:22:07,470 If you'll see here, the demo that I made of this video will work. 188 00:22:14,230 --> 00:22:22,030 You can see we're going to... it's a little bit fuzzy, but we're going to make the taxis drive out to Alcatraz over the water. 189 00:22:22,030 --> 00:22:25,270 They probably don't float like that in real life, but... 190 00:22:25,810 --> 00:22:31,810 Then, if you look on... I'm going to try and pull up the terminal. 191 00:22:33,990 --> 00:22:37,570 Yep, so this is my script running. 192 00:22:37,570 --> 00:22:41,970 This is a Nexus 7 with the Uber app installed on it. 193 00:22:41,970 --> 00:22:47,170 I'm just going to launch the Uber app, and you can see right away we start getting these requests out. 194 00:22:47,170 --> 00:22:49,730 You really can't read that so well. 195 00:22:49,730 --> 00:22:52,890 Let's turn 196 00:22:56,470 --> 00:22:58,430 up the font a little bit on that. 197 00:23:02,680 --> 00:23:06,520 I don't know if I can adjust the resolution without messing everything up. 198 00:23:08,400 --> 00:23:09,960 Is that a little better? 199 00:23:09,960 --> 00:23:16,080 Yeah, so you can see there's the nearest cab requests, and if we wait... 200 00:23:16,640 --> 00:23:33,160 Well, so right here, it's having a little bit of trouble determining my location inside the building, so we're not actually getting to the point where we can see the cab locations, but if we stepped outside and we were in a city where Uber actually operates, 201 00:23:33,160 --> 00:23:38,400 you would start seeing lots of geolocations for the Uber taxis in here. 202 00:23:38,400 --> 00:23:41,420 So back over to the slide deck. 203 00:23:44,880 --> 00:23:48,360 Those are some nice flowers, but that's not what I wanted to show you. 204 00:23:49,760 --> 00:23:53,780 So I reported this issue back in March 2014. 205 00:23:53,820 --> 00:24:00,200 I also reported similar issues to six or seven other vendors. 206 00:24:00,980 --> 00:24:04,060 Uber was very, very excellent about responding. 207 00:24:04,060 --> 00:24:20,140 They were very happy to hear about this from me rather than hearing about this from the Federal Trade Commission or whoever would be investigating that, and by the time May came around, they had a complete revamp of the app, which does not have this problem in it. 208 00:24:20,160 --> 00:24:24,220 So if you use Uber, you want to make sure your app is up to date. 209 00:24:24,220 --> 00:24:25,080 I'm not sure. 210 00:24:25,080 --> 00:24:30,800 It might have asked for new permissions, so you could be waiting if you don't explicitly tell it to update. 211 00:24:30,800 --> 00:24:43,940 Anyway, other apps that I looked at, since the manufacturers have not really been responding so well, I'm not comfortable with disclosing the particulars of the brands. 212 00:24:43,940 --> 00:24:45,900 I hope you all understand why. 213 00:24:45,900 --> 00:25:03,060 But a lot of cars these days, this is one of the things that I was looking at, they all have telematic systems which connect over typically CDMA networks, and you have smartphone apps that go along with them which allow you to do things like remote start your car, 214 00:25:03,060 --> 00:25:07,560 unlock the doors, find your car on a map, send directions to it. 215 00:25:07,700 --> 00:25:15,860 And what I found was with my car in particular, and none of you know what kind of car I have, right? 216 00:25:16,080 --> 00:25:17,700 So that's good. 217 00:25:17,860 --> 00:25:35,800 But you're able to, if you just intercept one connection from this app, you can start unlocking the doors, you can find the car on a map, and if you wanted to, you could use this to stalk somebody, you could use this to go watch their movement, wait until they park, 218 00:25:35,800 --> 00:25:47,840 say they're going into a shopping mall, you walk up, unlock the doors, you could plant a listening device if you're polite but wanting to be kind of intrusive, or you could plant a bomb if you wanted to. 219 00:25:48,760 --> 00:25:53,540 You could also follow somebody around from a distance without being exposed. 220 00:25:54,440 --> 00:26:03,960 So, if you wanted to exploit this, it's actually very, very simple, because you really don't even need to write any code yourself. 221 00:26:03,960 --> 00:26:08,180 Moxie's SSL sniff is more than enough to get the credentials. 222 00:26:08,180 --> 00:26:13,300 Once you have the credentials, you can forge all of the requests that you need for this. 223 00:26:15,860 --> 00:26:36,800 So, for link stars, what I'm calling it, obviously not the real name, I alerted them back in February, I alerted the car manufacturer in February, that is, I also alerted Google Play in March 2014 of this and several other applications in the same and other disciplines, 224 00:26:36,800 --> 00:26:47,560 and as of July, I have not gotten any responses, so it would seem that app developers really don't take this situation seriously. 225 00:26:47,560 --> 00:26:53,960 And there are other areas of concern, and there are going to continue to be more and more problems. 226 00:26:54,020 --> 00:27:10,800 I mean, we're having people with defibrillators implanted into them that have pacemakers that feed data into their cell phone and send it out to a doctor, allowing the doctor to make a response and send a charge to somebody's heart. 227 00:27:10,800 --> 00:27:19,540 If you could manipulate that data stream and make the doctor think that somebody's just had a cardiac event, you're talking about potential murder. 228 00:27:21,740 --> 00:27:40,940 So, also, I don't know how many people have been following BlackHat or were at BlackHat, but there were some references about various home security systems, and these things have a lot of the same problems, that they're either using encryption, but not using it properly so that you can man-in-the-middle it, 229 00:27:40,940 --> 00:27:59,300 or they're just using proprietary RF protocols that are plain text, and I'm sorry, I forget the name of the researcher, but there were two different researchers that have been showing recently that you could very easily use this to cause a flood of false positives or just disable or burglar alarms. 230 00:27:59,980 --> 00:28:07,680 These problems are beyond just 802.11 and smartphone apps. 231 00:28:11,080 --> 00:28:25,400 The mass availability of software-defined radio opens up the door to all sorts of different RF protocols being subject to attacks due to poorly implemented or not implemented encryption. 232 00:28:26,860 --> 00:28:29,360 So, how can you actually stay safe? 233 00:28:29,360 --> 00:28:36,480 If you're talking about the Wi-Fi aspect of things, you want to turn off Wi-Fi when you're not using it. 234 00:28:36,480 --> 00:28:40,920 You probably want to keep Wi-Fi off most of the time that you're at DEF CON, for example. 235 00:28:41,960 --> 00:28:50,140 You shouldn't be connecting to... or, I'm sorry, you only want to connect to SSIDs that are broadcasting their names, in my opinion. 236 00:28:51,200 --> 00:29:02,320 There are some issues with connecting to non-broadcast SSIDs, which can make it easier for somebody to man-in-the-middle your connection. 237 00:29:02,320 --> 00:29:16,440 It's kind of ongoing research, but I'm just going to say, not broadcasting your SSID, it doesn't really help you from a security perspective, and it can actually hurt you from what I've been seeing. 238 00:29:17,300 --> 00:29:23,900 If you're going to use open Wi-Fi, all right, but use it and then remove the profile from your device. 239 00:29:23,900 --> 00:29:29,200 You don't want to leave any profiles on your devices that are for open Wi-Fi. 240 00:29:29,200 --> 00:29:51,100 And if you're using an application that maybe has some kind of sensitive data or might have some ramifications in the real world, you can use that testing strategy that we went over in the beginning of setting up a PPTP VPN and using a cell sniff to find out very quickly whether or not applications are vulnerable to this type of attack. 241 00:29:51,100 --> 00:30:00,640 So there are also some things that you can do to kind of identify if somebody is performing these types of attacks in your vicinity. 242 00:30:00,640 --> 00:30:15,540 For example, if you're in this room right now and you were to take out your phone and add an SSID of ABCDEFG, I would guarantee you that in a couple seconds you would see that SSID being broadcast. 243 00:30:15,540 --> 00:30:23,060 That's a pretty good indicator that somebody is doing something hokey around you and you might not want to use your Wi-Fi at that point. 244 00:30:23,900 --> 00:30:38,060 You also have a big red alert if you, say, go into a Wi-Fi signal analyzer and you see all of a sudden that there's a hundred or even six or seven SSIDs that all have really high signal strength. 245 00:30:38,200 --> 00:30:40,820 That's maybe not legit. 246 00:30:42,440 --> 00:30:45,340 There are other tricks that you can use. 247 00:30:45,480 --> 00:30:47,780 There are more subtle attacks that somebody might use. 248 00:30:47,780 --> 00:30:49,520 They might not use Karma, for example. 249 00:30:49,520 --> 00:30:58,560 They might just spoof a specific SSID, in which case trick number one and trick number two are not going to do anything for you. 250 00:30:58,600 --> 00:31:05,540 But if somebody is redirecting your traffic, chances are, or there's a good chance that they're going to be using DNS to do this. 251 00:31:05,540 --> 00:31:20,340 So there are systems out there that you can use and websites that you can use over SSL to compare DNS results that you get from your local connection to what the rest of the world thinks the DNS results are. 252 00:31:20,340 --> 00:31:25,620 And if you start getting a lot of conflicts there, then yeah, there's a good chance you've been DNS hijacked. 253 00:31:25,820 --> 00:31:33,860 So I want to kind of talk a little bit about how to make these things better also. 254 00:31:34,620 --> 00:31:40,520 First of all, there's different aspects of SSL that you need to be concerned about. 255 00:31:40,580 --> 00:31:54,640 It's not just checking the server certificate, but it's also you need to make sure that you have a device that has decent entropy, because your SSL is all based on random numbers in your client hello and your server hello. 256 00:31:54,640 --> 00:32:03,500 If those random numbers can be predicted, like DULI, CB, DRG, that's a problem for you. 257 00:32:03,980 --> 00:32:07,580 Perfect forward secrecy also helps out a bit. 258 00:32:07,580 --> 00:32:08,780 This is a good idea. 259 00:32:08,780 --> 00:32:20,440 The idea here is that every time you're making a connection, you're actually, the server is taking a new certificate that it's generating, it's signing it with its trusted certificate. 260 00:32:20,440 --> 00:32:39,520 And that way, if that trusted certificate gets compromised at some point in the future, all of the other connections, maybe data that's been recorded, you're not going to be able to get at that, or the attacker is not going to be able to get at that, unless they brute force and crack every single one of the dynamic or the ephemeral certificates that's been generated. 261 00:32:39,520 --> 00:32:45,060 You also, of course, want to make sure that you're supporting TLS 1.2 with strong ciphers. 262 00:32:45,060 --> 00:32:49,700 So, like, you want to use the Galois counter mode and AES, typically. 263 00:32:51,280 --> 00:32:55,500 And you don't want to do self-signing in production. 264 00:32:55,760 --> 00:33:00,660 But, of course, this isn't completely avoidable, we'll talk about that in a second. 265 00:33:00,660 --> 00:33:05,380 But, one good idea, certificate pinning. 266 00:33:05,380 --> 00:33:08,700 Can anybody tell me what certificate pinning is? 267 00:33:09,380 --> 00:33:11,040 What's certificate pinning? 268 00:33:17,190 --> 00:33:18,530 Yeah, so, exactly. 269 00:33:18,530 --> 00:33:27,170 So, basically, rather than just looking that you've got a trusted certificate, you're looking to make sure that you've got a certificate that you're expecting. 270 00:33:27,170 --> 00:33:29,930 So, for example, the Gmail app. 271 00:33:30,410 --> 00:33:43,290 Even if you add a new trusted CA onto your Android device, you're not going to be able to man in the middle of the Gmail app unless you do some tricks on there to change around what certs it's looking for, because it has a pinned cert. 272 00:33:43,290 --> 00:33:49,170 So, I mentioned don't use self-signed certificates in production. 273 00:33:49,170 --> 00:33:51,290 But, of course, this is unavoidable. 274 00:33:51,310 --> 00:33:54,690 Over there you'll see a table full of wireless routers. 275 00:33:54,690 --> 00:33:59,930 All of those devices have self-signed certificates, if they have SSL at all. 276 00:33:59,930 --> 00:34:02,910 And this isn't going to change anytime soon. 277 00:34:02,910 --> 00:34:05,090 Getting a certificate signed costs money. 278 00:34:05,090 --> 00:34:14,850 It's not scalable to be able to have all manner of consumer products that are actually having signed certificates from a trusted authority. 279 00:34:14,950 --> 00:34:21,310 So, Internet of Things is going to have some serious problems if people don't start thinking about these issues. 280 00:34:21,310 --> 00:34:27,130 One of the approaches that I like is the trust-first approach to this. 281 00:34:27,130 --> 00:34:34,850 So, the first time you connect to a device, you see the SSL certificate that it gives you, you record that SSL certificate. 282 00:34:34,850 --> 00:34:41,630 If you ever see a different certificate, that should set off an alarm saying, user, did you change your device? 283 00:34:41,630 --> 00:34:42,710 Did you reset it? 284 00:34:42,710 --> 00:34:46,070 Otherwise, we think somebody is mucking with your connection. 285 00:34:46,070 --> 00:34:54,990 And this is kind of like the way Firefox works, if you want to go to a site that has a self-signed cert. 286 00:34:54,990 --> 00:35:00,930 But I haven't really seen this happening so much with mobile applications. 287 00:35:00,930 --> 00:35:02,490 I don't understand why. 288 00:35:02,490 --> 00:35:08,750 Maybe if some of you are smartphone developers, you can start integrating that into your apps. 289 00:35:09,430 --> 00:35:29,970 So, what we've talked about here, applications, Android applications specifically that are doing JSON requests, or downloading resources like a database, or doing diagnostic reports, it's really important that you have proper SSL certificate validation in all of these places. 290 00:35:31,370 --> 00:35:50,710 When you don't, like for example, if you're downloading a database that has contacts in it, doing that over HTTP, maybe somebody replaces your database with some cross-site scripting data in there to start accessing other stuff that's going to get loaded through a web view in your app. 291 00:35:50,710 --> 00:35:58,910 We talked a little bit about how to test for these issues, so hopefully this is easy to understand. 292 00:35:58,910 --> 00:36:15,390 If not, you can go to the Tripwire blog, and I actually have a blog post out there that gives a step-by-step process of how to set this up so that you can do end-to-end testing of Android applications for their SSL shortness, I guess we'll call it. 293 00:36:15,390 --> 00:36:22,210 And I just want to reiterate that people are way too trusting of Wi-Fi. 294 00:36:22,210 --> 00:36:30,130 You don't want to use open Wi-Fi networks, and if you don't have to, you know, anyway. 295 00:36:31,650 --> 00:36:37,170 Some of the tools that I talked about are listed up here, along with my contact information. 296 00:36:37,770 --> 00:36:39,930 Does anybody have any questions? 297 00:36:42,290 --> 00:36:45,910 All right, I guess that means that I explained everything very clearly. 298 00:36:45,910 --> 00:36:47,030 Glad to hear it. 299 00:36:47,110 --> 00:36:51,630 And I thank you guys all for your time, and I encourage you to check us out on Twitter.