WEBVTT

00:00.000 --> 00:01.600
All right.

00:01.600 --> 00:03.240
So, hi everybody.

00:03.240 --> 00:05.440
I'm glad you guys are all here.

00:17.620 --> 00:19.960
So, I'm Craig Young.

00:19.960 --> 00:23.100
I'm a security researcher with Tripwire Vert.

00:23.120 --> 00:27.820
I write vulnerability checks for our IP360 vulnerability scanner.

00:27.820 --> 00:31.520
And I also do a lot of research on different vulnerabilities.

00:31.520 --> 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.

00:42.020 --> 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.

00:57.060 --> 01:02.480
So, for example, if you have a taxi application, you have the threat of kidnapping.

01:02.480 --> 01:08.540
If you have a smart car application, you have the threat of somebody being able to access or track your car.

01:08.900 --> 01:14.160
And, of course, the future, we're seeing more and more medical devices and plannable devices.

01:14.300 --> 01:17.760
There are all sorts of nasty situations which could arise.

01:18.160 --> 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.

01:29.760 --> 01:32.360
Apparently, that's not the way to play it.

01:43.400 --> 01:51.100
Prevalence programs has individuals genuinely concerned with the privacy of their communications and personal data.

01:51.100 --> 01:57.580
The Snowden effect has brought SSL concerns and privacy issues to the forefront of conversations.

01:57.580 --> 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.

02:06.320 --> 02:13.160
Hackers can use a simple technique to abduct, stalk, spy, and murder, even physically harm unsuspecting victims.

02:13.160 --> 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.

02:20.560 --> 02:25.160
The attacker spots a potential victim who is using the Uber app to get a text.

02:25.160 --> 02:28.440
The attacker uses their smartphone to start the attack.

02:28.440 --> 02:32.240
The victim now receives a phone alert that an Uber car is on its way.

02:32.240 --> 02:35.460
The Uber driver is actually an accomplice to the attacker.

02:35.460 --> 02:37.960
The victim's Uber app shows the car driving up.

02:37.960 --> 02:41.940
The victim gets into the fake cabin and is now the attacker's captive.

02:41.940 --> 02:48.940
Security vulnerabilities in applications not only jeopardize data, but have devastating personal safety consequences.

02:49.480 --> 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.

03:00.860 --> 03:07.080
So, basically, Uber locked the door, they used SSL, but they didn't quite implement it properly.

03:07.080 --> 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.

03:18.920 --> 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.

03:27.860 --> 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.

03:35.340 --> 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.

03:44.980 --> 03:48.520
So, I use DigitalOcean as a VPS provider.

03:48.520 --> 03:50.780
I set up PPTP on there.

03:50.780 --> 03:53.580
I use my phone to connect into that.

03:53.660 --> 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.

04:00.900 --> 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.

04:13.760 --> 04:18.180
Now, there's lots of applications that have this problem.

04:18.180 --> 04:24.280
When I started using this test methodology, I very quickly saw scary stuff coming off my phone.

04:24.280 --> 04:27.840
Like, for example, Google credentials in plain text.

04:27.840 --> 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.

04:37.560 --> 04:43.140
I also saw that ISP credentials were coming out when using different media streaming applications.

04:43.140 --> 04:45.900
There's financial data that gets leaked.

04:46.400 --> 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.

04:56.380 --> 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.

05:07.120 --> 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.

05:21.180 --> 05:28.180
There's a variety of data in there that could be used to further attacks, like JavaScript bridge attacks against Android.

05:28.760 --> 05:32.740
But back to this particular application.

05:33.220 --> 05:38.640
Of course, Android provides built-in functionality for doing SSL.

05:38.640 --> 05:44.920
There's no problems with the SDK here, but there are a lot of applications that are broken.

05:45.300 --> 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.

06:03.180 --> 06:10.220
But the reason that this all happens, to understand this, you have to understand a little bit about the Android architecture.

06:10.700 --> 06:13.840
So Android is running on top of Linux.

06:14.540 --> 06:17.080
It's using a Dalvik VM.

06:17.080 --> 06:19.560
This is Google's own virtual machine.

