start	end	text
0	5300	Good morning, everyone. Our next speaker will be talking about TLS decryption attacks and
5300	9540	backdoors to secure systems. Let's all welcome Mr. Chris Henlon.
17330	22750	Welcome to TLS decryption attacks and backdoors to secure systems.
23470	29610	What we're going to be covering today is how weak authentication creates backdoors in modern
29610	34430	security systems. We're going to be covering how state-sponsored attackers have already
34430	40990	exploited those weaknesses. We're going to be talking about ways that you can copy their
40990	47310	exploits and ways that you can build on their exploits and do more advanced attacks than what
47310	53070	nation-states have been caught doing. I suspect that some of them have already
53070	58030	used these approaches, but they haven't been caught for quite a few of them.
59750	64130	So, a little bit about me and why you might want to listen to me.
67490	74070	I've been configuring and protecting desktops and servers since 1998. I run a small business
74070	79530	helping companies secure their infrastructure and their software development life cycle.
79610	88010	I have a few accepted volumes, starting with a file system volume in the Linux kernel a long
88010	93610	Google Apps vulnerabilities, one of which got me into the Google Security Hall of Fame.
93630	100050	I'm also on the organizing committee for B-Sides Vancouver Island. And in a totally shameless plug,
100050	104670	I'd like to encourage you all to try and buy the last eight tickets.
104670	109310	Because there's only about eight tickets left, and I'm hoping to see you there.
111370	115730	You really need to get permission before doing these attacks.
115730	121220	Or practicing any security testing. I don't want anyone here to go to jail.
121590	126810	And the laws vary from region to region. So, make sure you have appropriate permission for
126810	134040	your region. And the regions of any machines that you're hoping to test or break into.
136190	144010	So, TLS was explicitly invented to prevent man-in-the-middle attacks.
144010	151230	It even says in early specs from about 1994, what a man-in-the-middle attack is.
151230	157690	Where there's three parties on the conversation, theoretically more, and that a bad guy sits
157690	164210	between the client and the server on the network, intercepts the traffic, and effectively pretends
164210	172850	to be the server. According to the specs, the man-in-the-middle... oh, sorry. With SSL,
172850	179910	these attacks are impossible because of server certificates. The spec goes on to more reasons
179910	186050	why they would be very difficult. But it depends on server certificates.
187230	194510	And that is how attackers decrypt TLS encrypted traffic. Because many certificate authorities
195030	204050	are willing to accept plain text authentication for domain ownership. So this means the plain
204050	214710	text authentication makes certificate generation vulnerable to the exact attacks that certificates
214710	222210	are supposed to prevent. Attackers then exploit the plain text communication and obtain certificates
222210	227850	for domains they don't own and trick users into thinking they're the real server.
230120	235480	So how do we know that attackers have decrypted TLS encrypted traffic?
236100	245460	Well, the U.S. government issued instructions to various government organizations on how to fix
245460	254960	the problem. FireEye had some great details on all the ways the attacks happened. And there's
254960	263480	been many other, I believe this is a Cisco Talos, many other organizations commenting on it.
270220	272840	It's hot outside and I'm thirsty.
276140	279040	Oh, I think I went back one.
279040	292790	Okay. So if you wanted to copy them, you could intercept the DNS traffic on the way from the CA
293410	302350	to the DNS server for the domain you want to attack. You could intercept HTTP traffic, SMTP
302350	309210	traffic, or different DNS traffic. And a lot of people might go, Chris, these all sound like the
309210	315450	same thing. So I'm going to leave the top part on there and explain why they're not.
315630	323090	Let's say someone was trying to attack the city of Seattle's infrastructure. They have several
323090	332110	options. They could attack or intercept traffic near the primary DNS server, which appears to be
332110	340710	in New York. Or near their mail server, which appears to be in Wyoming. Or near the web server,
340710	349670	which is in Seattle. Or near the mail provider. So that would be Office 365's name servers. So
349670	355970	these are totally different networks, totally different locations where the same approximate
355970	362910	type of attack can be launched. From the attacker's point of view, they might not just be
362910	368090	targeting one domain. They might be trying to get as much data as they can. So if they break
368090	373930	in upstream from the name server, there's thousands of domains they can get certificates for. If
373930	383470	they break in upstream from Office 365, same thing. And so on and so forth for the other
383470	393710	locations. So how would an attacker break into a router? We've seen several firmware vulnerabilities
393710	401850	released. We've seen hard-coded passwords. There have been some compromised telecom companies.
401850	410650	And just this week we saw that AT&T staff had been accepting bribes to infect their own network.
411690	418810	Now, sometimes there's alternatives. You don't want to do those because you might get caught.
419110	425770	So we've seen quite a few BGP attacks where traffic gets redirected to a different country
425770	432710	than it was supposed to go through. You could, if you had, say, a search warrant,
432710	440550	tap the lease lines the traffic goes over. If you were wanting to attack a workplace that
440550	446270	you had a connection on, you could use our poisoning within there. And that approach
446270	457670	works to get a certificate for that host's domain name. So people can use that to, a lot of
457670	465570	companies will have, like, vpn.companyname.com or mail.companyname.com that points to the Office
465570	472230	Network. If you were already inside the network, you could use that to get a certificate for their
475090	482210	resolvable domain name. And then start intercepting VPN traffic. Later on I will
482210	487630	be encouraging the audience, if anyone wants to help with that and do a video on that,
487630	496910	I will promote your work. You do have other options, too. In the case of the successful
496910	502370	attacks by the government of Iran or people who seem to be sponsored by them, they were breaking
502370	520600	into name servers, domain registration servers, and mail servers are also an option. So most of
520600	525800	the time, when I'm talking about breaking into a router, I'm not talking about your home or office
525800	535020	router. I'm talking about moderately big routers all the way up to very big routers that may not
535020	543780	fit in a single rack. So we're going to start, this is a very basic attack. If the router was
543780	551200	running Linux, you would just be setting up network address translation. I like to use environment
551200	558620	variables for the victim and the attacker. Or the machine you want to attack. And then that
558620	567060	command, because there's colon 53 at the end, it means that it's redirecting DNS traffic. No
567060	573440	other traffic is being redirected right now. And you can play around with that. If you wanted to,
573440	579620	you could only redirect traffic from certain sources so that you were less likely to get caught
579620	589460	because the people monitoring that traffic aren't on those IPs. We're setting up a super basic name
589460	601980	server on the attack machine that provides new results to anyone querying them. Once we have
601980	609520	those new results, we request a certificate from Let's Encrypt. I only have the examples with
609520	616300	Let's Encrypt, but I've successfully launched the exact same attack against Komodo and GoDaddy,
616300	625740	both of whom set the standards for other CAs. CAs are certificate authorities. We test it and
625740	633700	many browsers happily mark the site as secure. I chose Firefox because they even use a green lock,
633700	638820	whereas the other ones have phased out the green locks on secure sites.
639520	650040	If we wanted to do it with HTTP, it's pretty much the same. It's just port 80 instead of 53.
656210	660590	And for SMTP, you're just switching the port again to 25.
661890	669470	So we did configure a basic interception mail server. The main important thing is that we put
669850	675350	a star in for host names so it would intercept all email traffic.
679110	686810	Now, in this case, we did a total fail. We hadn't gotten any certificates for the domain yet,
686810	692950	but that would only take a minute or two to cover your tracks. Unfortunately, very few
692950	701650	organizations verify the certificate or require a certificate when sending confidential data.
708930	716070	So quick notes about the email interception. I didn't break into any mailboxes. I'm just
716070	722970	sitting on the wire intercepting the mail. If you wanted to avoid detection, I'd highly recommend
722970	730870	using a proxy server and relaying most of the traffic to the intended destination. I would
730870	737030	probably skip anything mentioning the words password reset or maybe even skip emails from
737030	742430	the certificate authorities so the evidence of your attacks doesn't make it through the destination
742430	752500	mail server. So once we were intercepting email, what we noticed was that a lot of providers would
752500	760820	send unencrypted usernames of their users. We were able to intercept the usernames
762060	768920	and it went on and on and on. Now, I saved all these results in a mailbox to make it easy for
768920	774540	me to work with, but we haven't broken into anyone's mailbox. This is just the results we got
775260	782860	of all different organizations telling us usernames on their systems. And in a moment,
782860	791580	we're going to try and reset the passwords for those accounts. So this one's AWS.
792760	799820	AWS didn't require TLS even though the user signed up with an encrypted connection.
799820	806660	So they could have saved a record, hey, this user mail server supports encrypted email,
806660	816950	but they chose not to. So here we are breaking intercepting a username, requesting a password
817210	825210	link and breaking into a real estate company's Cisco Meraki account using the same attacks we
825210	831030	talked about. This is a really big deal because once you break into their Cisco Meraki account,
831030	838450	you can add VPN connections into their office, you can add port forwarding, you can change the
838450	845270	rules that segregate their network and stop certain machines from attacking other machines.
845810	853830	It's a gold mine if you can intercept email near Cisco Meraki customers.
854770	866110	Kept going and going and going. In the end, we got into, we used the interception attacks to
866110	872850	reset passwords on Cisco Meraki firewalls, Google Nest security cameras, AWS, Dropbox,
873410	882230	Salesforce, LogMeIn, Carbonite, pretty much every system you can think of. In a lot of cases,
882230	890510	we are also able to bypass full disk encryption using these attacks. Because both Windows and
890510	899210	Apple encourage users to set up their cloud account to be able to reset the password on
899210	908890	their full disk encryption. So, I sort of mentioned in the email portion, you really
908890	914930	want to use a proxy to cover your tracks. That's a little beyond the scope of this presentation.
914930	921250	But if anyone wants to, I'm happy to help you get a video going on the proxy style attacks.
921250	931360	You can even use my attack server if you want to. So, some of you might want to protect a business
931360	937980	from these attacks. I would strongly recommend getting certificates from a CA that doesn't
937980	944600	support domain authentication. Some of the CAs that are focused on organizational validation
945460	955360	only do org level certs. And then you can at least test that the certificates are from that
955360	960620	certificate authority. Monitor for certificates generated from your domain.
960620	964960	Facebook has a feature for this. This is even recommended by the government.
965940	975560	If someone generates a cert, you get an email letting you know. You also get a
975560	980220	Facebook notification, just in case that person is sitting near your mail server blocking
980220	990960	the messages telling you that your fake CA was generating a fake certificate. If you see any
990960	997580	fraudulent certs, you got to revoke them right away. You probably need to do a full investigation
997580	1004220	into how it was generated, how you're going to prevent it. I'd love to see people in the room
1004220	1007840	fighting for stronger domain authentication standards.
1008260	1013640	And you'll probably need to automate testing of your DNS records so you know when they're
1013640	1023480	being manipulated. So how could certificate authorities stop these attacks? They could
1023480	1033320	use the same technologies that they're encouraging for HTTPS on all steps of the
1033960	1043520	validation process. DNS, SMTP, just have mandatory TLS when validating domain ownerships.
1044580	1052060	They could... I would suggest checking all name servers when authenticating a domain. That way,
1052060	1058280	if one of them was compromised, they would have to compromise all the name servers to use that
1058280	1069240	compromise. To make sure that the name servers that are validating these requests aren't using
1069240	1076360	fake certs that were generated today, yesterday, or up until the problem is fixed, I'd require
1076360	1087640	organizational validation on the name servers. And in the event that the certificate is...
1089520	1096100	no longer has its authentication value sitting on the name server, I would set the CAs up to
1096100	1102660	automatically revoke those certs. The only CA that I know of who's doing that right now is Amazon.
1102660	1111960	If you have a cert in place with Amazon, they recheck your DNS values to make sure that you
1111960	1118820	still have the value proving your domain ownership. And they give you a warning if it disappears. I
1118820	1126440	know because I deleted one of those values. And then you have a chance to put it back.
1128880	1137520	So I'd love to see the browsers putting pressure on CAs to protect their users and even domain
1137520	1148800	owners. If the site doesn't support encrypted DNS, I'd start with a mild not secure message. Not
1148800	1155680	the big red message. But just put a little pressure on people because we know that those messages in
1156260	1164220	get action from customers. Similarly, if they don't support encrypted email,
1165200	1171640	warn the user. This isn't a site that takes security seriously. And it's a lot of government
1171640	1178000	sites that don't support encrypted email because some of the firewalls they use for spam filtering
1179240	1185280	block encrypted email by default or block transport layer security on the email.
1185280	1191320	So I think the users visiting those sites should know that the site isn't
1191320	1197180	taking security seriously. And it's not to trust the site.
1198880	1205940	Any CAs that continue to use plain text authentication to prove domain ownership,
1206180	1212200	I would refuse to trust them. And then as new standards become more common,
1212200	1218640	I would warn users about sites using old certificates that don't meet the modern
1218640	1225120	standards. And that last one of warning, I haven't seen it at the browser level,
1225120	1231180	but the payment card industry requires that you have a properly generated cert
1232020	1237580	in terms of the random numbers that were used. So I'm hoping that the payment card industry
1237580	1244980	and the web browsers could expand towards warning people about other weak authentication.
1248760	1253360	The main message of today is that weak authentication provides a back door
1253360	1262600	to many secure and encrypted systems. If anyone here wants to build on the work,
1263480	1270080	I'd love to help you make videos using Cisco or Juniper routers as part of the simulation.
1270960	1277840	I'd love to see an ARP cache poisoning video, videos of proxies and other open source tools
1277840	1281580	being used to reduce the risk of being caught.
1282760	1289720	Quite a few people I need to thank. My friend Adam Bennett helped with a lot of the account
1289720	1296560	creation. John Seymour was my mentor at the B-Sides Las Vegas Proving Ground last year,
1296560	1304720	and he helped me get some of this ready. Jerry Desime of Micro Focus. He had some related
1304720	1312640	CVs. He accepted my LinkedIn in-mail and helped me find a lot of resources that helped.
1312820	1321860	Chris Kubeka, she provided some awesome research about a year ago on email interception attacks.
1322000	1326100	And the Okanagan Information Security Group let me practice when I was
1326100	1331480	nowhere near ready. And that was very helpful to getting ready.
1332500	1341040	If any of you want to connect with me, I'm on Twitter, at ChrisHanlonCA. You got an email that
1341040	1346860	will work for a while to reach me. If I get too much spam there, I'll probably drop it. But
1347460	1354300	works for now. And I'd give you my real email if you email me on there.
1356100	1362700	In terms of following me on Twitter, if your profile says info sec or noob, I will follow
1362700	1367960	back. You may wonder why I follow noobs, but I think they're the future of the industry.
1368000	1376420	So anyone who admits they're a noob, I will follow them. Does anyone have any questions? Yes?
1376420	1381960	We've got a mic for questions. So if you have questions, come and line up
1381960	1387880	up here by me. And I'll be happy to hand you a mic so everybody can hear you.
1390730	1394750	Is there anything you can do from the service provider standpoint
1394750	1399590	when, if you're concerned that, say, your password reset emails are getting
1399590	1406050	intercepted in this way? Yes. Two-factor authentication
1406730	1412830	is probably your best bet. And it needs to be real two-factor. Because I found some where
1412830	1421010	they have a downgrade to email. And if there's an option to reset the password via email, along
1421010	1427370	with an option to get the two-factor token via email, that's not two factors, that's one factor
1427370	1435830	twice. So you mentioned one of your suggestions for mitigation was we'll do TLS on everything,
1435830	1442830	TNS and DLS when we're doing the domain validation. So we have to bootstrap our trust
1442830	1446890	from somewhere when we've got a new server. So you're saying we'll use some trusted thing.
1446890	1449930	Because if you want to do mutual TLS, you need to start on both sides already.
1450330	1453930	So are you saying we'll just bootstrap our trust from somewhere else where we already have
1453930	1456610	an existing trust? I guess the big thing is
1457250	1463610	I also asked that the name servers have to have organizational validation. So that typically
1463610	1470590	involves proof that you run the organization, which is done offline. And there's a relatively
1470590	1475930	limited number of name servers compared to the total number of domains. So our trust,
1475930	1484290	I guess, would be in notaries, lawyers, and similar people to prove ownership of name servers.
1484290	1485390	Sounds good. Thanks.
1487310	1491310	You mentioned on some of the redirects attacks, I could see how you're
1491310	1495540	doing that if you're already inside the network. But functionally or practically,
1496090	1499800	how could that be done from the internet, like on the other side of the world?
1501990	1508530	There's been quite a few firmware vulnerabilities in major routers. There's also the element of
1509210	1516530	insiders at the telecom companies either being bribed or just realizing the potential for money.
1516530	1522070	And we have seen the BGP attacks where millions of dollars of cryptocurrency
1522070	1528130	was stolen from one of them. And even in the last few months, we've seen
1529210	1532410	standard network traffic being redirected through China
1533080	1538390	that was intended to go between the EU and the US. So it does happen.
1538390	1546370	Would you agree that on the firmware argument, if you just kept up to date
1546370	1550050	with patches, that would lessen your vulnerability?
1550050	1558090	It definitely lessens the vulnerability of the ISP. But users don't know how good their
1558090	1564350	customers, including government customers, don't get a great idea of how well their
1564350	1570570	network presence provider is monitoring for intrusions or keeping their stuff up to date.
1571210	1579250	And I think that's really, you don't know how well your ISP is doing, but it only takes
1580250	1587830	a one-time mistake for a huge amount of damage. And the whole point of encrypted connections was
1587830	1594090	that we didn't need to trust the certificate authorities. We didn't need to trust the
1595430	1596710	internet providers.
1597070	1601690	A few years back, we used to have extended domain validation certificates where the browser
1601690	1607190	used to display like a green bar, and it disappeared. And so from a consumer point
1607190	1610690	of view who doesn't understand cryptography, that's using the browser to go to a bank or
1610690	1615070	something like that. There's no difference between some certificate that has gone through
1615070	1618890	extended validation to make sure they are the owner of the certificate, but somebody who went
1618890	1623610	to let's encrypt and maybe got a free certificate, right? So why there's no distinction between
1623610	1629050	I should be able to know as a consumer how trustworthy it is, like a green bar.
1629410	1635210	The big reason why those got pulled out is that criminals were getting certificates that met the
1635210	1642610	green bar standard, and users who didn't really understand the system put a lot of trust in the
1642610	1650430	green bar. So I think we're moving in a direction of warning when things don't meet good standards
1651270	1657210	with warnings about insecurity rather than trying to guess how secure someone is.
1657530	1662970	See, if I am a city bank, for example, right? I have to really prove that I am really a city bank.
1662970	1669110	How does a criminal kind of have the credentials to actually prove? Like a physical online visit
1669110	1673210	to make sure that you are the owner of the domain or something like that? I suppose just an email
1673210	1678490	saying that I own it. Yeah, so that's why we need higher standards on the verification of
1678490	1688130	domain ownership. Would DNSSEC provide any form of mitigation or would that just be another form,
1688130	1695990	another attack vector to abuse in this case? DNSSEC would likely help, but because TLS is
1695990	1702730	on so many protocols, I think that DNS over TLS is more likely to gain market share.
1706810	1710850	Thank you very much indeed. Just a quick comment on your previous answer about extended
1710850	1717650	validation certificates. It wasn't so much that users were putting a lot of trust in them and
1717650	1723970	therefore if a, as you mentioned, criminal was able to get hold of one incorrectly, it was too
1723970	1729660	powerful. The research was showing that nobody noticed them, even those people with training.
1730230	1736010	And there are some instances, for example, a large financial institution through a misconfiguration
1736010	1742630	was failing to serve EV certificates for quite a while and nobody noticed. So they were only
1742630	1747710	adding to confusion with no benefit that the number of studies could measure. But your other
1747710	1754830	points are perfectly correct. Thank you. So what is your recommendation for the next step? You
1754830	1759470	discover that your domain has a rogue certificate issued when certain certificate authorities such
1759470	1764150	as Let's Encrypt have an explicit policy against revoking certificates that have been determined to
1764150	1771170	be rogue. I was not aware about the failure to revoke Let's Encrypt. Those ones are only good
1771170	1778210	for three months. But you're going to need to investigate how they got that certificate. To
1778210	1783110	some extent you're also going to need to prevent the traffic from getting there. But I didn't know
1783110	1795110	that Let's Encrypt wouldn't revoke. Thank you. Any further questions? Do you share the presentation
1795110	1805490	slides? I will. Okay. I'll tag the crypto privacy village with a link to the slides.
1811990	1816490	I might have a way to show them right away so you can take pictures.
1818030	1831870	Nope. Nope. Well, I guess that is a public link. It's pretty long to type. But I was planning on
1831870	1836990	using a little clicker thing and there's radio frequency attacks against them. So I went into a
1836990	1842830	locked down account and this is the public link to the presentation slides. But I'll tag the crypto
1842830	1851590	privacy village with a short one very shortly. Any final questions? All right. One more big round
1851590	1852790	of applause for Chris.
