start	end	text
0	5440	All right. So, hi everybody. I'm glad you guys are all here.
17620	23100	So, I'm Craig Young. I'm a security researcher with Tripwire Vert.
23120	27820	I write vulnerability checks for our IP360 vulnerability scanner.
27820	31520	And I also do a lot of research on different vulnerabilities.
31520	35020	Lately, I've been looking at a lot of different Android applications,
35020	38780	and I've been noticing more and more that there's a lot of Android applications
38780	42020	that don't implement SSL properly.
42020	45980	And with the push that we've been seeing with more and more apps
45980	49220	that are really having real-world integration,
49220	54420	you have more and more situations where broken SSL doesn't just jeopardize privacy,
54420	57060	but it's actually jeopardizing people's safety.
57060	62480	So, for example, if you have a taxi application, you have the threat of kidnapping.
62480	64200	If you have a smart car application,
64200	68540	you have the threat of somebody being able to access or track your car.
68900	74160	And, of course, the future, we're seeing more and more medical devices and plannable devices.
74300	77760	There are all sorts of nasty situations which could arise.
78160	81100	But to introduce the scenario that I'm going to talk about first,
81100	88220	I have a little video clip, a dramatic video, a little play.
89760	92360	Apparently, that's not the way to play it.
103400	107200	Prevalence programs has individuals genuinely concerned
107200	111100	with the privacy of their communications and personal data.
111100	115100	The Snowden effect has brought SSL concerns and privacy issues
115100	117580	to the forefront of conversations.
117580	122540	What most of us don't realize is that there are real-world consequences to personal safety
122540	126320	when cryptography is not implemented properly.
126320	130320	Hackers can use a simple technique to abduct, stalk, spy, and murder,
130320	133160	even physically harm unsuspecting victims.
133160	136800	To exemplify, an attacker is at a bar hanging out with their hacking gear,
136920	140560	a pineapple Wi-Fi, intercepting Wi-Fi connections.
140560	145160	The attacker spots a potential victim who is using the Uber app to get a text.
145160	148440	The attacker uses their smartphone to start the attack.
148440	152240	The victim now receives a phone alert that an Uber car is on its way.
152240	155460	The Uber driver is actually an accomplice to the attacker.
155460	157960	The victim's Uber app shows the car driving up.
157960	161940	The victim gets into the fake cabin and is now the attacker's captive.
161940	165540	Security vulnerabilities in applications not only jeopardize data,
165540	168940	but have devastating personal safety consequences.
169480	174820	So, with that introduction, I'm sure a lot of people probably know
174820	178780	what the vulnerability here is, but I'm going to explain it anyway,
178780	180760	because that's what I'm talking to you guys about.
180860	184320	So, basically, Uber locked the door, they used SSL,
184320	187080	but they didn't quite implement it properly.
187080	191720	They did not implement anything for checking the client's or the server's certificate,
191720	195460	so the client Android application has no way of informing a user
195460	198680	if you're not actually talking to the real Uber service.
198920	204240	So, this is a real big problem, because anybody can generate a self-signed certificate,
204240	207740	man-in-the-middle connection, start manipulating traffic.
207860	212120	So, before I get into how I manipulate the Uber traffic,
212120	215160	let's take a look at how you can test for this kind of issue.
215340	222440	So, the easiest way that I've found to try and identify SSL certificate validation failures
222440	224980	is by setting up a simple VPN.
224980	228520	So, I use DigitalOcean as a VPS provider.
228520	230780	I set up PPTP on there.
230780	233580	I use my phone to connect into that.
233660	236720	And then using Mox and Marlin Spikes SSL sniff,
236720	240880	I found it was very easy to use IP tables, redirect traffic into there.
240900	249640	And you can see very easily, if the application under test is not implementing SSL properly,
249640	253760	you'll start getting requests like that, as opposed to getting an error on your device.
253760	258180	Now, there's lots of applications that have this problem.
258180	264280	When I started using this test methodology, I very quickly saw scary stuff coming off my phone.
264280	267840	Like, for example, Google credentials in plain text.
267840	274420	Not from an actual Google-made app, but from a third-party application that has millions of downloads
274420	277560	and still has not fixed it, which is why I'm not naming them.
277560	283140	I also saw that ISP credentials were coming out when using different media streaming applications.
283140	285900	There's financial data that gets leaked.
286400	293480	And we also, of course, there are libraries that get reused in a lot of different Android projects
293480	296380	that do error reporting.
296380	302300	And they will connect over SSL, but they won't do anything to validate the server,
302300	307080	because typically your server might have a self-signed certificate in this situation.
307120	310880	The result of this is that if somebody is man-in-the-middle-of-your-connection,
310880	316660	they're able to see a lot of detailed information, like what intents you have registered on the device,
316660	320080	sometimes what applications are actively running.
321180	325660	There's a variety of data in there that could be used to further attacks,
325660	328180	like JavaScript bridge attacks against Android.
328760	332740	But back to this particular application.
333220	338640	Of course, Android provides built-in functionality for doing SSL.
338640	344920	There's no problems with the SDK here, but there are a lot of applications that are broken.
345300	350660	And what I was finding is that it tends to be when you have an application that's not using a WebView,
350660	355080	but instead making direct JSON requests, for example,
355080	361320	the application developers very frequently implement kind of a naive trust model,
361320	362900	which I'll get into in a minute.
363180	367420	But the reason that this all happens, to understand this,
367420	370220	you have to understand a little bit about the Android architecture.
370700	373840	So Android is running on top of Linux.
374540	379560	It's using a Dalvik VM. This is Google's own virtual machine.
379560	381340	Now there's another one, ART.
381620	385180	And applications are getting distributed essentially in a zip file.
385180	388140	This zip file is renamed an APK.
388140	393400	And you've got some Dalvik executable files, decks in there, all sorts of resources.
393820	396780	And it's very, very easy to reverse.
396780	401720	There's tools like Ddexer, APKtool, which uses backsmolly.
401900	409020	And you can use these tools to start analyzing what it is that went wrong within an application,
409020	411840	find out why the SSL is broken.
412100	414900	So the tool that I like to use is APKtool.
414900	419880	I like it because it's preloaded on Kali, very straightforward to use.
419880	421860	It gives you a lot of flexibility.
421860	431060	So all you have to do is put your APK file that you want to analyze into the user-share APKtool directory,
431060	432840	on Kali Linux anyway.
432840	438160	Run APKtoold, and you can disassemble that application.
438160	441600	When you do that, you're going to get some data like this.
441600	445060	This is not all-inclusive, but some of the highlights.
445060	450700	You've got the manifest file, which anybody who's developed an Android application will know what this is.
450700	456960	This has all of your permissions, information regarding certs for sharing data between applications.
457240	461800	There's some metadata created by the application to help it rebuild itself.
461800	465880	You've also got native libraries on there, which you could perform static analysis
465880	470780	and start finding memory corruption vulnerabilities and things like that.
470880	476220	You've also got your resources directory, which is full of strings, layouts, things like that.
476220	479520	But the most interesting part is the smally code.
479520	486060	Smally is... I believe it's Icelandic for assembly or something along those lines,
486060	488720	because Dalvik is an Icelandic town.
489180	495000	But anyway, so once you have this smally output, you can start searching through it.
495000	499460	And what you're searching for is the TrustManager implementation.
499920	508100	The TrustManager, you can see up here, it's javax.net.ssl.x509.trustmanager.
508100	511540	You can do an fgrep through your smally directory.
511640	519080	And you want to find any place where there's a definition for an implementation of this x509.trustmanager.
519080	523500	And then you want to jump down to the checkServerTrusted.
523500	528600	This checkServerTrusted function, this is what's supposed to actually do the work
528600	533820	of figuring out whether or not the server that you're talking to has a properly signed certificate
533820	537460	and whether it should be trusted.
537460	545940	So you could have in here certificate pinning logic or trust logic for figuring out which CAs you trust.
545980	551320	But if you look at this disassembly, there's not much to it here.
551320	555180	You've got a declaration that we could throw an exception.
555180	558600	That's the exception that you would have to throw if you wanted to tell the client
558600	561300	that this is a bad connection to not be trusted.
561440	564020	But all they're doing here is a return void.
564020	569480	So there's absolutely no certificate that would not pass this validation check.
569480	572900	So you could actually roll your own patch.
572980	579300	When you find an application like this, you can go through these steps to find the x509.trustmanager.
579300	587280	You can then take that checkServerTrusted function and put in code that actually does something.
587620	591820	We'll talk a little bit about the things that you can do towards the end of this talk.
591820	597360	But then use the APK tool. It will rebuild up your package to an APK file.
597460	601420	You just need to sign it then, and you can load it onto your Android device.
601420	609100	And even if an application developer is not fixing their application and keeping an SSL vulnerability in there,
609100	613360	you could, in theory, continue to use the app without risking man-in-the-middle.
613840	619360	So for the sake of comparison, this is also from the Uber app.
619360	624240	By the way, I don't know if this was clear, but that first code sample, that was from the Uber app.
624240	626100	That was the root of this problem.
626820	631800	This is also from the Uber app, but this is part of the PayPal SDK.
632060	638140	And if you see, this is just the beginning of the checkServerTrusted function, because it actually does stuff.
638220	645860	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.
645860	654240	So under normal operations, there's really no impact from not validating the SSL certificates.
654240	661020	You have confidentiality, you have integrity, you have authenticity of the server you're going to, in theory.
661020	665860	But really, this all gets thrown out the window if there is a man-in-the-middle,
665860	671040	because you don't have any logic here checking whether the server has a trusted cert.
671040	681660	So even that SSL is preventing that somebody just passively eavesdropping would be able to listen and see what your password is,
681660	688120	or whatever other data is going across the stream, you still have the possibility of man-in-the-middle attacks.
688120	698220	This is particularly a risk with smartphones and tablets, because we have this wonderful thing, 802.11 Wi-Fi,
698220	706340	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.
706340	718480	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,
718480	726820	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.
726820	736420	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,
736420	741740	they're going to use it, and that gives somebody else access to their data stream.
742080	746940	And, of course, as I was saying, the 802.11 protocol has some shortcomings.
747020	754340	Very briefly, there's issues, for example, the fact that your devices are generally going to send out probe requests,
754340	760900	saying all of the SSIDs that they're looking for. Your deauthentication frames are never encrypted,
760900	769920	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,
769920	777700	you can send a completely plain text message and boot them off of that network, and then it becomes a race condition.
777700	785960	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.
785960	791840	And clients really don't have any mechanisms for validating the access point.
791840	798720	There have been some really great ideas in this field of using certificates to improve the situation,
798720	807040	but unfortunately there has not been really the hardware vendor cooperation in this realm to make these kinds of changes happen.
807040	812840	There are some complexity issues when you start talking about the average consumer trying to use this stuff.
813280	821300	So, these flaws, of course, can get exploited using Pineapple Wi-Fi, which is available through Hackshop,
821300	830220	and it's a nice little portable pen test tool. I won't talk too much about that since I'm sure all of you guys have seen that in this room,
830220	837480	but you can easily plug in a 4G modem stick to it so you have out-of-band access to it.
837480	845860	You have battery pack with it so you can travel with it. You can take it into a bar, wait for somebody using the Uber app,
845860	849240	and then start launching your attack as I showed in that video.
849420	857340	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.
857340	866380	But basically, the way that the interception is going to work in this scenario, the Pineapple Wi-Fi uses a tool called Karma,
866380	872480	also referred to as Yasager, I suppose, but this process is circular.
872480	882140	You're just listening for the probe request that you see. When there is a probe request sent, you take whatever SSID it was looking for,
882140	889500	and you start broadcasting that SSID and wait for unassociated clients to connect to you.
890340	899080	A slightly more sophisticated approach, if your target happens to already be connected to a wireless network,
899080	906520	you can use the flaw in the 802.11 protocol, or limitation I should say, that you can send a deauth frame.
906520	912960	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,
912960	922320	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.
922500	934780	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.
934780	939780	So there were a couple of approaches that I thought about taking for how to go through this.
939780	946000	Primarily I was looking at whether it would be better to completely impersonate the Uber backend server,
946000	954040	since you can present any certificate and the phone will think that it is uber.com, or you can just tamper the responses.
954440	957200	And clearly there are pros and cons for each of these.
957200	966000	If you're completely impersonating the backend, like meaning reconstructing the server and making it behave the way the real Uber server would,
966000	970840	you're going to have pretty good reliability with this approach, but it's going to take a while to develop.
970840	976900	It's going to take longer than I felt like spending for this presentation when I'm not really planning on kidnapping anybody.
976980	980360	So I went with the approach of response tampering.
980360	988320	This is very quick to implement, but of course it could be a little more fragile, because backend changes could cause this to break.
988880	995780	But the choice that I made, as I said, is to do the tampering method.
995780	1001100	With the tampering methods, you've got a couple of tools that are already available which you could use.
1001820	1007880	Mallory is a great example. It was released by DefCon or BlackHat a few years back from the Intrepidus group.
1007880	1013060	It's essentially a transparent TCP proxy. It has great support for SSL.
1013640	1017040	It will do automatic regex replacements.
1017040	1028140	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.
1029000	1035340	But it's also a little bit clunky for this kind of task, because I want it to run on the pineapple Wi-Fi.
1035340	1038000	It's not really that beefy of a machine.
1038000	1047160	And Mallory, you typically... it's a great tool for identifying vulnerabilities and working on pentest engagement, but it's not really so flexible.
1047160	1057140	You've got a GUI that you're going through. 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.
1057380	1062100	So another option out there, there's MITM dump, man-in-the-middle dump.
1062100	1069700	This is strictly an HTTPS proxy. It has hooks in there so that you can do straight regex replacements.
1069940	1077340	It's all command-driven. I believe there's even an infusion that you can get this pre-built for the pineapple Wi-Fi.
1077340	1083680	Don't quote me on that, but I kind of didn't want to go with the off-the-shelf methodology.
1085720	1093320	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,
1093320	1099860	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.
1099860	1108140	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.
1108140	1115060	You also have, with these off-the-shelf tools, perhaps some issues with dependencies that they're going to require on,
1115060	1118620	and you're not necessarily going to be able to port it from one place to another.
1118740	1126220	So I made a little Python script. It didn't take long to write, and it gave me a lot more flexibility
1126220	1132380	because there's no license restrictions on it, other than the Python license restrictions, because I wrote it.
1133520	1140400	It allows me to monitor the context of the application and do things statefully in an intelligent manner
1140400	1145460	so that I can control the coordinates that are going in a meaningful way if I wanted to.
1145560	1150920	And I made it as a single Py file that has all standard imports.
1150920	1158020	So it runs right out of the box on the Pineapple Wi-Fi, or basically anything else that has Python on it.
1158020	1162420	So this is kind of a block diagram of how this works.
1163140	1170520	We have a listening socket. The listening socket wraps TCP connection with an SSL handler.
1170520	1173220	We're using our self-assigned certificate.
1173320	1177680	It spawns off a sub-process, which is doing our receive handling.
1177900	1186270	And what I'm doing here, I used IP tables to redirect the traffic into the UberProxy Py file, or process.
1186270	1192470	So we don't have knowledge of what the hostname you're trying to connect to is.
1192470	1199730	So you have to look at the HTTP headers, and I use that information then with urllib to go out and fetch the resource.
1200010	1206330	And then I can look at the response and decide... or actually, first I look at the request and decide,
1206330	1214450	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?
1215370	1219110	So we've got... the DS handler is the downstream handler.
1219110	1221890	US handler, of course, is the upstream handler.
1222130	1227110	And the DS handler is where the magic really works.
1227250	1237710	But the way that the Uber app actually works, you are polling constantly for whatever the nearest vehicles are.
1238370	1243410	These are JSON requests that indicate where you intend to be picked up.
1243410	1250450	And you get back responses which are lists of coordinates of paths that the Uber cars have taken.
1250570	1257910	So essentially it will give you a list of timestamp and latitude and longitude, timestamp, latitude, and longitude,
1257910	1261810	so that the app is able to draw out on the screen how the cars are moving.
1262150	1266570	So Python has great support for interpreting JSON.
1266570	1275910	So I used the JSON module here to interpret these responses and manipulate them.
1275910	1280690	I didn't want to inadvertently start getting Uber drivers coming out to my house while I was working on this,
1280690	1285590	so I didn't actually go through the whole process of man-in-the-middling the purchase process.
1285590	1288550	I also wanted to avoid any PCI complications.
1288550	1302730	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.
1302810	1308310	And of course, if you wanted to, or if somebody wanted to actually use this in a real-world environment,
1308310	1320650	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.
1322310	1327470	If you'll see here, the demo that I made of this video will work.
1334230	1342030	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.
1342030	1345270	They probably don't float like that in real life, but...
1345810	1351810	Then, if you look on... I'm going to try and pull up the terminal.
1353990	1361970	Yep, so this is my script running. This is a Nexus 7 with the Uber app installed on it.
1361970	1367170	I'm just going to launch the Uber app, and you can see right away we start getting these requests out.
1367170	1378430	You really can't read that so well. Let's turn up the font a little bit on that.
1382680	1386520	I don't know if I can adjust the resolution without messing everything up.
1388400	1389960	Is that a little better?
1389960	1396080	Yeah, so you can see there's the nearest cab requests, and if we wait...
1396640	1402080	Well, so right here, it's having a little bit of trouble determining my location inside the building,
1402080	1407980	so we're not actually getting to the point where we can see the cab locations,
1407980	1413160	but if we stepped outside and we were in a city where Uber actually operates,
1413160	1418400	you would start seeing lots of geolocations for the Uber taxis in here.
1418400	1421420	So back over to the slide deck.
1424880	1428360	Those are some nice flowers, but that's not what I wanted to show you.
1429760	1433780	So I reported this issue back in March 2014.
1433820	1440200	I also reported similar issues to six or seven other vendors.
1440980	1444060	Uber was very, very excellent about responding.
1444060	1450980	They were very happy to hear about this from me rather than hearing about this from the Federal Trade Commission
1450980	1456020	or whoever would be investigating that, and by the time May came around,
1456020	1460140	they had a complete revamp of the app, which does not have this problem in it.
1460160	1464220	So if you use Uber, you want to make sure your app is up to date.
1464220	1470800	I'm not sure. It might have asked for new permissions, so you could be waiting if you don't explicitly tell it to update.
1470800	1480180	Anyway, other apps that I looked at, since the manufacturers have not really been responding so well,
1480180	1483940	I'm not comfortable with disclosing the particulars of the brands.
1483940	1485900	I hope you all understand why.
1485900	1490180	But a lot of cars these days, this is one of the things that I was looking at,
1490180	1496320	they all have telematic systems which connect over typically CDMA networks,
1496320	1503060	and you have smartphone apps that go along with them which allow you to do things like remote start your car,
1503060	1507560	unlock the doors, find your car on a map, send directions to it.
1507700	1515860	And what I found was with my car in particular, and none of you know what kind of car I have, right?
1516080	1517700	So that's good.
1517860	1525100	But you're able to, if you just intercept one connection from this app, you can start unlocking the doors,
1525100	1531440	you can find the car on a map, and if you wanted to, you could use this to stalk somebody,
1531440	1535800	you could use this to go watch their movement, wait until they park,
1535800	1539880	say they're going into a shopping mall, you walk up, unlock the doors,
1539880	1545080	you could plant a listening device if you're polite but wanting to be kind of intrusive,
1545080	1547840	or you could plant a bomb if you wanted to.
1548760	1553540	You could also follow somebody around from a distance without being exposed.
1554440	1560640	So, if you wanted to exploit this, it's actually very, very simple,
1560640	1563960	because you really don't even need to write any code yourself.
1563960	1568180	Moxie's SSL sniff is more than enough to get the credentials.
1568180	1573300	Once you have the credentials, you can forge all of the requests that you need for this.
1575860	1581500	So, for link stars, what I'm calling it, obviously not the real name,
1581500	1586560	I alerted them back in February, I alerted the car manufacturer in February,
1586560	1593560	that is, I also alerted Google Play in March 2014 of this and several other applications
1593560	1601100	in the same and other disciplines, and as of July, I have not gotten any responses,
1601100	1607560	so it would seem that app developers really don't take this situation seriously.
1607560	1613960	And there are other areas of concern, and there are going to continue to be more and more problems.
1614020	1621920	I mean, we're having people with defibrillators implanted into them that have pacemakers
1621920	1625580	that feed data into their cell phone and send it out to a doctor,
1625580	1630800	allowing the doctor to make a response and send a charge to somebody's heart.
1630800	1637200	If you could manipulate that data stream and make the doctor think that somebody's just had a cardiac event,
1637200	1639540	you're talking about potential murder.
1641740	1647260	So, also, I don't know how many people have been following BlackHat or were at BlackHat,
1647260	1651560	but there were some references about various home security systems,
1651560	1657920	and these things have a lot of the same problems, that they're either using encryption,
1657920	1660940	but not using it properly so that you can man-in-the-middle it,
1660940	1665120	or they're just using proprietary RF protocols that are plain text,
1665120	1669080	and I'm sorry, I forget the name of the researcher,
1669080	1674140	but there were two different researchers that have been showing recently that you could very easily use this
1674140	1679300	to cause a flood of false positives or just disable or burglar alarms.
1679980	1687680	These problems are beyond just 802.11 and smartphone apps.
1691080	1697940	The mass availability of software-defined radio opens up the door to all sorts of different RF protocols
1697940	1705400	being subject to attacks due to poorly implemented or not implemented encryption.
1706860	1709360	So, how can you actually stay safe?
1709360	1716480	If you're talking about the Wi-Fi aspect of things, you want to turn off Wi-Fi when you're not using it.
1716480	1720920	You probably want to keep Wi-Fi off most of the time that you're at DEF CON, for example.
1721960	1730140	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.
1731200	1739160	There are some issues with connecting to non-broadcast SSIDs,
1739160	1742320	which can make it easier for somebody to man-in-the-middle your connection.
1742320	1750300	It's kind of ongoing research, but I'm just going to say, not broadcasting your SSID,
1750300	1756440	it doesn't really help you from a security perspective, and it can actually hurt you from what I've been seeing.
1757300	1763900	If you're going to use open Wi-Fi, all right, but use it and then remove the profile from your device.
1763900	1769200	You don't want to leave any profiles on your devices that are for open Wi-Fi.
1769200	1777720	And if you're using an application that maybe has some kind of sensitive data or might have some ramifications in the real world,
1777720	1783700	you can use that testing strategy that we went over in the beginning of setting up a PPTP VPN
1783700	1791100	and using a cell sniff to find out very quickly whether or not applications are vulnerable to this type of attack.
1791100	1800640	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.
1800640	1810460	For example, if you're in this room right now and you were to take out your phone and add an SSID of ABCDEFG,
1810460	1815540	I would guarantee you that in a couple seconds you would see that SSID being broadcast.
1815540	1823060	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.
1823900	1835540	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
1835540	1840820	that all have really high signal strength. That's maybe not legit.
1842440	1847780	There are other tricks that you can use. There are more subtle attacks that somebody might use.
1847780	1858560	They might not use Karma, for example. 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.
1858600	1865540	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.
1865540	1880340	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.
1880340	1885620	And if you start getting a lot of conflicts there, then yeah, there's a good chance you've been DNS hijacked.
1885820	1893860	So I want to kind of talk a little bit about how to make these things better also.
1894620	1900520	First of all, there's different aspects of SSL that you need to be concerned about.
1900580	1914640	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.
1914640	1923500	If those random numbers can be predicted, like DULI, CB, DRG, that's a problem for you.
1923980	1940440	Perfect forward secrecy also helps out a bit. This is a good idea. 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.
1940440	1959520	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.
1959520	1980660	You also, of course, want to make sure that you're supporting TLS 1.2 with strong ciphers. So, like, you want to use the Galois counter mode and AES, typically. And you don't want to do self-signing in production. But, of course, this isn't completely avoidable, we'll talk about that in a second.
1980660	2007170	But, one good idea, certificate pinning. Can anybody tell me what certificate pinning is? What's certificate pinning? Yeah, so, exactly. 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.
2007170	2023290	So, for example, the Gmail app. 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.
2023290	2039930	So, I mentioned don't use self-signed certificates in production. But, of course, this is unavoidable. Over there you'll see a table full of wireless routers. All of those devices have self-signed certificates, if they have SSL at all.
2039930	2061310	And this isn't going to change anytime soon. Getting a certificate signed costs money. It's not scalable to be able to have all manner of consumer products that are actually having signed certificates from a trusted authority. So, Internet of Things is going to have some serious problems if people don't start thinking about these issues.
2061310	2086070	One of the approaches that I like is the trust-first approach to this. So, the first time you connect to a device, you see the SSL certificate that it gives you, you record that SSL certificate. If you ever see a different certificate, that should set off an alarm saying, user, did you change your device? Did you reset it? Otherwise, we think somebody is mucking with your connection.
2086070	2108750	And this is kind of like the way Firefox works, if you want to go to a site that has a self-signed cert. But I haven't really seen this happening so much with mobile applications. I don't understand why. Maybe if some of you are smartphone developers, you can start integrating that into your apps.
2109430	2129970	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.
2131370	2150710	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.
2150710	2175390	We talked a little bit about how to test for these issues, so hopefully this is easy to understand. 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.
2175390	2199930	And I just want to reiterate that people are way too trusting of Wi-Fi. You don't want to use open Wi-Fi networks, and if you don't have to, you know, anyway. Some of the tools that I talked about are listed up here, along with my contact information. Does anybody have any questions?
2202290	2211630	All right, I guess that means that I explained everything very clearly. Glad to hear it. And I thank you guys all for your time, and I encourage you to check us out on Twitter.