06:19.560 --> 06:21.340
Now there's another one, ART.

06:21.620 --> 06:25.180
And applications are getting distributed essentially in a zip file.

06:25.180 --> 06:28.140
This zip file is renamed an APK.

06:28.140 --> 06:33.400
And you've got some Dalvik executable files, decks in there, all sorts of resources.

06:33.820 --> 06:36.780
And it's very, very easy to reverse.

06:36.780 --> 06:41.720
There's tools like Ddexer, APKtool, which uses backsmolly.

06:41.900 --> 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.

06:52.100 --> 06:54.900
So the tool that I like to use is APKtool.

06:54.900 --> 06:59.880
I like it because it's preloaded on Kali, very straightforward to use.

06:59.880 --> 07:01.860
It gives you a lot of flexibility.

07:01.860 --> 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.

07:12.840 --> 07:18.160
Run APKtoold, and you can disassemble that application.

07:18.160 --> 07:21.600
When you do that, you're going to get some data like this.

07:21.600 --> 07:25.060
This is not all-inclusive, but some of the highlights.

07:25.060 --> 07:30.700
You've got the manifest file, which anybody who's developed an Android application will know what this is.

07:30.700 --> 07:36.960
This has all of your permissions, information regarding certs for sharing data between applications.

07:37.240 --> 07:41.800
There's some metadata created by the application to help it rebuild itself.

07:41.800 --> 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.

07:50.880 --> 07:56.220
You've also got your resources directory, which is full of strings, layouts, things like that.

07:56.220 --> 07:59.520
But the most interesting part is the smally code.

07:59.520 --> 08:08.720
Smally is... I believe it's Icelandic for assembly or something along those lines, because Dalvik is an Icelandic town.

08:09.180 --> 08:15.000
But anyway, so once you have this smally output, you can start searching through it.

08:15.000 --> 08:19.460
And what you're searching for is the TrustManager implementation.

08:19.920 --> 08:28.100
The TrustManager, you can see up here, it's javax.net.ssl.x509.trustmanager.

08:28.100 --> 08:31.540
You can do an fgrep through your smally directory.

08:31.640 --> 08:39.080
And you want to find any place where there's a definition for an implementation of this x509.trustmanager.

08:39.080 --> 08:43.500
And then you want to jump down to the checkServerTrusted.

08:43.500 --> 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.

08:57.460 --> 09:05.940
So you could have in here certificate pinning logic or trust logic for figuring out which CAs you trust.

09:05.980 --> 09:11.320
But if you look at this disassembly, there's not much to it here.

09:11.320 --> 09:15.180
You've got a declaration that we could throw an exception.

09:15.180 --> 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.

09:21.440 --> 09:24.020
But all they're doing here is a return void.

09:24.020 --> 09:29.480
So there's absolutely no certificate that would not pass this validation check.

09:29.480 --> 09:32.900
So you could actually roll your own patch.

09:32.980 --> 09:39.300
When you find an application like this, you can go through these steps to find the x509.trustmanager.

09:39.300 --> 09:47.280
You can then take that checkServerTrusted function and put in code that actually does something.

09:47.620 --> 09:51.820
We'll talk a little bit about the things that you can do towards the end of this talk.

09:51.820 --> 09:53.960
But then use the APK tool.

09:53.960 --> 09:57.360
It will rebuild up your package to an APK file.

09:57.460 --> 10:01.420
You just need to sign it then, and you can load it onto your Android device.

10:01.420 --> 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.

10:13.840 --> 10:19.360
So for the sake of comparison, this is also from the Uber app.

10:19.360 --> 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.

10:24.240 --> 10:26.100
That was the root of this problem.

10:26.820 --> 10:31.800
This is also from the Uber app, but this is part of the PayPal SDK.

10:32.060 --> 10:38.140
And if you see, this is just the beginning of the checkServerTrusted function, because it actually does stuff.

10:38.220 --> 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.

10:45.860 --> 10:54.240
So under normal operations, there's really no impact from not validating the SSL certificates.

10:54.240 --> 11:01.020
You have confidentiality, you have integrity, you have authenticity of the server you're going to, in theory.

