So I'm Matt Johanson, Matty J, whatever you want to call me. Oh, I'm Kyle Osborne, or The Cause. This is Cause, Baby Cause, sure. Oh, I'm The Cause. A lot of people know me as Jack Bauer now, so that's kind of cool. The internet's Jack Bauer for the LA Times audience. And someone joined, I don't know who it is, but someone's on. Who is it? There he is, cool. Cool video chatting with us on our Chromebook. So we both work for White Hat Securities Threat Research Center. That sounds pretty much as epic as it gets, right? But we are web app hackers. Oh, yeah, I'm an application security specialist, blah, blah, blah. Offensive security, fun stuff, likes to make things scarier than they actually are, but not FUD-like. Kyle breaks things. This is our obligatory. What our company does, we scan websites for vulnerabilities, just past 4,000 sites, very cool. Don't care. Okay, so the CR-48, this is what started this whole mess. This is what started our research. Kyle's sitting on Google Plus on it right now. This is the beta version of the Chromebooks that came out back in the fall of 2010. Who had a beta CR-48 in the room? Sweet. Yeah, they were sitting on about 25,000. You have yours right there. All right. I have an extension I'd like you to have. I'm going to install. So they were sitting on about 25,000 of these. They mailed them out. They gave White Hat one for us to hack on it, and we wouldn't be here if we didn't, right? So we found some pretty cool things. So before the CR-48 came out, Chrome OS was out as an open-source project. You could install it on whatever machine you were running, whatever VM you were running, that kind of thing. But this is the first device that actually was dedicated to it and utilized all of its features, utilized all the security features that, like, Google put in place. Yeah, another thing is that this is no longer a beta product. These are out in the public. Samsung put them out as Chromebooks. Did anyone buy them? Cool. A few of you? Nice. All right, so yeah, they're out there. They're in production right now. So yeah, what we know about Chrome OS, right? It's a web-based operating system. We were actually shocked when we opened this laptop that it was just a browser. It was just Chrome. We were like, oh. A machine with Chrome on it. I already had one of those. So this is all it is, right? It's just Chrome. So in order to get any functionality out of this besides the web browser, you've got to use the extensions in the web store. It's kind of like the Apple App Store, but they obviously couldn't call it that. So because of all of that, nothing is stored locally, right? The hard drive, you have no access to it. As a user of this device, you cannot touch the hard drive. You can't store anything on it. It's small anyway. Nothing is really on it. The file system is there. It's just Chrome. So because of that, it's pretty fast. You open these things up, and they're on. You're online. You're on the web browser. And Google's kind of pushing you towards storing everything in Google Docs or your Google Music, anything like that. They're pushing you towards the cloud, right? So this is what they're putting up against the iPads of the world, right? This is what they're putting up against Apple. They're trying to steal the iPads. They're trying to steal some market share, and it could very well sneak their way into the market. The Samsung Chromebook only came out in June. So even though we've had these CR48s for a while, they've only been available for public purchase for a few months. So we don't really know what it's going to look like, if this is going to steal a bunch of market share or not. So the analogy that we like to make, I've made it a few times already, is that these things are kind of like mobile devices but with keyboards, right? So it's an iPad with a keyboard, but it's just a web browser on it. So the same way that on those phones. Like an iPhone or something like that is very locked down, and you can't install anything on it. You can't just go ahead and install Microsoft Word on your iPhone, right? Wouldn't that be cool? But in order to do anything with it without jailbreaking it, you've got to go to the app store, right? So how many people in here have more than three pages of apps on their iPhone in their pocket? Okay, a bunch of you, right? So people go app crazy, right? You've got to download a bunch of different things. So those of you who have iPhones and have installed all these apps, how many of you have seen the permission warning that comes up, right? This app that you're about to install is going to have access to your GPS location, your call history, your text messages, your mother's maiden name, your social security number, all that kind of things, right? Who's hit cancel because of that pop-up box? Not enough of you. This is DEF CON. Come on. All right. So the same thing kind of happens in the Chrome web store when you go to install an extension on Chrome. Right below the install button it says what websites that that extension is going to have access to talk to. So we'll see some more examples of this in a second. Another thing we want to point out is that with the app store, there's actually a code review process, or not necessarily code review, there's an application review process, sort of like a Q&A sort of deal going on. It's not a security review as far as I know, but the Chrome web store doesn't have any sort of Q&A process going on. So you go immediately from the third-party developer to the Google Chrome web store for anybody to download. So a lot of these extensions are developed by third parties, right? It could just be Zynga or it could just be a person, right? Google also has a bunch of extensions in there, but we found vulnerability in those too, right? So what was the other thing I wanted to talk about? Oh, yeah. So because of the lack of review process in the Chrome web store. You can look it up right now, there's an extension called Cookie Stealer, I promise we didn't make it, but it's called Cookie Stealer and that's what it does and it's available for download. Go ahead. We're going to demonstrate a malicious extension that we developed later on in the talk. It's called, we named it Malicious Extension. With no legitimate purpose whatsoever. I did upload it. And it got into the web store, no problem, right? You could have downloaded it. It's not there anymore. He took it down right away. I only let a few people download it. We put the icon as a picture of Justin Bieber. It had four million downloads. Okay. So what does a hacker see, right? So we're looking at this web store as web hackers like, ah, heaven, right. This is a brand new attack service for us, this is months old, it's not even years old yet, right? So I'm sure this room, more than anyone knows, early on in the product life cycle, where does security come into play? Just non-existent, right? So it's not making money early on, it's costing money, right? So a lot of these extensions are just coming out now. So of course they're going to have security holes in them because that's what we find. And especially now because it's all just HTML5 and JavaScript, so why do you need to worry about security in HTML5 and JavaScript? Yeah. You do most of that stuff server side, there are not very many attacks that a server can't block that get reflected back to the user with HTML5 and JavaScript. So the other cool thing about a lot of these Chrome extensions, it makes them different than a lot of the Firefox or Safari or Internet Explorer add-ons and things like that, is these are just little mini websites, right? They're just used to help increase functionality of these Chromebooks especially, but the Chrome browser, right? You can install any of these on your machine right now. A lot of them just take up very little screen real estate, which is really important on a netbook. If any of you use netbooks, really important, right? So let's just get right to what started the whole mess. So this is kind of like their version of Notepad, right? It's called Scratchpad. It's just a note-taking application. It was pre-installed. It was the very first one on the CR48. Who's used it? Who's seen it, used it? Who has CR48 Scratchpad, right? All right, cool. So it's a little nifty note-taking thing, and the other feature that's cool about it is that it automatically syncs to your Google Docs. So if you have a Google Docs account in a folder called Scratchpad, right, so when you're writing up your shopping list or your to-do list or whatever you're doing in this little tiny mini website in the bottom of your screen, it syncs to your Google Docs account. Another feature of Google Docs that we've used in this exploit was that you can actually share a document or a folder with someone else who's using Google Docs, and they don't have to give you permission to get that folder or document, right, which has been, I guess, mostly okay because Google Docs is pretty well protected, but the Scratchpad extension was not, right? So we, you know, we could go ahead and share our malicious document, which you'll see in a second. Do you have anything you want to say before we go? Right. So just the key points that we wanted to push is that it comes default. Everybody that has Chrome OS has it. You can install it on Chrome. What was it? You're authenticated to your Google account to use it, right? The main feature of it is that it syncs to your Google Docs accounts. You're definitely authenticated. Everyone has it. It's on every single one of these Chromebooks, and you don't need permission to receive anything. And then on top of that, Google Documents lets you share across or lets you share to anybody without notifying them or allowing them to accept it. It just automatically goes into their documents completely stealthy if you want to. So not only do they not need to give you permission. There's a nice convenient checkbox when you share a document that says, turn off email notification to the person. So we can go ahead and share the document without the permission, and they'll never even know that it happened, right? And this automatically syncs to Scratchpad. So Google fixed this cross-site scripting bug right away, but I found it within half an hour of opening the CR48. It was the very first extension I opened. I threw in a tag. No sort of filter. I didn't do any crazy webhacker stuff. I threw in a tag. It didn't handle it. And we were like, oh, what can we do? What can we do with this? So at first we were trying to steal OAuth tokens that it was using and things, but then we just realized that it was talking directly to docs.google.com and www.google.com. So we were able to do some cool stuff. So we have a video since they fixed it right away. All right. So this is in fall 2010. There are about 30,000 users at the time. Those are either Chrome users or Chrome OS users that come default. In the bottom right. You can actually see the little yellow box there. That is the permissions it gives you that it needs to actually function, which is access to google.com and docs.google.com and your browser history and your browser history for some reason. Cool. So we're going to go ahead and show intended functionality, which is actually just adding a document and syncing it. So this is a regular user's account. No big deal here. The victim. Right there. There's actually a scratch pad folder on the left if you can see that. And that's actually where all your documents are stored. And that's important to remember that it's in that scratch pad folder because we're going to be utilizing that feature to attack this victim. So we're going to go ahead and move over to the attacker's docs. And you can see there's an inject right there that, a document right there that has HTML and JavaScript in it. Now that's completely sane inside of docs.google.com. It's not being rendered. It's not being executed. It's just the title of the document. Can you guys see the URL that we're calling? So we're basically using an on mouse over event just for illustration purposes. This could all happen automatically. But we're going to use an on mouse over event to fire our JavaScript. And it calls out to an external JavaScript file on Kyle's domain, Iamawesome.com. That's the external JavaScript file. It expired. So if you want to go buy it. I guess I could have sold it here and made it. That's some money. So now we're going to share it. So we're actually going to be sharing the scratch pad folder. Now when we share the scratch pad folder from the attacker to the victim, the full folder actually gets moved over. So right here we go ahead and throw the user ID or the user name, the victim's email address into there. And we uncheck that little nifty check box that says. Send email notification. So we can just simply share it to the user without any sort of notification. So go ahead and share it. We'll zoom back right over to the victim's account. And in just a second, his Google account will sync with a shared scratch pad folder. There it is. And then in just a second, it's going to sync with scratch pad. And now this is just an on mouse over event. So just a link with a JavaScript event. We can make this all automated. There's no reason that we couldn't just make it pop. So what we're doing here, we sourced in that JavaScript file into this completely sane extension, this extension provided by Google. And we have now taken over the extension. So we made some nifty buttons out of JavaScript that do exactly what they say on them. Right. For the purpose of the demonstration, there are buttons. Automation is pretty basic. So the first button actually grabs your Google contacts. Because you're logged into Google and scratch pad needs to access Google.com. We can just pull down Google.com slash contacts. So I can have scratch pad just make a request, pull down the export functionality, pull all down as nicely formatted CSV format. Thank you, Google. And then I can wrap that up. It's parsable. It's very parsable. Then I can just wrap that up and spit it back out, send it back to the attacker without the user ever really noticing. Another bit of functionality that scratch pad app has, because it has access to docs.google.com and www.google.com, I can actually spawn a tab with one of those host names in it. And then I can inject JavaScript into that frame. There's a nifty built-in function called execute script. Yep. Tabs that execute scripts. In the API. There we go. So it's great because now we can effectively inject JavaScript to any web page we want. And in the scope of this app, it's only docs.google.com and www.google.com, but we can effectively inject our own JavaScript into these web pages without any sort of vulnerability in these web pages. So there's no cross-site scripting that we know of in google.com that we're utilizing here. We've simply just injected the JavaScript directly into the DOM via these extensions. And so you can see on the screen we just, you know, stereotypical alert box with a cookie in it. So what we could have done here is shared a malicious folder, a malicious document with someone that we knew that was using Scratchpad, automatically execute JavaScript in the context of it, grab your whole address book and your session, and then force you to share that same document with everyone in your address book and so on and so forth, and let's go ahead and not notify anyone that we did this. So it was potentially a zero-click silent worm, right? So we can go ahead and just go steal every session of anyone who was using Scratchpad at the time. One click if you had to open the extension, but this all could happen automatically if the extension was open. So how do we do this, right? So we've been talking about permissions a little bit here and there, right? So if you guys have played around with Chrome extensions at all, when you have them installed locally, the permissions are actually set in a file called manifest.json, and basically it just tells you what websites this extension can talk to. Scratchpad could talk to docs.google and www.google, but of course it can, right? So like, if you install... A Google Document note-taking app, of course it's going to be able to talk to Google Documents. Why would that stop me from installing it? But the cool thing here is that not only do... Well, the permissions are set by the third-party developer, right? So if they don't know any better, what do they default to? Talk to every website. You know, I don't want to deal with this later and break something. So we've seen some extensions out there that have these wide open permissions, just basically star, can talk to star, that don't need it. But the other kind of scary thing is that some extensions need that permission. Something like an RSS reader, right? Is there any way to blacklist or whitelist an RSS reader for what websites it's going to be able to talk to? So if you have an RSS reader extension, it's going to need to talk to every possible website that's going to have an RSS feed on it. So it's going to have wide open permissions. And again, Google does not check these extensions. So if you have an RSS reader extension, it's going to have an RSS feed on it, and it's And again, Google does not check these extensions or the permissions that are set by the third-party developer before they're uploaded to the web store. All right. So a quick overview of the APIs that, as an attacker, I found interesting. So the first three, bookmarks, cookies, history, those basically allow me to access, edit, delete, insert bookmarks, cookies, and history. This is great because I can kind of pull down your whole history, all your bookmarks, all your cookies. And then if I want to make trends, I can figure out which websites you go to most often. I can stage attacks based on that information. Or if I have direct API access to all of your cookies, I can just pull down all of your cookies and impersonate you on every website that you're currently logged in and have a session with. Now, windows and tabs. Windows and tabs, pretty much all the extensions have this. This is basically the API that allows them to create pop-ups, create new tabs, and create new windows. It's pretty standard. This is also the... Or talk to... I'm sorry. Or talk to any currently open tab or window, right? So if an extension needs to talk to a website that you're currently open, it doesn't need to pop something up or let you know. And this is the awesome one because this is the one that has the functionality of tabs.executescript. So most of the extensions utilize this API, and most of them have the ability to call the execute script functionality. And that's great. And that's great because if most of them have it, it just means it's that much easier for us to inject code into websites that we feel necessary to. So down at the bottom there, you see that's a screenshot of what the manifest.json file, like a sample manifest.json file. It just had permission to, you know, storage, notification, tabs. Tabs is what we're talking about. That's cool. And then you'll see a sample wide open permission kind of regex, right? So it can match on any protocol, any domain. Any path. Any protocol is kind of tricky here. It's not actually any protocol. It's either HTTP or HTTPS. So even though it's a star, it's just those two things. We can't start, like, initiating FTP connections and stuff like that through these things. And you see that that's seen very often. There are extensions in the wild right now with that, with cross-site scripting. Every once in a while, I pull down the top 1,000 featured or most popular extensions. I go through and I parse the manifest.json files. And there's a good percent that have exactly that. And of those, I can usually find a few that have vulnerabilities. So what are we looking for now, right? As web hackers, we're not looking for buffer overflows or anything like that in your software security. It was perfect, right? I was given, we were given this talk at the executive briefing at Black Hat. It was a little quick, a couple minute of it. And this guy was talking before me. And he was talking about, I couldn't have asked for a better person to be talking before me. He went up there and he was talking about all new ASLR and DEP and all this kind of stuff. Comparing Windows 7 and OS X and the latest and who's more secure, this, that, and the other thing. He gave this whole talk about that. And I got up there and introduced ourselves. And I said, and this is exactly why we don't care what he just talked about. We don't give a shit about ASLR, DEP, anything like that. We're talking about everything in the web now. I don't care about what's on your hard drive. These machines don't store anything locally. Even if they did, you're storing everything in the cloud anyway, right? Like, we were just able to hijack everyone's Google account. How many people live in Google? I know I do. It's all my email. We were cracking up. We were using Google Docs to pass outlines for this talk back and forth to each other. That we just found a vulnerability in it. While we were testing Scratchpad, I also shared extensions to Matt that he was not happy about. Or shared titles. Yeah. So, you know, we're looking for a new set of usual suspects, right? We're not looking for insecure software on your hard drive or anything like that. We're looking for extensions that are going to take input from somewhere and display it back on the screen for cross-site scripting vulnerabilities. We're going to look for extensions that perform some sort of sensitive administrative function for you conveniently on some website for CSRF vulnerabilities. We're going to look for, and we'll show it in a second, we're going to look for extensions that talk to a database for SQL injection vulnerabilities, right? These are web hacks that everyone's known about for decades. And, you know, we're not doing anything fancy. You know, I don't want to write crazy buffer overflows, ASLR bypasses, anything like that. We're just writing JavaScript and we're doing some pretty cool stuff. So, you know, the other unique thing about these extensions is if you find cross-site scripting on a website, you can attack the users of that website. If you find cross-site scripting on an extension with wide open permissions, you can potentially attack the users of every website that that user is using. That's completely different. You know, we're not seeing that a lot today. This is kind of new. So we have a direct quote from Kyle here. Why are we going to spend all this time, like I was saying, why are we going to spend all this time trying to learn assembly code or anything like that when JavaScript is really easy? So says this small child. That is a quote that I said. So cross-site scripting is going to give you everything, you know, we want and more, right? Exploit development is hard. Like I don't have time to learn it. I'm not smart enough to learn it. Kyle agrees that I'm not smart enough to learn it. And all these APIs are really easy and, you know, callable by JavaScript. You know, maybe we can get like a memory-based malware key logger in this system if it really felt like trying to break the sandbox or something like that. I mean, no one even showed up at CanSec West to try to break the sandbox. That's not what I'm going to spend my time doing. The return on investment isn't worth it there. All right. The impact is so high with these vulnerabilities, but the learning curve is so low. It's really just JavaScript. Most of the attacks can be done in two to five lines of JavaScript. And it would be pointless to really do any sort of in-memory malware because as soon as you reboot the machine, it's lost. Your attack window is probably a shorter amount of time. And you can't really do much once you get the code execution. The hard drive is read-only besides your home directory, but nothing in your home directory is executable. So you can't even maintain that. You can't maintain persistence with native code execution. See, the other thing that we haven't seen yet that we're seeing here is that if we're going to fix this besides fixing just the cross-site scripting holes, a lot of the sanitization might have to happen client-side, right? These extensions are locally, right? So usually when you fix cross-site scripting, you're doing some sort of input validation or outputting coding on the server side. What if these extensions don't talk to a server at any point, right? And, like, they're just grabbing information locally, things like that. You know, then the sanitization might have to happen client-side. That's crazy. We don't even know what that's going to look like. So let's get to another fun demo. Cool. So this is a purposely malicious extension that we threw together just to demonstrate the vulnerabilities. This extension pretty much has the same permission levels as the Scratchpad extension does. It's a nicely named malicious extension. So anything we do here we could have done with Scratchpad. Can't do it anymore because Google fixed it, so that would be a deal. Actually, I take that back. The only difference between a Scratchpad extension is that instead of having only access to Google.com, we have access to star colon slash slash star. We can access any domain, any host name, any protocol, and that's actually very common. Yeah, like we said, there are extensions out there, RSS readers, things like that. I think at the time, the top-rated RSS reader and the top-used RSS reader had an XSX bug in it and had permission to talk to every website when we found it back in December. But this is just a little easier to demonstrate. So with this extension here, I'll go ahead and maximize. Oh, great, okay. So with this extension here, we just have the nice little buttons again. Of course, we've seen the Google contacts. We can just pull that up, and there you go. There's your Google contacts in a nice CSV format. Now this is a fun one. Did you update this? Yeah, we did. Yeah. So who wants to come up on stage and type their phone number in? Wedgie. Come on. I promise it's a password field. No one will see it. One, the area code, and your number. No, no. So what we're doing here is since this extension has permission to the whole website, it also has permission to Google Voice, right? So we're actually able to hijack that, parse Google Voice for its CSRF token on the fly, and then spoof a text message. Actually, I changed it, so it's no longer a text message. I'm actually spoofing a phone call. So if as a user I wanted to get someone to call someone, I would have Matt, within a vulnerable injection or a vulnerable extension, I would pop his extension, then I would force a phone call to his phone, and then that would call whoever I want it to be. Our last one was also a text message, but it's not limited to that. We can pull down your call history. We can pull down your text message history. We can pull down your voice mails. It's really not limited at all. Did your phone ring? Not yet. Oh, well, mine rang. I don't have Google Voice on my phone. No, because it calls my phone and then calls you. It's using the victim's Google Voice account. Yeah. It doesn't want to call you. So you actually, as an attacker, you were just using my Google Voice account, which then called you, and that could all be automated again. It's just like buttons because they're pretty. The demo gods are not smiling. No. Anyway, so another fun one, which is execute alert, which execute JavaScript, same thing with Google.com. So we're just going to go ahead, okay, Google.com, Facebook, JavaScript injected, Twitter, Yahoo, and Chase is still giving me a call. They're giving some air. So let's just go ahead and pretend there's an alert box there. Oh, hey, proceed. Will it actually work? I don't think that works. Oh, look it. That didn't even work. There we go. So these websites don't have any vulnerabilities in them. Well, they probably do. Well, I'm sure they do. It's Chase. We don't have permission to test that. We haven't exposed or utilized any vulnerabilities in these websites. We're just injecting code to them. So we can go one step further. Instead of alert, why don't we just inject a JavaScript key logger? I mean, there's your in-memory malware. You now have a key logger in every page that you go to. And it's not just spawning tabs. I can contact tabs that are already open and inject as much or whatever I want. We can listen for what tabs you're opening. We can view your history, right, via the history API. We can watch I Love Lucy. Yeah, I Love Lucy. All right. So then another fun one, which hopefully doesn't kernel panic your Mac again. I kernel panicked my Mac earlier. Let's... So we can actually do XHR scans. Because we have access to colon, star, dot, star, whatever, we have access to everything, this also includes IP addresses. So we can actually use XHR requests to scan your local subnet and look for anything listening on port 80. So we'll go ahead and do this on this one, and we'll see if anything pops up and hope to God that it doesn't die. Oh, your button doesn't work. My button doesn't work. Oh, that's sad. No, we can do all different things. Yeah, we can basically do any port that's not restricted by the browser. So the browser has it hard-coded. You can't access, like, port 20 through 25. You can't do... Like, IRC, you can't do SMB stuff. So you wouldn't be able to do SMB scanning in the network to look for Windows hosts, but you could pull down a local list of web servers in your local area network. So I could potentially fingerprint your internal network by taking over one of your extensions, scan your internal network, look for fancy things. Say you have Jira listening or you have... Maybe there's printers there that I can take advantage of. Who was at our Black Hat talk? Anyone? No? Okay, cool. That's fine. Yeah. All right. Okay. So we found a printer. We did the XHR scan, and there was a printer listening that we could have printed up from on the podium at Black Hat when we did that. It was pretty awesome. Let's see. I don't know why this isn't working now. It's probably somewhere. There may not even be anything. I bet they have it all. Oh, yeah. We might be segregated. Anyway. So it's kind of cool because you can see it do its little thing here, and it scans really fast. Like, it scanned all... It made all those requests at the same time. And it's a very quick scan. And we can pull back not only the fact that the host is up, because we have access to the content on all the pages we're requesting, we can pull back the full HTML page and the headers. So if you do have, like, Jira or some wiki or ticketing system on your internal network, we can pull that back, parse that page, and find out exactly what it is. And then from there, we can, as an attacker, go, okay, great. You have Jira. I have a Jira zero day. From here... From your web browser, I'm actually going to own your Jira server, load up a meterpreter session, and suddenly I have a real shell from your Jira server that I attacked from your browser calling out back to me, and I have a real shell on a server inside your network. So... Who uses LastPass? Who's heard of it, uses it? Okay. Handful. For those of you who don't know what it is, it's a password manager. Right? So us as security guys, we're always telling people, hey, you need to use different passwords. For everything, right? Oh, use a different password for every website that you go to and remember them all. All right? So, you know, this LastPass is actually a website that helps that make, makes that a little bit more user-friendly. Right? So you go there, you make one password for LastPass, it generates passwords for all your different sites, stores them securely. It actually is a really awesome service. Kyle used it, and that's why we found the vulnerability in it. They have an extension in Chrome. It had cross-site scripting in it when we first were testing it, but they fixed it right away. They've actually been really awesome to work with. So there's no vulnerability in it right now. So this is kind of our demo of, like, we can own an extension that has no vulnerability in it that's doing absolutely everything correctly, and it's pretty cool. Right. So when I was testing the LastPass extension, I did find a vulnerability, some pretty hard to manage, on drag, whatever. They fixed that pretty immediately, but I realized as I was testing it, there's this functionality of the extension. As long as you're logged into the extension, it'll automatically log you into the LastPass website. So if you're logged into the extension, like, you are, I mean, you're going to be logged into the extension if you're browsing the net. You want to be able to access your Gmail account without being logged in. You don't want to have to re-authenticate. So you've always got the little red square up there saying that you're logged in. So when that's the case, you can go to LastPass.com, and it'll automatically log you into LastPass.com. It does this because the extension notices that you went to LastPass.com, and it kind of handles the login process for you. It lets the server know that you're actually logged in, and then it passes your local crypto key from LastPass to the web browser, or to the frame. So real quick, LastPass, like Matt was saying, great service. It handles all of your encryption locally. So your database that you send them is all encrypted. It's not in clear text, and your password is never actually sent to them. It's all stored locally. It's all in the DOM. It's all encrypted in the DOM with a representation of your password. So anyway, it passes that local key to that frame. Now, we can take advantage of this, this automation, because if we say we own an RSS reader, just Joe Schmoe RSS reader, some third-party developer that doesn't really know anything about security, but makes some great extensions. And say has, like, 500,000 downloads in the App Store right now. We can spawn a tab for LastPass. Where, of course, you know, not speaking of any actual top-rated RSS reader with a vulnerability in it currently, or anything like that. So we can spawn a new window with LastPass. And what this does is the LastPass extension then goes in, and it notices that window. So it thinks that you opened that window and that you logged in. And you want to go to LastPass.com. So it automatically logs you in to your online vault. And, you know, you can change settings there and all that and access all your passwords. And that's great. But instead of allowing the user to do that, we're going to have the extension automatically open this window, allow the extension to log you in, and then inject JavaScript to pull out your crypto key. So now I've got your private key to decrypt your database. Then I'm going to just, you know. Grab your database because I can do that. It's very trivial. And we're going to demonstrate it right now. We could just decrypt it locally in our hacker den at home. It's like a man cave but with more green lights and Neo. So we're logged in right now. We've got recently used. So, okay, Google and a bank. So if we go ahead and click grab LastPass database. It's going to spawn it up. It's going to automatically load it up. So we're logged in. No prompt from the user. In just a second, it's going to, you know, change. So, okay. So here is your actual crypto key up there. There's a weird way of passing it between the extension. Now I grabbed your database and then I just decrypted it on the fly and threw it right there. So what we can do with this is we can just grab the database, send it back to us with your key. And then suddenly I've literally got the keys to the kingdom. I don't know about you guys, but I put way too much information in my LastPass extension. I've been using it for about two months and I probably have close to about 50 sites or more that I just use because I'm slowly switching away from my weaker passwords to the really long random stuff. But that doesn't matter if an attacker can just come in and literally steal my LastPass database and cryptographic key. That's my password, too. So we did this at Black Hat and we didn't actually write this as not really my password. DEF CON, don't try to log in. And someone logged in and sent us an email. They were very nice and they didn't change the password on us and lock us out, but we didn't trust you guys. You look shifty. All you evil hackers. Anyway, so the important thing to know about this is that there's no vulnerability to LastPass at the moment. We're not taking advantage of anything that LastPass is. No cross-site scripting that we know about. What we did find, they fixed immediately. The extension itself is not vulnerable anymore. And actually, this functionality is no longer there. They made it so you actually have to click it from within the extension. It's still ownable, but the extension doesn't automatically log you in. But if you are logged in, we can still own it. So it's not as automatic and cool as what our demo was, but it's still ownable. And that is the last version of LastPass. So you're all safe now, I promise. So we're running out of time. So let's try to fly through some of this. So how many of you guys know what Beef is? You've heard of it. I'm hoping some of you. All right. How many of you know what Metasploit is? Hoping a lot more than you. Okay, cool. So Beef is kind of like the Metasploit of the web, web app, right? So you can store a lot of preloaded kind of payloads and things like that to do cool stuff and help making it work. Hacking websites easier, right? So if you find a cross-site scripting vulnerability in a website, instead of just hoping that your JavaScript does what you wanted it to do the first time that you pass this injection, you can pass it a Beef hook, which is what it's called, and it actually maintains access and you can just replay attacks over and over again. So it makes everything that we did just really, really easy. All right. So I made this even easier, and I pretty much just took all of the demo functionality I did and I threw them into Beef extensions. Beef. Beef modules. So now when you own an app, all you got to do is hook Beef, and suddenly you have Beef inside the extension. You can maintain access and you can send commands as you want. Go ahead. Say your quote. I'm not there yet. So first, check permissions, like if you don't know what extension you're in for whatever reason. All the extensions we tested are all local, so we don't really need to check the extensions, but if somehow you manage to own an extension that you're not really familiar with, you can hit this module and it'll give you. It'll give you all that information. Execute tabs. Execute arbitrary JavaScript inside of all tabs. So if you want to inject a key logger, it's pretty simple. And my favorite, inject Beef. So basically, if you have tabs open and I want inside of those tabs, instead of doing execute tab, I can just inject Beef into those tabs. So I suddenly go from one Beef session to 50 Beef sessions because you have 50 tabs open. So now, not only am I inside your extension, but I'm actually inside bankofamerica.com. I'm inside your PayPal account. I'm inside of every website or every tab that you currently have opened and it's very simple. Go ahead. Do your quote. Yo, dog. I heard you like Beef. So I put Beef in your Beef so you can Beef while you Beef. Perfect. And the other three just do kind of what the other demos that we had. Yeah. So basically, our main point that we're trying to push here is that this is kind of the same problem we've been dealing with. We've been dealing with it forever. We're just, it looks different. Right? So this isn't the end all be all of security, but it's definitely a step in our direction. It eliminates a lot of modern malware and viruses because you can't talk to the hard drive, but that doesn't mean that we still don't want the information that you're storing on the internet now. And if you're using one of these devices, you're being pushed very heavily to store a lot of information on the internet in order to get functionality of these. So like I said, we're not looking for these buffer overflows, underflows, any sort of stuff like that. We're just looking for cross-site scripting, which is the most widely seen vulnerability on the web today. Yeah. And since you're literally taking the desktop out of the desktop operating system, you have to rebuild all the functionality that you're used to with your desktop operating system. You don't have a calculator anymore, so you have to download a calculator extension. You don't have a mail client, so you have to use some mail client or notification system to recreate that. So one of the first things that people ask as soon as I tell them about any of this research is, what about the sandbox? I hear about this Chrome sandbox. Did you guys break it? Did you guys break the Chrome sandbox? Oh my God, right? We didn't break it. We just went around it. These extensions actually live outside of the sandbox. So what the sandbox does, for anyone who's not familiar, is it isolates each tab from any other tab that's open and also isolates that tab from the hard drive. So that's why it eliminates a lot of the modern malware and viruses. But these extensions actually control their own kind of intertabular communication. Again, I made that word up, and I think it's awesome. Intertabular. Intertabular, right? So these extensions completely control the communication on their own, set the permissions that are set locally, and they live outside the sandbox. So instead of breaking it, we're walking right around it. We pour water in your sandbox and make it all muddy. So again, just to harp on this. These permissions are set by the third-party developer. They're not set by Google, and they're not checked by Google. But a lot of that stuff that Google did put in place has made some awesome improvements in security. We're just kind of here to say, hey, that's not it. That's not the end-all, be-all. One other really cool thing that they did, the Chrome Web Store is explicitly... We're not allowed to attack the Chrome Web Store via any extension. It's actually hard-coded into the Chrome source that you cannot... None of the extensions can interact with the Chrome Web Store. And the reason they did this is because if we could, we could force you to install an extension. So we can kind of do a privilege escalation, right? So if you had a scratchpad installed with a vulnerability that could talk to docs.google, and we could force you to install an extension with wider permissions, then we could do some more stuff. But we can't do that. They thought of that way before we did. However... So we're going to fly past this because we didn't do too much research on it. But nifty new feature of Google, the market.android.com. Who's used it? Who knows what it is? Okay, cool. A bunch of you. So you can install apps on your Android phone from the Internet. That's not blacklisted. So we can actually force install apps onto your phone via cross-site scripting. And because it's part of Google services, as soon as you go to that website, you're automatically logged on, and your phone is listed in these sync devices. So we could literally open up a tab. Spit some JavaScript at it, and force you to download and install our own malicious extension. Again, probably a Justin Beaver wallpaper. And then we can just harvest information off of your phone without you ever knowing because it doesn't really prompt you on your phone. It doesn't tell you that something's about to be installed. It just tells you Justin Beaver Live has been installed. Yes. Yes. Thank you. Finally got it. Yeah. So just in discussion with the Google security team, we've been talking to them this whole time. They're really cool guys. One of the ideas that they have for kind of fixing this in the future is creating more restrictive APIs for common use cases, things like RSS readers. They're going to eliminate a lot of the risk involved with that. They're going to try to create APIs for extensions that absolutely need to use this wide open permission set in order to function properly. This unfortunately does not eliminate the threat of a developer not knowing anybody. They're going to do better in creating an extension with wide open permissions. So it's just for common use case APIs. So it's not going to eliminate it, but it could reduce it. That's it. I have one more thing to note. Go ahead. Clap. Clap. All right. One more thing that we wanted to note is that all of this is the same for Chrome browser. The only difference between Chrome OS and Chrome browser is that Chrome browser on a Windows, Mac, Linux machine is just another browser. So you're probably not going to be installing tons and tons of extensions unlike the Chrome OS. One other thing to note is unlike Chrome OS, the Chrome browser can install extensions with binaries on them, plug-ins. So LastPass actually has the ability to sync your LastPass logged in status among your other browsers, which is a binary. We can actually interact with some of those binaries with JavaScript. And I haven't looked into a whole lot of it, but with LastPass alone, there's functionality to read arbitrary files on the file system. So if I owned your LastPass extension, not only do I own everything in LastPass, I can read random files from your hard drive as I feel. Cool. Thanks, guys. We'll be in the Q&A. We'll be across the hall if you want to talk to us.