00:00:00.000 --> 00:00:06.006 DEFCON 2015 08/08/15 - 4 PM TO 5 PM I WANT THESE BUGS OFF "This 00:00:12.012 --> 00:00:19.219 text is being provided in a rough draft format. 00:00:19.219 --> 00:00:24.825 Communication Access Realtime Translation (CART) is provided 00:00:24.825 --> 00:00:30.430 in order to facilitate communication accessibility and 00:00:30.430 --> 00:00:36.436 may not be a totally verbatim record of the proceedings." >> 00:00:39.273 --> 00:00:47.047 Who is here for their first Def Con ever? Awesome. Welcome to 00:00:47.047 --> 00:00:53.253 Vegas. At least our version of it. Have been coming for 15 00:00:53.253 --> 00:01:00.227 years and I do talk about more than DNS and I want to thank you 00:01:00.227 --> 00:01:06.333 for being here. Because it not like I told you what I'm going 00:01:06.333 --> 00:01:12.272 the talk about. Why am I here. Why do I come back to vegas. I 00:01:12.272 --> 00:01:19.580 like hacking and the primary thing that we break as hackers 00:01:19.580 --> 00:01:22.783 are assumption and people think they know how the world works 00:01:22.783 --> 00:01:28.488 and there is difference just because we break assumption and 00:01:28.488 --> 00:01:32.326 dealing the way things work doesn't mean we understand what 00:01:32.326 --> 00:01:34.328 we're doing. What do you think happens when you mess with 00:01:34.328 --> 00:01:40.334 system and you don't how it works well it falls over and 00:01:42.536 --> 00:01:47.941 breaks. But there is advantage to now how things work. We can 00:01:47.941 --> 00:01:53.146 fix things no one else cares to if we with bother to care to. I 00:01:53.146 --> 00:01:59.886 want the talk about something I like. I like the web. I think is 00:01:59.886 --> 00:02:03.890 web is the most interest advance in technology that I have seen 00:02:03.890 --> 00:02:10.998 in my career. HT pH is property people don't realize. It was the 00:02:10.998 --> 00:02:18.071 first document format and put the crap into it and it would 00:02:18.071 --> 00:02:22.009 renter something. This should not be weird but if you got a 00:02:22.009 --> 00:02:26.113 hammer and you hit a nail and miss the nail it is not like the 00:02:26.113 --> 00:02:32.119 board turns into a fish. Most file formats if you got it wrong 00:02:36.256 --> 00:02:42.262 even a little -- there is this great phrase surfing the web. Do 00:02:44.564 --> 00:02:48.135 you realize how weird this phrase is. You don't surf 00:02:48.135 --> 00:02:53.340 cobwebs but the experience of being able to go ahead and I'm 00:02:53.340 --> 00:02:59.846 on this site and now on this and now I'm here and there. It was 00:02:59.846 --> 00:03:04.484 so compelling we got this weird phrase popular. The web is 00:03:04.484 --> 00:03:08.889 always up to date. Not stale or old. Not like old version how do 00:03:08.889 --> 00:03:15.695 we patch 950 million web pages. The web is always live and I 00:03:15.695 --> 00:03:20.434 like that property and not how the world has to work. Mobile 00:03:20.434 --> 00:03:24.938 does not work that way. Your phone does not work that way. 00:03:24.938 --> 00:03:30.911 Not saying mobile is bad, but it is optimize for you using way 00:03:30.911 --> 00:03:34.381 less internet. You have to accept installation and wait for 00:03:34.381 --> 00:03:41.254 download and mobile has a lot of friction, applications get old 00:03:41.254 --> 00:03:48.261 and stale you can't re-download because 25 megs and the worse 00:03:48.261 --> 00:03:53.667 part the permission you have the apple situation to put something 00:03:53.667 --> 00:03:58.371 online or you doctor the google android model where it might 00:03:58.371 --> 00:04:03.310 work better if you needed permission because there is lot 00:04:03.310 --> 00:04:08.415 of crap out there. The web has amazing security model really 00:04:08.415 --> 00:04:14.287 does. The browser represents a neutral broker but software that 00:04:14.287 --> 00:04:22.095 approvals other software and implementing two major ideas. 00:04:22.095 --> 00:04:28.235 The first idea is same origin policy which basically says we 00:04:28.235 --> 00:04:33.340 have one user. We have one program. The web browser and 00:04:33.340 --> 00:04:38.245 that program might be at two sites one of them is CNN and one 00:04:38.245 --> 00:04:43.517 is G mail, CNN doesn't get to read your G mail. The only 00:04:43.517 --> 00:04:49.523 intersection between the two programs is the user. Might not 00:04:51.691 --> 00:04:57.697 be two tabs and you have thing called io family where you embed 00:05:02.235 --> 00:05:06.840 paypal and say do you want to spent a thousand dollars and buy 00:05:06.840 --> 00:05:12.112 something and the one at the top page can't say I am going to 00:05:12.112 --> 00:05:17.050 click the button and make some money. That doesn't work because 00:05:17.050 --> 00:05:21.821 the web made sure that didn't work. Other thing about the web 00:05:24.457 --> 00:05:30.831 it should be safe to surf anywhere. The web requires you 00:05:30.831 --> 00:05:37.237 to download unaudited code and execute it blindly. That is now 00:05:37.237 --> 00:05:43.043 web works but in return user require the web anything 00:05:43.043 --> 00:05:48.281 executed is constrained and lives in the most aggressively 00:05:48.281 --> 00:05:54.654 tested sand box that has been deployed. Not perfect but that 00:05:54.654 --> 00:06:00.594 is model we had to do things to make this safe. Active X gone. 00:06:03.263 --> 00:06:09.269 Java gone flash not looking so good. We keep pulling back 00:06:11.538 --> 00:06:17.377 because this is really hard challenge. Now advertising there 00:06:17.377 --> 00:06:22.882 is thing where people say everybody should run add 00:06:22.882 --> 00:06:28.154 blockers because adds might contain dangerous contend. This 00:06:28.154 --> 00:06:34.794 is because adds might contain dangerous contend. It is true 00:06:34.794 --> 00:06:40.500 just not exclusively true. All these terrible sites that are 00:06:40.500 --> 00:06:44.938 everyone complains about. You think these are more secure than 00:06:44.938 --> 00:06:50.543 add networks who do you think is making more money. These little 00:06:50.543 --> 00:06:57.550 crappy sites no. So if you follow the add pattern you are 00:06:57.550 --> 00:07:01.821 saying it is not safe to brows with all these sites you should 00:07:01.821 --> 00:07:06.593 have a list of sites that you get contend from because those 00:07:06.593 --> 00:07:10.297 are the only places trusted so Facebook and twitter and nothing 00:07:10.297 --> 00:07:14.968 else that sounds like the web, not to me. That sounds awful. 00:07:14.968 --> 00:07:22.375 The you want say everyone should run add blockers because adds 00:07:22.375 --> 00:07:27.847 are annoying and make the web slow now you a different point 00:07:27.847 --> 00:07:31.017 you have the totally different story and to tell you I have 00:07:31.017 --> 00:07:35.188 been working for the last cup to clean up the ad system because 00:07:35.188 --> 00:07:41.361 somebody got to and one of questions why are ads causing 00:07:41.361 --> 00:07:46.433 all of these performance problems. Turns out it is our 00:07:46.433 --> 00:07:51.771 fought in security. Same origin policy as wonderful as it is can 00:07:51.771 --> 00:07:54.975 be a problem. This is a surprising finding. What is 00:07:57.010 --> 00:08:01.915 ultimate goal of the same origin policy. Protect the user. We 00:08:01.915 --> 00:08:07.520 fight for the user you have all of these distrusting entities. 00:08:07.520 --> 00:08:11.257 The only thing that it can do is draw pixel in this frame I need 00:08:11.257 --> 00:08:15.595 the make sure that it doesn't take over my clicks. It has to 00:08:15.595 --> 00:08:21.601 live in the box but turns out what is not accurate. Things can 00:08:34.581 --> 00:08:42.322 be invisible and still make your web slow. You are not allowed to 00:08:42.322 --> 00:08:48.328 tell. As far as the system knows bunk up to works is possible 00:08:52.932 --> 00:09:00.740 thing. So same origin policy means the parent should not be 00:09:00.740 --> 00:09:06.746 able I frames. So I wrote a CPU in Java script. This thing goes 00:09:22.228 --> 00:09:27.467 -- crap what are you asking me to do and this is big thing. We 00:09:27.467 --> 00:09:32.772 will go to little site and see this does some work but it is 00:09:32.772 --> 00:09:37.744 taking way way less work so it works much faster. So this way 00:09:37.744 --> 00:09:41.915 of measuring what is going on. Anyone got a theory for what 00:09:41.915 --> 00:09:47.220 trick I'm pulling here. This works everywhere. Works in IE, 00:09:47.220 --> 00:09:53.226 Firefox chrome, every browser sick the beginning of time. 00:09:57.664 --> 00:10:02.202 Someone tell me if he was right. Check it out, you can just ask 00:10:02.202 --> 00:10:08.441 the browser to do something in 250m s and then you find out if 00:10:08.441 --> 00:10:13.279 it did so you set a interval so keep trying to do something and 00:10:13.279 --> 00:10:17.851 find out the gap between attempt and reality. If it happens at 00:10:17.851 --> 00:10:23.857 the ms mark yes browser was a daily -- was busy. This is what 00:10:39.372 --> 00:10:45.378 you're doing. So I have been building this code up one is to 00:10:48.147 --> 00:10:52.418 find out for a page is slow and two if you do something that 00:10:52.418 --> 00:10:56.723 might make a page slow, how about we wait until later. So 00:10:56.723 --> 00:11:02.328 you can schedule events so like a set idle time out. So what do 00:11:02.328 --> 00:11:08.334 we have here in term of usefulness, for the people 00:11:13.907 --> 00:11:16.809 trying to make web pages we have easy way of seeing if the page 00:11:16.809 --> 00:11:23.616 sucks so we also have a way of seeing across the frame boundary 00:11:23.616 --> 00:11:28.454 something is going on in there. Hard to know what but you do get 00:11:28.454 --> 00:11:32.959 the find out something is going on at 60 frames a second. So 00:11:32.959 --> 00:11:36.129 attacks that have taken advantage of this stuff. Could 00:11:36.129 --> 00:11:42.635 we fix this problem. Well as it happens because it is in single 00:11:42.635 --> 00:11:49.409 web browser it is core to way browser are built and frames 00:11:49.409 --> 00:11:53.813 share the event loop so they are using resources that we are 00:11:53.813 --> 00:11:58.017 trying to use so if they are busy we are busy. So you have to 00:11:58.017 --> 00:12:03.990 design the web browser to try and fix this and chrome is doing 00:12:03.990 --> 00:12:09.996 stuff like that they are going to try the make io frames work 00:12:13.933 --> 00:12:21.007 but still you share CPU. Not like two computer there so even 00:12:21.007 --> 00:12:27.013 if it still not blocking other things are trying to work. Do we 00:12:29.682 --> 00:12:34.354 want to fix this. Is this a good thing for the user that random 00:12:34.354 --> 00:12:36.823 things can be included in the web page and no one can tell it 00:12:36.823 --> 00:12:42.829 is making things slow. No. What we might be able to do because I 00:12:49.002 --> 00:12:55.174 don't know if you guys know this when you are like a publisher of 00:12:55.174 --> 00:12:59.946 the ad site or news site you doctor no idea what contend you 00:12:59.946 --> 00:13:04.517 are including from ads. I run this script and it brings stuff 00:13:04.517 --> 00:13:10.757 in. You can't tell if it is good or bad. So by design I have a 00:13:10.757 --> 00:13:15.561 frame here tell me if this particular frame is using up all 00:13:15.561 --> 00:13:19.232 the CPU cycles and making things slow or if it is not, if it is 00:13:19.232 --> 00:13:23.002 being very quick what is how you get to point where people can 00:13:23.002 --> 00:13:29.008 manages performance impact. So let's step back. What have I 00:13:32.445 --> 00:13:37.083 just done. What is conversation that I just had in front of you. 00:13:37.083 --> 00:13:45.058 It's a hack. What should browser developers do. Turns out that is 00:13:45.058 --> 00:13:49.562 complicated question to answer. Even if you just have a med 00:13:49.562 --> 00:13:53.666 trick of what is best for the user. We have a theoretical harm 00:13:53.666 --> 00:13:58.838 maybe some how some stuff that you can see through the timing 00:13:58.838 --> 00:14:02.909 attack and you have actual real word problem. The web is 00:14:02.909 --> 00:14:07.180 drowning under poorly performing web page. So which thing do we 00:14:07.180 --> 00:14:11.484 want to protect. We have different things we're going to 00:14:11.484 --> 00:14:17.523 do versus from a one line fix that just works to rehabbing the 00:14:17.523 --> 00:14:21.027 re-architect the world and not going to be fixed after we do 00:14:21.027 --> 00:14:25.798 that anyway. That matters and how useful would a proper 00:14:25.798 --> 00:14:29.435 implementation be. Maybe this is not a bug maybe we should double 00:14:29.435 --> 00:14:31.437 down and make this awesome feature. This is conversation 00:14:31.437 --> 00:14:34.674 that you have to have. If you want to make things better this 00:14:34.674 --> 00:14:39.045 is the conversation you have to have. If not sure why are you at 00:14:39.045 --> 00:14:44.050 my talk. I like making things better. Our first step by ad 00:14:44.050 --> 00:14:50.056 space on the popular site, step three profit. Anybody know what 00:14:58.698 --> 00:15:04.637 step two is? Turns out there are some unknowns out there. This is 00:15:11.711 --> 00:15:15.648 called ad stuff in this is why web browser are sucking. So 00:15:15.648 --> 00:15:21.654 buying ads on popular sites and putting 10 more ads in that ad. 00:15:21.654 --> 00:15:27.360 You don't see it but the web browser is choking on this 00:15:27.360 --> 00:15:33.065 stuff. This is why nobody can audit for this stuff. It is 00:15:33.065 --> 00:15:39.238 ugly. There is no limit. They are just keep doing it all day 00:15:39.238 --> 00:15:43.342 you don't notice anything on screen meanwhile you turn around 00:15:43.342 --> 00:15:49.916 and run sniffer. So there is this thing called view ability 00:15:49.916 --> 00:15:51.918 and it basically comes down to maybe we should be able to 00:15:51.918 --> 00:15:59.258 notice there is bunch of stuff that loading that nobody can 00:15:59.258 --> 00:16:05.198 see. Maybe that is not good for anybody but the scrammer. You 00:16:07.466 --> 00:16:10.603 can see this stuff with (indiscernible) because CPU goes 00:16:10.603 --> 00:16:15.241 through the roof and there are tricks to go ahead and detect I 00:16:15.241 --> 00:16:20.179 am the box that says one pixel by one pixel some time these 00:16:20.179 --> 00:16:24.684 tricks work sometimes they do not work. Should this be a hack 00:16:24.684 --> 00:16:29.355 at all? So who here knows what click jacking is? The only 00:16:29.355 --> 00:16:35.361 environment in the world I can have that many hands go up. So 00:16:44.403 --> 00:16:48.040 there is this dialogue and in the middle of flash and this 00:16:48.040 --> 00:16:52.478 dialogue is a permission dialogue that if you happen to 00:16:52.478 --> 00:16:56.816 click allow flash gets to see your camera and get to listen to 00:16:56.816 --> 00:17:02.755 your microphone. That is mission model the viewable the harm is 00:17:08.928 --> 00:17:12.865 done just because it loaded just because it executed but there 00:17:12.865 --> 00:17:18.137 was no user interaction but that rabbit hole gets deep because 00:17:18.137 --> 00:17:23.009 the point is you show somebody important warning and if you 00:17:23.009 --> 00:17:27.280 click allow you may be recorded and then you get the actual user 00:17:27.280 --> 00:17:31.784 for action. If the user doesn't know what they give permission 00:17:31.784 --> 00:17:37.356 to the interaction doesn't mean anything legitimate. So we call 00:17:37.356 --> 00:17:41.827 these attacks that try to hijack user interrex click jacking 00:17:41.827 --> 00:17:49.101 attack and offend against them we make the web suck. So here is 00:17:49.101 --> 00:17:54.140 paypal. You buy something on paypal and you are on E-bay you 00:17:54.140 --> 00:17:59.779 get the buy something on E-bay. You have pay button but if you 00:17:59.779 --> 00:18:04.550 anywhere else beside E-bay it navigates you somewhere else. So 00:18:04.550 --> 00:18:08.154 you go to store and buy something and like you go to the 00:18:08.154 --> 00:18:16.162 cash register and go over there and we can't take your card. 00:18:16.162 --> 00:18:22.168 That would be a terrible model but that is only way E-bay knows 00:18:25.104 --> 00:18:30.810 that It cannot be manipulated. Should say a thousand dollars 00:18:30.810 --> 00:18:36.816 but we will put a icon that says one dollar. Sure I will buy that 00:18:40.620 --> 00:18:45.324 for a buck and now you are out a ground. Twitter knows a thing or 00:18:45.324 --> 00:18:49.929 two about web design and when you re-tweet it does a pop up. 00:18:49.929 --> 00:18:52.965 People hate pop ups but the most poplar sites have to use pop up 00:18:52.965 --> 00:18:58.971 us but a the only way they can know you just not browsing 00:19:04.810 --> 00:19:08.647 random sites. We have this terrible design that is being 00:19:08.647 --> 00:19:14.654 maintained. Some bugs need to be judged by the crap they create 00:19:16.922 --> 00:19:22.862 in their wake. We fix click jacking by turning off embedding 00:19:22.862 --> 00:19:29.268 entirely. Disables and io frames entirely or at least controls 00:19:29.268 --> 00:19:33.039 where they should be. That thing you were doing on web is nice 00:19:33.039 --> 00:19:36.242 but still too ugly. That sucks. Embedding is one of cool parts 00:19:36.242 --> 00:19:42.248 of the web. People are doing pop ups and some sites are doing 00:19:49.455 --> 00:19:55.461 things like forget the security model. We have a really good 00:19:59.298 --> 00:20:02.134 security model and we are going abandon it but what's what 00:20:02.134 --> 00:20:09.308 people do because of risk of content bedding adobe can't do 00:20:09.308 --> 00:20:15.314 anything of that. They have advantage they have code. They 00:20:19.785 --> 00:20:25.791 destroyed click jacking. We have the thing fully visible it works 00:20:34.900 --> 00:20:37.803 put in a frame that too small it doesn't load. You put stuff on 00:20:37.803 --> 00:20:41.974 top it renter but you fry to click stuff nothing happens. You 00:20:41.974 --> 00:20:47.980 try to move it to left page nothing happens. So as far as 00:20:53.085 --> 00:21:00.960 flash knows has all of pixel space but some how it knows when 00:21:00.960 --> 00:21:05.531 inside of I frame not when this stuff on top of io frame. Say 00:21:05.531 --> 00:21:11.537 we're going the talk this box here and have it follow the 00:21:21.447 --> 00:21:27.453 mouse so when you click it is under allow button. S It is 00:21:31.857 --> 00:21:37.863 moving. They make photoshop they can tell by the pixels. Adobe is 00:21:40.599 --> 00:21:47.506 comparing the expected stuff whether they hope they are going 00:21:47.506 --> 00:21:54.146 the dis-plateau output. If you renter their dialogue at 50 00:21:54.146 --> 00:22:01.921 percent capacity. If you put on top of it 25 percent image it 00:22:01.921 --> 00:22:06.892 works if two, 25 percent it doesn't work. If you have 00:22:06.892 --> 00:22:12.331 originally 75 percent and with a 25 percent overlay it doesn't. 00:22:12.331 --> 00:22:19.004 They have dealt with this problem. Cool good job. Adobe. 00:22:19.004 --> 00:22:25.010 Glad I'm not getting spied on. I guess flash can do -- you me 00:22:27.846 --> 00:22:33.853 want to read pixels back. You don't get the read barkens not 00:22:41.560 --> 00:22:47.533 repeatedly what you have to do know things have been moving 00:22:47.533 --> 00:22:52.771 around you turn browser into the video parser so in this one 00:22:52.771 --> 00:22:55.908 content where security is necessary and the use is this, 00:22:55.908 --> 00:23:01.413 to a scenario where it is never going to have that dialogue up. 00:23:01.413 --> 00:23:07.419 Here we can scrape some pixels. Nowhere else do we get to do 00:23:10.789 --> 00:23:16.996 that but not like we can't patch browser too. Adobe can patch 00:23:16.996 --> 00:23:23.569 flash we can patch browser engine. HT5 people -- they have 00:23:23.569 --> 00:23:29.575 a group called web hack. Which says maybe contend should know 00:23:33.279 --> 00:23:38.584 if it is being displayed or not. It rems pixel scraping strategy. 00:23:38.584 --> 00:23:44.590 I want these click jacking bugs off my web. How we going to do 00:23:56.902 --> 00:24:02.841 it? Okay browser don't really know what pixels they are 00:24:05.277 --> 00:24:09.915 displaying on screen they make a bunch of stuff up. I don't know 00:24:09.915 --> 00:24:16.455 CPU you figure it out. But not like a browser is without 00:24:16.455 --> 00:24:22.461 knowledge. It is sended to CPU -- let me show you the Def Con 00:24:28.934 --> 00:24:35.974 web page here. Nice simple this is the way your computer looks 00:24:35.974 --> 00:24:40.879 at the web page. We see a stuff that is smacked on top of each 00:24:40.879 --> 00:24:44.383 other. There are layers here. This is what the computer sees 00:24:44.383 --> 00:24:50.389 would we make it see something else. Pixels scraping attempt at 00:24:53.525 --> 00:24:59.531 auditing saying with have so many ways of putting something 00:24:59.531 --> 00:25:04.269 on screen we will see what happens after. Building this 00:25:04.269 --> 00:25:08.907 thing call iron frame and attempt as correctness by 00:25:08.907 --> 00:25:14.580 design. We take the layer so -- name for this was Jenga so take 00:25:14.580 --> 00:25:20.586 the layer at the bottom and drop it on the top. This only thing 00:25:23.789 --> 00:25:29.795 that could be renderer is the right thing. What happens when 00:25:31.997 --> 00:25:34.700 you play JENGA things roll over. We can't put too much on the top 00:25:34.700 --> 00:25:41.073 but we can measure the position and size what our space should 00:25:41.073 --> 00:25:45.778 be and we only make things that big. So let me show you this 00:25:45.778 --> 00:25:50.783 working and then -- before I do that, let me explain why you 00:25:50.783 --> 00:25:54.086 never use the word just when it comes to trouser. Just is four 00:25:54.086 --> 00:25:56.088 letter word. So we're going to start here is tweet. There is no 00:25:56.088 --> 00:25:58.090 way for this frame to know it is being framed. It would create 00:25:58.090 --> 00:26:00.025 this pop up. I have slides here I could show it to you but 00:26:00.025 --> 00:26:02.027 forget. On our left we have swift on security twitter 00:26:02.027 --> 00:26:04.029 account, there is this security applied no matter how this thing 00:26:04.029 --> 00:26:06.031 is messed with. All right check it out. We have to tweet it is 00:26:06.031 --> 00:26:11.136 visible am interact able. This is gone down we have read 00:26:11.136 --> 00:26:17.142 boarder here can't use that. We're going to put some stuff on 00:26:25.684 --> 00:26:31.690 top of your tweet over here if you look it is popped on top and 00:26:43.869 --> 00:26:49.875 fully visible. Scroll down more. We go off the left and not fully 00:26:59.218 --> 00:27:05.157 visible. Secure mode it knows you can't mess with it. Mouse 00:27:10.195 --> 00:27:16.201 follow this is the trick. Only place mouse can be where it can 00:27:38.123 --> 00:27:41.393 click through. So we have this follow the mouse. Note it is 00:27:41.393 --> 00:27:47.399 following and it will get somewhere. So it can yellow it 00:27:52.104 --> 00:27:58.110 is here but it is enterable. Anyone think I am doing silly 00:28:00.345 --> 00:28:06.351 stuff. No real attack is going to get through here? Any bad 00:28:08.620 --> 00:28:14.626 asses out there. Check it out. We are going to make this 50 00:28:17.596 --> 00:28:25.103 percent opaque. Now it visible and put 10X icons on top. So 10 00:28:25.103 --> 00:28:28.073 of these things and all 10 percent visible. We're going 00:28:28.073 --> 00:28:34.012 have a drop shadow this is element and not on top of us but 00:28:34.012 --> 00:28:40.285 it is like way over there and it is going the crap pixels on us 00:28:40.285 --> 00:28:46.291 and it is going to work. Not working because it is not fully 00:28:48.827 --> 00:28:51.930 visible because it was not scrolled into space. It knows 00:28:51.930 --> 00:28:55.033 about your scrolling. Blurring, un-blurring. We're going the 00:28:55.033 --> 00:29:00.973 draw a X over our frame. I don't know anything else -- Zoom. So 00:29:10.249 --> 00:29:14.720 check this out. Scale 3D. You can take imported contend and 00:29:14.720 --> 00:29:18.757 flip it and reverse it and it still a thing that you can 00:29:18.757 --> 00:29:23.161 interact with and still this code finds something bad 00:29:23.161 --> 00:29:29.601 happens. Use the visible element and makes it visible. So here is 00:29:29.601 --> 00:29:35.607 crazy thing, it's not like I did a bunch of special pieces here. 00:29:48.587 --> 00:29:54.026 Security by design a thing. Not say what I'm doing is perfect 00:29:54.026 --> 00:29:58.397 but all of those things that you saw all I'm going to make messed 00:29:58.397 --> 00:30:02.801 up contend all of those attacks failed because one fix that was 00:30:02.801 --> 00:30:08.907 using the way they web browser worked so I want the talk take 00:30:08.907 --> 00:30:13.178 the gory details here. Let's talk about how this stuff works. 00:30:13.178 --> 00:30:21.153 What it means to move a layer. I'm talking to you about blink 00:30:21.153 --> 00:30:25.924 the renamed engine from web kit inside of chrome but old browser 00:30:25.924 --> 00:30:31.930 work this way. They have to you're working with the actual 00:30:35.767 --> 00:30:39.538 graphical layer to build a security policy that we have 00:30:39.538 --> 00:30:45.777 been struggling with for 10 years. What do we have to do 00:30:45.777 --> 00:30:51.717 here. We have to promote contend to top lay r. Then we need the 00:30:51.717 --> 00:30:58.023 make sure that we have not put too much on top. And we have to 00:30:58.023 --> 00:31:02.260 report back how much was promoted. The way security model 00:31:02.260 --> 00:31:07.532 works is not I a make things read and yellow. You sending 00:31:07.532 --> 00:31:11.303 messages to thing you promote saying here is how visible you 00:31:11.303 --> 00:31:14.806 are. What do you want to do with that information you figure it 00:31:14.806 --> 00:31:21.680 out. Paypal is not going to have the same policy as anything 00:31:21.680 --> 00:31:24.816 else. Here is information that you need to decide what the 00:31:24.816 --> 00:31:28.820 right thing to do is. So what do we have to work with. 00:31:28.820 --> 00:31:34.192 (indiscernible) graphic layer tree builder. Wow web browser 00:31:34.192 --> 00:31:40.198 are complicated crap. So let me make your life easier here you 00:31:42.200 --> 00:31:49.574 have three layer to worry about, you document layer and layer 00:31:49.574 --> 00:31:55.580 tree of paint layers. I will teach you what these things are 00:31:57.616 --> 00:32:03.789 and this is not a final implementation. I am still a 00:32:03.789 --> 00:32:08.727 hacker not a web developer. I don't mean the document object 00:32:08.727 --> 00:32:16.568 in C plus plus it is basically the (indiscernible) without the 00:32:16.568 --> 00:32:24.409 guardrails. You can do anything in here doesn't mean you should. 00:32:24.409 --> 00:32:30.415 So you go ahead and move things around but anything you move 00:32:33.218 --> 00:32:36.555 remember the bad guy also has access and they can see what you 00:32:36.555 --> 00:32:42.160 did after and feed you bad stuff so be careful what you read. 00:32:42.160 --> 00:32:46.932 Layout object this is first layer where the graphic engine 00:32:46.932 --> 00:32:49.935 says I don't need this script stuff, what I need to know is 00:32:49.935 --> 00:32:55.941 what are you trying to draw. You have block flow for HD pH these 00:33:00.545 --> 00:33:05.150 things still know what they are just restricting anything that 00:33:05.150 --> 00:33:09.221 is not relevant to graphical subsystem and that is what moves 00:33:09.221 --> 00:33:15.227 around. But still not bank transparency. Anyone do website 00:33:21.933 --> 00:33:27.439 design and test to see the anything has changed so if you 00:33:27.439 --> 00:33:31.309 were doing that this is the layer you want to dump to be 00:33:31.309 --> 00:33:36.281 like what is web browser showing the user in a form less annoying 00:33:36.281 --> 00:33:42.287 than pixels. So you have paint layer and different methods and 00:33:45.624 --> 00:33:48.927 likely the same underlying structure and here I have some 00:33:48.927 --> 00:33:55.133 stuff here and stack stack stack doesn't know what it is just 00:33:55.133 --> 00:34:01.072 knows it is pretty pictures. Many objects the share the same 00:34:01.072 --> 00:34:06.378 graphic layers this is the problem because we have a 00:34:06.378 --> 00:34:09.447 particular object that we want to move. We don't want to 00:34:09.447 --> 00:34:12.684 movables that are already there we want to specify this I frame 00:34:12.684 --> 00:34:15.287 need to be move able. This will turn the simple layer tree and 00:34:15.287 --> 00:34:21.293 do a complicated layer tree. You might think this is slow but 00:34:25.664 --> 00:34:31.670 most of these layers are not drawing contend just applying 00:34:33.905 --> 00:34:41.146 rules. Throw a school bar here and this is complex tree you 00:34:41.146 --> 00:34:46.551 take this crap at the bottom and -- so what I found is that 00:34:46.551 --> 00:34:50.455 everything in iron frame could be implemented at document. 00:34:50.455 --> 00:34:56.561 Layout object or graphics layer. You do many ways for security 00:34:56.561 --> 00:35:04.169 and difficulty and stable. The game you are playing is sort of 00:35:04.169 --> 00:35:08.607 fight before absorption of the browser knowledge versus what is 00:35:08.607 --> 00:35:13.144 to happen or not happen versus the web browser assumption. 00:35:38.303 --> 00:35:41.673 Figuring out what should move is different story that is possible 00:35:41.673 --> 00:35:46.511 in graphics layer. I am using the actual document layer. That 00:35:46.511 --> 00:35:52.517 is useful method called wound in view port space. All of those 00:35:54.919 --> 00:36:00.859 transforms and been a some done you are covering pixels 100 to 00:36:02.927 --> 00:36:08.933 300. This is you. Cool. And you apply to graphic numbers. We 00:36:13.138 --> 00:36:19.144 have to find our document element so you have document and 00:36:24.215 --> 00:36:28.420 I frame it has document. That is what I went to raise. If you 00:36:28.420 --> 00:36:31.356 don't a I frame in the way you can say pages are filled else 00:36:31.356 --> 00:36:37.362 elements. You just say we put that on top but if it is not 00:36:42.467 --> 00:36:46.571 across the I frame boundary and not across a domain some bad guy 00:36:46.571 --> 00:36:51.810 is like sweet. I will put you back out because we are living 00:36:51.810 --> 00:36:57.115 in the same security domain and you need to use security model 00:36:57.115 --> 00:36:59.651 if you want there to be a security model I don't like 00:36:59.651 --> 00:37:04.122 check box features. And once you are inside the I frame you can 00:37:04.122 --> 00:37:09.561 raise any element. I want to raise all of it because I want 00:37:09.561 --> 00:37:14.466 to it to be a thing that testable. There is different 00:37:14.466 --> 00:37:18.503 elements with different rules let's go this working on one of 00:37:18.503 --> 00:37:21.840 them and that one of them is everything inside of I frame 00:37:21.840 --> 00:37:27.846 then we clip it from we need the find our layer. You go to 00:37:32.717 --> 00:37:36.554 document and you ask for object and lay it object and ask for 00:37:36.554 --> 00:37:41.292 lay r object and get the graphic layer back and over the river 00:37:41.292 --> 00:37:45.797 and through the woods reality that we are up to here. So you 00:37:45.797 --> 00:37:48.933 find the graphic layer for I frame. Then you have the find 00:37:48.933 --> 00:37:54.939 the root layer just root grab layer it just works. Sweet I say 00:38:01.880 --> 00:38:05.049 that because lots of other ways that don't work and you scratch 00:38:05.049 --> 00:38:11.055 your head a lot. So layer is too big and you lifted it up and it 00:38:13.057 --> 00:38:18.229 is huge. You have the fix that. So how do you do that. The way 00:38:18.229 --> 00:38:23.802 I'm doing it now is -- so you inside I frame you might be 00:38:23.802 --> 00:38:29.474 inside like 10. I saw one are 56I frames deep. What the heck I 00:38:29.474 --> 00:38:35.613 have no good idea. You have to walk your way up and key holes 00:38:35.613 --> 00:38:41.920 they are smaller than they could be so what you're doing you are 00:38:41.920 --> 00:38:45.089 saying I'm a thousand by a thousand and just keep getting 00:38:45.089 --> 00:38:48.560 smaller gone through here or there and trying to figure out 00:38:48.560 --> 00:38:53.565 how big you are by to time you make it to top frame and reason 00:38:53.565 --> 00:38:57.535 you do this manually normally graphics layer will do this for 00:38:57.535 --> 00:39:01.539 you but you don't like all the transformation graphic layer is 00:39:01.539 --> 00:39:04.842 going to do to you you go ahead and put stuff on top of you. 00:39:04.842 --> 00:39:11.149 That is all the transformations like blurs and whatnot. So then 00:39:11.149 --> 00:39:14.953 we go ahead and walk up the stack. What next. Now gone from 00:39:14.953 --> 00:39:17.755 a thousand to a thousand by a hundred by a hundred. We're not 00:39:17.755 --> 00:39:22.427 done. Because the top view port, we're like a user scrolls they 00:39:22.427 --> 00:39:28.299 night have scrolled through our screen or recently scrolled you. 00:39:28.299 --> 00:39:35.373 That is not a frame boundary that view port boundary. Where 00:39:35.373 --> 00:39:43.181 you supposed to be you have the shrink that stuff. So we apply 00:39:43.181 --> 00:39:48.286 our wound and done using set position and size and take the 00:39:48.286 --> 00:39:56.094 scrolling into account. Then you have to tell you layer you is 00:39:56.094 --> 00:40:03.935 had wound set apply them. System will do it for you. You wish you 00:40:03.935 --> 00:40:08.473 would be done but as it happens one last step those subframes 00:40:08.473 --> 00:40:14.479 scroll two. So turns out there is function set off from layout 00:40:17.315 --> 00:40:23.221 object so use all three of the layers that I described to get 00:40:23.221 --> 00:40:27.925 not just stuff raised up but raised up correctly but it works 00:40:27.925 --> 00:40:33.097 and works well and 10 step is to report back and say here is 00:40:33.097 --> 00:40:39.070 where you are here is how visible you are. It is so easy. 00:40:39.070 --> 00:40:44.475 That is why you never see the word just. So issues you need to 00:40:44.475 --> 00:40:48.046 actually get this in compositing pipeline. There are step that go 00:40:48.046 --> 00:40:54.052 in order. We are saying now just do it. So you need to get the 00:41:04.295 --> 00:41:10.301 point where the thing is maintaining itself because other 00:41:13.871 --> 00:41:17.442 things will cause new law out the happen and it will blow away 00:41:17.442 --> 00:41:20.445 you fix. It is most I will stable. Usually is dis-flaying 00:41:20.445 --> 00:41:22.947 things when everything is in right mode. Which I mean it 00:41:22.947 --> 00:41:24.949 aborts if not. It was nice to schedule stuff at the right time 00:41:24.949 --> 00:41:30.955 and there is some issue with the mouse issue as well. Testing 00:41:33.291 --> 00:41:37.595 gets weird biggest issue is do we want to be forcing things to 00:41:37.595 --> 00:41:43.601 be on top. Are we altering the design of web pages. My design I 00:41:45.803 --> 00:41:52.243 want the failing close. It is saying whatever is reported is 00:41:52.243 --> 00:41:59.050 absolutely the correct thing. It might be ugly but a visible and 00:41:59.050 --> 00:42:04.989 alternative the failing open you analyze and audit. I don't care 00:42:18.069 --> 00:42:21.305 about fail close or open I want something with a bug bounty on 00:42:21.305 --> 00:42:28.012 it. The thinking was that position and size was good 00:42:28.012 --> 00:42:34.018 enough. How many times s someone putting stuff on contend and not 00:42:36.554 --> 00:42:42.560 trying the hack you. Designers, you know. So you have a frame on 00:42:45.830 --> 00:42:51.836 top and drawing a nice shade. Could we support that yes but 00:42:59.243 --> 00:43:01.446 not with the toys that I have. The deal is I got this world 00:43:01.446 --> 00:43:07.452 here up here that has drop shadow and that world is 00:43:11.355 --> 00:43:14.892 viewable but not like our viewable. The area we want to 00:43:14.892 --> 00:43:19.197 promote that we want to record is being fully visible the down 00:43:19.197 --> 00:43:23.668 here. We want to split our layer in two and promote the bottom 00:43:23.668 --> 00:43:29.674 half but not the top half. That is not easy. Chrome has 00:43:35.112 --> 00:43:41.118 something called replica layers. One more thing I want, someone 00:43:44.021 --> 00:43:48.926 can draw a fake twitter. They are just fake pixels. When you 00:43:48.926 --> 00:43:54.932 lit the retreat doesn't know what you are. What if we wanted 00:44:00.972 --> 00:44:04.809 the use iron frame for single sign on. The it collects your -- 00:44:04.809 --> 00:44:08.679 now -- you don't know who it really is. Look I frames have 00:44:08.679 --> 00:44:14.685 been -- that means when you talk to I frame it is the just the I 00:44:25.730 --> 00:44:31.202 frame. We are now getting output that means whatever pixels are 00:44:31.202 --> 00:44:37.208 there this frame knows it is . L we have input and output. We can 00:44:40.611 --> 00:44:44.749 update the address bot. We can say I know you are random 00:44:44.749 --> 00:44:50.755 site.com but right now you are interacting with coin based or 00:44:53.925 --> 00:44:59.931 paypal or anyone else. No more messing around fix some stuff. 00:45:04.368 --> 00:45:11.242 Here is what I have do leave you with. We can kill click jacking. 00:45:11.242 --> 00:45:17.481 This bug has been around for 10 years. We can kill it. We can do 00:45:17.481 --> 00:45:23.688 crazy things as hackers not just about blowing things up. We can 00:45:23.688 --> 00:45:30.895 defend the open web and realize when we do this it is going to 00:45:30.895 --> 00:45:35.366 be hard and fail the first time, the second time and 10 time and 00:45:35.366 --> 00:45:39.236 that is okay. All the greatest hacks that I have every seen 00:45:39.236 --> 00:45:47.111 have been you failed you failure nail and then you succeed and 00:45:47.111 --> 00:45:50.114 these ad stuffers that are making slights slow they can go 00:45:50.114 --> 00:45:57.855 stuff themselves. That is what I have to say. So looks like a 00:45:57.855 --> 00:46:03.794 have a couple minutes for questions. Anyone want the ask 00:46:12.436 --> 00:46:14.538 something? The question am I going to make this public. I 00:46:14.538 --> 00:46:17.375 have to. I want this in web browser not just to show off so 00:46:17.375 --> 00:46:24.982 the code will be public. I am at a hallway at Def Con and I am 00:46:24.982 --> 00:46:30.988 like wait a minute this can be on twitter and code will be out 00:46:37.528 --> 00:46:42.066 next week. Presentation will be up in the next eight hours. 00:46:42.066 --> 00:46:48.072 Anyone else? Go for it. Testing one, two, three. Sweet I am on 00:47:05.923 --> 00:47:11.929 the secured wire Mike. When you conduct your research on port 00:47:19.704 --> 00:47:25.710 3478 which is emulating tunnel traffic how much beer are you 00:47:29.480 --> 00:47:35.486 going to buy for everything that responded to that? You know, 00:47:38.222 --> 00:47:42.193 sometimes you scan internets. Sometimes internets scan you. 00:47:45.629 --> 00:47:52.903 Any other questions about? See you tonight. Web developers if 00:47:52.903 --> 00:47:58.909 you got some interesting ideas I will make it so you can make it 00:48:02.246 --> 00:48:04.248 by itself it things so it doesn't suck security is going 00:48:04.248 --> 00:48:06.250 to give you a hand. That is what I got. "This text is being 00:48:06.250 --> 00:48:08.252 provided in a rough draft format. Communication Access 00:48:08.252 --> 00:48:10.254 Realtime Translation (CART) is provided in order to facilitate 00:48:10.254 --> 00:48:12.256 communication accessibility and may not be a totally verbatim 00:48:12.256 --> 00:48:14.258 record of the proceedings."