11:01.020 --> 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.

11:11.040 --> 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.

11:28.120 --> 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.

11:46.340 --> 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.

12:06.820 --> 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.

12:22.080 --> 12:26.940
And, of course, as I was saying, the 802.11 protocol has some shortcomings.

12:27.020 --> 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.

12:37.740 --> 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,

12:55.480 --> 12:57.700
and then it becomes a race condition.

12:57.700 --> 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.

13:05.960 --> 13:11.840
And clients really don't have any mechanisms for validating the access point.

13:11.840 --> 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.

13:27.040 --> 13:32.840
There are some complexity issues when you start talking about the average consumer trying to use this stuff.

13:33.280 --> 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.

13:45.640 --> 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.

13:57.480 --> 14:00.900
You have battery pack with it so you can travel with it.

14:00.900 --> 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.

14:09.420 --> 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.

14:17.340 --> 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.

14:32.480 --> 14:35.240
You're just listening for the probe request that you see.

14:35.240 --> 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.

14:50.340 --> 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.

15:06.520 --> 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.

15:22.500 --> 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.

15:34.780 --> 15:39.780
So there were a couple of approaches that I thought about taking for how to go through this.

15:39.780 --> 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.

15:54.440 --> 15:57.200
And clearly there are pros and cons for each of these.

15:57.200 --> 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.

16:10.840 --> 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.

16:16.980 --> 16:20.360
So I went with the approach of response tampering.

16:20.360 --> 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.

16:28.880 --> 16:35.780
But the choice that I made, as I said, is to do the tampering method.

16:35.780 --> 16:41.100
With the tampering methods, you've got a couple of tools that are already available which you could use.

16:41.820 --> 16:43.720
Mallory is a great example.

16:43.720 --> 16:47.880
It was released by DefCon or BlackHat a few years back from the Intrepidus group.

16:47.880 --> 16:50.920
It's essentially a transparent TCP proxy.

16:50.920 --> 16:53.060
It has great support for SSL.

16:53.640 --> 16:57.040
It will do automatic regex replacements.

16:57.040 --> 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.

17:09.000 --> 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.

17:15.340 --> 17:18.000
It's not really that beefy of a machine.

17:18.000 --> 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.

17:27.160 --> 17:29.700
You've got a GUI that you're going through.

17:29.700 --> 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.

17:37.380 --> 17:42.100
So another option out there, there's MITM dump, man-in-the-middle dump.

17:42.100 --> 17:45.180
This is strictly an HTTPS proxy.

17:45.380 --> 17:49.700
It has hooks in there so that you can do straight regex replacements.

17:49.940 --> 17:51.660
It's all command-driven.

17:51.940 --> 17:57.340
I believe there's even an infusion that you can get this pre-built for the pineapple Wi-Fi.

17:57.340 --> 18:03.680
Don't quote me on that, but I kind of didn't want to go with the off-the-shelf methodology.

18:05.720 --> 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.

18:19.860 --> 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.

18:28.140 --> 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.

18:38.740 --> 18:42.060
So I made a little Python script.

18:42.060 --> 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.

18:53.520 --> 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.

19:05.560 --> 19:10.920
And I made it as a single Py file that has all standard imports.

19:10.920 --> 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.

19:18.020 --> 19:22.420
So this is kind of a block diagram of how this works.

19:23.140 --> 19:25.360
We have a listening socket.

19:25.360 --> 19:30.520
The listening socket wraps TCP connection with an SSL handler.

19:30.520 --> 19:33.220
We're using our self-assigned certificate.

19:33.320 --> 19:37.680
It spawns off a sub-process, which is doing our receive handling.

19:37.900 --> 19:46.270
And what I'm doing here, I used IP tables to redirect the traffic into the UberProxy Py file, or process.

19:46.270 --> 19:52.470
So we don't have knowledge of what the hostname you're trying to connect to is.

19:52.470 --> 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.

20:00.010 --> 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?

20:15.370 --> 20:19.110
So we've got... the DS handler is the downstream handler.

20:19.110 --> 20:21.890
US handler, of course, is the upstream handler.

