1 00:00:00,000 --> 00:00:04,500 Okay. We've got a ton of stuff to get through, so I'm going to kind of kick off. 2 00:00:05,160 --> 00:00:11,760 Just a quick disclaimer up front. We kind of cut this talk down from 140 slides and a 75-minute talk at Black Hat 3 00:00:11,760 --> 00:00:15,940 to 50 minutes and a lot less slides. So everything is going to be up on our site. 4 00:00:16,160 --> 00:00:21,340 If you catch our blog, we'll link to our research portal and we'll have the full content up as well as this. 5 00:00:21,720 --> 00:00:25,240 Just a quick overview of where we're going to go. We're going to give a quick introduction to the talk, 6 00:00:25,240 --> 00:00:29,940 kind of background on where some of our things are going. 7 00:00:30,180 --> 00:00:33,200 We'll talk about some drawbacks when you're dealing with cloud computing. 8 00:00:33,640 --> 00:00:35,580 And then we're going to look at some specific people. 9 00:00:35,720 --> 00:00:42,600 So the ones we looked at were Salesforce.com, Amazon's AWS, and Apple's MobileMe, and then a quick wrap-up. 10 00:00:43,220 --> 00:00:45,120 Just very quickly again about us. 11 00:00:45,600 --> 00:00:49,880 So SensePost as a company, we're a dedicated security services company out of South Africa. 12 00:00:50,260 --> 00:00:51,980 Been around for about nine years. 13 00:00:52,900 --> 00:00:55,220 We've spoken at Black Hat and DEF CON for the last... 14 00:00:55,240 --> 00:00:56,200 eight of those years. 15 00:00:56,360 --> 00:01:02,980 We do a ton of research, a lot of training, put out some papers, kind of put out some books. 16 00:01:03,240 --> 00:01:04,900 Not going to hop on us. 17 00:01:07,460 --> 00:01:10,660 So really quickly, the moment you talk about cloud computing, 18 00:01:11,820 --> 00:01:14,240 the question has to come up, why are we even bothering? 19 00:01:15,420 --> 00:01:18,200 At the moment, cloud is a real headline stealer. 20 00:01:18,280 --> 00:01:21,100 Okay, you just have to say cloud and a whole bunch of people are listening. 21 00:01:21,420 --> 00:01:24,120 But we've been doing talks for quite a bit. 22 00:01:24,220 --> 00:01:25,100 We've spoken at... 23 00:01:25,240 --> 00:01:27,120 at Black Hat, DEF CON for quite a while. 24 00:01:27,320 --> 00:01:30,800 And we're not famous for doing talks just because they headline steely. 25 00:01:31,200 --> 00:01:34,640 In fact, some of our talks have some of the most boring demos known to man. 26 00:01:35,000 --> 00:01:41,320 We've got probably the slowest port scanner, probably the slowest tunneling tool ever released on the interwebs. 27 00:01:43,620 --> 00:01:48,380 And the reason I'm saying that is we wouldn't choose a talk just because of its fashion appeal. 28 00:01:48,800 --> 00:01:54,660 Okay, we think there's something important going on here, and we think it's important that people start noticing it. 29 00:01:55,240 --> 00:02:02,240 So, there are a few people talking cloud, but the moment cloud is spoken, you get people splintering into different groups. 30 00:02:02,480 --> 00:02:08,100 There's a group of people who immediately go, that's nothing new, cloud, cloud, cloud, it's the same old thing. 31 00:02:08,700 --> 00:02:13,560 Schneier's gone on record a few times saying it's the same old computing paradigms that we've done. 32 00:02:14,180 --> 00:02:18,340 What's interesting to note is that he's said that multiple times in multiple interviews. 33 00:02:18,640 --> 00:02:21,180 Okay, so clearly something new is happening here. 34 00:02:21,860 --> 00:02:22,840 Something's coming up. 35 00:02:23,020 --> 00:02:24,960 There's also something that we'll touch on. 36 00:02:24,960 --> 00:02:35,100 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. 37 00:02:35,380 --> 00:02:43,700 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. 38 00:02:44,040 --> 00:02:52,920 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. 39 00:02:53,120 --> 00:02:54,820 What we're interested in is what. 40 00:02:54,960 --> 00:02:58,220 We can do with it and to make sure we're prepared for these attacks. 41 00:03:00,800 --> 00:03:03,140 So why would we want to attack the cloud? 42 00:03:03,300 --> 00:03:05,520 Why would we want to try and find things to break? 43 00:03:05,660 --> 00:03:09,020 Well, as much hype as it is, a lot of people are actually moving there. 44 00:03:09,160 --> 00:03:17,640 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. 45 00:03:18,520 --> 00:03:20,240 It's also fairly insidious, right? 46 00:03:20,320 --> 00:03:24,940 So even as a technical person, you could be fighting that and saying, look, we don't want to give up. 47 00:03:24,960 --> 00:03:25,740 We don't want to give away those things. 48 00:03:25,880 --> 00:03:30,240 But the decision is made above you at a business level because that's what's happening, right? 49 00:03:30,300 --> 00:03:31,420 And that's where those calls are made. 50 00:03:31,600 --> 00:03:37,100 So everybody in one way or another is kind of moving into the cloud, which makes it a really, really attractive target for us. 51 00:03:37,260 --> 00:03:42,080 And interestingly enough, if you consider the nature of the thing, it's out there, right? 52 00:03:42,180 --> 00:03:44,180 It's a web app that you're accessing things through. 53 00:03:44,560 --> 00:03:48,060 Clearly, we haven't got web apps right since the dark ages. 54 00:03:48,280 --> 00:03:51,500 And we're very prone to making those same mistakes again and again. 55 00:03:51,800 --> 00:03:54,160 But the truth is we don't have to make those same mistakes. 56 00:03:54,220 --> 00:03:54,940 If we can. 57 00:03:54,940 --> 00:03:56,140 We tackle the stuff up front. 58 00:03:57,340 --> 00:04:06,020 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. 59 00:04:06,240 --> 00:04:08,540 And the first major one is transparency. 60 00:04:09,520 --> 00:04:16,780 Anybody who remembers a couple of weeks ago the Amazon debacle, they got really attacked pretty hard about their transparency on that. 61 00:04:17,240 --> 00:04:23,960 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. 62 00:04:24,040 --> 00:04:24,840 Otherwise, they're going to lose. 63 00:04:24,940 --> 00:04:25,380 And that's what we're going to do. 64 00:04:25,720 --> 00:04:26,200 And that's what we're going to do. 65 00:04:26,500 --> 00:04:28,140 Privacy is a big deal as well. 66 00:04:28,360 --> 00:04:33,640 So on a small scale, you could be saying, look, I'm concerned about giving my email to Google. 67 00:04:33,800 --> 00:04:41,440 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? 68 00:04:41,940 --> 00:04:46,000 That thing goes further when you look at the legalities that are involved. 69 00:04:46,200 --> 00:04:53,000 So in essence, what's happening is you're losing your Fourth Amendment right to a warrant being searched before you get your data. 70 00:04:53,220 --> 00:04:54,920 So what actually happens is we're losing our fourth amendment right to a warrant being searched before you get your data. 71 00:04:54,940 --> 00:04:59,360 So what actually happens is with the law at this stage in time, your cloud provider can be told to give up your data. 72 00:04:59,780 --> 00:05:06,500 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. 73 00:05:07,280 --> 00:05:09,080 One of the other big things is compliance. 74 00:05:09,480 --> 00:05:13,440 We don't necessarily know how to handle compliance in the cloud at the moment. 75 00:05:13,620 --> 00:05:16,620 So some people are doing some work around it, the cloud security guys. 76 00:05:17,320 --> 00:05:23,840 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. 77 00:05:24,560 --> 00:05:25,920 Vendor lock-in is another one. 78 00:05:26,380 --> 00:05:39,940 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? 79 00:05:40,100 --> 00:05:44,460 Or if you make a massive investment into a specific platform, how portable does that become? 80 00:05:45,320 --> 00:05:46,880 The big one as well is availability. 81 00:05:47,600 --> 00:05:50,440 So availability is one of the major promises from the cloud. 82 00:05:50,740 --> 00:05:51,620 It's always up. 83 00:05:51,680 --> 00:05:53,820 There's massive kind of scalable information. 84 00:05:53,840 --> 00:05:54,100 There's infrastructure. 85 00:05:54,360 --> 00:05:56,100 You can always get access to your data. 86 00:05:56,420 --> 00:05:59,820 So from a browser, from a mobile device, whatever it is. 87 00:05:59,920 --> 00:06:03,820 But a lot of people are failing in that space, even though that's one of the major selling points. 88 00:06:04,140 --> 00:06:06,640 So you look at somebody like cloud files, for example. 89 00:06:07,540 --> 00:06:09,060 I want to access my files. 90 00:06:09,160 --> 00:06:10,140 I want to write stuff up. 91 00:06:10,280 --> 00:06:13,860 But at the moment, it's in read-only mode because they're having issues with their data center. 92 00:06:14,700 --> 00:06:15,900 That's less than ideal. 93 00:06:16,680 --> 00:06:22,620 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. 94 00:06:23,060 --> 00:06:23,820 I want to try that. 95 00:06:23,840 --> 00:06:27,640 I want to try and access that data because that's why I'm paying for the service, but they're down for maintenance. 96 00:06:28,040 --> 00:06:30,040 That stuff doesn't scale very well. 97 00:06:30,500 --> 00:06:31,520 It's not the smaller guys. 98 00:06:31,600 --> 00:06:33,180 The big guys are vulnerable to that as well. 99 00:06:33,480 --> 00:06:36,340 Google App Engine had a really big issue recently. 100 00:06:39,120 --> 00:06:44,780 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. 101 00:06:45,060 --> 00:06:50,800 So when we were looking at this talk, we were pretty much browsing around looking for cloud providers to attack. 102 00:06:50,800 --> 00:06:55,240 And one of the first guys to come up for disk storage was Oosa. 103 00:06:55,480 --> 00:06:58,380 Go to their page, and it turns out they don't exist anymore. 104 00:06:58,880 --> 00:07:02,280 How they handled people getting their data back is questionable. 105 00:07:02,940 --> 00:07:09,760 If you go to TechCrunch, TechCrunch lists a whole bunch of online storage guys you should be using or could be using. 106 00:07:10,040 --> 00:07:16,780 And what you almost see highlighted down there is them recommending Omnidrive. 107 00:07:17,140 --> 00:07:20,240 You go to Omnidrive, and this pops up. 108 00:07:20,240 --> 00:07:22,200 Omnidrive is no longer available. 109 00:07:22,400 --> 00:07:24,280 We now recommend Nomadisk. 110 00:07:24,540 --> 00:07:26,380 Okay, so it's a big problem. 111 00:07:26,440 --> 00:07:27,920 It's something that needs to be considered. 112 00:07:28,200 --> 00:07:35,340 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. 113 00:07:35,660 --> 00:07:41,400 What happens suddenly is somebody locking you out of your account starts to become a very real attack. 114 00:07:41,660 --> 00:07:47,640 If someone locks you out of your account when you're using a cloud provider, you're now going to provide your identity somehow. 115 00:07:47,900 --> 00:07:49,840 And you're basically just sitting in a queue. 116 00:07:50,240 --> 00:07:51,900 Hoping that they'll bring your account back. 117 00:07:54,480 --> 00:08:02,340 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. 118 00:08:02,720 --> 00:08:09,960 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. 119 00:08:10,280 --> 00:08:15,740 Even more so, a lot of things that are now out of your control can affect your security posture. 120 00:08:15,960 --> 00:08:18,760 So consider the case with a traditional phishing attack. 121 00:08:18,760 --> 00:08:24,920 Your users get phished, maybe they lose some email, maybe you give up some creds, whatever it is. 122 00:08:25,000 --> 00:08:33,400 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. 123 00:08:34,000 --> 00:08:40,100 And if anybody thinks that's not a big deal, we can talk about how effective user education is after the talk. 124 00:08:40,240 --> 00:08:43,120 I'm sure everybody's dealt with users and seen the phishing attacks. 125 00:08:43,500 --> 00:08:45,460 And it's happened to some of the bigger guys. 126 00:08:45,620 --> 00:08:47,960 So everybody knows about the Twitter stuff. 127 00:08:48,760 --> 00:08:50,680 It's happened to some of the other big players as well. 128 00:08:52,020 --> 00:09:00,740 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. 129 00:09:01,140 --> 00:09:06,980 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. 130 00:09:07,320 --> 00:09:11,220 And that same username and password grants you access to your entire data center. 131 00:09:11,480 --> 00:09:15,300 So it's a slightly bigger deal for what we'd potentially consider a lame attack. 132 00:09:16,740 --> 00:09:18,520 Trust is a big deal too, right? 133 00:09:18,760 --> 00:09:23,020 So the question we say is, why would we give our data to these guys? 134 00:09:23,360 --> 00:09:26,580 If we want to outsource this function, it's because we trust those guys. 135 00:09:26,700 --> 00:09:28,560 Because they're specialists at what they do. 136 00:09:28,700 --> 00:09:30,760 And we're trusting them to control that data. 137 00:09:31,100 --> 00:09:32,940 But there have been a couple of fails there as well. 138 00:09:33,100 --> 00:09:38,680 And a quick Google for cloud fails will give you tons of hits coming back on how those things have gone wrong. 139 00:09:40,400 --> 00:09:46,980 So interestingly enough, on IRC recently I was speaking to someone who was talking about how much cost he has cloud break stuff. 140 00:09:47,300 --> 00:09:48,740 So for those of you who haven't seen it yet. 141 00:09:48,740 --> 00:09:53,860 It's a really, really elegant exploit that allows you to escape from VMware. 142 00:09:54,380 --> 00:09:57,000 And he was talking about how scary this attack is. 143 00:09:57,320 --> 00:10:05,180 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. 144 00:10:05,600 --> 00:10:12,400 That actually that type of attack, we've got no reason to not fear that attack natively from Amazon, right? 145 00:10:12,500 --> 00:10:14,700 If you're running in Amazon's data center. 146 00:10:14,760 --> 00:10:18,680 You don't know that Amazon don't have a Trojan hypervisor already. 147 00:10:18,740 --> 00:10:22,940 All the hypervisor has to do is give them access to stuff that they weren't meant to. 148 00:10:23,060 --> 00:10:25,280 And actually you've got no way of knowing it. 149 00:10:25,600 --> 00:10:29,040 So sometimes we tend to focus on the wrong threats. 150 00:10:29,440 --> 00:10:33,380 So if you take the popular phrase, trust but verify. 151 00:10:33,760 --> 00:10:38,460 You'll find that one of the problems you have with the cloud is your inability to verify. 152 00:10:38,920 --> 00:10:39,440 Okay? 153 00:10:39,500 --> 00:10:43,440 So to some extent, reverse engineers keep Microsoft honest. 154 00:10:43,760 --> 00:10:46,320 If you remember back in like 92 or 93. 155 00:10:47,020 --> 00:10:48,500 People found NSA. 156 00:10:48,740 --> 00:10:50,460 Made a DLL in Windows. 157 00:10:50,860 --> 00:10:55,520 And everyone went nuts because we thought there was something wrong going on. 158 00:10:55,740 --> 00:10:58,620 That stuff's almost impossible to do in the cloud. 159 00:10:59,160 --> 00:10:59,680 Okay? 160 00:10:59,720 --> 00:11:05,780 Even if you verified somehow that Amazon didn't have an evil hypervisor on your system today. 161 00:11:06,060 --> 00:11:09,300 You don't know that that's the same hypervisor that you're on tomorrow. 162 00:11:09,740 --> 00:11:10,240 Okay? 163 00:11:10,260 --> 00:11:13,820 And it's just one of those things that you give up the moment you enter the cloud. 164 00:11:14,400 --> 00:11:18,100 So like I said, the problem is even if they're not evil today. 165 00:11:18,100 --> 00:11:20,560 How do you know that they're not evil in the future? 166 00:11:21,380 --> 00:11:23,300 One of the things that you need to ponder. 167 00:11:23,460 --> 00:11:25,280 So I'm not sure how many of you remember. 168 00:11:25,460 --> 00:11:27,660 But a little while back or long while back. 169 00:11:28,440 --> 00:11:31,140 The story of crypto Swiss AG came up. 170 00:11:31,260 --> 00:11:36,000 Swiss AG was the Swiss company selling crypto to about 140 countries. 171 00:11:36,540 --> 00:11:41,080 And it turned out later on that Swiss AG was just a front for the NSA. 172 00:11:41,520 --> 00:11:47,200 So all these countries that were buying crypto were actually buying specifically weakened crypto. 173 00:11:47,200 --> 00:11:49,680 So that the NSA could have access to it. 174 00:11:49,900 --> 00:11:53,700 I'm not saying any of this about any of the current cloud providers. 175 00:11:53,780 --> 00:11:55,600 I'm just saying that if they are doing it. 176 00:11:55,700 --> 00:11:56,660 You don't know. 177 00:11:56,780 --> 00:11:58,460 And you probably wouldn't find out. 178 00:12:01,960 --> 00:12:05,660 So another interesting angle is not attacking the cloud itself. 179 00:12:05,880 --> 00:12:08,040 But using the cloud for things that are interesting. 180 00:12:08,220 --> 00:12:11,080 And taking advantage of the extra resources that we get. 181 00:12:11,280 --> 00:12:14,060 And a couple of researchers were kind of quick off the mark on this. 182 00:12:14,220 --> 00:12:17,080 So if anybody remembers back to the Debian week. 183 00:12:17,200 --> 00:12:17,900 The keys debacle. 184 00:12:18,400 --> 00:12:20,520 Dino D'Azovi picked up on that really quickly. 185 00:12:20,660 --> 00:12:23,440 And used Amazon EC2 instances to brute force keys. 186 00:12:24,040 --> 00:12:27,500 There was another case where Ben Nagy at his SysScan talk. 187 00:12:27,580 --> 00:12:30,820 Spoke about how he'd used parallelized resources. 188 00:12:30,960 --> 00:12:34,820 For when he was building his MetaFuzz harness for attacking Office. 189 00:12:35,160 --> 00:12:37,760 And some of the guys like Dave Molnar and Zynamix. 190 00:12:37,820 --> 00:12:41,020 Also using it for things like malware analysis and fuzzing. 191 00:12:41,140 --> 00:12:42,780 So you get this ton of resources. 192 00:12:43,160 --> 00:12:44,700 And it's kind of more cheaply available. 193 00:12:45,160 --> 00:12:47,000 And you can really, really scale your attacks. 194 00:12:47,200 --> 00:12:48,220 And speed things up. 195 00:12:48,880 --> 00:12:51,840 So with the background and some of the drawbacks out of the way. 196 00:12:52,100 --> 00:12:55,100 Let's dig into some of the specific providers that we looked at. 197 00:12:55,240 --> 00:12:57,300 And the first one is Salesforce.com. 198 00:12:57,760 --> 00:13:01,020 We figured we'd look at Salesforce because they're the leader in the industry. 199 00:13:01,140 --> 00:13:03,780 And pretty much everyone who's anyone is using them. 200 00:13:04,040 --> 00:13:06,060 So we figured they'd be an attractive target. 201 00:13:06,680 --> 00:13:08,320 Salesforce also gives you two things. 202 00:13:08,500 --> 00:13:11,180 So on the one hand you've got platform as a service. 203 00:13:11,360 --> 00:13:13,760 Where they give you a development platform in the cloud. 204 00:13:13,880 --> 00:13:15,680 And you can start to build your own apps. 205 00:13:15,680 --> 00:13:17,080 Or extend functionality. 206 00:13:17,480 --> 00:13:19,760 But they also give you the full software as a service stack. 207 00:13:19,980 --> 00:13:23,660 So you get things like you can outsource your entire sales management or CRM. 208 00:13:23,740 --> 00:13:25,480 And they really got a mature offering. 209 00:13:25,800 --> 00:13:26,940 So we took a look at them. 210 00:13:27,060 --> 00:13:30,620 And we kind of started out probing them for traditional web app vulnerabilities. 211 00:13:31,680 --> 00:13:33,520 Again, we had limited time. 212 00:13:33,720 --> 00:13:36,960 And we were kind of working at that stage without a mandate. 213 00:13:37,240 --> 00:13:39,560 So we were really, really careful about what we were doing. 214 00:13:39,660 --> 00:13:40,980 So we only did cursory testing. 215 00:13:41,280 --> 00:13:44,300 But again, they held up really, really well against that stuff. 216 00:13:44,420 --> 00:13:45,660 And fully props to them. 217 00:13:45,660 --> 00:13:46,640 For the work they've done. 218 00:13:47,360 --> 00:13:50,660 Ultimately though, what you're dealing with is a web application. 219 00:13:51,160 --> 00:13:52,800 You're accessing the stuff over the web. 220 00:13:53,140 --> 00:13:56,360 And everyone knows over the years that nobody makes web app mistakes anymore. 221 00:13:57,480 --> 00:14:01,440 So you've got a fundamental problem now where we suck at web apps. 222 00:14:01,520 --> 00:14:02,320 As an industry. 223 00:14:03,280 --> 00:14:05,120 Now we're tying the cloud to the web. 224 00:14:05,360 --> 00:14:07,100 And things can go horribly wrong. 225 00:14:07,720 --> 00:14:10,060 If you look at the statistics on web app vulnerabilities. 226 00:14:10,160 --> 00:14:13,060 Pretty much from any source you come across, that stuff looks terrible. 227 00:14:13,060 --> 00:14:15,500 Nobody can argue that that stuff is good. 228 00:14:16,000 --> 00:14:17,880 And we've had a couple of high profile examples. 229 00:14:18,160 --> 00:14:20,700 So from Sammy in the early days on Myspace. 230 00:14:20,920 --> 00:14:24,000 Through to multiple cross-site scripting worms of the same deal. 231 00:14:24,100 --> 00:14:25,240 Earlier this year against Twitter. 232 00:14:25,660 --> 00:14:27,240 And if you think about Twitter. 233 00:14:27,500 --> 00:14:28,300 I need to interrupt you. 234 00:14:29,300 --> 00:14:30,260 I'm sorry folks. 235 00:14:30,880 --> 00:14:31,980 I've got to interrupt him. 236 00:14:32,140 --> 00:14:33,060 That's the bad news. 237 00:14:33,420 --> 00:14:35,020 The good news is I will keep it short. 238 00:14:38,300 --> 00:14:39,580 The last 24 hours. 239 00:14:40,580 --> 00:14:42,640 We've had a serious outbreak of the stupids. 240 00:14:43,300 --> 00:14:44,140 From you people. 241 00:14:46,340 --> 00:14:46,940 I'm sorry. 242 00:14:47,000 --> 00:14:48,080 I'm very upset right now. 243 00:14:55,360 --> 00:14:57,880 The slide on the screen is very apropos. 244 00:14:59,680 --> 00:15:01,060 In the last 24 hours. 245 00:15:01,440 --> 00:15:04,060 We've had a serious outbreak of the case of the stupids. 246 00:15:04,500 --> 00:15:05,580 By a lot of people here. 247 00:15:07,240 --> 00:15:08,080 Police yourselves. 248 00:15:09,320 --> 00:15:11,200 If you see someone about to do something stupid. 249 00:15:12,160 --> 00:15:13,080 Don't laugh at them. 250 00:15:14,000 --> 00:15:14,600 Stop them. 251 00:15:16,980 --> 00:15:19,180 The staff is flashing back to DEFCON 9. 252 00:15:20,040 --> 00:15:21,700 Which was our worst DEFCON ever. 253 00:15:23,700 --> 00:15:24,980 You guys are better than this. 254 00:15:26,100 --> 00:15:28,080 Is there anybody here who doesn't like the hotel? 255 00:15:28,920 --> 00:15:30,480 Who doesn't like coming to DEFCON here? 256 00:15:30,540 --> 00:15:31,140 Would you raise your hand? 257 00:15:32,800 --> 00:15:33,200 Good. 258 00:15:33,540 --> 00:15:34,580 We like it here too. 259 00:15:35,240 --> 00:15:36,320 Keep doing what you're doing. 260 00:15:36,840 --> 00:15:37,740 We won't be here. 261 00:15:38,880 --> 00:15:40,540 Do not bungee jump off the roof. 262 00:15:42,280 --> 00:15:43,640 Do not go to the roof. 263 00:15:45,880 --> 00:15:49,040 Carrying a concealed weapon in a casino is a big deal. 264 00:15:50,440 --> 00:15:52,000 Even if you have a permit for it elsewhere. 265 00:15:54,620 --> 00:15:54,980 Basically. 266 00:15:55,740 --> 00:15:56,560 Don't be an asshole. 267 00:15:57,580 --> 00:15:58,860 If you see someone being an asshole. 268 00:15:59,320 --> 00:15:59,860 Stop them. 269 00:16:01,520 --> 00:16:04,580 We're supposed to be in the top 10% in terms of IQ in the United States. 270 00:16:04,660 --> 00:16:05,380 If not worldwide. 271 00:16:06,360 --> 00:16:07,980 You're acting like a bunch of 13 year olds. 272 00:16:09,500 --> 00:16:10,080 Knock it off. 273 00:16:11,400 --> 00:16:12,000 I'm sorry. 274 00:16:13,260 --> 00:16:13,780 Thank you. 275 00:16:14,000 --> 00:16:14,220 Thanks. 276 00:16:18,380 --> 00:16:18,780 Okay. 277 00:16:22,820 --> 00:16:24,880 So that's going to be a really hard act to follow. 278 00:16:25,140 --> 00:16:27,360 So I'm going to kind of. 279 00:16:28,400 --> 00:16:28,800 Thanks. 280 00:16:29,760 --> 00:16:33,280 So I'm going to kind of leave you with the idea that if we're talking about web app security. 281 00:16:33,580 --> 00:16:34,820 Look at somebody like Twitter. 282 00:16:34,960 --> 00:16:35,200 Right? 283 00:16:35,220 --> 00:16:36,400 They've been owned so many times. 284 00:16:36,500 --> 00:16:39,360 All they're doing is they're putting out 140 character strings. 285 00:16:39,660 --> 00:16:40,060 And they're like. 286 00:16:40,060 --> 00:16:40,140 What's the point of doing that? 287 00:16:40,140 --> 00:16:41,460 If they're not getting that stuff right. 288 00:16:41,580 --> 00:16:43,520 What hope do we have for the more complex stuff? 289 00:16:44,260 --> 00:16:46,580 So we decided to just demo a quick attack. 290 00:16:46,840 --> 00:16:49,360 It's a fairly overhyped attack. 291 00:16:49,580 --> 00:16:50,720 So I'm not going to go into. 292 00:16:50,880 --> 00:16:52,360 Everybody knows about the click jacking bug. 293 00:16:52,780 --> 00:16:54,060 I didn't discover it. 294 00:16:54,160 --> 00:16:55,700 I don't want to take credit for it. 295 00:16:56,180 --> 00:16:59,060 But if we fire up a video clip very quickly. 296 00:17:01,520 --> 00:17:02,960 What you'll see on the screen is. 297 00:17:03,060 --> 00:17:03,620 You've got. 298 00:17:04,040 --> 00:17:04,960 Kind of in the app. 299 00:17:05,080 --> 00:17:07,980 You've got tasks that can get assigned to a user in salesforce.com. 300 00:17:08,300 --> 00:17:09,680 And to close that task. 301 00:17:09,680 --> 00:17:11,120 They kind of get listed like that. 302 00:17:11,240 --> 00:17:12,560 And if you just go through the motions. 303 00:17:12,960 --> 00:17:14,180 You hit the X button. 304 00:17:14,700 --> 00:17:16,020 And you can kind of go in. 305 00:17:16,120 --> 00:17:17,060 You can check out the task. 306 00:17:17,300 --> 00:17:18,780 You can hit save to carry on. 307 00:17:19,040 --> 00:17:20,660 So I'm going to skip ahead a little. 308 00:17:23,600 --> 00:17:24,700 Skip ahead in that guy. 309 00:17:24,880 --> 00:17:25,820 What we can do is. 310 00:17:25,920 --> 00:17:28,360 If we fire up a malicious page on our site. 311 00:17:28,520 --> 00:17:30,180 And we get a user to browse to it. 312 00:17:30,320 --> 00:17:32,400 Essentially we can load that page as a frame. 313 00:17:32,880 --> 00:17:33,700 In the background. 314 00:17:33,800 --> 00:17:35,320 And you can see it's kind of semi-transparent. 315 00:17:35,540 --> 00:17:36,840 So we did it like that for the demo. 316 00:17:37,080 --> 00:17:38,920 You could make that thing completely transparent. 317 00:17:39,220 --> 00:17:39,660 Or you could put it. 318 00:17:39,680 --> 00:17:41,480 Put up a punch the dancing pigs. 319 00:17:41,520 --> 00:17:42,220 Or the lolcats. 320 00:17:42,380 --> 00:17:43,200 Or whatever it is. 321 00:17:43,600 --> 00:17:45,820 And force the user to click where you want them to click. 322 00:17:46,100 --> 00:17:46,900 But what you've got is. 323 00:17:46,940 --> 00:17:47,480 Within the page. 324 00:17:47,620 --> 00:17:49,720 You've got JS that will follow the user's mouse clicks. 325 00:17:49,960 --> 00:17:50,860 So what we can do is. 326 00:17:50,880 --> 00:17:53,500 We can force them to click wherever we want them to. 327 00:17:54,000 --> 00:17:54,800 So in this case. 328 00:17:54,920 --> 00:17:57,640 We get the user to save their task. 329 00:17:57,920 --> 00:17:59,220 We do a refresh in the app. 330 00:17:59,320 --> 00:18:00,080 And the task is gone. 331 00:18:00,700 --> 00:18:00,860 Right. 332 00:18:01,260 --> 00:18:02,440 Simple click jacking. 333 00:18:02,840 --> 00:18:06,220 Just shows that even some of the guys who are doing everything right. 334 00:18:06,480 --> 00:18:09,660 Can still be vulnerable to some of the smaller web app vulnerabilities. 335 00:18:15,420 --> 00:18:17,820 So for all the Mike Myers fans out there. 336 00:18:17,880 --> 00:18:19,640 Allow myself to introduce myself. 337 00:18:20,520 --> 00:18:22,280 My name is Mark from Sensepost. 338 00:18:22,420 --> 00:18:23,900 So we didn't get the intro right at the beginning. 339 00:18:24,320 --> 00:18:25,200 This is Harun. 340 00:18:25,280 --> 00:18:25,860 This is Nick. 341 00:18:26,000 --> 00:18:28,340 So just if you need to figure out in your head. 342 00:18:28,480 --> 00:18:29,780 Who to give the credit to. 343 00:18:30,220 --> 00:18:31,800 It's probably to those two. 344 00:18:31,900 --> 00:18:32,820 Harun and Nicholas. 345 00:18:33,560 --> 00:18:34,000 Okay. 346 00:18:34,040 --> 00:18:37,140 So I'm going to carry on talking about Salesforce for a little bit. 347 00:18:37,960 --> 00:18:39,380 I focused on Salesforce. 348 00:18:39,660 --> 00:18:40,820 As Nick pointed out. 349 00:18:41,260 --> 00:18:44,600 Because they actually managed to split the software as a service. 350 00:18:44,660 --> 00:18:45,780 And platform as a service. 351 00:18:46,640 --> 00:18:47,560 Quite nicely. 352 00:18:47,760 --> 00:18:49,360 So what they do as their core business. 353 00:18:49,620 --> 00:18:54,680 Is provide web based CRM software for their clients. 354 00:18:54,840 --> 00:18:56,200 And they've got a lot of clients. 355 00:18:56,660 --> 00:18:57,840 And they're a big company. 356 00:18:57,980 --> 00:18:59,900 But they also expose that infrastructure. 357 00:19:00,080 --> 00:19:00,760 And that platform. 358 00:19:01,500 --> 00:19:03,580 To developers for third party applications. 359 00:19:03,940 --> 00:19:08,440 So essentially they've got a system kind of like the app store for Apple. 360 00:19:09,700 --> 00:19:12,680 Whereby developers can code their own apps. 361 00:19:12,880 --> 00:19:14,540 And sell them to customers. 362 00:19:15,080 --> 00:19:17,960 So they've got massive infrastructure spread out across the world. 363 00:19:18,500 --> 00:19:19,920 But what's awesome for us. 364 00:19:20,000 --> 00:19:20,740 We're South African. 365 00:19:20,840 --> 00:19:21,500 We're kind of cheap. 366 00:19:21,620 --> 00:19:24,320 So they do provide us with free accounts to test with. 367 00:19:24,400 --> 00:19:26,100 They provide you with a free dev account. 368 00:19:26,440 --> 00:19:27,760 And so we played with that. 369 00:19:28,260 --> 00:19:29,540 To see what we could get. 370 00:19:29,720 --> 00:19:30,940 Our goal here wasn't to. 371 00:19:30,980 --> 00:19:31,140 Well. 372 00:19:32,940 --> 00:19:35,040 While looking for exploits is fun. 373 00:19:35,820 --> 00:19:37,060 When you don't have mandate. 374 00:19:37,060 --> 00:19:39,860 It becomes a really, really gray area. 375 00:19:39,960 --> 00:19:41,380 As we'll chat about later. 376 00:19:41,620 --> 00:19:45,900 So in this case we were looking to find ways to abuse. 377 00:19:46,200 --> 00:19:48,860 Rather than exploit their platform. 378 00:19:50,200 --> 00:19:53,120 So if one wants to develop on their platform. 379 00:19:53,680 --> 00:19:55,480 Basically there are three main components. 380 00:19:55,760 --> 00:19:57,720 The one is to write front end. 381 00:19:58,300 --> 00:20:01,220 Front end pages are written in a language called visual force. 382 00:20:01,380 --> 00:20:04,140 It's a HTML like templating language. 383 00:20:04,880 --> 00:20:06,480 So you might be able to read that. 384 00:20:06,480 --> 00:20:07,040 You might not. 385 00:20:07,220 --> 00:20:08,080 You'll see that. 386 00:20:08,140 --> 00:20:10,220 They've got custom tags embedded there with HTML. 387 00:20:10,540 --> 00:20:12,660 But that's less interesting for us. 388 00:20:13,300 --> 00:20:15,760 They also support business logic language. 389 00:20:15,880 --> 00:20:19,420 That's kind of got sort of Java like called Apex. 390 00:20:20,000 --> 00:20:22,340 But it is their own language there. 391 00:20:23,100 --> 00:20:25,880 And Apex is quite interesting for a number of reasons. 392 00:20:26,740 --> 00:20:30,600 What you'll find is that it supports interesting API. 393 00:20:30,840 --> 00:20:33,420 So for instance you can make web requests from within Apex. 394 00:20:33,600 --> 00:20:36,120 You can also code web service end points. 395 00:20:36,120 --> 00:20:37,260 From within Apex. 396 00:20:37,420 --> 00:20:42,680 So in other words you can have business logic that runs when someone hits a page on your Salesforce site. 397 00:20:42,840 --> 00:20:44,240 And likewise for email. 398 00:20:45,000 --> 00:20:46,480 So you can send email. 399 00:20:46,620 --> 00:20:50,040 And you can also have Apex that runs on the receipt of email. 400 00:20:51,000 --> 00:20:54,820 And then the third part of their platform is the data store. 401 00:20:55,540 --> 00:20:58,220 Obviously it's kind of an embedded database that they have. 402 00:20:58,900 --> 00:21:01,680 So when you're dev for force.com. 403 00:21:01,700 --> 00:21:03,300 You write either in Eclipse with a plug in. 404 00:21:03,300 --> 00:21:06,020 Or they've got this web based dev environment. 405 00:21:06,200 --> 00:21:07,160 Which is kind of cool. 406 00:21:07,580 --> 00:21:10,540 But the big thing here is that it's a multi-tenant system. 407 00:21:10,880 --> 00:21:13,280 So you share infrastructure with other people. 408 00:21:13,560 --> 00:21:20,640 So you need to quite carefully protect instance or organizations or accounts within Salesforce from one another. 409 00:21:20,820 --> 00:21:24,800 You can imagine if one account monopolizes the resources on the platform. 410 00:21:24,960 --> 00:21:26,040 Everyone else suffers. 411 00:21:26,280 --> 00:21:30,360 So in order to protect users from each other. 412 00:21:30,360 --> 00:21:32,540 They've got a piece of technology called. 413 00:21:34,040 --> 00:21:34,600 Right. 414 00:21:34,760 --> 00:21:36,860 So they've got a piece of technology called the governor. 415 00:21:37,260 --> 00:21:39,020 And the governor is. 416 00:21:39,260 --> 00:21:40,840 So it's built into their platform. 417 00:21:41,020 --> 00:21:43,420 And it enforces all of the execution limits. 418 00:21:43,620 --> 00:21:47,840 So essentially any script that ever executes is subject to a whole number of limits. 419 00:21:48,880 --> 00:21:50,820 And once your limits are exceeded. 420 00:21:50,940 --> 00:21:52,080 They kill your script. 421 00:21:52,460 --> 00:21:53,020 Okay. 422 00:21:54,640 --> 00:21:59,160 Limits vary dependent on how and where your code executes. 423 00:21:59,160 --> 00:22:01,840 But your code at all times is subject to limits. 424 00:22:02,000 --> 00:22:06,100 The type of limits you'll see are things like the number of script lines that get executed. 425 00:22:06,560 --> 00:22:07,980 Number of database queries. 426 00:22:08,540 --> 00:22:11,940 The size of the result sets from database queries. 427 00:22:12,500 --> 00:22:13,340 Number of call outs. 428 00:22:13,420 --> 00:22:14,180 Number of sent mails. 429 00:22:14,280 --> 00:22:14,620 And so on. 430 00:22:14,700 --> 00:22:15,700 And those are all published. 431 00:22:16,000 --> 00:22:21,200 But there are also of course a number of unpublished limits that we bumped into along the way. 432 00:22:21,640 --> 00:22:24,120 Which points to good thinking on their part. 433 00:22:24,700 --> 00:22:25,400 So things. 434 00:22:25,880 --> 00:22:27,820 Kind of unpublished limits you'll hit are. 435 00:22:27,820 --> 00:22:31,020 Number of received mails as well as running time of scripts. 436 00:22:32,640 --> 00:22:36,280 But this language called Apex comes with a number of limitations. 437 00:22:36,560 --> 00:22:38,240 It's not a general purpose language. 438 00:22:38,420 --> 00:22:40,220 It's a business logic language. 439 00:22:40,860 --> 00:22:46,080 So you'll find that there are a number of primitives you'd like from other languages that just aren't present here. 440 00:22:46,480 --> 00:22:48,120 So things like you don't have locks. 441 00:22:48,660 --> 00:22:49,420 Explicit locks. 442 00:22:49,880 --> 00:22:51,840 You can't pause execution. 443 00:22:52,200 --> 00:22:52,980 There aren't real threads. 444 00:22:53,760 --> 00:22:55,600 There's no explicit shared memory. 445 00:22:55,600 --> 00:22:57,140 And so on. 446 00:22:57,220 --> 00:23:01,980 And you'll also find that the order in which you make API calls is quite important. 447 00:23:02,680 --> 00:23:05,140 Just because of the way the system has been built. 448 00:23:06,220 --> 00:23:08,080 So this is less interesting. 449 00:23:08,540 --> 00:23:10,600 Basically we came up with a bunch of workarounds. 450 00:23:10,760 --> 00:23:13,840 So in order to pause execution do a whole bunch of floating point operations. 451 00:23:14,660 --> 00:23:15,840 They don't count. 452 00:23:18,380 --> 00:23:23,320 So they only count script lines rather than the size of the expression on each line. 453 00:23:23,420 --> 00:23:24,600 So in this slide. 454 00:23:24,600 --> 00:23:30,100 Basically what we're showing is you can chain about 200 odd cube roots to pause execution. 455 00:23:30,440 --> 00:23:33,080 And that just counts as one line of script. 456 00:23:33,460 --> 00:23:37,520 But you'll agree I'm sure that that's quite a horrible looking hack. 457 00:23:39,300 --> 00:23:42,680 We also managed to figure out ways to do locks and synchronization. 458 00:23:43,160 --> 00:23:45,720 They do support one implicit lock mechanism. 459 00:23:46,640 --> 00:23:47,620 It's less important. 460 00:23:49,840 --> 00:23:52,800 Shared memory you get by default with the data store. 461 00:23:52,940 --> 00:23:54,480 You just have to write it as such. 462 00:23:54,600 --> 00:23:56,760 You also get access to triggers. 463 00:23:56,940 --> 00:24:01,880 So within the data store on certain actions you can set triggers that will fire. 464 00:24:01,980 --> 00:24:05,700 And the triggers can do things like make other updates into the data store. 465 00:24:05,800 --> 00:24:06,400 Send emails. 466 00:24:06,680 --> 00:24:07,800 Send web requests. 467 00:24:07,980 --> 00:24:08,440 And so on. 468 00:24:09,700 --> 00:24:13,480 And so we focused on trying to bypass the governor. 469 00:24:13,700 --> 00:24:20,140 Because if you can bypass the governor then you get access to a lot more computing power than was intended. 470 00:24:21,280 --> 00:24:23,900 And with their platform that's spread out across the world. 471 00:24:23,900 --> 00:24:26,240 That equals both computing time as well as bandwidth. 472 00:24:26,860 --> 00:24:29,460 We really don't have a lot of that back home. 473 00:24:29,640 --> 00:24:33,880 So any bandwidth that we can get is gratefully accepted. 474 00:24:35,040 --> 00:24:35,480 Donations? 475 00:24:36,660 --> 00:24:37,100 No? 476 00:24:37,240 --> 00:24:37,500 Okay. 477 00:24:38,720 --> 00:24:45,060 So what we wanted to do there was to create a way to fire off a lot of actions. 478 00:24:45,120 --> 00:24:48,720 More actions than should be allowed based on a single user interaction. 479 00:24:48,920 --> 00:24:51,340 So in other words normally a user hits a script. 480 00:24:51,460 --> 00:24:52,140 It executes. 481 00:24:52,140 --> 00:24:52,940 It's subject to limits. 482 00:24:52,940 --> 00:24:56,160 What we want to do is to find a way by which we can hit a script. 483 00:24:56,300 --> 00:24:57,220 It executes. 484 00:24:57,320 --> 00:24:59,920 And we get a lot more processing time. 485 00:25:00,340 --> 00:25:02,880 Processing power than was intended. 486 00:25:03,240 --> 00:25:06,320 And so what we focused on doing was to create event loops. 487 00:25:06,500 --> 00:25:10,800 So essentially chaining together multiple execution steps of a single script. 488 00:25:11,200 --> 00:25:14,180 And the first way that we tried which didn't work. 489 00:25:14,760 --> 00:25:16,980 But it's worth reporting on failures I suppose. 490 00:25:17,120 --> 00:25:18,340 Gives us time to talk here. 491 00:25:19,460 --> 00:25:22,820 Was to create a web service endpoint that called itself. 492 00:25:22,820 --> 00:25:25,560 But that gets detected on their side. 493 00:25:25,820 --> 00:25:33,400 So the next thing that we thought of but discarded fairly soon after that was to have a third party. 494 00:25:33,540 --> 00:25:40,080 In other words you sitting with your browser to just have your browser repeatedly call their Apex script sitting on their server. 495 00:25:40,260 --> 00:25:41,920 But that involves a third party. 496 00:25:42,100 --> 00:25:43,080 So we stayed clear of that. 497 00:25:43,560 --> 00:25:48,160 So what we finally decided on was to go with email. 498 00:25:48,700 --> 00:25:50,760 So essentially you can create email loops. 499 00:25:51,680 --> 00:25:52,800 You can imagine how that works. 500 00:25:52,800 --> 00:25:55,140 We send an email to a sales force address. 501 00:25:55,380 --> 00:25:58,840 It does a small part of the job that we're interested in. 502 00:25:58,940 --> 00:26:01,120 And it then fires off another email to itself. 503 00:26:01,960 --> 00:26:03,060 Carries on with the job. 504 00:26:03,280 --> 00:26:06,500 Sends off an email once the limit approaches for that script. 505 00:26:06,780 --> 00:26:07,380 And so on. 506 00:26:07,440 --> 00:26:08,020 The loop continues. 507 00:26:09,360 --> 00:26:10,540 And so that gave us. 508 00:26:10,640 --> 00:26:14,520 Gives you about 1500 rounds of execution in a day. 509 00:26:14,600 --> 00:26:17,040 You still hit an unpublished limit eventually. 510 00:26:17,320 --> 00:26:21,580 But it gives you more processing time than was originally intended. 511 00:26:21,580 --> 00:26:26,180 And of course whatever job gets executed is then up to the user's imagination. 512 00:26:26,560 --> 00:26:28,060 We don't have much imagination. 513 00:26:29,080 --> 00:26:33,460 So what we came up with was Sifto. 514 00:26:33,760 --> 00:26:39,820 Which is essentially a port of the Nicto web scanning tool onto the cloud. 515 00:26:41,120 --> 00:26:48,120 So I'm sure most of you are aware but Nicto basically scans a website for vulnerabilities based on a database that it has. 516 00:26:48,120 --> 00:26:52,680 And so we ported that as I say into sales force. 517 00:26:53,080 --> 00:26:59,060 So our little app will basically add your target website into the alert endpoints. 518 00:26:59,200 --> 00:27:01,640 If you're a developer on sales force you'll know what that means. 519 00:27:02,120 --> 00:27:04,520 And then it kicks off this event loop. 520 00:27:04,740 --> 00:27:10,160 And in each iteration of the event loop you'll get results for 10 of the Nicto tests. 521 00:27:10,780 --> 00:27:14,220 And then you'll get an email coming through every time hits received. 522 00:27:15,400 --> 00:27:17,300 Of course the question you're going to ask me is. 523 00:27:17,300 --> 00:27:18,220 Why would you want to do this? 524 00:27:18,460 --> 00:27:26,360 And as I say this is a proof of concept for utilizing the cloud or a cloud platform as an attack platform. 525 00:27:26,600 --> 00:27:31,500 You can fire up EC2 instances and scan the world if you want. 526 00:27:32,280 --> 00:27:38,380 But this is actually using a programming language within the cloud to also perform security testing. 527 00:27:38,760 --> 00:27:39,840 So for one it's free. 528 00:27:39,980 --> 00:27:44,580 So as I said you get access to a whole lot of infrastructure that we just don't have. 529 00:27:44,580 --> 00:27:47,240 You get a degree of anonymity. 530 00:27:47,380 --> 00:27:50,780 But of course they definitely do monitor as we found out. 531 00:27:52,000 --> 00:27:52,360 Okay. 532 00:27:52,460 --> 00:27:52,820 So. 533 00:27:55,760 --> 00:27:58,020 I'm going to show you a little video of this thing in action. 534 00:28:04,840 --> 00:28:05,200 Okay. 535 00:28:05,260 --> 00:28:07,300 So this is us just doing the setup. 536 00:28:11,440 --> 00:28:12,280 I lied to you. 537 00:28:12,360 --> 00:28:13,320 I want to play this faster. 538 00:28:13,500 --> 00:28:13,860 Okay. 539 00:28:14,580 --> 00:28:15,080 So this is just to show you. 540 00:28:16,100 --> 00:28:23,060 You're required to have a bunch of custom Apex classes as well as a bunch of custom Apex objects. 541 00:28:23,240 --> 00:28:26,180 So all of this is now done through their web interface. 542 00:28:26,520 --> 00:28:30,180 We have an alert email that gets sent when a record is updated. 543 00:28:30,420 --> 00:28:33,900 So that's our trigger which will help us kick off the event loop. 544 00:28:34,160 --> 00:28:38,840 And then the email address which receives the trigger mail is that. 545 00:28:39,000 --> 00:28:43,120 So as you can see it's kind of a randomly generated email address that they provide you with. 546 00:28:46,300 --> 00:28:47,180 Less important. 547 00:28:48,040 --> 00:28:48,480 Okay. 548 00:28:48,920 --> 00:28:54,060 So what we've got then is a little shell script that wraps up all our calls to the site. 549 00:28:54,360 --> 00:28:59,680 In the one console we're going to tail the victim's web log. 550 00:28:59,800 --> 00:29:01,900 And on the other side we're actually going to kick off the scan. 551 00:29:02,140 --> 00:29:06,400 So you'll see that the requests start to come through on that console. 552 00:29:07,300 --> 00:29:08,460 There we kick off the scan. 553 00:29:08,680 --> 00:29:12,760 And now we start to see requests coming through in the web logs. 554 00:29:12,760 --> 00:29:15,020 So essentially we've performed one user action. 555 00:29:15,160 --> 00:29:19,100 And that's caused our scanning tool on Salesforce to kick off. 556 00:29:19,200 --> 00:29:20,680 So we've bypassed the governor limits. 557 00:29:21,280 --> 00:29:26,140 At that point we can make a lot more web call outs than were originally intended. 558 00:29:28,120 --> 00:29:30,300 But I'm afraid there's no shells to be popped yet. 559 00:29:32,360 --> 00:29:32,840 Okay. 560 00:29:34,640 --> 00:29:40,160 So what we see then at the end is basically as results are found they come through via email. 561 00:29:41,540 --> 00:29:44,080 At the end we get all of our results via email. 562 00:29:44,980 --> 00:29:50,780 And I guess for us the more interesting thing here is just that little slide that says we started at 1.05. 563 00:29:50,860 --> 00:29:52,120 We ended at 1.16. 564 00:29:52,140 --> 00:29:54,180 Total scan time 11 minutes. 565 00:29:54,900 --> 00:30:02,420 Which if we had to do from a single machine on the bandwidth that we have would take a lot longer than that. 566 00:30:04,600 --> 00:30:05,040 Okay. 567 00:30:13,880 --> 00:30:14,480 All right. 568 00:30:14,520 --> 00:30:16,740 So then we're going to talk just a few pros and cons of the approach. 569 00:30:17,000 --> 00:30:18,620 As I say this thing is a proof of concept. 570 00:30:18,780 --> 00:30:22,700 Just to get an idea of what can be done on custom cloud platforms. 571 00:30:23,500 --> 00:30:24,260 It is free. 572 00:30:24,360 --> 00:30:25,600 You get lots more bandwidth. 573 00:30:27,560 --> 00:30:30,400 Of course the question about denial of service does come up here. 574 00:30:30,520 --> 00:30:32,080 We're not going to talk about it too much. 575 00:30:33,620 --> 00:30:35,400 There are a few cons that are listed there. 576 00:30:35,700 --> 00:30:39,400 So the one thing that's immediately obvious is to say look. 577 00:30:39,400 --> 00:30:41,680 You only had 1,500 possible iterations. 578 00:30:41,980 --> 00:30:42,440 Now what? 579 00:30:42,700 --> 00:30:43,440 Well that's true. 580 00:30:43,780 --> 00:30:45,760 But the converse is also well not the converse. 581 00:30:45,900 --> 00:30:49,200 But there's an alternative approach which says that accounts are zero cost. 582 00:30:49,480 --> 00:30:54,500 So actually we can register one account that will perform 1,500 iterations. 583 00:30:54,740 --> 00:30:57,000 We can register a second one which will carry on with the next one. 584 00:30:57,100 --> 00:31:00,440 We can register a third one which will carry on with the next 1,500 iterations. 585 00:31:00,820 --> 00:31:01,180 Okay. 586 00:31:01,220 --> 00:31:05,940 So we can spread it out horizontally instead of having one account responsible for all execution. 587 00:31:06,740 --> 00:31:08,780 And of course they can communicate via email. 588 00:31:08,900 --> 00:31:09,380 Okay. 589 00:31:09,400 --> 00:31:12,820 So for this we needed to have a whole bunch of accounts. 590 00:31:13,040 --> 00:31:14,260 So we needed to auto register. 591 00:31:14,440 --> 00:31:15,220 There's a problem. 592 00:31:15,400 --> 00:31:17,560 The registration page is protected by capture. 593 00:31:18,100 --> 00:31:19,640 Not a particularly strong one. 594 00:31:19,720 --> 00:31:20,380 But it's there. 595 00:31:21,080 --> 00:31:25,800 However we found when we pulled the capture actually just in the command line. 596 00:31:26,720 --> 00:31:33,800 They had an unfortunate print R at the end of their capture script which just dumped out the text of the object. 597 00:31:34,000 --> 00:31:35,140 So actually it was there. 598 00:31:39,400 --> 00:31:39,620 Really? 599 00:31:40,220 --> 00:31:40,700 Okay. 600 00:31:42,300 --> 00:31:45,780 To their immense credit though they fixed that within 15 minutes. 601 00:31:46,020 --> 00:31:49,860 So I think that also probably deserves a round of applause. 602 00:31:53,680 --> 00:31:54,160 Okay. 603 00:31:54,240 --> 00:31:55,940 So at this point we now have 200 accounts. 604 00:31:56,260 --> 00:31:57,560 They're spread out around the world. 605 00:31:58,340 --> 00:32:02,620 And so at this point you can then do that horizontal scaling. 606 00:32:04,060 --> 00:32:04,540 Yeah. 607 00:32:05,540 --> 00:32:08,500 So some of the things that we figure should be pointed out here. 608 00:32:08,500 --> 00:32:11,220 So basically SIFTO is really basic. 609 00:32:11,540 --> 00:32:15,680 But it does hint at the possibilities for attacks from within the cloud. 610 00:32:17,220 --> 00:32:18,860 Their platform is developing rapidly. 611 00:32:19,260 --> 00:32:21,100 They're already on API version 16. 612 00:32:21,500 --> 00:32:25,500 And so we'll be monitoring that as new features become available. 613 00:32:27,860 --> 00:32:36,640 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 614 00:32:36,640 --> 00:32:39,260 to your Salesforce administrator. 615 00:32:40,560 --> 00:32:43,260 And in many cases that's actually a C-level executive. 616 00:32:43,680 --> 00:32:46,680 And this is the guy who's getting phished on a daily basis. 617 00:32:47,420 --> 00:32:49,980 He's not, and fair enough, he's not a security guy. 618 00:32:50,160 --> 00:32:52,800 This isn't something that he should have loads of knowledge about. 619 00:32:53,040 --> 00:32:57,140 But if he gets phished, there go all your customer data. 620 00:32:57,360 --> 00:32:58,440 So something to keep in mind. 621 00:32:59,120 --> 00:32:59,520 Yeah. 622 00:32:59,540 --> 00:33:00,300 One last thing there. 623 00:33:00,800 --> 00:33:04,160 Salesforce was really positive with the interaction with us. 624 00:33:04,220 --> 00:33:06,220 So we just wanted to acknowledge that. 625 00:33:06,220 --> 00:33:07,000 They fixed the bugs. 626 00:33:07,120 --> 00:33:08,620 And they've actually been quite cool to work with. 627 00:33:08,920 --> 00:33:10,800 So that ends my Salesforce stuff. 628 00:33:10,880 --> 00:33:13,540 I'm going to hand over to Harun to talk to you about Amazon. 629 00:33:16,160 --> 00:33:16,640 Okay. 630 00:33:17,360 --> 00:33:17,840 Okay. 631 00:33:17,920 --> 00:33:23,760 So we've got Amazon and straight after that mobile me coming up. 632 00:33:25,140 --> 00:33:34,400 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. 633 00:33:34,400 --> 00:33:46,280 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. 634 00:33:47,580 --> 00:33:59,980 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. 635 00:34:00,400 --> 00:34:03,140 We're not going to look at a whole bunch of others right now. 636 00:34:03,140 --> 00:34:07,860 Although we're doing some of that testing back home, we're not ready to talk about some of it. 637 00:34:09,380 --> 00:34:15,360 So EC2 really quickly, if you break it down into its simplest form, you hit a web page. 638 00:34:15,580 --> 00:34:17,500 If you want to, you can do it from the command line. 639 00:34:17,860 --> 00:34:19,180 You pick a machine. 640 00:34:19,380 --> 00:34:20,340 You boot the machine. 641 00:34:20,520 --> 00:34:21,820 It gives you an IP address. 642 00:34:22,020 --> 00:34:26,200 And you've now got a machine sitting in Amazon's data center somewhere. 643 00:34:26,680 --> 00:34:27,120 Okay. 644 00:34:28,120 --> 00:34:31,980 It's got a whole bunch of other functionality which we're not going to need right now. 645 00:34:32,620 --> 00:34:33,060 Okay. 646 00:34:33,140 --> 00:34:33,680 We've got S3. 647 00:34:33,760 --> 00:34:35,620 It's a simple storage service. 648 00:34:36,500 --> 00:34:38,240 Relatively easy to understand. 649 00:34:38,540 --> 00:34:39,760 It's storage in the cloud. 650 00:34:40,140 --> 00:34:42,140 And it works with a bucket model. 651 00:34:42,820 --> 00:34:43,040 Okay. 652 00:34:43,140 --> 00:34:46,400 For all of the services, Amazon is trying to get support. 653 00:34:46,680 --> 00:34:48,680 Their pricing is really good, really attractive. 654 00:34:49,440 --> 00:34:52,280 Some people differ on the EC2 costs. 655 00:34:52,520 --> 00:34:57,820 But for lots of uses, you'll find it's a really quick, really reasonable way to get machine time. 656 00:34:59,100 --> 00:35:02,620 If we look at S3, there's a Firefox plug-in. 657 00:35:02,620 --> 00:35:04,660 It's a big plug-in called S3 Organizer. 658 00:35:04,720 --> 00:35:09,380 So it gives you pretty much an explorer-type view that allows you to drag and drop files 659 00:35:09,380 --> 00:35:09,700 around. 660 00:35:10,980 --> 00:35:12,600 Its usage is increasing. 661 00:35:12,780 --> 00:35:16,200 January of 2008, it was storing 14 billion objects. 662 00:35:16,900 --> 00:35:17,380 Okay. 663 00:35:17,420 --> 00:35:21,500 And something that's going to come up in a little while to bite them is the fact that 664 00:35:21,500 --> 00:35:23,460 it's pretty much got a flat namespace. 665 00:35:23,820 --> 00:35:24,300 Okay. 666 00:35:24,360 --> 00:35:27,300 Which means you get to choose your bucket. 667 00:35:27,440 --> 00:35:31,140 And if you grab your bucket early enough, then that bucket is yours. 668 00:35:31,140 --> 00:35:31,880 Okay. 669 00:35:31,960 --> 00:35:35,800 So nothing stops me right now from grabbing a bucket called Defcon. 670 00:35:36,080 --> 00:35:44,040 And going into the future, nobody else gets to store something as top-level Defcon on S3. 671 00:35:44,680 --> 00:35:49,780 This doesn't sound so bad, but we'll be able to use it for fun and profit shortly. 672 00:35:51,340 --> 00:35:51,900 Okay. 673 00:35:51,940 --> 00:35:58,760 So one of the quick things that come up when you look at AWS is its feature for auto-scaling. 674 00:35:58,960 --> 00:35:59,520 Okay. 675 00:35:59,520 --> 00:36:00,840 It's a really big promise. 676 00:36:01,060 --> 00:36:04,900 Well, it's a really big promise with the cloud. 677 00:36:05,100 --> 00:36:08,720 And basically, it means you don't have to plan for peak usage anymore. 678 00:36:09,240 --> 00:36:13,140 You can basically have your app rise and fall as it's needed. 679 00:36:13,660 --> 00:36:14,260 Okay. 680 00:36:14,340 --> 00:36:18,640 Of course, you can probably see where this is going to start going wrong. 681 00:36:19,260 --> 00:36:25,920 If you take Amazon SimpleDB, SimpleDB gives the site the opportunity to charge depending 682 00:36:25,920 --> 00:36:27,780 on SimpleDB usage. 683 00:36:27,780 --> 00:36:34,760 Which basically means that you, with your little wget script, can start adding cost to 684 00:36:34,760 --> 00:36:36,880 the guy who's using SimpleDB in the background. 685 00:36:37,460 --> 00:36:37,720 Okay. 686 00:36:37,740 --> 00:36:41,200 Now, the immediate response is we've bumped into this problem before. 687 00:36:41,400 --> 00:36:48,460 It's the same thing that happens with click fraud and with ads, except that with ads, 688 00:36:48,640 --> 00:36:50,820 the system self-regulates somewhat. 689 00:36:50,960 --> 00:36:56,280 If you get a bazillion clicks and only three of them convert, the price you're willing 690 00:36:56,280 --> 00:36:57,660 to pay for your ads go down. 691 00:36:57,660 --> 00:36:58,320 Okay. 692 00:36:58,520 --> 00:37:03,480 In the case of SimpleDB, you're paying a price based on number of hits, whether those people 693 00:37:03,480 --> 00:37:05,060 actually buy from you or not. 694 00:37:05,520 --> 00:37:06,080 Okay. 695 00:37:06,140 --> 00:37:09,900 So, there's actually less incentive for that problem to be fixed. 696 00:37:10,520 --> 00:37:16,020 Google have to fix click fraud because if they don't, it devalues their ads. 697 00:37:16,360 --> 00:37:22,940 If there's the equivalent of click fraud happening on SimpleDB, you get poorer and Amazon gets 698 00:37:22,940 --> 00:37:23,300 richer. 699 00:37:24,460 --> 00:37:25,020 Okay. 700 00:37:25,100 --> 00:37:27,640 So, we were looking at what we could do with ads. 701 00:37:27,640 --> 00:37:31,620 We were looking at AWS and we didn't have ideas initially, or I didn't have ideas, 702 00:37:31,860 --> 00:37:36,220 and probably a safe thing to do in any such situation is to copy Marco. 703 00:37:37,140 --> 00:37:41,840 So, what we were trying to do was just see if we could steal resources from Amazon. 704 00:37:42,080 --> 00:37:42,480 Okay. 705 00:37:42,500 --> 00:37:43,400 They put the stuff up. 706 00:37:43,600 --> 00:37:45,460 Let's see what we can steal from them. 707 00:37:45,920 --> 00:37:48,740 It turns out we can, or we could. 708 00:37:49,900 --> 00:37:56,260 So, if we take a really quick look at how this works, what you're seeing there is the 709 00:37:56,260 --> 00:38:02,380 page that comes up when you log into the AWS interface and you now want to boot up some 710 00:38:02,380 --> 00:38:02,780 machine. 711 00:38:03,420 --> 00:38:03,580 Okay. 712 00:38:03,660 --> 00:38:08,220 What's interesting to note is what you should see at the time that screenshot was taken, 713 00:38:08,340 --> 00:38:13,860 that there's 2,800 just about machine images that you can fire up. 714 00:38:14,180 --> 00:38:19,240 Now, interestingly enough, only 47 of these images were built by Amazon. 715 00:38:19,700 --> 00:38:20,260 Okay. 716 00:38:20,700 --> 00:38:24,640 All the rest are user contributed in some way or fashion. 717 00:38:24,840 --> 00:38:25,400 Okay. 718 00:38:25,500 --> 00:38:25,700 Okay. 719 00:38:26,260 --> 00:38:29,280 So, you should be starting to get worried already. 720 00:38:29,860 --> 00:38:37,040 Now, with these shared AMIs, what's interesting is people basically take an Amazon AMI or build 721 00:38:37,040 --> 00:38:43,080 one from scratch, bundle it together, then upload it to S3 and share it with the world. 722 00:38:43,720 --> 00:38:44,020 Okay. 723 00:38:44,040 --> 00:38:47,580 So, the first question is how many of these people are doing it right? 724 00:38:47,700 --> 00:38:52,180 Before you even wonder about how many of them are evil, just the question of how many of 725 00:38:52,180 --> 00:38:53,080 them are making mistakes. 726 00:38:53,080 --> 00:38:59,480 So, if you troll Amazon's forum pages, you'll find a whole bunch of forum posts from people 727 00:38:59,480 --> 00:39:04,120 who are claiming or complaining that they can't get something to work right. 728 00:39:04,340 --> 00:39:08,920 And if you actually look through at the cause of their problem, you find that they've actually 729 00:39:08,920 --> 00:39:14,380 uploaded their secret Amazon credentials to the Amazon instances and then given these 730 00:39:14,380 --> 00:39:15,240 instances away. 731 00:39:15,700 --> 00:39:16,260 Okay. 732 00:39:16,280 --> 00:39:21,200 Now, all that means is you've got to boot that image, take those credentials, and now 733 00:39:21,200 --> 00:39:22,920 you transact as those people. 734 00:39:22,920 --> 00:39:25,360 When you're transacting inside of Amazon. 735 00:39:26,220 --> 00:39:30,720 There's also the question, and Amazon's taken some heat for this, that they provide kernel 736 00:39:30,720 --> 00:39:35,460 images and how quickly they can keep up with the vulnerabilities that seem to be coming 737 00:39:35,460 --> 00:39:37,040 out quite often in kernels today. 738 00:39:37,980 --> 00:39:38,340 Okay. 739 00:39:38,380 --> 00:39:43,660 One of the problems that you've got here is you can't just scan machines in the cloud. 740 00:39:43,880 --> 00:39:50,780 Even though Amazon say, so officially Amazon say no scanning in the cloud, it transgresses 741 00:39:50,780 --> 00:39:51,280 their EULA. 742 00:39:51,280 --> 00:39:56,300 And unofficially, the word is as long as there's no complaint, you won't get kicked 743 00:39:56,300 --> 00:39:56,580 out. 744 00:39:57,340 --> 00:40:01,360 But one of them is a legal document and the other one is something that Amazon said. 745 00:40:01,820 --> 00:40:02,180 Okay. 746 00:40:02,220 --> 00:40:04,620 So right now, scanning in the cloud is dangerous. 747 00:40:05,020 --> 00:40:10,240 So we needed a quick alternative because remember the intention is we're trying to find other 748 00:40:10,240 --> 00:40:12,300 people's credentials so that we can use it. 749 00:40:13,080 --> 00:40:16,980 And so what we hacked together really quickly was a really ghetto scanner. 750 00:40:18,120 --> 00:40:21,080 And what the scanner does is it goes out. 751 00:40:21,280 --> 00:40:26,940 Gets a list of all the AMIs and builds an SQS list with it, SQS queue with it. 752 00:40:27,240 --> 00:40:33,180 So SQS is just a normal queue except you keep it in the cloud and Amazon pay, charge you 753 00:40:33,180 --> 00:40:34,800 a little bit of money to use their queue. 754 00:40:35,080 --> 00:40:37,760 They handle synchronization and all of that cool stuff. 755 00:40:38,260 --> 00:40:40,220 So we get this list of AMIs. 756 00:40:40,800 --> 00:40:42,840 We then fire up 10 images. 757 00:40:43,400 --> 00:40:43,880 Okay. 758 00:40:43,940 --> 00:40:46,300 Each of those images go to the queue. 759 00:40:46,460 --> 00:40:50,540 Pull down one of the images that's listed. 760 00:40:50,540 --> 00:40:55,660 It then fires up that image and then proceeds to scan that image. 761 00:40:55,940 --> 00:40:56,460 Okay. 762 00:40:56,480 --> 00:40:58,680 And in this case, we're doing really simple scanning. 763 00:40:58,780 --> 00:40:59,800 We're doing a Nessus scan. 764 00:41:00,080 --> 00:41:05,180 We're SSH-ing in and trying to steal stuff that looks interesting from their file system. 765 00:41:05,800 --> 00:41:06,320 Okay. 766 00:41:06,360 --> 00:41:11,780 So what we're looking for there is keys, passwords, bash histories, MySQL histories, 767 00:41:11,920 --> 00:41:12,660 stuff like that. 768 00:41:13,000 --> 00:41:17,140 We then dump the results to S3 so that we can grab them offline later. 769 00:41:17,760 --> 00:41:18,280 Okay. 770 00:41:18,320 --> 00:41:19,160 So the first question. 771 00:41:19,160 --> 00:41:23,360 The first thing is we were really surprised because we thought we'd find some stuff. 772 00:41:23,740 --> 00:41:26,200 But it turns out you actually find quite a bit. 773 00:41:26,920 --> 00:41:33,480 So just on the Nessus scans, you end up with 1,200 highs, a whole bunch of criticals. 774 00:41:33,780 --> 00:41:35,260 Only marginally interesting. 775 00:41:35,540 --> 00:41:41,100 What's more interesting is those are all user credentials that were left on these images. 776 00:41:41,520 --> 00:41:41,960 Okay. 777 00:41:41,980 --> 00:41:45,400 So these are all Amazon.pems or Amazon passwords. 778 00:41:45,720 --> 00:41:48,120 And they're either left clean on the system. 779 00:41:49,160 --> 00:41:52,120 Or people have left them in their bash histories while they were doing stuff. 780 00:41:53,120 --> 00:41:53,340 Okay. 781 00:41:53,780 --> 00:41:57,000 What you're seeing there are certificates and key pairs. 782 00:41:57,200 --> 00:41:57,700 Okay. 783 00:41:57,760 --> 00:41:59,200 All just left on those machines. 784 00:41:59,500 --> 00:42:03,180 So at this point, they're ours and we can be them on Amazon. 785 00:42:03,820 --> 00:42:09,280 So while we're stealing stuff, the quick question becomes, can we steal licenses? 786 00:42:10,340 --> 00:42:11,940 Also turns out to be yes. 787 00:42:12,400 --> 00:42:16,620 So if you go to Amazon, you get to boot Windows images. 788 00:42:16,620 --> 00:42:20,040 We then use the super elite magical jelly bean. 789 00:42:20,200 --> 00:42:24,760 So it's just a utility to steal, to recover licenses from your own machine. 790 00:42:25,200 --> 00:42:30,240 At this point, we're taking Windows Server 2003 license, which it gives us. 791 00:42:30,860 --> 00:42:33,980 We then take this back to our house in South Africa. 792 00:42:34,080 --> 00:42:38,760 We put it on our own Windows 2003 server and it happily registers for us. 793 00:42:39,160 --> 00:42:42,920 Those machines even are allowed, they pass genuine advantage. 794 00:42:43,120 --> 00:42:45,880 So they're even allowed to install updates from Microsoft. 795 00:42:47,540 --> 00:42:49,800 So we now run Windows machines also. 796 00:42:56,660 --> 00:43:00,060 So if we're stealing stuff, we decide not to stop there. 797 00:43:01,020 --> 00:43:05,860 Amazon also provides something called DevPay. 798 00:43:06,000 --> 00:43:13,940 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. 799 00:43:14,460 --> 00:43:16,540 Someone comes along and wants to use it. 800 00:43:16,540 --> 00:43:20,440 They pay the guy, they get a product code, they then get to boot this machine. 801 00:43:21,200 --> 00:43:24,680 Okay, I'm going to quickly try to show you a video. 802 00:43:26,600 --> 00:43:28,280 So DevPay is really cool. 803 00:43:28,480 --> 00:43:34,300 Essentially, they're offloading a whole bunch of work that you no longer have to do. 804 00:43:35,980 --> 00:43:42,100 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. 805 00:43:42,700 --> 00:43:45,280 So what you see here is if you hit Amazon, 806 00:43:45,280 --> 00:43:49,840 what you should see down there is a product code that I then pay for. 807 00:43:50,620 --> 00:43:51,860 We pay for this. 808 00:43:51,980 --> 00:43:53,400 We then fire up that machine. 809 00:43:53,680 --> 00:43:59,380 And what happens is every time we fire up this machine, the original guy gets paid for it. 810 00:43:59,760 --> 00:44:03,540 Okay, so Amazon handled that separately and we don't particularly care about it. 811 00:44:03,880 --> 00:44:07,840 If you see down here, if I describe this instance of mine that's running, 812 00:44:08,040 --> 00:44:11,540 what you should see up here is there's a product code attached to it. 813 00:44:11,920 --> 00:44:12,440 Okay. 814 00:44:12,440 --> 00:44:16,500 Essentially, this just means that I'm getting charged extra while this runs. 815 00:44:17,200 --> 00:44:23,460 So what we do here is we quickly bundle this image, which is normal functionality on an AMI. 816 00:44:23,720 --> 00:44:28,000 And once we've bundled this image, we upload this back into S3. 817 00:44:28,580 --> 00:44:30,580 Okay, so essentially I've paid for it once. 818 00:44:31,190 --> 00:44:32,240 I've then made a copy. 819 00:44:32,360 --> 00:44:35,320 What I'm going to do for demonstration here is make two copies, 820 00:44:36,620 --> 00:44:39,280 imaginatively called copy one and copy two. 821 00:44:39,660 --> 00:44:41,620 And we're uploading this to Amazon. 822 00:44:42,440 --> 00:44:50,240 Okay, once this is uploaded, we then go back to S3 and pull down that machine's image manifest. 823 00:44:50,640 --> 00:44:54,260 Okay, so the image manifest basically says this is what makes up the machine. 824 00:44:54,580 --> 00:44:58,360 And if you look through the manifest, you see here it's got an ancestry. 825 00:44:59,060 --> 00:45:04,040 Okay, which basically tells it that this machine was once Nick's machine, which we paid for. 826 00:45:04,240 --> 00:45:06,680 So at this point, we're feeling quite proud of ourselves. 827 00:45:07,080 --> 00:45:08,520 We remove the manifest. 828 00:45:08,780 --> 00:45:09,940 We remove the ancestry. 829 00:45:10,300 --> 00:45:12,080 We upload it back to Amazon. 830 00:45:12,440 --> 00:45:14,180 And we try to register it. 831 00:45:14,700 --> 00:45:17,680 Unfortunately, Amazon come back and say that's an invalid signature. 832 00:45:17,900 --> 00:45:18,980 This is not going to be allowed. 833 00:45:19,480 --> 00:45:22,240 Okay, it turns out there's not a lot more needed. 834 00:45:22,400 --> 00:45:23,740 So we grab it again. 835 00:45:23,980 --> 00:45:25,760 We remove the ancestry again. 836 00:45:26,120 --> 00:45:29,920 And then we use the tools that Amazon give you for bundling machines. 837 00:45:30,120 --> 00:45:33,540 And we re-sign the now modified request. 838 00:45:34,120 --> 00:45:37,320 We upload that to S3. 839 00:45:37,380 --> 00:45:39,480 And this time, it allows us to register. 840 00:45:39,480 --> 00:45:43,060 So effectively, we can now run that machine from now on. 841 00:45:43,160 --> 00:45:46,220 And there's no tie to the original image, which we should have paid for. 842 00:45:47,340 --> 00:45:49,980 Okay, so I'll kill that really quickly. 843 00:45:50,300 --> 00:45:55,220 Go back to the presentation just because there's a lot of it. 844 00:45:55,240 --> 00:45:56,320 And we're running out of time. 845 00:45:58,200 --> 00:46:00,560 So if that's Nick's deal. 846 00:46:00,980 --> 00:46:09,000 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, 847 00:46:10,040 --> 00:46:13,000 Amazon itself becomes your single point of failure. 848 00:46:13,580 --> 00:46:17,760 Okay, and the normal response to this is it's Amazon. 849 00:46:17,920 --> 00:46:20,280 If anyone can handle DOS, they can. 850 00:46:20,440 --> 00:46:26,840 If you read Amazon's docs, they talk about DDoS prevention and how they're willing to stay up despite DDoS attacks. 851 00:46:28,080 --> 00:46:32,520 But attackers are not DDoSing you like it's 1992 anymore. 852 00:46:32,840 --> 00:46:36,020 Okay, nobody is sin flooding to take people down. 853 00:46:36,120 --> 00:46:37,860 And if they go down for that, they deserve it. 854 00:46:37,860 --> 00:46:43,840 So what Amazon does is they prevent you from firing up more than 20 machines. 855 00:46:44,520 --> 00:46:47,660 Okay, so if you're a first timer, you get to fire up 20 machines. 856 00:46:47,860 --> 00:46:52,760 Because if a whole bunch of people fire up 1,000 machines, you can see it causing them some problems. 857 00:46:53,420 --> 00:47:01,000 Okay, so what we did, what we did, sorry. 858 00:47:02,480 --> 00:47:07,020 Okay, so I'll skip the video just because Marco says so. 859 00:47:09,060 --> 00:47:18,400 But effectively, what we do here is it turns out you can sign up Amazon accounts without any capture or without anything stopping you. 860 00:47:18,880 --> 00:47:22,760 Okay, so a really quick tool script allows you to register hundreds of users. 861 00:47:23,360 --> 00:47:30,080 Okay, so really simply what we do is we take one script and that script creates 20 users. 862 00:47:30,340 --> 00:47:33,960 And each of those 20 users go ahead and get 20 machines. 863 00:47:34,120 --> 00:47:36,620 And each of those fire up 20 machines. 864 00:47:36,940 --> 00:47:37,500 Okay. 865 00:47:37,500 --> 00:47:48,900 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. 866 00:47:49,460 --> 00:47:50,060 Okay. 867 00:47:50,100 --> 00:47:52,620 And this is going to cause them some problems. 868 00:47:56,300 --> 00:47:58,100 So thank you very much. 869 00:47:58,520 --> 00:48:02,840 So we want one more way to steal machine time. 870 00:48:02,940 --> 00:48:05,420 And it comes from Amazon. 871 00:48:05,420 --> 00:48:10,880 And that's basically when you get a machine, you don't know that that machine wasn't pre-owned before you got it. 872 00:48:11,340 --> 00:48:13,640 Amazon gives you the six-point bullet list. 873 00:48:13,900 --> 00:48:17,320 But six points is not enough to know that your machine hasn't been owned. 874 00:48:17,820 --> 00:48:18,340 Okay. 875 00:48:18,380 --> 00:48:23,460 So what we do is we want to take an image, upload it, and get someone to run it. 876 00:48:23,820 --> 00:48:33,860 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. 877 00:48:33,860 --> 00:48:38,260 So I'm going to skip through the videos and talk you through them for the most part. 878 00:48:38,860 --> 00:48:43,220 But basically, your image shows up like on page 200. 879 00:48:43,560 --> 00:48:45,060 And nobody's going to run it. 880 00:48:45,320 --> 00:48:52,220 So what we do is we wrap that in a little script that registers the machine, checks the AMI ID that it gets. 881 00:48:52,400 --> 00:48:56,420 If the AMI ID is too high, it deregisters it and registers it again. 882 00:48:56,660 --> 00:48:58,740 Because those things are assigned to you randomly. 883 00:48:59,280 --> 00:49:01,360 The first time we ran it, we ran it overnight. 884 00:49:01,360 --> 00:49:05,760 And by morning, we'd gotten an AMI ID that now showed up in the top ten. 885 00:49:06,180 --> 00:49:10,440 Which now means that when people go to the page, your image bubbles right to the top. 886 00:49:10,920 --> 00:49:11,400 Okay. 887 00:49:11,440 --> 00:49:14,960 The second time we ran it, we got a top five hit in under two hours. 888 00:49:15,080 --> 00:49:17,180 So you can race it. 889 00:49:18,180 --> 00:49:19,400 But that's not all. 890 00:49:21,040 --> 00:49:25,580 Because it turns out that you remember I spoke about the name grab thing. 891 00:49:25,800 --> 00:49:26,280 Okay. 892 00:49:26,300 --> 00:49:28,700 Because you can grab names as you want them, 893 00:49:28,820 --> 00:49:30,920 you can also make your image more attractive 894 00:49:31,360 --> 00:49:32,080 by naming it better. 895 00:49:32,600 --> 00:49:35,860 So what we do is we try to create something called Fedora. 896 00:49:36,220 --> 00:49:37,840 Fedora is unfortunately taken. 897 00:49:38,960 --> 00:49:41,620 Eventually, you find names that work for you. 898 00:49:41,780 --> 00:49:42,580 Underscores are cool. 899 00:49:43,140 --> 00:49:47,280 So Fedora underscore 11 gives you a nice name. 900 00:49:47,580 --> 00:49:50,180 And you manage to promote it to a top five hit. 901 00:49:50,460 --> 00:49:50,900 Okay. 902 00:49:50,940 --> 00:49:52,920 So that thing bubbles to the top really quickly. 903 00:49:53,540 --> 00:49:55,800 At the time we did this, we did it at home. 904 00:49:55,900 --> 00:49:56,840 I did it at the office. 905 00:49:57,080 --> 00:50:00,780 By the time I drove home, two people had already booted our machine. 906 00:50:00,780 --> 00:50:01,580 Okay. 907 00:50:01,680 --> 00:50:05,240 And this is now our machine running in the cloud that we don't care about anymore. 908 00:50:06,040 --> 00:50:08,960 Amazon also don't do any outbound firewalling. 909 00:50:09,120 --> 00:50:11,020 People ask about it on the forums. 910 00:50:11,200 --> 00:50:12,580 People actually reply saying, 911 00:50:12,680 --> 00:50:14,640 but why would you want outbound firewalling? 912 00:50:14,940 --> 00:50:15,420 Okay. 913 00:50:15,480 --> 00:50:16,760 So welcome to 1990. 914 00:50:18,900 --> 00:50:22,220 So really quickly, I'm going to touch on MobileMe. 915 00:50:22,440 --> 00:50:27,020 A long time ago, people figured out that MobileMe disclosed usernames. 916 00:50:27,360 --> 00:50:30,020 And basically, if you go to the MobileMe page, 917 00:50:30,020 --> 00:50:34,280 as Bob the Cat, everyone on MobileMe gets a public page. 918 00:50:34,660 --> 00:50:37,020 Bob the Cat gets told, no such page. 919 00:50:37,820 --> 00:50:39,600 Funder Vault gets no such page. 920 00:50:40,220 --> 00:50:42,120 Shell Funder Vault, you get a public page. 921 00:50:42,340 --> 00:50:42,600 Okay. 922 00:50:42,640 --> 00:50:44,660 So we now know Shell exists on the system. 923 00:50:45,020 --> 00:50:49,800 You can now take all of Apple execs and start looking to see who actually uses MobileMe. 924 00:50:50,500 --> 00:50:52,620 You see Steve Jobs has an account, 925 00:50:52,820 --> 00:50:55,900 which should mean you can mail him at stevejobs at me.com. 926 00:50:56,300 --> 00:50:58,720 But it turns out that one's not used. 927 00:50:58,720 --> 00:51:00,780 Notice that if you go to Steve, 928 00:51:01,020 --> 00:51:03,600 you actually see one with a 75 gig option, 929 00:51:03,900 --> 00:51:07,260 and you can't buy a 75 gig option on MobileMe. 930 00:51:08,040 --> 00:51:08,600 Okay. 931 00:51:08,940 --> 00:51:13,740 So account password resets are a really hard problem to solve in the cloud 932 00:51:13,740 --> 00:51:18,300 because essentially someone who doesn't know you has to trust who you are. 933 00:51:18,700 --> 00:51:23,320 And so it turns out MobileMe is quite silly about this, 934 00:51:23,380 --> 00:51:26,700 so I'll go to my last demo quickly. 935 00:51:26,700 --> 00:51:31,280 It turns out that MobileMe is quite silly about this, 936 00:51:31,360 --> 00:51:33,000 and they handle... 937 00:51:33,490 --> 00:51:33,780 Meh. 938 00:51:36,740 --> 00:51:37,960 Let's see if you go to Nick. 939 00:51:38,120 --> 00:51:38,480 Okay. 940 00:51:40,280 --> 00:51:43,600 So if you go to MobileMe, 941 00:51:43,740 --> 00:51:47,440 what you'll find is they have a password reset scheme 942 00:51:47,440 --> 00:51:50,520 that's basically based on secret questions. 943 00:51:51,020 --> 00:51:51,600 Okay. 944 00:51:51,620 --> 00:51:53,460 So once we find out that Nick exists, 945 00:51:53,780 --> 00:51:55,860 you hit his secret questions, 946 00:51:55,860 --> 00:52:00,940 and so initially all it needs is his me at me at me.com address. 947 00:52:01,520 --> 00:52:02,000 Okay. 948 00:52:02,060 --> 00:52:04,200 So you don't even have to know the guy's real address. 949 00:52:04,480 --> 00:52:05,620 You just know his name. 950 00:52:05,720 --> 00:52:09,080 It then also gives you confirmation of his private email address, 951 00:52:09,200 --> 00:52:11,520 so you can confirm that it's the right guy you want to attack. 952 00:52:12,140 --> 00:52:12,620 Okay. 953 00:52:12,700 --> 00:52:14,380 It then gives you secret questions. 954 00:52:14,700 --> 00:52:16,580 The first one is his birth date, 955 00:52:16,760 --> 00:52:20,760 which almost everyone gives away free on Facebook on the Amazon wish list. 956 00:52:21,780 --> 00:52:22,260 Okay. 957 00:52:22,340 --> 00:52:24,360 And then it asks you a secret question, 958 00:52:24,360 --> 00:52:26,320 and those things fall pretty quickly. 959 00:52:27,140 --> 00:52:30,380 So once we've got access to Nick's MobileMe, 960 00:52:30,520 --> 00:52:32,880 the question is what else we can do with it. 961 00:52:32,940 --> 00:52:33,200 Okay. 962 00:52:33,220 --> 00:52:35,460 Because we can reset his password, 963 00:52:36,250 --> 00:52:39,180 but shortly Nick's going to come back and change his password. 964 00:52:39,400 --> 00:52:42,760 So what we wanted was permanent access to Nick's account, 965 00:52:42,960 --> 00:52:47,140 and we found it in the stolen iPhone thing. 966 00:52:47,260 --> 00:52:47,500 Okay. 967 00:52:47,640 --> 00:52:48,520 We've got to go. 968 00:52:48,780 --> 00:52:51,700 Basically what we do is we take an iPhone, 969 00:52:51,900 --> 00:52:53,260 sync it with his account, 970 00:52:54,360 --> 00:53:02,680 except we also go into iTunes and rename my phone script alert high, 971 00:53:02,820 --> 00:53:04,920 so we rename my phone malicious JavaScript. 972 00:53:06,040 --> 00:53:08,160 My phone now syncs with his. 973 00:53:08,660 --> 00:53:11,660 We've got to do some JavaScript to get it right, 974 00:53:11,860 --> 00:53:15,240 but essentially once we've gotten over those hurdles, 975 00:53:15,340 --> 00:53:18,480 every time that Nick goes into his MobileMe page, 976 00:53:19,260 --> 00:53:21,160 as long as my phone's there, 977 00:53:21,160 --> 00:53:23,940 my JavaScript runs in Nick's browser, 978 00:53:24,160 --> 00:53:27,080 and when Nick tries to do a Who Am I, 979 00:53:27,220 --> 00:53:29,080 he essentially runs our script, 980 00:53:29,200 --> 00:53:31,540 and we own his MobileMe forever. 981 00:53:32,500 --> 00:53:33,100 Okay. 982 00:53:41,540 --> 00:53:43,860 So while doing this, 983 00:53:43,960 --> 00:53:47,200 we actually tested and found Steve Wozniak's account, 984 00:53:47,300 --> 00:53:50,540 logged into his mail just to show him how it worked. 985 00:53:51,120 --> 00:53:53,360 Turned out he was really cool about the whole thing. 986 00:53:55,920 --> 00:53:57,200 We've got conclusions, 987 00:53:57,420 --> 00:53:58,880 which you can read off the slides. 988 00:53:59,560 --> 00:54:02,080 We're in the room for questions. 989 00:54:04,400 --> 00:54:06,120 Room 103 for questions. 990 00:54:07,060 --> 00:54:08,180 We want to say again, 991 00:54:08,420 --> 00:54:10,480 Apple were really quick to fix their stuff. 992 00:54:11,000 --> 00:54:12,500 So were AWS. 993 00:54:12,840 --> 00:54:15,160 So we only told AWS about it yesterday. 994 00:54:15,320 --> 00:54:17,500 They've already put in fixes for some of the stuff. 995 00:54:18,460 --> 00:54:20,520 Salesforce.com ready with their fixes. 996 00:54:20,520 --> 00:54:21,480 Other than that, 997 00:54:22,660 --> 00:54:24,480 you can get the stuff from our website. 998 00:54:24,760 --> 00:54:26,180 We should write up more of this stuff. 999 00:54:26,860 --> 00:54:27,660 Thanks for your time.