Okay. We've got a ton of stuff to get through, so I'm going to kind of kick off. Just a quick disclaimer up front. We kind of cut this talk down from 140 slides and a 75-minute talk at Black Hat to 50 minutes and a lot less slides. So everything is going to be up on our site. If you catch our blog, we'll link to our research portal and we'll have the full content up as well as this. Just a quick overview of where we're going to go. We're going to give a quick introduction to the talk, kind of background on where some of our things are going. We'll talk about some drawbacks when you're dealing with cloud computing. And then we're going to look at some specific people. So the ones we looked at were Salesforce.com, Amazon's AWS, and Apple's MobileMe, and then a quick wrap-up. Just very quickly again about us. So SensePost as a company, we're a dedicated security services company out of South Africa. Been around for about nine years. We've spoken at Black Hat and DEF CON for the last... eight of those years. We do a ton of research, a lot of training, put out some papers, kind of put out some books. Not going to hop on us. So really quickly, the moment you talk about cloud computing, the question has to come up, why are we even bothering? At the moment, cloud is a real headline stealer. Okay, you just have to say cloud and a whole bunch of people are listening. But we've been doing talks for quite a bit. We've spoken at... at Black Hat, DEF CON for quite a while. And we're not famous for doing talks just because they headline steely. In fact, some of our talks have some of the most boring demos known to man. We've got probably the slowest port scanner, probably the slowest tunneling tool ever released on the interwebs. And the reason I'm saying that is we wouldn't choose a talk just because of its fashion appeal. Okay, we think there's something important going on here, and we think it's important that people start noticing it. So, there are a few people talking cloud, but the moment cloud is spoken, you get people splintering into different groups. There's a group of people who immediately go, that's nothing new, cloud, cloud, cloud, it's the same old thing. Schneier's gone on record a few times saying it's the same old computing paradigms that we've done. What's interesting to note is that he's said that multiple times in multiple interviews. Okay, so clearly something new is happening here. Something's coming up. There's also something that we'll touch on. There's something that we'll touch on later on during our talk, and that's lots of attacks that we previously thought were uncool and unsexy suddenly start to take on a different tinge with the new paradigm. And the bottom line there is that at this point, with attacking this stuff, with testing this stuff, we really don't want to waste time splitting hairs. Okay, this is not the time for us to be deciding whether Web 2.0 is or isn't new, whether JavaScript is or isn't a cool attack vector. What we're interested in is what. We can do with it and to make sure we're prepared for these attacks. So why would we want to attack the cloud? Why would we want to try and find things to break? Well, as much hype as it is, a lot of people are actually moving there. A lot of businesses are going and outsourcing functions and putting things up in the cloud so that they can then abstract that infrastructure and not have that responsibility. It's also fairly insidious, right? So even as a technical person, you could be fighting that and saying, look, we don't want to give up. We don't want to give away those things. But the decision is made above you at a business level because that's what's happening, right? And that's where those calls are made. So everybody in one way or another is kind of moving into the cloud, which makes it a really, really attractive target for us. And interestingly enough, if you consider the nature of the thing, it's out there, right? It's a web app that you're accessing things through. Clearly, we haven't got web apps right since the dark ages. And we're very prone to making those same mistakes again and again. But the truth is we don't have to make those same mistakes. If we can. We tackle the stuff up front. So if we look at some of the drawbacks of cloud computing, there are a couple of issues that we face as testers or as people that are putting their data out in the cloud. And the first major one is transparency. Anybody who remembers a couple of weeks ago the Amazon debacle, they got really attacked pretty hard about their transparency on that. Felton came out and said that they need to really step up to the plate and make sure that there's more insight into what they're doing. Otherwise, they're going to lose. And that's what we're going to do. And that's what we're going to do. Privacy is a big deal as well. So on a small scale, you could be saying, look, I'm concerned about giving my email to Google. But on a bigger scale, what happens when you're outsourcing core business functions or your core data, like sales-related data, whatever it is? That thing goes further when you look at the legalities that are involved. So in essence, what's happening is you're losing your Fourth Amendment right to a warrant being searched before you get your data. So what actually happens is we're losing our fourth amendment right to a warrant being searched before you get your data. So what actually happens is with the law at this stage in time, your cloud provider can be told to give up your data. And you don't even have to necessarily be notified about that, never mind have a warrant to give consent, which obviously is a big deal for a lot of people. One of the other big things is compliance. We don't necessarily know how to handle compliance in the cloud at the moment. So some people are doing some work around it, the cloud security guys. But compliance in the cloud is still a big deal because ultimately, even though your data is somewhere else, you're responsible for that data. Vendor lock-in is another one. So consider now that you're giving your data to somebody specific, what happens if all of a sudden they go out of business or if they're acquired by a competitor of yours, how do you then get guarantees that you'll get that data back and you'll get it back in the form that you had? Or if you make a massive investment into a specific platform, how portable does that become? The big one as well is availability. So availability is one of the major promises from the cloud. It's always up. There's massive kind of scalable information. There's infrastructure. You can always get access to your data. So from a browser, from a mobile device, whatever it is. But a lot of people are failing in that space, even though that's one of the major selling points. So you look at somebody like cloud files, for example. I want to access my files. I want to write stuff up. But at the moment, it's in read-only mode because they're having issues with their data center. That's less than ideal. You could also look at someone like SugarSync who promises to have all your data and your contacts and whatever it is synced at the same time. I want to try that. I want to try and access that data because that's why I'm paying for the service, but they're down for maintenance. That stuff doesn't scale very well. It's not the smaller guys. The big guys are vulnerable to that as well. Google App Engine had a really big issue recently. So if you're thinking about availability, one of the things you need to keep in mind is that it's not just about uptime. So when we were looking at this talk, we were pretty much browsing around looking for cloud providers to attack. And one of the first guys to come up for disk storage was Oosa. Go to their page, and it turns out they don't exist anymore. How they handled people getting their data back is questionable. If you go to TechCrunch, TechCrunch lists a whole bunch of online storage guys you should be using or could be using. And what you almost see highlighted down there is them recommending Omnidrive. You go to Omnidrive, and this pops up. Omnidrive is no longer available. We now recommend Nomadisk. Okay, so it's a big problem. It's something that needs to be considered. But as an attacker or as an auditor, something else that pops up is that it's not just stuff that's out of your control like this. What happens suddenly is somebody locking you out of your account starts to become a very real attack. If someone locks you out of your account when you're using a cloud provider, you're now going to provide your identity somehow. And you're basically just sitting in a queue. Hoping that they'll bring your account back. The other big issue that comes up is that by default, if you're giving things away and you're outsourcing functions, you're automatically extending your attack surface. So it's one thing to protect your systems when they're in-house, but once that stuff is out there, other people can get at it. Even more so, a lot of things that are now out of your control can affect your security posture. So consider the case with a traditional phishing attack. Your users get phished, maybe they lose some email, maybe you give up some creds, whatever it is. If your provider gets phished now and they're looking after your entire infrastructure, all of a sudden your data and your infrastructure is out there on a risk that you can't even control. And if anybody thinks that's not a big deal, we can talk about how effective user education is after the talk. I'm sure everybody's dealt with users and seen the phishing attacks. And it's happened to some of the bigger guys. So everybody knows about the Twitter stuff. It's happened to some of the other big players as well. While we're on the phishing attack, all of a sudden now, again, like I said, you're not dealing with a loss of somebody's credentials or giving up some email. Suddenly you can get phished and your entire data center gets given up because you've got one username and password for Amazon to buy books. And that same username and password grants you access to your entire data center. So it's a slightly bigger deal for what we'd potentially consider a lame attack. Trust is a big deal too, right? So the question we say is, why would we give our data to these guys? If we want to outsource this function, it's because we trust those guys. Because they're specialists at what they do. And we're trusting them to control that data. But there have been a couple of fails there as well. And a quick Google for cloud fails will give you tons of hits coming back on how those things have gone wrong. So interestingly enough, on IRC recently I was speaking to someone who was talking about how much cost he has cloud break stuff. So for those of you who haven't seen it yet. It's a really, really elegant exploit that allows you to escape from VMware. And he was talking about how scary this attack is. And what keeps coming up is the point that while the attack is scary and cost has clearly got more brains than some small countries. That actually that type of attack, we've got no reason to not fear that attack natively from Amazon, right? If you're running in Amazon's data center. You don't know that Amazon don't have a Trojan hypervisor already. All the hypervisor has to do is give them access to stuff that they weren't meant to. And actually you've got no way of knowing it. So sometimes we tend to focus on the wrong threats. So if you take the popular phrase, trust but verify. You'll find that one of the problems you have with the cloud is your inability to verify. Okay? So to some extent, reverse engineers keep Microsoft honest. If you remember back in like 92 or 93. People found NSA. Made a DLL in Windows. And everyone went nuts because we thought there was something wrong going on. That stuff's almost impossible to do in the cloud. Okay? Even if you verified somehow that Amazon didn't have an evil hypervisor on your system today. You don't know that that's the same hypervisor that you're on tomorrow. Okay? And it's just one of those things that you give up the moment you enter the cloud. So like I said, the problem is even if they're not evil today. How do you know that they're not evil in the future? One of the things that you need to ponder. So I'm not sure how many of you remember. But a little while back or long while back. The story of crypto Swiss AG came up. Swiss AG was the Swiss company selling crypto to about 140 countries. And it turned out later on that Swiss AG was just a front for the NSA. So all these countries that were buying crypto were actually buying specifically weakened crypto. So that the NSA could have access to it. I'm not saying any of this about any of the current cloud providers. I'm just saying that if they are doing it. You don't know. And you probably wouldn't find out. So another interesting angle is not attacking the cloud itself. But using the cloud for things that are interesting. And taking advantage of the extra resources that we get. And a couple of researchers were kind of quick off the mark on this. So if anybody remembers back to the Debian week. The keys debacle. Dino D'Azovi picked up on that really quickly. And used Amazon EC2 instances to brute force keys. There was another case where Ben Nagy at his SysScan talk. Spoke about how he'd used parallelized resources. For when he was building his MetaFuzz harness for attacking Office. And some of the guys like Dave Molnar and Zynamix. Also using it for things like malware analysis and fuzzing. So you get this ton of resources. And it's kind of more cheaply available. And you can really, really scale your attacks. And speed things up. So with the background and some of the drawbacks out of the way. Let's dig into some of the specific providers that we looked at. And the first one is Salesforce.com. We figured we'd look at Salesforce because they're the leader in the industry. And pretty much everyone who's anyone is using them. So we figured they'd be an attractive target. Salesforce also gives you two things. So on the one hand you've got platform as a service. Where they give you a development platform in the cloud. And you can start to build your own apps. Or extend functionality. But they also give you the full software as a service stack. So you get things like you can outsource your entire sales management or CRM. And they really got a mature offering. So we took a look at them. And we kind of started out probing them for traditional web app vulnerabilities. Again, we had limited time. And we were kind of working at that stage without a mandate. So we were really, really careful about what we were doing. So we only did cursory testing. But again, they held up really, really well against that stuff. And fully props to them. For the work they've done. Ultimately though, what you're dealing with is a web application. You're accessing the stuff over the web. And everyone knows over the years that nobody makes web app mistakes anymore. So you've got a fundamental problem now where we suck at web apps. As an industry. Now we're tying the cloud to the web. And things can go horribly wrong. If you look at the statistics on web app vulnerabilities. Pretty much from any source you come across, that stuff looks terrible. Nobody can argue that that stuff is good. And we've had a couple of high profile examples. So from Sammy in the early days on Myspace. Through to multiple cross-site scripting worms of the same deal. Earlier this year against Twitter. And if you think about Twitter. I need to interrupt you. I'm sorry folks. I've got to interrupt him. That's the bad news. The good news is I will keep it short. The last 24 hours. We've had a serious outbreak of the stupids. From you people. I'm sorry. I'm very upset right now. The slide on the screen is very apropos. In the last 24 hours. We've had a serious outbreak of the case of the stupids. By a lot of people here. Police yourselves. If you see someone about to do something stupid. Don't laugh at them. Stop them. The staff is flashing back to DEFCON 9. Which was our worst DEFCON ever. You guys are better than this. Is there anybody here who doesn't like the hotel? Who doesn't like coming to DEFCON here? Would you raise your hand? Good. We like it here too. Keep doing what you're doing. We won't be here. Do not bungee jump off the roof. Do not go to the roof. Carrying a concealed weapon in a casino is a big deal. Even if you have a permit for it elsewhere. Basically. Don't be an asshole. If you see someone being an asshole. Stop them. We're supposed to be in the top 10% in terms of IQ in the United States. If not worldwide. You're acting like a bunch of 13 year olds. Knock it off. I'm sorry. Thank you. Thanks. Okay. So that's going to be a really hard act to follow. So I'm going to kind of. Thanks. So I'm going to kind of leave you with the idea that if we're talking about web app security. Look at somebody like Twitter. Right? They've been owned so many times. All they're doing is they're putting out 140 character strings. And they're like. What's the point of doing that? If they're not getting that stuff right. What hope do we have for the more complex stuff? So we decided to just demo a quick attack. It's a fairly overhyped attack. So I'm not going to go into. Everybody knows about the click jacking bug. I didn't discover it. I don't want to take credit for it. But if we fire up a video clip very quickly. What you'll see on the screen is. You've got. Kind of in the app. You've got tasks that can get assigned to a user in salesforce.com. And to close that task. They kind of get listed like that. And if you just go through the motions. You hit the X button. And you can kind of go in. You can check out the task. You can hit save to carry on. So I'm going to skip ahead a little. Skip ahead in that guy. What we can do is. If we fire up a malicious page on our site. And we get a user to browse to it. Essentially we can load that page as a frame. In the background. And you can see it's kind of semi-transparent. So we did it like that for the demo. You could make that thing completely transparent. Or you could put it. Put up a punch the dancing pigs. Or the lolcats. Or whatever it is. And force the user to click where you want them to click. But what you've got is. Within the page. You've got JS that will follow the user's mouse clicks. So what we can do is. We can force them to click wherever we want them to. So in this case. We get the user to save their task. We do a refresh in the app. And the task is gone. Right. Simple click jacking. Just shows that even some of the guys who are doing everything right. Can still be vulnerable to some of the smaller web app vulnerabilities. So for all the Mike Myers fans out there. Allow myself to introduce myself. My name is Mark from Sensepost. So we didn't get the intro right at the beginning. This is Harun. This is Nick. So just if you need to figure out in your head. Who to give the credit to. It's probably to those two. Harun and Nicholas. Okay. So I'm going to carry on talking about Salesforce for a little bit. I focused on Salesforce. As Nick pointed out. Because they actually managed to split the software as a service. And platform as a service. Quite nicely. So what they do as their core business. Is provide web based CRM software for their clients. And they've got a lot of clients. And they're a big company. But they also expose that infrastructure. And that platform. To developers for third party applications. So essentially they've got a system kind of like the app store for Apple. Whereby developers can code their own apps. And sell them to customers. So they've got massive infrastructure spread out across the world. But what's awesome for us. We're South African. We're kind of cheap. So they do provide us with free accounts to test with. They provide you with a free dev account. And so we played with that. To see what we could get. Our goal here wasn't to. Well. While looking for exploits is fun. When you don't have mandate. It becomes a really, really gray area. As we'll chat about later. So in this case we were looking to find ways to abuse. Rather than exploit their platform. So if one wants to develop on their platform. Basically there are three main components. The one is to write front end. Front end pages are written in a language called visual force. It's a HTML like templating language. So you might be able to read that. You might not. You'll see that. They've got custom tags embedded there with HTML. But that's less interesting for us. They also support business logic language. That's kind of got sort of Java like called Apex. But it is their own language there. And Apex is quite interesting for a number of reasons. What you'll find is that it supports interesting API. So for instance you can make web requests from within Apex. You can also code web service end points. From within Apex. So in other words you can have business logic that runs when someone hits a page on your Salesforce site. And likewise for email. So you can send email. And you can also have Apex that runs on the receipt of email. And then the third part of their platform is the data store. Obviously it's kind of an embedded database that they have. So when you're dev for force.com. You write either in Eclipse with a plug in. Or they've got this web based dev environment. Which is kind of cool. But the big thing here is that it's a multi-tenant system. So you share infrastructure with other people. So you need to quite carefully protect instance or organizations or accounts within Salesforce from one another. You can imagine if one account monopolizes the resources on the platform. Everyone else suffers. So in order to protect users from each other. They've got a piece of technology called. Right. So they've got a piece of technology called the governor. And the governor is. So it's built into their platform. And it enforces all of the execution limits. So essentially any script that ever executes is subject to a whole number of limits. And once your limits are exceeded. They kill your script. Okay. Limits vary dependent on how and where your code executes. But your code at all times is subject to limits. The type of limits you'll see are things like the number of script lines that get executed. Number of database queries. The size of the result sets from database queries. Number of call outs. Number of sent mails. And so on. And those are all published. But there are also of course a number of unpublished limits that we bumped into along the way. Which points to good thinking on their part. So things. Kind of unpublished limits you'll hit are. Number of received mails as well as running time of scripts. But this language called Apex comes with a number of limitations. It's not a general purpose language. It's a business logic language. So you'll find that there are a number of primitives you'd like from other languages that just aren't present here. So things like you don't have locks. Explicit locks. You can't pause execution. There aren't real threads. There's no explicit shared memory. And so on. And you'll also find that the order in which you make API calls is quite important. Just because of the way the system has been built. So this is less interesting. Basically we came up with a bunch of workarounds. So in order to pause execution do a whole bunch of floating point operations. They don't count. So they only count script lines rather than the size of the expression on each line. So in this slide. Basically what we're showing is you can chain about 200 odd cube roots to pause execution. And that just counts as one line of script. But you'll agree I'm sure that that's quite a horrible looking hack. We also managed to figure out ways to do locks and synchronization. They do support one implicit lock mechanism. It's less important. Shared memory you get by default with the data store. You just have to write it as such. You also get access to triggers. So within the data store on certain actions you can set triggers that will fire. And the triggers can do things like make other updates into the data store. Send emails. Send web requests. And so on. And so we focused on trying to bypass the governor. Because if you can bypass the governor then you get access to a lot more computing power than was intended. And with their platform that's spread out across the world. That equals both computing time as well as bandwidth. We really don't have a lot of that back home. So any bandwidth that we can get is gratefully accepted. Donations? No? Okay. So what we wanted to do there was to create a way to fire off a lot of actions. More actions than should be allowed based on a single user interaction. So in other words normally a user hits a script. It executes. It's subject to limits. What we want to do is to find a way by which we can hit a script. It executes. And we get a lot more processing time. Processing power than was intended. And so what we focused on doing was to create event loops. So essentially chaining together multiple execution steps of a single script. And the first way that we tried which didn't work. But it's worth reporting on failures I suppose. Gives us time to talk here. Was to create a web service endpoint that called itself. But that gets detected on their side. So the next thing that we thought of but discarded fairly soon after that was to have a third party. In other words you sitting with your browser to just have your browser repeatedly call their Apex script sitting on their server. But that involves a third party. So we stayed clear of that. So what we finally decided on was to go with email. So essentially you can create email loops. You can imagine how that works. We send an email to a sales force address. It does a small part of the job that we're interested in. And it then fires off another email to itself. Carries on with the job. Sends off an email once the limit approaches for that script. And so on. The loop continues. And so that gave us. Gives you about 1500 rounds of execution in a day. You still hit an unpublished limit eventually. But it gives you more processing time than was originally intended. And of course whatever job gets executed is then up to the user's imagination. We don't have much imagination. So what we came up with was Sifto. Which is essentially a port of the Nicto web scanning tool onto the cloud. So I'm sure most of you are aware but Nicto basically scans a website for vulnerabilities based on a database that it has. And so we ported that as I say into sales force. So our little app will basically add your target website into the alert endpoints. If you're a developer on sales force you'll know what that means. And then it kicks off this event loop. And in each iteration of the event loop you'll get results for 10 of the Nicto tests. And then you'll get an email coming through every time hits received. Of course the question you're going to ask me is. Why would you want to do this? And as I say this is a proof of concept for utilizing the cloud or a cloud platform as an attack platform. You can fire up EC2 instances and scan the world if you want. But this is actually using a programming language within the cloud to also perform security testing. So for one it's free. So as I said you get access to a whole lot of infrastructure that we just don't have. You get a degree of anonymity. But of course they definitely do monitor as we found out. Okay. So. I'm going to show you a little video of this thing in action. Okay. So this is us just doing the setup. I lied to you. I want to play this faster. Okay. So this is just to show you. You're required to have a bunch of custom Apex classes as well as a bunch of custom Apex objects. So all of this is now done through their web interface. We have an alert email that gets sent when a record is updated. So that's our trigger which will help us kick off the event loop. And then the email address which receives the trigger mail is that. So as you can see it's kind of a randomly generated email address that they provide you with. Less important. Okay. So what we've got then is a little shell script that wraps up all our calls to the site. In the one console we're going to tail the victim's web log. And on the other side we're actually going to kick off the scan. So you'll see that the requests start to come through on that console. There we kick off the scan. And now we start to see requests coming through in the web logs. So essentially we've performed one user action. And that's caused our scanning tool on Salesforce to kick off. So we've bypassed the governor limits. At that point we can make a lot more web call outs than were originally intended. But I'm afraid there's no shells to be popped yet. Okay. So what we see then at the end is basically as results are found they come through via email. At the end we get all of our results via email. And I guess for us the more interesting thing here is just that little slide that says we started at 1.05. We ended at 1.16. Total scan time 11 minutes. Which if we had to do from a single machine on the bandwidth that we have would take a lot longer than that. Okay. All right. So then we're going to talk just a few pros and cons of the approach. As I say this thing is a proof of concept. Just to get an idea of what can be done on custom cloud platforms. It is free. You get lots more bandwidth. Of course the question about denial of service does come up here. We're not going to talk about it too much. There are a few cons that are listed there. So the one thing that's immediately obvious is to say look. You only had 1,500 possible iterations. Now what? Well that's true. But the converse is also well not the converse. But there's an alternative approach which says that accounts are zero cost. So actually we can register one account that will perform 1,500 iterations. We can register a second one which will carry on with the next one. We can register a third one which will carry on with the next 1,500 iterations. Okay. So we can spread it out horizontally instead of having one account responsible for all execution. And of course they can communicate via email. Okay. So for this we needed to have a whole bunch of accounts. So we needed to auto register. There's a problem. The registration page is protected by capture. Not a particularly strong one. But it's there. However we found when we pulled the capture actually just in the command line. They had an unfortunate print R at the end of their capture script which just dumped out the text of the object. So actually it was there. Really? Okay. To their immense credit though they fixed that within 15 minutes. So I think that also probably deserves a round of applause. Okay. So at this point we now have 200 accounts. They're spread out around the world. And so at this point you can then do that horizontal scaling. Yeah. So some of the things that we figure should be pointed out here. So basically SIFTO is really basic. But it does hint at the possibilities for attacks from within the cloud. Their platform is developing rapidly. They're already on API version 16. And so we'll be monitoring that as new features become available. I think the third last point there is of most interest in the sense that we now have the security for an organization is transferred to your Salesforce administrator. And in many cases that's actually a C-level executive. And this is the guy who's getting phished on a daily basis. He's not, and fair enough, he's not a security guy. This isn't something that he should have loads of knowledge about. But if he gets phished, there go all your customer data. So something to keep in mind. Yeah. One last thing there. Salesforce was really positive with the interaction with us. So we just wanted to acknowledge that. They fixed the bugs. And they've actually been quite cool to work with. So that ends my Salesforce stuff. I'm going to hand over to Harun to talk to you about Amazon. Okay. Okay. So we've got Amazon and straight after that mobile me coming up. So really quickly, Amazon Web Services, we have to say right at the start, is cleanly one of the coolest things we've worked on for a long time. The ability for a shell script to fire up 20 boxes in some data center somewhere, do some work, and then send you back some results is really cool and well worth fiddling with. The pieces that we'll touch during this talk, we're going to look at EC2, which is the Elastic Compute Cloud, S3 we'll touch on, SQS, which is the queuing service, and DevPay. We're not going to look at a whole bunch of others right now. Although we're doing some of that testing back home, we're not ready to talk about some of it. So EC2 really quickly, if you break it down into its simplest form, you hit a web page. If you want to, you can do it from the command line. You pick a machine. You boot the machine. It gives you an IP address. And you've now got a machine sitting in Amazon's data center somewhere. Okay. It's got a whole bunch of other functionality which we're not going to need right now. Okay. We've got S3. It's a simple storage service. Relatively easy to understand. It's storage in the cloud. And it works with a bucket model. Okay. For all of the services, Amazon is trying to get support. Their pricing is really good, really attractive. Some people differ on the EC2 costs. But for lots of uses, you'll find it's a really quick, really reasonable way to get machine time. If we look at S3, there's a Firefox plug-in. It's a big plug-in called S3 Organizer. So it gives you pretty much an explorer-type view that allows you to drag and drop files around. Its usage is increasing. January of 2008, it was storing 14 billion objects. Okay. And something that's going to come up in a little while to bite them is the fact that it's pretty much got a flat namespace. Okay. Which means you get to choose your bucket. And if you grab your bucket early enough, then that bucket is yours. Okay. So nothing stops me right now from grabbing a bucket called Defcon. And going into the future, nobody else gets to store something as top-level Defcon on S3. This doesn't sound so bad, but we'll be able to use it for fun and profit shortly. Okay. So one of the quick things that come up when you look at AWS is its feature for auto-scaling. Okay. It's a really big promise. Well, it's a really big promise with the cloud. And basically, it means you don't have to plan for peak usage anymore. You can basically have your app rise and fall as it's needed. Okay. Of course, you can probably see where this is going to start going wrong. If you take Amazon SimpleDB, SimpleDB gives the site the opportunity to charge depending on SimpleDB usage. Which basically means that you, with your little wget script, can start adding cost to the guy who's using SimpleDB in the background. Okay. Now, the immediate response is we've bumped into this problem before. It's the same thing that happens with click fraud and with ads, except that with ads, the system self-regulates somewhat. If you get a bazillion clicks and only three of them convert, the price you're willing to pay for your ads go down. Okay. In the case of SimpleDB, you're paying a price based on number of hits, whether those people actually buy from you or not. Okay. So, there's actually less incentive for that problem to be fixed. Google have to fix click fraud because if they don't, it devalues their ads. If there's the equivalent of click fraud happening on SimpleDB, you get poorer and Amazon gets richer. Okay. So, we were looking at what we could do with ads. We were looking at AWS and we didn't have ideas initially, or I didn't have ideas, and probably a safe thing to do in any such situation is to copy Marco. So, what we were trying to do was just see if we could steal resources from Amazon. Okay. They put the stuff up. Let's see what we can steal from them. It turns out we can, or we could. So, if we take a really quick look at how this works, what you're seeing there is the page that comes up when you log into the AWS interface and you now want to boot up some machine. Okay. What's interesting to note is what you should see at the time that screenshot was taken, that there's 2,800 just about machine images that you can fire up. Now, interestingly enough, only 47 of these images were built by Amazon. Okay. All the rest are user contributed in some way or fashion. Okay. Okay. So, you should be starting to get worried already. Now, with these shared AMIs, what's interesting is people basically take an Amazon AMI or build one from scratch, bundle it together, then upload it to S3 and share it with the world. Okay. So, the first question is how many of these people are doing it right? Before you even wonder about how many of them are evil, just the question of how many of them are making mistakes. So, if you troll Amazon's forum pages, you'll find a whole bunch of forum posts from people who are claiming or complaining that they can't get something to work right. And if you actually look through at the cause of their problem, you find that they've actually uploaded their secret Amazon credentials to the Amazon instances and then given these instances away. Okay. Now, all that means is you've got to boot that image, take those credentials, and now you transact as those people. When you're transacting inside of Amazon. There's also the question, and Amazon's taken some heat for this, that they provide kernel images and how quickly they can keep up with the vulnerabilities that seem to be coming out quite often in kernels today. Okay. One of the problems that you've got here is you can't just scan machines in the cloud. Even though Amazon say, so officially Amazon say no scanning in the cloud, it transgresses their EULA. And unofficially, the word is as long as there's no complaint, you won't get kicked out. But one of them is a legal document and the other one is something that Amazon said. Okay. So right now, scanning in the cloud is dangerous. So we needed a quick alternative because remember the intention is we're trying to find other people's credentials so that we can use it. And so what we hacked together really quickly was a really ghetto scanner. And what the scanner does is it goes out. Gets a list of all the AMIs and builds an SQS list with it, SQS queue with it. So SQS is just a normal queue except you keep it in the cloud and Amazon pay, charge you a little bit of money to use their queue. They handle synchronization and all of that cool stuff. So we get this list of AMIs. We then fire up 10 images. Okay. Each of those images go to the queue. Pull down one of the images that's listed. It then fires up that image and then proceeds to scan that image. Okay. And in this case, we're doing really simple scanning. We're doing a Nessus scan. We're SSH-ing in and trying to steal stuff that looks interesting from their file system. Okay. So what we're looking for there is keys, passwords, bash histories, MySQL histories, stuff like that. We then dump the results to S3 so that we can grab them offline later. Okay. So the first question. The first thing is we were really surprised because we thought we'd find some stuff. But it turns out you actually find quite a bit. So just on the Nessus scans, you end up with 1,200 highs, a whole bunch of criticals. Only marginally interesting. What's more interesting is those are all user credentials that were left on these images. Okay. So these are all Amazon.pems or Amazon passwords. And they're either left clean on the system. Or people have left them in their bash histories while they were doing stuff. Okay. What you're seeing there are certificates and key pairs. Okay. All just left on those machines. So at this point, they're ours and we can be them on Amazon. So while we're stealing stuff, the quick question becomes, can we steal licenses? Also turns out to be yes. So if you go to Amazon, you get to boot Windows images. We then use the super elite magical jelly bean. So it's just a utility to steal, to recover licenses from your own machine. At this point, we're taking Windows Server 2003 license, which it gives us. We then take this back to our house in South Africa. We put it on our own Windows 2003 server and it happily registers for us. Those machines even are allowed, they pass genuine advantage. So they're even allowed to install updates from Microsoft. So we now run Windows machines also. So if we're stealing stuff, we decide not to stop there. Amazon also provides something called DevPay. So with DevPay, someone gets to put up a machine and then gets to register it with Amazon saying that they want to charge for its use. Someone comes along and wants to use it. They pay the guy, they get a product code, they then get to boot this machine. Okay, I'm going to quickly try to show you a video. So DevPay is really cool. Essentially, they're offloading a whole bunch of work that you no longer have to do. So if we look at it, and I'm going to speed through lots of these videos because, outstandingly, we're short on time again. So what you see here is if you hit Amazon, what you should see down there is a product code that I then pay for. We pay for this. We then fire up that machine. And what happens is every time we fire up this machine, the original guy gets paid for it. Okay, so Amazon handled that separately and we don't particularly care about it. If you see down here, if I describe this instance of mine that's running, what you should see up here is there's a product code attached to it. Okay. Essentially, this just means that I'm getting charged extra while this runs. So what we do here is we quickly bundle this image, which is normal functionality on an AMI. And once we've bundled this image, we upload this back into S3. Okay, so essentially I've paid for it once. I've then made a copy. What I'm going to do for demonstration here is make two copies, imaginatively called copy one and copy two. And we're uploading this to Amazon. Okay, once this is uploaded, we then go back to S3 and pull down that machine's image manifest. Okay, so the image manifest basically says this is what makes up the machine. And if you look through the manifest, you see here it's got an ancestry. Okay, which basically tells it that this machine was once Nick's machine, which we paid for. So at this point, we're feeling quite proud of ourselves. We remove the manifest. We remove the ancestry. We upload it back to Amazon. And we try to register it. Unfortunately, Amazon come back and say that's an invalid signature. This is not going to be allowed. Okay, it turns out there's not a lot more needed. So we grab it again. We remove the ancestry again. And then we use the tools that Amazon give you for bundling machines. And we re-sign the now modified request. We upload that to S3. And this time, it allows us to register. So effectively, we can now run that machine from now on. And there's no tie to the original image, which we should have paid for. Okay, so I'll kill that really quickly. Go back to the presentation just because there's a lot of it. And we're running out of time. So if that's Nick's deal. The other thing that needs to be considered really quickly is even though the cloud provides us with a lot of stability and high availability, Amazon itself becomes your single point of failure. Okay, and the normal response to this is it's Amazon. If anyone can handle DOS, they can. If you read Amazon's docs, they talk about DDoS prevention and how they're willing to stay up despite DDoS attacks. But attackers are not DDoSing you like it's 1992 anymore. Okay, nobody is sin flooding to take people down. And if they go down for that, they deserve it. So what Amazon does is they prevent you from firing up more than 20 machines. Okay, so if you're a first timer, you get to fire up 20 machines. Because if a whole bunch of people fire up 1,000 machines, you can see it causing them some problems. Okay, so what we did, what we did, sorry. Okay, so I'll skip the video just because Marco says so. But effectively, what we do here is it turns out you can sign up Amazon accounts without any capture or without anything stopping you. Okay, so a really quick tool script allows you to register hundreds of users. Okay, so really simply what we do is we take one script and that script creates 20 users. And each of those 20 users go ahead and get 20 machines. And each of those fire up 20 machines. Okay. And what you look at, if you look at the graph of how that grows, is by the ninth iteration, you're going to be firing up close to 800 billion machines. Okay. And this is going to cause them some problems. So thank you very much. So we want one more way to steal machine time. And it comes from Amazon. And that's basically when you get a machine, you don't know that that machine wasn't pre-owned before you got it. Amazon gives you the six-point bullet list. But six points is not enough to know that your machine hasn't been owned. Okay. So what we do is we want to take an image, upload it, and get someone to run it. The first time we do this, it turns out that we register our image, we upload it, but it shows up really low on Amazon's list of machines. So I'm going to skip through the videos and talk you through them for the most part. But basically, your image shows up like on page 200. And nobody's going to run it. So what we do is we wrap that in a little script that registers the machine, checks the AMI ID that it gets. If the AMI ID is too high, it deregisters it and registers it again. Because those things are assigned to you randomly. The first time we ran it, we ran it overnight. And by morning, we'd gotten an AMI ID that now showed up in the top ten. Which now means that when people go to the page, your image bubbles right to the top. Okay. The second time we ran it, we got a top five hit in under two hours. So you can race it. But that's not all. Because it turns out that you remember I spoke about the name grab thing. Okay. Because you can grab names as you want them, you can also make your image more attractive by naming it better. So what we do is we try to create something called Fedora. Fedora is unfortunately taken. Eventually, you find names that work for you. Underscores are cool. So Fedora underscore 11 gives you a nice name. And you manage to promote it to a top five hit. Okay. So that thing bubbles to the top really quickly. At the time we did this, we did it at home. I did it at the office. By the time I drove home, two people had already booted our machine. Okay. And this is now our machine running in the cloud that we don't care about anymore. Amazon also don't do any outbound firewalling. People ask about it on the forums. People actually reply saying, but why would you want outbound firewalling? Okay. So welcome to 1990. So really quickly, I'm going to touch on MobileMe. A long time ago, people figured out that MobileMe disclosed usernames. And basically, if you go to the MobileMe page, as Bob the Cat, everyone on MobileMe gets a public page. Bob the Cat gets told, no such page. Funder Vault gets no such page. Shell Funder Vault, you get a public page. Okay. So we now know Shell exists on the system. You can now take all of Apple execs and start looking to see who actually uses MobileMe. You see Steve Jobs has an account, which should mean you can mail him at stevejobs at me.com. But it turns out that one's not used. Notice that if you go to Steve, you actually see one with a 75 gig option, and you can't buy a 75 gig option on MobileMe. Okay. So account password resets are a really hard problem to solve in the cloud because essentially someone who doesn't know you has to trust who you are. And so it turns out MobileMe is quite silly about this, so I'll go to my last demo quickly. It turns out that MobileMe is quite silly about this, and they handle... Meh. Let's see if you go to Nick. Okay. So if you go to MobileMe, what you'll find is they have a password reset scheme that's basically based on secret questions. Okay. So once we find out that Nick exists, you hit his secret questions, and so initially all it needs is his me at me at me.com address. Okay. So you don't even have to know the guy's real address. You just know his name. It then also gives you confirmation of his private email address, so you can confirm that it's the right guy you want to attack. Okay. It then gives you secret questions. The first one is his birth date, which almost everyone gives away free on Facebook on the Amazon wish list. Okay. And then it asks you a secret question, and those things fall pretty quickly. So once we've got access to Nick's MobileMe, the question is what else we can do with it. Okay. Because we can reset his password, but shortly Nick's going to come back and change his password. So what we wanted was permanent access to Nick's account, and we found it in the stolen iPhone thing. Okay. We've got to go. Basically what we do is we take an iPhone, sync it with his account, except we also go into iTunes and rename my phone script alert high, so we rename my phone malicious JavaScript. My phone now syncs with his. We've got to do some JavaScript to get it right, but essentially once we've gotten over those hurdles, every time that Nick goes into his MobileMe page, as long as my phone's there, my JavaScript runs in Nick's browser, and when Nick tries to do a Who Am I, he essentially runs our script, and we own his MobileMe forever. Okay. So while doing this, we actually tested and found Steve Wozniak's account, logged into his mail just to show him how it worked. Turned out he was really cool about the whole thing. We've got conclusions, which you can read off the slides. We're in the room for questions. Room 103 for questions. We want to say again, Apple were really quick to fix their stuff. So were AWS. So we only told AWS about it yesterday. They've already put in fixes for some of the stuff. Salesforce.com ready with their fixes. Other than that, you can get the stuff from our website. We should write up more of this stuff. Thanks for your time.