20:22.130 --> 20:27.110
And the DS handler is where the magic really works.

20:27.250 --> 20:37.710
But the way that the Uber app actually works, you are polling constantly for whatever the nearest vehicles are.

20:38.370 --> 20:43.410
These are JSON requests that indicate where you intend to be picked up.

20:43.410 --> 20:50.450
And you get back responses which are lists of coordinates of paths that the Uber cars have taken.

20:50.570 --> 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.

21:02.150 --> 21:06.570
So Python has great support for interpreting JSON.

21:06.570 --> 21:15.910
So I used the JSON module here to interpret these responses and manipulate them.

21:15.910 --> 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.

21:25.590 --> 21:28.550
I also wanted to avoid any PCI complications.

21:28.550 --> 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.

21:42.810 --> 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.

22:02.310 --> 22:07.470
If you'll see here, the demo that I made of this video will work.

22:14.230 --> 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.

22:22.030 --> 22:25.270
They probably don't float like that in real life, but...

22:25.810 --> 22:31.810
Then, if you look on... I'm going to try and pull up the terminal.

22:33.990 --> 22:37.570
Yep, so this is my script running.

22:37.570 --> 22:41.970
This is a Nexus 7 with the Uber app installed on it.

22:41.970 --> 22:47.170
I'm just going to launch the Uber app, and you can see right away we start getting these requests out.

22:47.170 --> 22:49.730
You really can't read that so well.

22:49.730 --> 22:52.890
Let's turn

22:56.470 --> 22:58.430
up the font a little bit on that.

23:02.680 --> 23:06.520
I don't know if I can adjust the resolution without messing everything up.

23:08.400 --> 23:09.960
Is that a little better?

23:09.960 --> 23:16.080
Yeah, so you can see there's the nearest cab requests, and if we wait...

23:16.640 --> 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,

23:33.160 --> 23:38.400
you would start seeing lots of geolocations for the Uber taxis in here.

23:38.400 --> 23:41.420
So back over to the slide deck.

23:44.880 --> 23:48.360
Those are some nice flowers, but that's not what I wanted to show you.

23:49.760 --> 23:53.780
So I reported this issue back in March 2014.

23:53.820 --> 24:00.200
I also reported similar issues to six or seven other vendors.

24:00.980 --> 24:04.060
Uber was very, very excellent about responding.

24:04.060 --> 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.

24:20.160 --> 24:24.220
So if you use Uber, you want to make sure your app is up to date.

24:24.220 --> 24:25.080
I'm not sure.

24:25.080 --> 24:30.800
It might have asked for new permissions, so you could be waiting if you don't explicitly tell it to update.

24:30.800 --> 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.

24:43.940 --> 24:45.900
I hope you all understand why.

24:45.900 --> 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,

25:03.060 --> 25:07.560
unlock the doors, find your car on a map, send directions to it.

25:07.700 --> 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?

25:16.080 --> 25:17.700
So that's good.

25:17.860 --> 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,

25:35.800 --> 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.

25:48.760 --> 25:53.540
You could also follow somebody around from a distance without being exposed.

25:54.440 --> 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.

26:03.960 --> 26:08.180
Moxie's SSL sniff is more than enough to get the credentials.

26:08.180 --> 26:13.300
Once you have the credentials, you can forge all of the requests that you need for this.

26:15.860 --> 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,

26:36.800 --> 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.

26:47.560 --> 26:53.960
And there are other areas of concern, and there are going to continue to be more and more problems.

26:54.020 --> 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.

27:10.800 --> 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.

27:21.740 --> 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,

27:40.940 --> 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.

27:59.980 --> 28:07.680
These problems are beyond just 802.11 and smartphone apps.

28:11.080 --> 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.

28:26.860 --> 28:29.360
So, how can you actually stay safe?

28:29.360 --> 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.

28:36.480 --> 28:40.920
You probably want to keep Wi-Fi off most of the time that you're at DEF CON, for example.

28:41.960 --> 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.

28:51.200 --> 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.

29:02.320 --> 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.

29:17.300 --> 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.

29:23.900 --> 29:29.200
You don't want to leave any profiles on your devices that are for open Wi-Fi.

