1 00:00:00,000 --> 00:00:04,800 Okay, so hi. Thank you for coming to my talk, or our talk. This talk is entitled Traps of Gold. 2 00:00:05,420 --> 00:00:10,380 My name is Andrew Wilson. I work for Trustwave Spider Labs. I compete in Capture the Flags with 3 00:00:10,380 --> 00:00:15,640 these guys. I've trained in martial arts for quite some time with these guys, and this is the family 4 00:00:15,640 --> 00:00:19,340 that supports me to make sure that I can be here and give talks like that with you guys. 5 00:00:20,120 --> 00:00:25,240 So this talk is kind of, in popular parlance, what some people would call offensive countermeasures, 6 00:00:25,240 --> 00:00:30,940 right? So offensive countermeasures, as defined by the Paul.com group, includes things like 7 00:00:30,940 --> 00:00:37,340 annoyance, attribution, and then attack, right? So based on where you live inside of this threshold, 8 00:00:38,020 --> 00:00:42,500 it's probably to your best benefit to talk to somebody who is a legal advisor about whether 9 00:00:42,500 --> 00:00:47,400 or not some of the things that we're going to show you guys today are viable inside of the 10 00:00:47,400 --> 00:00:51,580 environment that you work in. Some of it's going to be straightforward that you probably don't need 11 00:00:51,580 --> 00:00:55,060 to get permission for, and then other things you definitely want to seek kind of legal 12 00:00:55,060 --> 00:00:55,220 accountability for. So I'm going to start with you guys. So I'm going to start with you guys. 13 00:00:55,240 --> 00:00:57,980 This is just some proof-of-concept stuff to go from there. 14 00:01:00,980 --> 00:01:06,480 My name is Michael Brooks, and I attack software. These are all the CVE numbers I've accumulated 15 00:01:07,080 --> 00:01:16,600 over the years. That CVE right there, CVE-0049, I just obtained my highest severity metric. 16 00:01:17,280 --> 00:01:22,380 So the Department of Homeland Security issues severity metrics for the most serious vulnerabilities. 17 00:01:22,780 --> 00:01:23,900 This one right here, 18 00:01:24,820 --> 00:01:31,860 received a severity metric of 25.2, which is in the top 500 of all time. I got it apart of the 19 00:01:31,860 --> 00:01:37,060 Mozilla bug bounty program, and I got their highest bounty of $3,000, and this sweet T-shirt. 20 00:01:39,520 --> 00:01:45,220 But that's not why I'm talking about, that's not why I'm here today. The reason why I'm here today 21 00:01:45,220 --> 00:01:53,880 is because we have a problem. Our approach to security is flawed, and one of the problems we have is that we have a problem. 22 00:01:53,900 --> 00:01:57,740 that I found is in a product called PHP IDS. 23 00:01:58,460 --> 00:02:00,380 This is the wrong fucking slide. 24 00:02:02,100 --> 00:02:04,760 Oh, fuck. This is so bad. 25 00:02:05,840 --> 00:02:09,740 Sorry. Okay. PHP IDS is making an incorrect assumption. 26 00:02:10,080 --> 00:02:13,660 And the assumption, PHP IDS is, what's nice about this 27 00:02:13,660 --> 00:02:17,640 intrusion detection system is that 28 00:02:17,640 --> 00:02:21,860 it is embedded into your application. So you can apply it in places that you 29 00:02:21,860 --> 00:02:25,560 wouldn't normally, such as a GoDaddy shared hosting account. It's making an incorrect 30 00:02:25,560 --> 00:02:29,760 assumption in its security system, and that is that attacks can never be 31 00:02:29,760 --> 00:02:30,220 repetitive. 32 00:02:38,900 --> 00:02:41,080 This is the vulnerable piece of code. 33 00:02:43,400 --> 00:02:45,800 Now, so we rely on web application 34 00:02:45,800 --> 00:02:49,660 firewalls. I mean, if you think of a secure website, one of the first things you say is, 35 00:02:49,660 --> 00:02:53,980 well, you have a WAF, right? But the problem is that WAFs can be bypassed. 36 00:02:54,000 --> 00:02:57,620 And a common problem with WAFs is the preprocessor. And what you're looking at 37 00:02:57,620 --> 00:03:00,740 right now is a method that's being called an all input. 38 00:03:01,180 --> 00:03:05,600 And what it's looking at is, it's looking at a regular expression, and this is saying, hey, I want 39 00:03:05,600 --> 00:03:09,540 to match a wildcard, which is the dot. I want to match two of those, at least two of those. 40 00:03:09,880 --> 00:03:13,560 And then I want to match at least 41 00:03:13,560 --> 00:03:17,520 32 more, so a total of 33 repeating. And if it finds 42 00:03:17,520 --> 00:03:21,500 a string that's repeating 33 times, it replaces it with the 43 00:03:21,500 --> 00:03:25,260 letter X. So the significance of this is that 44 00:03:25,260 --> 00:03:28,760 I can hide any payload 45 00:03:29,340 --> 00:03:33,160 from the PHP IDS rule sets by repeating it 33 times. 46 00:03:33,740 --> 00:03:37,140 The effect is that I completely bypassed PHP IDS entirely. 47 00:03:37,540 --> 00:03:40,840 Absolutely every rule set is bypassed. But then I went a step further. 48 00:03:41,120 --> 00:03:45,520 Not only was I able to bypass it, I can intentionally trigger a rule 49 00:03:45,520 --> 00:03:47,260 set in order to populate 50 00:03:47,520 --> 00:03:50,500 its flat file logging system with PHP code. 51 00:03:51,260 --> 00:03:55,200 The significance of this is that once I have PHP code on the local file system, 52 00:03:55,400 --> 00:03:59,420 then I can turn any local file include vulnerability in the 53 00:03:59,420 --> 00:04:03,520 application into remote code execution. So I said a lot. But the point is 54 00:04:03,520 --> 00:04:07,220 that not only did I bypass the web application firewall 55 00:04:07,220 --> 00:04:10,880 entirely, I also made it less secure. 56 00:04:11,780 --> 00:04:15,540 So this is a great quote from Bruce Schneier, complexity is the worst 57 00:04:15,540 --> 00:04:19,520 enemy of security. So if you're able to add complexity to a 58 00:04:19,520 --> 00:04:22,680 system and actually make it more secure, well that's quite a hack. 59 00:04:22,940 --> 00:04:24,260 That is not easy. 60 00:04:28,880 --> 00:04:31,440 And here, let me demo it for you. 61 00:04:47,060 --> 00:04:49,640 Now, that wasn't the only thing I'm looking at. 62 00:04:50,080 --> 00:04:53,960 Today we're seeing a new trend. And that is we're starting to see 63 00:04:53,960 --> 00:04:57,480 XSS filters in web browsers. Internet Explorer was the first to 64 00:04:57,480 --> 00:05:01,260 introduce this, but other browsers are following suit. In Firefox, 65 00:05:01,520 --> 00:05:05,300 there's the NoScript plugin, which has an anti-XSS filter. And also 66 00:05:05,300 --> 00:05:09,440 within Chrome is also beta testing their own XSS filter. 67 00:05:09,740 --> 00:05:13,440 It's safe to say that soon all web browsers, all major web browsers 68 00:05:13,440 --> 00:05:17,000 will have XSS filters. So the era of very simple 69 00:05:17,000 --> 00:05:20,500 XSS exploitation is starting to go away. But instead, 70 00:05:21,980 --> 00:05:24,740 really these security systems, these 71 00:05:25,240 --> 00:05:29,240 general purpose security systems, it's not just web application firewalls or XSS filters 72 00:05:29,240 --> 00:05:33,060 and browsers, but also ASLR. These general purpose security systems 73 00:05:33,060 --> 00:05:37,260 create this kind of water balloon effect. The more they try 74 00:05:37,260 --> 00:05:41,240 and cramp down on the application, the vulnerabilities that are present 75 00:05:41,240 --> 00:05:44,800 start bulging out in new and interesting ways. And although 76 00:05:48,740 --> 00:05:50,040 Internet Explorer is loading. 77 00:05:50,500 --> 00:05:51,540 It takes a while. 78 00:05:52,560 --> 00:05:55,660 We were thinking about putting some whole music in here for you guys. 79 00:05:58,500 --> 00:06:00,560 Anyway, it turns out that 80 00:06:00,560 --> 00:06:04,900 a bit of background. On the CD, 81 00:06:05,140 --> 00:06:08,660 I go into great detail about bypassing PHP IDS in one of my papers. 82 00:06:08,660 --> 00:06:12,340 I highly recommend reading it. I go over a lot of my attack 83 00:06:12,340 --> 00:06:16,480 methodology. But after I submitted 84 00:06:16,480 --> 00:06:20,480 the paper to PHP IDS, the developers were ecstatic. They were really happy about it. 85 00:06:20,580 --> 00:06:24,360 And I'm actually now a member of their development team. I submitted 86 00:06:24,360 --> 00:06:27,140 a similar paper to Microsoft, Internet Explorer. 87 00:06:27,920 --> 00:06:28,540 And... 88 00:06:37,280 --> 00:06:40,140 So I submitted a similar paper to Microsoft, right? 89 00:06:41,060 --> 00:06:44,800 Basically it's this. I showed that... 90 00:06:49,080 --> 00:06:52,900 So I found a problem with the way that 91 00:06:52,900 --> 00:06:57,080 Internet Explorer was handling UTF-7 characters. So it turns out 92 00:06:57,140 --> 00:07:00,740 how this XSS filter is working is that it's looking at outgoing requests. 93 00:07:01,020 --> 00:07:04,840 And it's looking specifically for brackets, greater than or less than symbols, and 94 00:07:04,840 --> 00:07:08,420 quote marks. If you can create a payload that doesn't contain any of these 95 00:07:09,040 --> 00:07:11,600 attributes, then it's possible to execute JavaScript. 96 00:07:13,900 --> 00:07:17,100 So I found a way. It turns out you can use 97 00:07:17,100 --> 00:07:21,120 UTF-7 encoding. Now UTF-7 has a history 98 00:07:21,120 --> 00:07:24,060 where it's only for SMTP. 99 00:07:24,480 --> 00:07:26,740 It's not designed for HTTP at all. 100 00:07:27,580 --> 00:07:30,840 In fact, no browser except for Internet Explorer supports UTF-7 101 00:07:30,840 --> 00:07:34,980 for web pages. But that's beside the point. I was able to... 102 00:07:36,400 --> 00:07:38,940 The real problem here is that their XSS 103 00:07:38,940 --> 00:07:43,000 filter is not accounting for this. But okay, hold on. I said that no... 104 00:07:43,000 --> 00:07:47,020 UTF-7 is not for HTTP, right? Well, 105 00:07:47,860 --> 00:07:50,640 why... So that means no website's going to be running it. 106 00:07:51,240 --> 00:07:54,860 Except there's a way. You can change the content type 107 00:07:54,860 --> 00:07:56,720 of a web app... of a... 108 00:07:57,140 --> 00:08:01,080 of a page using a CRLF injection, or HTTP 109 00:08:01,080 --> 00:08:03,800 response splitting. And... bam. 110 00:08:06,000 --> 00:08:08,080 And it allows you to get an alert box. 111 00:08:09,140 --> 00:08:13,040 Here, hold up. Oh, my God. This is so fucked. 112 00:08:14,880 --> 00:08:15,400 The... 113 00:08:17,540 --> 00:08:18,440 Oh, my God. 114 00:08:20,420 --> 00:08:21,440 Oh, my God. 115 00:08:25,040 --> 00:08:27,860 Oh, my God. 116 00:08:27,940 --> 00:08:29,380 The computer just crashed. 117 00:08:30,320 --> 00:08:32,060 Sorry. Technical difficulties. 118 00:08:35,900 --> 00:08:37,100 Yeah. Memory. 119 00:08:37,380 --> 00:08:41,240 All right. I apologize. I was going to show you a great masterpiece. 120 00:08:41,560 --> 00:08:44,500 And that is that I was going to bypass both 121 00:08:45,220 --> 00:08:49,100 PHP IDS's built-in ruleset for XSS and Internet Explorer's 122 00:08:49,100 --> 00:08:52,940 ruleset for XSS in the exact same attack. That it is possible 123 00:08:52,940 --> 00:08:56,460 to bypass both filters on the browser and the server. 124 00:08:57,160 --> 00:09:00,800 And be able to... be able to execute 125 00:09:00,800 --> 00:09:04,680 code ultimately. So it doesn't matter. It doesn't matter that we're 126 00:09:04,680 --> 00:09:08,380 adding all of these new filters if really the fundamental problem remains. 127 00:09:08,660 --> 00:09:12,540 And that they can be bypassed. They can be fooled. So we need another approach. 128 00:09:14,720 --> 00:09:16,740 Screw slides. We could do it from memory. 129 00:09:16,740 --> 00:09:20,320 Okay. So why talk about all of this, right? What's the point of 130 00:09:20,320 --> 00:09:24,560 explaining, you know, really a bypass to PHP IDS, a bypass to Internet Explorer 131 00:09:24,560 --> 00:09:28,380 is that these are supposed to be like defensive products that we're going to be relying 132 00:09:28,380 --> 00:09:32,500 on for the security of applications. And kind of as Michael was pointing out, this is like 133 00:09:32,500 --> 00:09:36,360 this system is stuff that we're going to be relying on more and more as we get into the future, right? 134 00:09:36,400 --> 00:09:40,220 So you kind of saw a slide there for just two seconds before we crashed about 135 00:09:40,620 --> 00:09:44,220 frustration, right? Is anybody here earnestly in the room think like 136 00:09:44,220 --> 00:09:48,060 the secure development approach is working, right? We see the news every 137 00:09:48,060 --> 00:09:52,160 day. And some major company, some data breach, not just a small one, 138 00:09:52,240 --> 00:09:56,020 but a really large one comes into play and it hits people in pretty negative 139 00:09:56,020 --> 00:09:59,900 impactual ways, right? So everybody's kind of getting hit with that. 140 00:10:00,320 --> 00:10:04,060 And we feel that the ultimate reason for that is kind of our approach 141 00:10:04,060 --> 00:10:08,340 to dealing with security has been a quality issue, right? It's a bug. 142 00:10:08,480 --> 00:10:12,280 When you look at books that are in popular use today, stuff like 143 00:10:12,280 --> 00:10:16,120 the secure development life cycle for Microsoft and then secure code and some of the rugged 144 00:10:16,120 --> 00:10:20,040 movement stuff, we treat security issues literally as if they were 145 00:10:20,040 --> 00:10:24,220 a quality concern and that's how we approach it, right? So we took strategies 146 00:10:24,220 --> 00:10:28,140 to mitigate security issues like it was a bug, like it was a quality 147 00:10:28,140 --> 00:10:32,380 concern and that starts with patch management, right? So patch management takes an approach 148 00:10:32,380 --> 00:10:36,320 that says you find a bug, it's in production, we've got to fix it. So you write new code 149 00:10:36,320 --> 00:10:38,860 that fixes the abuse scenario 150 00:10:38,860 --> 00:10:42,620 so that way you can actually go ahead and 151 00:10:42,620 --> 00:10:46,760 make it safe, right? But that tends to come with some baggage, right? 152 00:10:46,800 --> 00:10:50,900 The first problem is that if you have a bug inside of a production system, 153 00:10:51,240 --> 00:10:54,800 it's available for people to exploit it. And if it's a known exploit, 154 00:10:55,480 --> 00:10:58,340 you run this patch window life cycle, right, where 155 00:10:58,840 --> 00:11:02,740 Microsoft puts out a patch on patch Tuesday, it's reverse engineered on Wednesday, and then 156 00:11:02,740 --> 00:11:06,900 you have a time between that patch, that release, where anybody who hasn't 157 00:11:06,900 --> 00:11:08,840 updated on the availability of the release, 158 00:11:08,860 --> 00:11:12,700 is still incredibly vulnerable, right? So there's definitely 159 00:11:12,700 --> 00:11:16,920 some issues with that approach. And then you run into a secondary issue where the patch itself 160 00:11:16,920 --> 00:11:20,840 may not necessarily be something that actually fixes the issue. 161 00:11:20,940 --> 00:11:24,840 It might be a temporary fix or it might be... There's also another problem, like 162 00:11:24,840 --> 00:11:28,880 really the problems with IE's XSS filter are trivial to fix. 163 00:11:28,980 --> 00:11:32,680 It would take an afternoon. But they didn't even recognize it was a vulnerability. 164 00:11:33,300 --> 00:11:35,940 They're not, and they won't even fix it. It's 165 00:11:35,940 --> 00:11:38,060 a constant problem. Like back in 166 00:11:38,960 --> 00:11:42,380 2004, there was an interesting vulnerability that was released in IE. 167 00:11:42,460 --> 00:11:44,480 It was called the IE drag and drop vulnerability. 168 00:11:46,040 --> 00:11:49,760 In the attack, the victim 169 00:11:50,480 --> 00:11:54,460 picks up a carrot and drags it, just as if it was a game. 170 00:11:54,920 --> 00:11:58,880 The only problem is that that's not a carrot. It's actually an executable 171 00:11:58,880 --> 00:12:01,920 on a remote share, and you're dragging it into your startup folder. 172 00:12:02,240 --> 00:12:05,880 You could get remote shell on Internet Explorer for two years! 173 00:12:05,880 --> 00:12:09,820 And Microsoft said, that's not a vulnerability? Like, you've got 174 00:12:09,820 --> 00:12:13,240 to be kidding me. Ultimately, they did patch it, and even... 175 00:12:13,240 --> 00:12:17,900 So four years after this attack was... It wasn't until four years later that the term 176 00:12:17,900 --> 00:12:21,780 click jacking was even coined. But it's recognizing 177 00:12:21,780 --> 00:12:24,740 that there's a problem is an important step. 178 00:12:26,740 --> 00:12:29,560 So patch management obviously was not ideal, 179 00:12:29,660 --> 00:12:33,460 and everybody kind of knows that, right? Anybody who's done secure regular development 180 00:12:33,460 --> 00:12:37,060 doesn't want bugs in production, right? Because bugs in production is 181 00:12:37,060 --> 00:12:40,380 no bueno. The problem with that is 182 00:12:41,120 --> 00:12:45,080 that we move forward. We move forward to... Here, let's just play it from here. 183 00:12:48,680 --> 00:12:50,260 So patch management... 184 00:12:53,900 --> 00:12:55,900 Oh, and the computer crashed again. 185 00:12:56,500 --> 00:13:00,740 So I guess we're going to do this whole thing from memory. That's fine. No big deal. 186 00:13:01,140 --> 00:13:02,160 It is a Mac. 187 00:13:04,500 --> 00:13:07,400 Apparently, it has not been watching enough TV. That's my theory. 188 00:13:07,880 --> 00:13:11,680 Okay, so... Screw my laptop. So SDLC, right? 189 00:13:11,740 --> 00:13:15,320 SDLC came out as a measure to say, hey, bugs in production, that's definitely not 190 00:13:15,320 --> 00:13:19,740 the way that you want to go about doing this, right? Because inside of that system... 191 00:13:19,740 --> 00:13:23,080 Was that...? Yeah, I'll try boot up again. Inside of that system, 192 00:13:23,240 --> 00:13:26,840 you want to deal with it proactively, right? So you build it into your development lifecycle. 193 00:13:27,200 --> 00:13:31,360 It becomes something that you have to deal with. It becomes an earlier system. 194 00:13:31,360 --> 00:13:34,780 You start defining it. You come up with quality gates. You do threat models. 195 00:13:34,960 --> 00:13:39,200 You work inside of the system and make sure that it works for what you're doing as your 196 00:13:39,200 --> 00:13:43,400 dev cycle. And then at the end of the day, it's sort of a process of refinement, right? 197 00:13:43,460 --> 00:13:46,200 You try to reduce known vulnerabilities inside of the application. 198 00:13:46,880 --> 00:13:51,300 I'm a huge fan of Microsoft's SDLC, right? Despite the fact that it misses stuff, 199 00:13:51,580 --> 00:13:55,260 I think that it's the way that people ought to be taking a look at writing 200 00:13:55,260 --> 00:13:58,700 software, right? It's super mature, 10 years something of experience, 201 00:13:58,700 --> 00:14:02,180 lots of money, lots of manpower, and perhaps even more importantly, 202 00:14:02,360 --> 00:14:06,440 it has executive buy-in to say you can't release insecure software, right? So it's a great 203 00:14:06,440 --> 00:14:10,460 approach, fantastic approach, right? But you still have patch Tuesday, 204 00:14:10,760 --> 00:14:14,020 right? You still have bugs that do get out into the system. 205 00:14:14,240 --> 00:14:18,160 And so we've got to kind of question what advantage does this have 206 00:14:18,160 --> 00:14:22,480 and how tenable is this as an end product for us, right? 207 00:14:22,560 --> 00:14:26,020 So the final thing we throw out there as our 208 00:14:26,020 --> 00:14:30,020 solution to security is more bad software, right? I call 209 00:14:30,020 --> 00:14:33,840 it defects in defense, right? If we put more software like web 210 00:14:33,840 --> 00:14:37,960 application firewalls or we put protections like antivirus or 211 00:14:37,960 --> 00:14:41,980 regular firewalls in front of these things, they're going to stop bad guys from doing bad 212 00:14:41,980 --> 00:14:45,680 things. But kind of as we just shown earlier within the context of 213 00:14:45,680 --> 00:14:50,060 our actual attack component, you can bypass those things. 214 00:14:50,240 --> 00:14:53,720 And so when we rely on stuff like that, that definitely 215 00:14:53,720 --> 00:14:57,360 creates a situation for us that's pretty disadvantageous, right? It's not 216 00:14:57,360 --> 00:15:01,740 ideal. That's how we end up with the TSA, right? 217 00:15:01,820 --> 00:15:05,560 You get groped for free in the airport, which is nice, right? Admittedly, but 218 00:15:05,560 --> 00:15:09,600 it doesn't make you any safer is kind of the question. And what about the 219 00:15:09,600 --> 00:15:13,800 backscatter of security scanners, right? Like we spend tens of millions of dollars 220 00:15:13,800 --> 00:15:17,580 on a security system that can be defeated with pancakes. Like 221 00:15:17,580 --> 00:15:21,480 really? Really? Are we really doing this? And this is at least the second 222 00:15:21,480 --> 00:15:23,700 time that breakfast has been used in an attack. 223 00:15:23,720 --> 00:15:27,700 The first of course being the Captain Crunch Whistle. 224 00:15:28,300 --> 00:15:31,520 So clearly more research needs to be done in the area of breakfast 225 00:15:31,520 --> 00:15:33,860 based exploitation. I'm just putting that out there. 226 00:15:35,920 --> 00:15:39,760 So the question then really, this talk is not about all the stuff that's broken, 227 00:15:39,900 --> 00:15:43,820 right? I want to point out that these are difficulties that we face. It's the reality of writing software. 228 00:15:43,960 --> 00:15:47,660 And it's stuff that we need to continue to do. I think that's just security 229 00:15:47,660 --> 00:15:51,580 hygiene, right? It's the sort of stuff you do. You brush your teeth because you don't want bad breath 230 00:15:51,580 --> 00:15:55,500 and ideally it makes you a better person. Even refinement, right, is good 231 00:15:55,500 --> 00:15:59,580 too. But none of these approaches actually stop you from getting punched in the face 232 00:15:59,580 --> 00:16:03,440 nor do they really prepare you for that, right? Like having clean teeth isn't a defensive 233 00:16:03,440 --> 00:16:07,260 countermeasure in my opinion. And so we really think that the 234 00:16:07,260 --> 00:16:11,440 solution or the answer here is we need to start looking at strategies in which we 235 00:16:11,440 --> 00:16:15,620 can fight back against people, right? We want to kick their ass, right? When I was 236 00:16:15,620 --> 00:16:19,080 working at a company a while ago, I used to tell developers they've got to build their applications 237 00:16:19,080 --> 00:16:22,920 so they can take a punch. I'm going to change my statement. I think you need to build 238 00:16:22,920 --> 00:16:27,080 applications that punch people back, right? I think that needs to be the way we 239 00:16:27,080 --> 00:16:30,840 move down this road. So how do we do that, right? 240 00:16:30,940 --> 00:16:34,780 How do we build in systems for that? And that's we leverage technology 241 00:16:34,780 --> 00:16:39,040 that already exists. PHP IDS being one of those. We use 242 00:16:39,040 --> 00:16:42,620 Honeypot and HoneyNet technologies. And then we write exploits that 243 00:16:42,620 --> 00:16:46,880 are capable of taking advantage of the fact that software that's going to be attempting 244 00:16:46,880 --> 00:16:49,060 to hit you also is vulnerable. 245 00:16:49,080 --> 00:16:53,040 It's all the same things that we talked about before, right? They have bugs. They have weakness. 246 00:16:53,160 --> 00:16:56,100 They have problems. There's this phenomenal 247 00:16:56,740 --> 00:17:01,060 Twitter feed from Richard Baitlick who said something great. He said it's not just 248 00:17:01,060 --> 00:17:04,900 because we have these glass-built homes. It's because there's people 249 00:17:04,900 --> 00:17:09,000 throwing bricks at them, right? And that's what we need to deal with 250 00:17:09,000 --> 00:17:12,940 is the brick throwers. Hacking against our systems and attacking 251 00:17:12,940 --> 00:17:17,060 these things, this is a human problem that manifests itself with 252 00:17:17,060 --> 00:17:17,400 technology. 253 00:17:20,560 --> 00:17:21,000 . 254 00:17:24,660 --> 00:17:25,100 . 255 00:17:27,340 --> 00:17:27,780 . 256 00:17:27,780 --> 00:17:28,000 . 257 00:17:28,000 --> 00:17:28,260 . 258 00:17:28,260 --> 00:17:28,320 . 259 00:17:28,320 --> 00:17:28,480 . 260 00:17:28,480 --> 00:17:28,820 . 261 00:17:28,820 --> 00:17:28,840 . 262 00:17:28,840 --> 00:17:28,860 . 263 00:17:28,860 --> 00:17:28,920 . 264 00:17:39,800 --> 00:17:40,240 . 265 00:17:40,240 --> 00:17:40,260 . 266 00:17:53,820 --> 00:17:54,340 . 267 00:17:58,300 --> 00:17:58,820 . 268 00:17:59,580 --> 00:18:00,100 . 269 00:18:00,100 --> 00:18:00,140 . 270 00:18:00,140 --> 00:18:00,240 . 271 00:18:00,240 --> 00:18:01,200 . 272 00:18:01,200 --> 00:18:01,340 . 273 00:18:01,340 --> 00:18:01,720 . 274 00:18:01,720 --> 00:18:01,760 . 275 00:18:02,440 --> 00:18:02,960 . 276 00:18:02,960 --> 00:18:02,980 . 277 00:18:02,980 --> 00:18:03,420 . 278 00:18:03,420 --> 00:18:03,440 . 279 00:18:03,440 --> 00:18:03,460 . 280 00:18:03,460 --> 00:18:03,800 . 281 00:18:03,800 --> 00:18:04,860 . 282 00:18:04,860 --> 00:18:05,320 . 283 00:18:07,860 --> 00:18:08,540 . 284 00:18:08,540 --> 00:18:08,560 . 285 00:18:13,060 --> 00:18:13,740 . 286 00:18:13,740 --> 00:18:13,760 . 287 00:18:13,760 --> 00:18:14,100 . 288 00:18:14,100 --> 00:18:14,140 . 289 00:18:14,140 --> 00:18:14,160 . 290 00:18:19,440 --> 00:18:20,120 . 291 00:18:20,120 --> 00:18:20,140 . 292 00:18:32,760 --> 00:18:33,440 . 293 00:18:33,440 --> 00:18:34,440 . . 294 00:18:41,360 --> 00:18:42,080 . . 295 00:18:42,080 --> 00:18:42,680 . . 296 00:18:42,680 --> 00:18:43,240 . . . 297 00:18:43,240 --> 00:18:43,840 . . 298 00:18:45,700 --> 00:18:47,140 . . 299 00:18:47,140 --> 00:18:47,300 . . 300 00:18:47,300 --> 00:18:47,400 . . 301 00:18:47,400 --> 00:18:48,080 . . . 302 00:18:48,080 --> 00:18:48,140 . . . 303 00:18:49,220 --> 00:18:52,040 We're about here. That's where you attack them. 304 00:18:52,640 --> 00:18:55,500 When we look at how we're going to do that, we're going to leverage stuff that other people 305 00:18:55,500 --> 00:18:59,220 have done, and that includes IDS systems, honey pots, exploits, and we're going to put 306 00:18:59,220 --> 00:19:04,840 those together in a fashion that we can trap people inside of our systems to create things 307 00:19:04,840 --> 00:19:09,720 like better attribution, shut down their tools so they ignore particular content areas, or 308 00:19:09,720 --> 00:19:12,780 in certain cases just completely shut them down entirely. 309 00:19:12,780 --> 00:19:19,960 A thing about lying, we're worried about China hacking into us, right? We're worried 310 00:19:19,960 --> 00:19:25,020 about them getting a leg up in business, but that's weak. China is being weak. If they 311 00:19:25,020 --> 00:19:31,700 would have to rely on you to break into you to get a leg up, what happens if when they 312 00:19:31,700 --> 00:19:36,120 hack into you, you give them information that you want them to find, that you use that against 313 00:19:36,120 --> 00:19:42,100 them, that they steal a secret that you want them to have? Something to think about. 314 00:19:42,300 --> 00:19:42,760 Right. 315 00:19:42,760 --> 00:19:49,560 If they can social engineer us, why can't we social engineer them? People will say potentially 316 00:19:49,560 --> 00:19:54,720 security hygiene is a way that you are fighting back, too. They might say that. I would classify 317 00:19:55,140 --> 00:20:00,260 that as more of like a war of attrition. When you look at how people fight combat, how they 318 00:20:00,260 --> 00:20:05,560 can compete in combat, there's really two strategies. There's an attrition-based model 319 00:20:05,560 --> 00:20:10,240 and then a maneuverability model, which is kind of a modern-day guerrilla warfare combined 320 00:20:10,240 --> 00:20:11,620 with some other things. 321 00:20:11,620 --> 00:20:15,440 In a war through attrition, the idea is that I'm going to gather as many resources as I 322 00:20:15,440 --> 00:20:20,640 possibly can and kind of who has the most arms wins. If they have four nuclear warheads, 323 00:20:20,760 --> 00:20:24,540 I've got to get ten. Then when they get ten, I've got to come up with a better nuclear 324 00:20:24,540 --> 00:20:29,820 warhead, so then I'm kind of the winner. That approach is expensive because it costs 325 00:20:29,820 --> 00:20:34,440 to build it up. It's expensive because it costs to maintain these things. Then it's 326 00:20:34,440 --> 00:20:38,540 expensive in the sense that if you actually go toe-to-toe with these people, it's pretty 327 00:20:38,540 --> 00:20:41,500 deadly when you actually start talking about it in real tangible terms. 328 00:20:43,160 --> 00:20:47,100 That's not actually how the bad guys are attacking us. They're taking an approach, 329 00:20:47,280 --> 00:20:53,380 whether conscious or unconscious, of maneuverability. It's like our good guys, our defensive line, 330 00:20:53,540 --> 00:20:57,820 wants to create a football team, so we get the very best football players we can find. 331 00:20:57,960 --> 00:21:02,320 We give them the best food. We work out with them in the best equipment. We do the best 332 00:21:02,320 --> 00:21:06,060 training. They're the biggest and the baddest, and they're going to shut down the offensive 333 00:21:06,060 --> 00:21:10,840 line. When they show up to play the game, they're there to win. In this case, the offensive 334 00:21:10,840 --> 00:21:15,380 lines poison their food. They're sleeping with their girlfriends on the side. When they 335 00:21:15,380 --> 00:21:18,600 go to play the game, they've already broken in their house, stole all their money. That's 336 00:21:18,600 --> 00:21:22,780 how the bad guys are attacking. They've set the stage up so that all the things you think 337 00:21:22,780 --> 00:21:27,000 you're doing that are to your advantage end up being to your weakness. They're not going 338 00:21:27,000 --> 00:21:32,160 to play your game because your game is designed so you can win. They play their game, and 339 00:21:32,160 --> 00:21:34,900 they make you play their game as a means to shut you down. 340 00:21:35,500 --> 00:21:40,140 If we look at strategies, I think the people that we want to look to is people who are 341 00:21:40,140 --> 00:21:40,760 actually fighting. 342 00:21:40,840 --> 00:21:45,100 They're fighting in a capacity to do that. In this case, we've based a model off of the 343 00:21:45,100 --> 00:21:49,600 United States Marine Corps. Maneuverability, just out of historical reference, comes from 344 00:21:49,600 --> 00:21:53,640 a gentleman primarily known as John Boyd. I don't know if you're familiar with the 345 00:21:53,640 --> 00:21:58,620 OODA loop, but he's the guy who is behind that, and he's definitely behind maneuverability. 346 00:21:59,760 --> 00:22:04,300 Maneuverability at its core, as doctrine says, we aim to shatter the cohesion of our 347 00:22:04,300 --> 00:22:09,660 opponents so they can't make decisions in a timely manner while we gain strategic advantage 348 00:22:09,660 --> 00:22:13,800 and basically obliterate them. We're going to use their stuff against them. We're going 349 00:22:13,800 --> 00:22:15,220 to stack the deck in our own favor. 350 00:22:16,320 --> 00:22:21,480 This strategy is based off of three major components, right? The first being ambiguity, 351 00:22:21,820 --> 00:22:27,560 the second being deception, and the third ultimately being tempo, right? Ambiguity is 352 00:22:27,560 --> 00:22:32,060 this idea that if there's more than one way to accomplish a task, we should try to find 353 00:22:32,060 --> 00:22:35,380 a route that makes it very unobvious what we're actually doing, right? 354 00:22:35,500 --> 00:22:39,640 If we go ahead and say I have a destination and there's four different ways that I might 355 00:22:39,660 --> 00:22:43,520 possibly get there, from a pure resourcing perspective, if you're trying to provide 356 00:22:43,520 --> 00:22:47,740 intel about how somebody does something, you need four times the resources in order to 357 00:22:47,740 --> 00:22:51,920 monitor each one of the possible ones because presumably you don't know where they're going, 358 00:22:52,080 --> 00:22:56,280 right? That's the value of ambiguity. But that's not how we build apps. We build 359 00:22:56,280 --> 00:23:00,100 our applications like they're billboards, right? We're proud of the fact that we wrote 360 00:23:00,100 --> 00:23:04,780 it in Java or we're proud of the CMS that we built it on or we're proud of all the developers 361 00:23:04,780 --> 00:23:08,880 who were involved. That's why we leave dev comments all over the place, right? And we 362 00:23:08,880 --> 00:23:13,440 make it as if, hey, you know, not only am I going to this destination, but here's how 363 00:23:13,440 --> 00:23:17,900 I'm going to get there, here's who I'm taking along with me, and here's all the gear that 364 00:23:17,900 --> 00:23:21,100 I'm going to be packing with it, right? And so some of the ways we see that are server 365 00:23:21,100 --> 00:23:24,980 banners where we tell people what we're running. Oftentimes you don't need those, right? It's 366 00:23:24,980 --> 00:23:28,620 not of any value to stuff. And when you start measuring that against things like the showdown 367 00:23:28,620 --> 00:23:33,000 project or when people are doing Google dorks, when they find an exploit in a CMS or something 368 00:23:33,000 --> 00:23:36,460 that you might be using, like, those are pretty compelling reasons that you might not 369 00:23:36,460 --> 00:23:38,640 want to actually sit around and tell people that stuff. 370 00:23:38,880 --> 00:23:43,580 Right? File extensions. Your browser doesn't care about file extensions. If you send them 371 00:23:43,580 --> 00:23:47,980 HTML back, for the most part, your browser is fine. So unless you have a use case where 372 00:23:47,980 --> 00:23:51,640 you have, like, different mappings for how the file extension comes back, that's mostly 373 00:23:51,640 --> 00:23:55,980 a server-side processing issue. And in most cases, you can completely disable that and 374 00:23:55,980 --> 00:24:00,680 not say, hey, I've got PHP or, hey, I'm running ASP.net or, hey, I'm running Ruby, right? 375 00:24:00,860 --> 00:24:06,020 Those are things that are unnecessary. And then, finally, default files, right? I was 376 00:24:06,020 --> 00:24:08,100 working on a CMS a couple weeks ago. 377 00:24:08,880 --> 00:24:12,780 And they had some default control examples for developers. And it says, hey, you know, 378 00:24:12,860 --> 00:24:16,260 this is how you write software using our stuff. It's installed by default. And it's 379 00:24:16,260 --> 00:24:19,780 of advantage, right? But the problem is that these control examples 380 00:24:19,780 --> 00:24:24,300 were bound to the top node of the CMS so they could look at every single part of the application 381 00:24:24,300 --> 00:24:29,700 with unauthenticated access. So from a default control example that was left enabled, you 382 00:24:29,700 --> 00:24:34,320 could completely bypass the majority of security in the entire CMS off of a default file, right? 383 00:24:34,400 --> 00:24:38,820 So these are most often unnecessary. And, in fact, these are some of the things 384 00:24:38,880 --> 00:24:44,300 that, when you start looking at things like JoomScan or CMS Explore or any of the tools 385 00:24:44,300 --> 00:24:48,440 that are based around fingerprinting, they're going to be using these tools as a means to 386 00:24:48,440 --> 00:24:52,320 identify how you've built your application, what plug-ins you've got enabled, and how 387 00:24:52,320 --> 00:24:57,220 they might actually go about attacking them. So if knowing's half the battle, you should 388 00:24:57,220 --> 00:25:01,860 shut up, right? That's what this is about. It's not just don't be so obvious about everything 389 00:25:01,860 --> 00:25:04,620 you're doing. And that's kind of the first step, right? 390 00:25:04,700 --> 00:25:08,640 So the next step is deception. And this is where we kind of get into the fun 391 00:25:08,880 --> 00:25:12,340 stuff. Deception's about lying, right? We're going to convince people that we're doing 392 00:25:12,340 --> 00:25:16,340 stuff that we're not, in fact, planning on doing at all, right? Instead of saying, hey, 393 00:25:16,400 --> 00:25:20,140 I'm going to this destination, everybody plans and gets themselves situated to do that, 394 00:25:20,660 --> 00:25:24,160 don't go to that destination, right? Set them up to do it. It's a trap. Or maybe you 395 00:25:24,160 --> 00:25:28,180 set up ways that if you go to that destination, you're going to get ambushed as you get there. 396 00:25:28,680 --> 00:25:32,660 And there's a couple of ways that we might go about doing that. Reduce the things that 397 00:25:32,660 --> 00:25:36,500 they can know. We lie about everything else. And we could do that by increasing the noise. 398 00:25:36,600 --> 00:25:38,080 We can blatantly lie about stuff. 399 00:25:38,080 --> 00:25:43,920 And if I had a computer to show you, I've been able to trigger every single vulnerability 400 00:25:43,920 --> 00:25:49,840 that's identified through major security tools, like NIC2, for instance. I can trigger 54,000 401 00:25:49,840 --> 00:25:55,140 or 5,400 vulnerabilities inside of it. If you scan my site, I could tell you every single 402 00:25:55,140 --> 00:25:59,420 thing is valid, right? So how do you figure out which one of those is valid if you're 403 00:25:59,420 --> 00:26:02,580 trying to scan my system and try to identify components in it? 404 00:26:03,380 --> 00:26:07,400 In PHP IDS, I added a system of triggers. 405 00:26:07,400 --> 00:26:14,420 So when a particular rule set is hit, let's say it's a blind SQL injection test, and they're 406 00:26:14,420 --> 00:26:18,920 trying to get us to sleep for 30 seconds. Well, when I see an incoming request, PHP 407 00:26:18,920 --> 00:26:22,560 IDS flags it, and then I look at it. I'm like, well, how long do they want me to sleep 408 00:26:22,560 --> 00:26:27,560 for? I pull it out with a regular expression and sleep for that period of time. This fools 409 00:26:27,560 --> 00:26:30,060 every scanner. Another thing, what happens if they're trying 410 00:26:30,060 --> 00:26:35,060 to use directory traversal, and they're trying to grab, like, slash ETC PSSWD? Well, we'll 411 00:26:35,060 --> 00:26:36,580 just print out that file. That's fine. 412 00:26:36,580 --> 00:26:41,140 It's a fake. It's not the actual file. The same thing goes for Windows files, like 413 00:26:41,140 --> 00:26:47,400 trying to get win.ini. And the point is that it's easy to fool. These 414 00:26:47,400 --> 00:26:52,120 tools are trusting. They're not planning on someone lying to them, and so they're easy 415 00:26:52,120 --> 00:26:55,440 to manipulate. So I actually have a slide in the one 416 00:26:55,440 --> 00:26:58,380 that doesn't crash where this isn't, like, to pick on NIC2, right? 417 00:26:58,520 --> 00:27:02,500 This NIC2 is just an example of a tool that we use to do this, but we've been able to 418 00:27:02,500 --> 00:27:06,560 actually trigger false positives on just about every major scanner, commercial, or any other 419 00:27:06,580 --> 00:27:11,100 or uncommercial on the industry today. We can lie to them. We can subvert their ability 420 00:27:11,100 --> 00:27:15,520 to make cognizant decisions, because ultimately when it boils down to it is they have this 421 00:27:15,520 --> 00:27:19,280 pseudo-responsibility of being safe, right? They don't want to shut you down, which means 422 00:27:19,280 --> 00:27:21,180 they're not going to exploit stuff that they find. 423 00:27:21,420 --> 00:27:25,160 And if they don't exploit stuff, they're just collecting evidence and saying, hey, it kind 424 00:27:25,160 --> 00:27:28,140 of sort of looks like this. So you might as well lie about the evidence 425 00:27:28,140 --> 00:27:31,900 and make sure that that happens. A secondary issue with this kind of a corollary 426 00:27:31,900 --> 00:27:36,380 is how these things work. Oftentimes they make 427 00:27:36,580 --> 00:27:39,680 developer mistakes. If you put together, like, a scanner or a tool 428 00:27:39,680 --> 00:27:44,100 and return a 404, oftentimes developers use these things as, like, a null check, right? 429 00:27:44,200 --> 00:27:46,740 I hit a web page. If I get a 404, it means there's no content. 430 00:27:46,840 --> 00:27:50,060 So why bother scanning it, right? Well, the problem is that your browser actually 431 00:27:50,060 --> 00:27:52,340 doesn't care about what the status code comes back. 432 00:27:52,520 --> 00:27:56,060 It'll render that content anyways. And so one of the ways you could actually evade 433 00:27:56,060 --> 00:28:01,320 content being discovered is if you take and return 404s for all your 200s, it makes most 434 00:28:01,320 --> 00:28:05,220 scanners disappear by default, and they can't identify stuff inside of it. 435 00:28:05,260 --> 00:28:05,960 It's actually really trippy. 436 00:28:05,960 --> 00:28:11,700 If you're using a popular scanning tool that everybody uses in the industry or for regular 437 00:28:11,700 --> 00:28:16,580 work and you try to spider off the index, it actually makes the entire web page disappear 438 00:28:17,180 --> 00:28:21,540 because as it's finding stuff, it says 404, 404, 404, and so you can't rely on it for 439 00:28:21,540 --> 00:28:25,680 results that don't get included when you try to do other more advanced analysis against 440 00:28:25,680 --> 00:28:30,740 it because as far as the tool is concerned, the content doesn't exist at all, right? 441 00:28:30,980 --> 00:28:35,820 So that's not necessarily going to fool people. That's just a design strategy to say, hey, 442 00:28:35,820 --> 00:28:39,820 these tools are running automation against us, which in and of itself is pretty bad because 443 00:28:39,820 --> 00:28:42,940 if you think of the impervious study that just came out and you are getting scanned 444 00:28:42,940 --> 00:28:47,380 once every two minutes, maybe shutting down the scanner's ability to do that would probably 445 00:28:47,380 --> 00:28:50,600 be to your advantage. So people, right? This is a people problem. 446 00:28:50,940 --> 00:28:55,280 And kind of as Mike was pointing out, some of the lies are a lot better than other things. 447 00:28:55,420 --> 00:28:59,260 When you get into forensics and you're trying to understand what happens inside of an application, 448 00:29:00,260 --> 00:29:03,540 the only way that you're going to be able to really understand it is to start exploiting 449 00:29:03,540 --> 00:29:05,800 it and get information back out. And if you can't understand what's going on inside of an application, the only way that you're going to be able to really understand it is to start exploiting it and get information back out. And if you 450 00:29:05,820 --> 00:29:09,800 can create a scenario where, like he was talking about, you're getting back the files that 451 00:29:09,800 --> 00:29:13,040 you're looking for. You're getting back the blind SQL injection that you're expecting. 452 00:29:13,280 --> 00:29:17,220 Everything is working along the testing route that you've already prepared yourself to do. 453 00:29:17,360 --> 00:29:21,760 Why would you believe that's not valid? Why would you give it up and say, hey, maybe 454 00:29:21,760 --> 00:29:25,640 something's wrong? Personally, I think I'd probably spend a really long time trying to 455 00:29:25,640 --> 00:29:29,800 figure out what I'm doing wrong as opposed to thinking, hey, maybe they're lying to me, 456 00:29:29,860 --> 00:29:35,040 right? But then it can take it a step further. Like, why can't I seed my application with 457 00:29:35,040 --> 00:29:39,920 trip wiring? Why can't I create form fields inside of my app that do absolutely nothing 458 00:29:39,920 --> 00:29:44,520 other than if you tamper this, I know you're tampering with stuff, right? Then you put that 459 00:29:44,520 --> 00:29:48,840 inside of a secondary database that's isolated just like you would a honey pot, and you can 460 00:29:48,840 --> 00:29:52,440 actually let them exploit it. You can let them run the full broad spectrum completely 461 00:29:52,440 --> 00:29:56,660 isolated away from your production environment. But while you're doing this, you're building 462 00:29:56,660 --> 00:30:00,540 attribution. You're building a case against them. You know at this point it's probably 463 00:30:00,540 --> 00:30:04,940 not a scanner anymore, and it's probably somebody exploiting your system. And you actually 464 00:30:04,940 --> 00:30:09,300 have a case that if you want to build this attribution for prosecution later, you've 465 00:30:09,300 --> 00:30:14,140 created better information, better intel about what they're doing against you, right? And 466 00:30:14,140 --> 00:30:19,480 that leads into tempo. Tempo is about initiative. A lot of people think of pace or tempo, they 467 00:30:19,480 --> 00:30:24,340 think speed. And maneuverability does have some concepts based in speed. If I can overwhelm 468 00:30:24,340 --> 00:30:28,880 you by creating and putting forth a greater effort before you can start actively making real 469 00:30:28,880 --> 00:30:34,180 decisions about it, I'm pretty likely to win. If anybody compete in any games like chess, go, 470 00:30:34,940 --> 00:30:38,680 anything like that, boxing, you never win if you play their game, right? You can't win 471 00:30:38,680 --> 00:30:43,260 if you play their game. You have to take initiative and you have to keep it the entire way through. 472 00:30:43,560 --> 00:30:47,660 Which means you can't be relying on reaction. You have to be relying on awareness and then 473 00:30:47,660 --> 00:30:52,140 proper decision making. There was a study that came out a couple of years ago where 474 00:30:52,140 --> 00:30:56,500 they had junior tennis players and then advanced tennis players, and they were measuring reaction 475 00:30:56,500 --> 00:31:00,280 speeds to see who was faster, you know, kind of make some notices between them. And they 476 00:31:00,280 --> 00:31:04,580 found that the difference was actually fairly nominal in the context of overall reaction. 477 00:31:04,940 --> 00:31:11,380 But where the juniors were failing and where the expert players were exceeding is that the junior 478 00:31:11,380 --> 00:31:15,300 player would wait until the ball was hit before they start making decisions about where to go. 479 00:31:15,480 --> 00:31:19,860 Whereas the senior people were doing things like watching where the shoulder was moving or how 480 00:31:19,860 --> 00:31:24,020 their hips were turning and how their arm was coming up. And they were getting intel quicker into 481 00:31:24,020 --> 00:31:28,100 that process so they could make better decisions. And they weren't relying on reaction. They weren't 482 00:31:28,100 --> 00:31:33,600 relying on trying to catch up. They were changing the pace to their own advantage and using that as 483 00:31:33,600 --> 00:31:34,920 a way to decision against people. 484 00:31:34,940 --> 00:31:39,300 So that's something that we need to do that. And if we build a system like we're talking 485 00:31:39,300 --> 00:31:44,360 about where it has IDS systems inside of it that are creating a bunch of false positives, 486 00:31:44,580 --> 00:31:49,160 effectively embedded honeynets, you can create a perceived attack surface that's completely 487 00:31:49,160 --> 00:31:53,760 different than the actual surface of attack inside of your system, right? So as people 488 00:31:53,760 --> 00:31:57,820 are going down this route, you've already gotten visibility into the fact that they're 489 00:31:57,820 --> 00:32:02,420 doing bad things against you. If you feed this into a sim or ideally a project that 490 00:32:02,420 --> 00:32:04,920 lets you create better decisions against it, you're going to be able to make better decisions 491 00:32:04,920 --> 00:32:08,500 against it. You can then use these things to create a scenario where you can decide 492 00:32:08,500 --> 00:32:12,480 how you want to respond, right? You can kick them out of your system. You can shut them 493 00:32:12,480 --> 00:32:19,920 down or you can potentially attack them as we get to it, right? So yeah. That's where 494 00:32:19,920 --> 00:32:23,900 I think the AppSensor project, right, the OWASP AppSensor project actually has a lot 495 00:32:23,900 --> 00:32:28,100 of value with the stuff that Michael Coates is working on is that application has to be 496 00:32:28,100 --> 00:32:32,000 embedded in the context of awareness as to what's going on inside of it, which is why 497 00:32:32,000 --> 00:32:34,900 we chose PHP IDS as our base model for this. Because we're going to be able to do a lot 498 00:32:34,900 --> 00:32:36,860 of things inside of it because it lives inside of the application. 499 00:32:37,780 --> 00:32:41,300 So one thing you can do when you're living inside an application is you can see 500 00:32:41,300 --> 00:32:46,860 how it's reacting. So one thing is for to shut down blind SQL injection tests, we can 501 00:32:46,860 --> 00:32:51,720 sleep. But what about error-based detection, okay? So we could give them fake error messages, 502 00:32:51,860 --> 00:32:55,360 but what if they trigger a real error? Like what happens if they trigger a MySQL error 503 00:32:55,360 --> 00:32:58,980 in our application? Or even worse, like an eval error, like they're trying to evaluate 504 00:32:58,980 --> 00:33:04,320 PHP code. Well, when we get to that level, we can shut down. We know that they've broken 505 00:33:04,900 --> 00:33:08,900 in the application. And we can kill the application, right? A kill bit. And if that kill bit 506 00:33:08,900 --> 00:33:13,980 exists, then do not run. And the point is, is that, yeah, okay. This would turn, this 507 00:33:13,980 --> 00:33:17,120 is now a denial of service attack, right? But it's a hell of a lot better than remote 508 00:33:17,120 --> 00:33:22,600 code execution. You can go back and fix that. So we're not playing the game. We know that 509 00:33:22,600 --> 00:33:28,600 you've gotten too far and we can shut down. So how do we put this all together, right? 510 00:33:28,660 --> 00:33:32,140 That's the real question. And we love it when a plan comes together, of course. 511 00:33:32,500 --> 00:33:36,860 So we talked about misdirection with the 404s. We've talked about shutting down tools, scanners, 512 00:33:37,000 --> 00:33:41,200 completely invalidating the results. And in some cases, as we were hitting scanners, we 513 00:33:41,200 --> 00:33:44,140 can just crash the scanner remotely by accident, right? 514 00:33:44,840 --> 00:33:49,060 At least one or two major scanners that we've hit this with, we've actually been able to 515 00:33:49,060 --> 00:33:54,480 just to stop the scanner from working completely inside of that so we can increase awareness 516 00:33:54,480 --> 00:33:58,280 as to what was going on. But the real question is, can we attack people 517 00:33:58,280 --> 00:34:01,420 with the scanner or through the scanner? And I think, yes, we can. 518 00:34:06,760 --> 00:34:09,960 All right. What you're looking at is a very unpatched 519 00:34:09,960 --> 00:34:16,140 Windows XP VM running Acudetics. Right now, we'll...anyway. 520 00:34:16,860 --> 00:34:18,960 So I want to be careful. 521 00:34:18,960 --> 00:34:22,540 I'm careful here, and I don't definitely want this not on the news to read Oday and Acunetics. 522 00:34:22,720 --> 00:34:26,260 It's actually this attack is not based on Acunetics. This is an attack based on the 523 00:34:26,260 --> 00:34:30,880 fact that Acunetics is many other web scanners on the market. When they're trying to parse 524 00:34:30,880 --> 00:34:35,260 information and you want to do that well, the only real way to do that is to use an 525 00:34:35,260 --> 00:34:38,780 embedded browser or to use the browser that's on the system because you need to execute 526 00:34:38,780 --> 00:34:43,220 JavaScript, you need to execute the HTML in order to get a real clear picture for, like, 527 00:34:43,220 --> 00:34:46,740 for instance, little things like if they have Ajax requests on the page and content comes 528 00:34:46,740 --> 00:34:47,420 back dynamically. 529 00:34:47,420 --> 00:34:52,300 If all you're doing is an HTTP get and then parsing the results back out, because there's 530 00:34:52,300 --> 00:34:55,940 no dynamic execution environment, you'll never see any of that content, right? 531 00:34:56,020 --> 00:35:00,380 So commercial-grade scanners or particularly advanced scanners, good scanners, quite frankly, 532 00:35:00,520 --> 00:35:04,920 they're going to be using this as a mechanism to gather intel about what's going on. 533 00:35:05,160 --> 00:35:06,160 So let's pop this. 534 00:35:08,640 --> 00:35:11,060 So you should attack them exactly in that spot. 535 00:35:12,700 --> 00:35:13,220 Oh. 536 00:35:15,800 --> 00:35:17,020 That kind of pop. 537 00:35:17,420 --> 00:35:17,560 All right. 538 00:35:20,700 --> 00:35:21,220 Okay. 539 00:35:21,300 --> 00:35:23,680 So actually what I was doing was scanning Metasploit. 540 00:35:26,860 --> 00:35:29,940 And now there's a shell. 541 00:35:30,240 --> 00:35:33,980 You notice it popped it in web vulnerability scanner 7. 542 00:35:34,180 --> 00:35:36,200 So it popped just fine. 543 00:35:40,340 --> 00:35:42,480 Now really, so what's happening here? 544 00:35:42,640 --> 00:35:46,400 Like we heard about the Zeus botnet being leaked. 545 00:35:46,400 --> 00:35:48,180 Or the source code for that. 546 00:35:48,320 --> 00:35:51,080 So these black hats have these great tools to attack the web browser. 547 00:35:51,320 --> 00:35:53,940 Well, what about using these tools to defend ourselves? 548 00:35:54,380 --> 00:36:00,960 What about having Zeus installed on your production server with a disallow saying, hey, disallow, 549 00:36:01,140 --> 00:36:02,220 don't go to slash Zeus. 550 00:36:03,340 --> 00:36:04,840 Because if you do, you're going to get owned. 551 00:36:05,280 --> 00:36:08,120 Well, a web vulnerability scanner is going to ignore that. 552 00:36:08,200 --> 00:36:10,160 It's going to see a disallow and it's going to go there purposefully. 553 00:36:10,520 --> 00:36:12,580 And in that case, it would be owned. 554 00:36:14,180 --> 00:36:15,320 Interesting side note. 555 00:36:15,320 --> 00:36:17,080 I've tried a number of vulnerabilities. 556 00:36:17,340 --> 00:36:22,260 Like I tried the anti-animated cursor vulnerability to pop the scanner. 557 00:36:22,420 --> 00:36:24,080 And that was the first thing I tried. 558 00:36:24,200 --> 00:36:24,780 It didn't work. 559 00:36:25,120 --> 00:36:30,660 So one thing to note is that a lot of these scanners, it's not executing the graphical 560 00:36:30,660 --> 00:36:31,280 part of it. 561 00:36:33,760 --> 00:36:38,260 So maybe some of the image-based attacks, like we're seeing some of the new SVG-based 562 00:36:38,260 --> 00:36:40,700 attacks or OpenGL attacks on web browsers. 563 00:36:40,920 --> 00:36:42,960 These are graphics-based. 564 00:36:43,160 --> 00:36:45,300 And if you're running a browser headlock. 565 00:36:46,540 --> 00:36:48,460 It's not going to be executing this complexity. 566 00:36:48,780 --> 00:36:50,180 And that's not really a part of attack. 567 00:36:50,520 --> 00:36:53,720 So maybe it has a smaller attack surface than your average web browser. 568 00:36:53,840 --> 00:36:54,540 But it's still huge. 569 00:36:54,800 --> 00:36:58,700 Like in this attack right here, we're using an ActiveX exploit. 570 00:36:59,000 --> 00:36:59,520 And come on. 571 00:36:59,860 --> 00:37:03,120 ActiveX has been a festering wound in Internet Explorer since the beginning. 572 00:37:05,360 --> 00:37:11,300 And it is a valid avenue of attack against some of these web browsers that rely upon 573 00:37:11,300 --> 00:37:11,640 IE. 574 00:37:13,400 --> 00:37:13,840 Yeah. 575 00:37:13,960 --> 00:37:14,980 So there you go. 576 00:37:14,980 --> 00:37:18,120 We took over somebody's box as they were attempting to scan us. 577 00:37:19,180 --> 00:37:20,860 Can you switch me back? 578 00:37:22,040 --> 00:37:26,060 So you definitely don't want to put this in a place that's going to be blatantly obvious, 579 00:37:26,200 --> 00:37:29,180 publicly accessible, because that creates obviously legal problems. 580 00:37:29,440 --> 00:37:34,660 And kind of as we talked about the system before, I think I'm four. 581 00:37:35,400 --> 00:37:37,100 We talked about the system before. 582 00:37:38,620 --> 00:37:40,680 There's some legal ramifications to this. 583 00:37:40,760 --> 00:37:43,060 And I don't necessarily want to undercut that. 584 00:37:43,160 --> 00:37:43,300 Right? 585 00:37:43,300 --> 00:37:47,620 There's some case evidence that says this might actually be a valid approach under particular 586 00:37:47,620 --> 00:37:48,280 circumstances. 587 00:37:48,520 --> 00:37:53,780 In particular, U.S. versus Heckenkamp, which the network administrator took over the box 588 00:37:53,780 --> 00:37:57,740 of a person who was in their mail server, saying that this was an emergency, I had to 589 00:37:57,740 --> 00:37:59,960 respond against this, this was the best course of avenue. 590 00:38:00,240 --> 00:38:04,520 They used the information to get attribution to identify that this was the gentleman who 591 00:38:04,520 --> 00:38:05,680 had broken into the machine. 592 00:38:05,980 --> 00:38:09,960 And that evidence was applicable in court, and the court accepted it, and he went to 593 00:38:09,960 --> 00:38:10,160 jail. 594 00:38:11,520 --> 00:38:14,760 Because he signed a EULA that said, I'm not going to do that. 595 00:38:14,940 --> 00:38:18,560 And within the course of action, the network administrator is tasked with protecting his 596 00:38:18,560 --> 00:38:20,340 systems in the best way that he possibly can. 597 00:38:20,480 --> 00:38:24,040 And the best way he could possibly do it, in this case, was to take it over. 598 00:38:24,260 --> 00:38:27,920 That doesn't mean you get free rights to sit around and leave, you know, vulnerable browser 599 00:38:27,920 --> 00:38:31,900 stuff inside of it that you can hit anybody, because accidental attacks probably would 600 00:38:31,900 --> 00:38:32,520 be bad, too. 601 00:38:32,620 --> 00:38:37,500 But if you put something like this into a web server that's hosted on, you know, like 602 00:38:37,500 --> 00:38:39,480 your mail server or on a print server or something. 603 00:38:39,480 --> 00:38:42,600 Something that people really ought not to be in, that's not public, that maybe is an 604 00:38:42,600 --> 00:38:47,120 internal process, now you have a better case where you might be able to come against that. 605 00:38:47,460 --> 00:38:49,680 But again, consult your lawyer, right? 606 00:38:50,220 --> 00:38:55,380 So kind of as a recap, you need to stop acting like security is a broken egg that you can 607 00:38:55,380 --> 00:38:57,340 put Band-Aids over and think of it. 608 00:38:57,420 --> 00:38:58,620 You can't think of it this way. 609 00:38:58,660 --> 00:39:00,440 This is not a tenable position, right? 610 00:39:00,620 --> 00:39:03,360 You need to start thinking, like, I'm going to kick your ass, right? 611 00:39:04,200 --> 00:39:07,860 You need to think like this guy, because I'm not a rooster, but I'm actually a little afraid 612 00:39:07,860 --> 00:39:08,340 of him, too. 613 00:39:08,340 --> 00:39:09,940 This isn't somebody you want to mess with. 614 00:39:10,060 --> 00:39:14,140 This is somebody who looks like, if you start playing games with me, I'm going to take you 615 00:39:14,140 --> 00:39:14,360 down. 616 00:39:14,540 --> 00:39:19,140 And that's how we should be treating security as we're looking towards it and stop thinking 617 00:39:19,140 --> 00:39:23,380 about purely in terms of vulnerabilities and think, how can we shut you down? 618 00:39:23,460 --> 00:39:24,420 How can we take that back? 619 00:39:24,480 --> 00:39:27,260 And how can we regain our pride, right? 620 00:39:27,360 --> 00:39:30,280 And that means we should fight back, right? 621 00:39:30,500 --> 00:39:31,420 That's what we need to do. 622 00:39:32,820 --> 00:39:34,500 So that's it for us. 623 00:39:34,660 --> 00:39:35,460 Any questions? 624 00:39:35,820 --> 00:39:36,040 Thank you. 625 00:39:38,460 --> 00:39:40,440 Thank you.