29:29.200 --> 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.

29:51.100 --> 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.

30:00.640 --> 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.

30:15.540 --> 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.

30:23.900 --> 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.

30:38.200 --> 30:40.820
That's maybe not legit.

30:42.440 --> 30:45.340
There are other tricks that you can use.

30:45.480 --> 30:47.780
There are more subtle attacks that somebody might use.

30:47.780 --> 30:49.520
They might not use Karma, for example.

30:49.520 --> 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.

30:58.600 --> 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.

31:05.540 --> 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.

31:20.340 --> 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.

31:25.820 --> 31:33.860
So I want to kind of talk a little bit about how to make these things better also.

31:34.620 --> 31:40.520
First of all, there's different aspects of SSL that you need to be concerned about.

31:40.580 --> 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.

31:54.640 --> 32:03.500
If those random numbers can be predicted, like DULI, CB, DRG, that's a problem for you.

32:03.980 --> 32:07.580
Perfect forward secrecy also helps out a bit.

32:07.580 --> 32:08.780
This is a good idea.

32:08.780 --> 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.

32:20.440 --> 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.

32:39.520 --> 32:45.060
You also, of course, want to make sure that you're supporting TLS 1.2 with strong ciphers.

32:45.060 --> 32:49.700
So, like, you want to use the Galois counter mode and AES, typically.

32:51.280 --> 32:55.500
And you don't want to do self-signing in production.

32:55.760 --> 33:00.660
But, of course, this isn't completely avoidable, we'll talk about that in a second.

33:00.660 --> 33:05.380
But, one good idea, certificate pinning.

33:05.380 --> 33:08.700
Can anybody tell me what certificate pinning is?

33:09.380 --> 33:11.040
What's certificate pinning?

33:17.190 --> 33:18.530
Yeah, so, exactly.

33:18.530 --> 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.

33:27.170 --> 33:29.930
So, for example, the Gmail app.

33:30.410 --> 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.

33:43.290 --> 33:49.170
So, I mentioned don't use self-signed certificates in production.

33:49.170 --> 33:51.290
But, of course, this is unavoidable.

33:51.310 --> 33:54.690
Over there you'll see a table full of wireless routers.

33:54.690 --> 33:59.930
All of those devices have self-signed certificates, if they have SSL at all.

33:59.930 --> 34:02.910
And this isn't going to change anytime soon.

34:02.910 --> 34:05.090
Getting a certificate signed costs money.

34:05.090 --> 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.

34:14.950 --> 34:21.310
So, Internet of Things is going to have some serious problems if people don't start thinking about these issues.

34:21.310 --> 34:27.130
One of the approaches that I like is the trust-first approach to this.

34:27.130 --> 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.

34:34.850 --> 34:41.630
If you ever see a different certificate, that should set off an alarm saying, user, did you change your device?

34:41.630 --> 34:42.710
Did you reset it?

34:42.710 --> 34:46.070
Otherwise, we think somebody is mucking with your connection.

34:46.070 --> 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.

34:54.990 --> 35:00.930
But I haven't really seen this happening so much with mobile applications.

35:00.930 --> 35:02.490
I don't understand why.

35:02.490 --> 35:08.750
Maybe if some of you are smartphone developers, you can start integrating that into your apps.

35:09.430 --> 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.

35:31.370 --> 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.

35:50.710 --> 35:58.910
We talked a little bit about how to test for these issues, so hopefully this is easy to understand.

35:58.910 --> 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.

36:15.390 --> 36:22.210
And I just want to reiterate that people are way too trusting of Wi-Fi.

36:22.210 --> 36:30.130
You don't want to use open Wi-Fi networks, and if you don't have to, you know, anyway.

36:31.650 --> 36:37.170
Some of the tools that I talked about are listed up here, along with my contact information.

36:37.770 --> 36:39.930
Does anybody have any questions?

36:42.290 --> 36:45.910
All right, I guess that means that I explained everything very clearly.

36:45.910 --> 36:47.030
Glad to hear it.

36:47.110 --> 36:51.630
And I thank you guys all for your time, and I encourage you to check us out on Twitter.

