1 00:00:00,000 --> 00:00:04,160 I'm Ben Feinstein. I work with SecureWorks in Atlanta, Georgia on the Counter Threat Unit. 2 00:00:04,320 --> 00:00:08,800 I'm also happily affiliated with DC404, Atlanta's local DC group. 3 00:00:08,980 --> 00:00:11,000 We've got a big crowd out here this year. 4 00:00:11,400 --> 00:00:14,400 And today I'm going to be talking about web application firewalls, 5 00:00:14,400 --> 00:00:17,200 how they relate to PCI compliance, 6 00:00:17,600 --> 00:00:21,680 and also focusing a little bit on the mod security open source web application firewall. 7 00:00:23,620 --> 00:00:26,340 So just to cover a little bit what we're going to be going over, 8 00:00:26,480 --> 00:00:28,620 WAFs, web app firewalls, 9 00:00:28,620 --> 00:00:32,440 some of you may be familiar with PCI data security standard. 10 00:00:32,680 --> 00:00:36,740 This involves payment transaction processors here in the United States typically. 11 00:00:37,280 --> 00:00:43,500 And there's a particular requirement in the DSS or data security standard known as requirement 6.6. 12 00:00:43,780 --> 00:00:47,900 We'll cover that in a little more detail about why, if you're in the security industry, 13 00:00:48,240 --> 00:00:54,500 either an attacker, a defender, hacker, you should care about why PCI is affecting all this. 14 00:00:55,180 --> 00:00:56,840 We're going to review mod security. 15 00:00:57,200 --> 00:00:58,600 We're going to go over some key concepts. 16 00:00:58,620 --> 00:01:00,560 We're going to go over some key concepts of the mod security web app firewall. 17 00:01:01,180 --> 00:01:05,760 We're going to cover some of the core rules that they release with their web app firewall. 18 00:01:06,440 --> 00:01:08,340 And we're going to do a few live demos. 19 00:01:08,960 --> 00:01:11,440 Unfortunately, the content injection demo is not going to happen today. 20 00:01:11,620 --> 00:01:16,160 But we will be demoing reverse proxying and embedded deployments of mod security. 21 00:01:16,500 --> 00:01:18,420 And we'll demo it blocking a few attacks as well. 22 00:01:20,480 --> 00:01:22,740 So some basics about web app firewalls. 23 00:01:23,560 --> 00:01:27,660 Basically, it's essentially a firewall up at the web application layer. 24 00:01:27,840 --> 00:01:28,600 So it's a firewall up at the web application layer. 25 00:01:28,620 --> 00:01:31,320 It understands HTTP, HTTPS. 26 00:01:31,440 --> 00:01:33,940 It understands all the web services protocols. 27 00:01:34,480 --> 00:01:40,280 Typically, it can do some XML processing, maybe XPath queries against XML. 28 00:01:40,760 --> 00:01:47,960 Typically, these products or solutions will understand SOAP and XML RPC kind of protocols. 29 00:01:48,460 --> 00:01:52,900 A lot of these products will perform some sort of normalization or de-obfuscation of the request 30 00:01:52,900 --> 00:01:55,480 before they inspect it for malicious content. 31 00:01:56,720 --> 00:01:58,600 Typically, these solutions will detect it. 32 00:01:58,600 --> 00:01:59,000 They will detect attacks. 33 00:02:00,460 --> 00:02:02,880 They have passive and active modes, typically. 34 00:02:03,160 --> 00:02:06,000 So an active mode is going to actually block the attack. 35 00:02:06,240 --> 00:02:10,760 A passive mode is going to generate an alert for an administrator to deal with. 36 00:02:11,520 --> 00:02:17,920 And these products rewrite and modify the request as they go through them before it ever hits your web application. 37 00:02:18,260 --> 00:02:22,920 So that's where you get the security from in that it's going to basically defang these requests, 38 00:02:23,140 --> 00:02:28,520 either block them, normalize them, decode them somehow, and then pass them along to your web application. 39 00:02:30,100 --> 00:02:36,520 So mod security is, I believe, probably the most widely deployed web app firewall right now. 40 00:02:37,000 --> 00:02:40,680 It's released under the GPLv2 in a community edition. 41 00:02:41,180 --> 00:02:43,180 There's also a commercial license. 42 00:02:43,880 --> 00:02:49,600 Ivan Ristich and some of his colleagues created this, and it's been commercialized by Breach Security. 43 00:02:49,960 --> 00:02:57,180 They have a line of commercial appliances, management tools, and reporting infrastructure around their web application firewalls. 44 00:02:57,240 --> 00:02:58,400 The core rules. 45 00:02:58,400 --> 00:03:04,420 They have a rule set, which is really mod security doesn't do anything without these core rules, or without adding rules to it. 46 00:03:04,580 --> 00:03:08,860 So the core rules are released under GPLv2 on the modsecurity.org website. 47 00:03:09,620 --> 00:03:14,680 And also the commercial Breach customers get a, I believe they get a commercial rule feed from Breach 48 00:03:14,680 --> 00:03:19,320 that has some additional protections that are not available in the GPL core rules. 49 00:03:21,000 --> 00:03:22,560 So payment card industry. 50 00:03:23,540 --> 00:03:27,640 How many of y'all deal with PCI and payment card industry issues? 51 00:03:28,420 --> 00:03:30,040 So pretty good number of hands. 52 00:03:30,840 --> 00:03:34,560 I'm going to apologize for everybody else if you don't care, you don't want to know about it. 53 00:03:34,760 --> 00:03:39,320 But PCI is important because it's really driving the adoption of web app firewalls 54 00:03:39,320 --> 00:03:42,320 and the adoption of a lot of technical controls in the enterprise. 55 00:03:43,020 --> 00:03:47,880 So pen testers, which are now known as QSAs, and we'll define that term. 56 00:03:48,860 --> 00:03:52,100 Basically, if you're a pen tester, PCI is going to be driving your business. 57 00:03:52,220 --> 00:03:55,260 It's going to be generating a lot of engagements for you 58 00:03:55,260 --> 00:03:58,380 because these companies now have this new regulatory compliance that they have. 59 00:03:59,580 --> 00:04:03,800 So as a pen tester, you probably need to become familiar with web app firewalls. 60 00:04:04,160 --> 00:04:08,700 How to detect them, how to fingerprint them, how to subvert them. 61 00:04:09,320 --> 00:04:14,140 There's a talk I'm going to plug towards the end of this talk that's happening, I think, later this afternoon 62 00:04:14,140 --> 00:04:17,980 that's going to cover web app firewalls from an attacker's perspective. 63 00:04:18,940 --> 00:04:22,880 So this is kind of a little more of a defender's perspective here on web app firewalls. 64 00:04:23,440 --> 00:04:25,680 So if you're an IT security organization, 65 00:04:26,280 --> 00:04:28,360 you're going to be deploying web app firewalls. 66 00:04:28,380 --> 00:04:29,500 You're going to be deploying web app firewalls because of PCI. 67 00:04:30,800 --> 00:04:33,400 And also, you know, the black hats out there, 68 00:04:33,540 --> 00:04:35,780 you're going to be subverting these things for fun and profit. 69 00:04:37,200 --> 00:04:39,940 So some basic terminology around PCI. 70 00:04:40,060 --> 00:04:42,560 There's all sorts of acronyms they've defined around this. 71 00:04:42,760 --> 00:04:47,720 So you have the PCI Security Standards Council, also known as just PCI for short. 72 00:04:47,820 --> 00:04:53,420 And that's an organization of the major merchant banks, credit card issuing organizations, 73 00:04:54,000 --> 00:04:56,360 you know, Visa, MasterCard, those kind of folks. 74 00:04:56,500 --> 00:04:58,260 And they've gotten together in a consortium. 75 00:04:58,380 --> 00:05:02,560 And they've tried to define the PCI Data Security Standard, PCI DSS. 76 00:05:02,780 --> 00:05:09,520 And this is a set of standards that people that handle payment card data have to comply with. 77 00:05:10,140 --> 00:05:13,880 So there's some other PCI standards that we're not really going to be talking about today. 78 00:05:14,560 --> 00:05:17,100 There's the PIN Entry Device, PEDS standard. 79 00:05:17,300 --> 00:05:24,000 And that applies to, like, typically like an ATM machine or a POS system, 80 00:05:24,220 --> 00:05:26,400 you know, where you swipe and enter a PIN. 81 00:05:26,820 --> 00:05:28,240 So there's standards around that. 82 00:05:28,380 --> 00:05:31,380 There's also standards around payment application data. 83 00:05:31,600 --> 00:05:33,760 I'm not going to really focus on those at all. 84 00:05:34,740 --> 00:05:35,560 So a QSA. 85 00:05:35,760 --> 00:05:39,280 A QSA is a Qualified Security Assessor. 86 00:05:39,500 --> 00:05:45,400 Now, you have to become certified by the PCI Standards Council to become a QSA. 87 00:05:45,820 --> 00:05:49,100 And there's also approved scanning vendors, ASVs. 88 00:05:49,120 --> 00:05:53,260 And these are organizations that have been approved to provide web application scanning 89 00:05:53,260 --> 00:05:57,520 to detect these vulnerabilities that are covered under the PCI DSS. 90 00:05:58,380 --> 00:06:00,680 So an example of an ASV would be, like, Qualys. 91 00:06:00,800 --> 00:06:02,420 And I think, anybody from Qualys here? 92 00:06:03,180 --> 00:06:03,820 All right. 93 00:06:03,920 --> 00:06:04,860 No, they won't admit it. 94 00:06:07,920 --> 00:06:10,400 So PCI Data Security Standard V1.1. 95 00:06:10,480 --> 00:06:12,760 This is the standard that's out right now. 96 00:06:12,820 --> 00:06:13,580 It's the current version. 97 00:06:14,360 --> 00:06:18,820 So it has some very basic requirements, very high-level requirements. 98 00:06:19,480 --> 00:06:21,840 Build and maintain a secure network. 99 00:06:23,080 --> 00:06:24,420 Okay, how do we do that? 100 00:06:25,180 --> 00:06:26,520 Protect cardholder data. 101 00:06:27,100 --> 00:06:28,360 Maintain a vulnerability management. 102 00:06:29,460 --> 00:06:31,080 Implement strong access controls. 103 00:06:31,420 --> 00:06:32,860 Monitor and test your networks. 104 00:06:33,080 --> 00:06:34,840 Have information security policy. 105 00:06:35,080 --> 00:06:36,260 These are the basics, okay? 106 00:06:36,420 --> 00:06:40,720 And under these basic areas, they have a whole wide range of requirements. 107 00:06:43,040 --> 00:06:46,200 So we're going to really focus in on requirement number six. 108 00:06:47,380 --> 00:06:53,620 Requirement number six tells people that they need to develop and maintain secure systems and applications. 109 00:06:55,140 --> 00:06:55,740 Okay. 110 00:06:56,260 --> 00:06:58,340 So 6.6 gets a little bit complicated. 111 00:06:58,360 --> 00:06:59,120 It's a little bit more specific. 112 00:06:59,300 --> 00:07:00,920 But this is still a pretty high-level standard. 113 00:07:01,940 --> 00:07:08,240 So vendors need to ensure that all their applications are protected against known attacks. 114 00:07:08,600 --> 00:07:12,340 So they're not talking about zero days or anything, just known attack vectors. 115 00:07:12,740 --> 00:07:17,340 And they give organizations a choice of how to comply with this. 116 00:07:17,600 --> 00:07:19,300 You could either do code review. 117 00:07:19,860 --> 00:07:21,940 And that could be manual code review. 118 00:07:22,120 --> 00:07:23,960 It could be automated code review. 119 00:07:24,460 --> 00:07:27,960 And there's not a whole lot of clarity around that. 120 00:07:29,060 --> 00:07:30,260 It's just what they mean by that. 121 00:07:30,760 --> 00:07:35,860 And also, you can install a web application firewall in front of your web-facing applications. 122 00:07:36,400 --> 00:07:39,720 So the PCI Council has kind of set this up as an either-or. 123 00:07:39,940 --> 00:07:41,040 You can do code reviews. 124 00:07:41,580 --> 00:07:43,940 Or you can do application firewalls. 125 00:07:43,960 --> 00:07:45,180 If you want to do both, great. 126 00:07:45,280 --> 00:07:45,920 But you don't need to. 127 00:07:46,980 --> 00:07:53,680 So on June 30th of this year, requirement 6.6 became mandatory. 128 00:07:54,600 --> 00:07:56,480 Before, it was a nice-to-have. 129 00:07:56,700 --> 00:07:57,680 So as of now. 130 00:07:57,960 --> 00:07:59,940 People need to be meeting this requirement. 131 00:08:02,080 --> 00:08:06,700 So a little bit of off-topic on what I think PCI all means. 132 00:08:07,380 --> 00:08:10,860 I got a minor in economics with my CS degree. 133 00:08:10,960 --> 00:08:14,180 So I kind of look at things and analyze things from an economic perspective. 134 00:08:14,620 --> 00:08:19,520 So I see PCI as really a way to reassign legal liability amongst the parties. 135 00:08:21,000 --> 00:08:22,520 And I'm not a lawyer. 136 00:08:22,740 --> 00:08:27,120 If there is a lawyer that understands the PCI stuff well, I'd love to talk to him. 137 00:08:27,160 --> 00:08:27,940 But my understanding is that PCI is a legal liability. 138 00:08:27,960 --> 00:08:32,780 And my understanding is that the QSA assumes potentially unlimited legal liability. 139 00:08:33,180 --> 00:08:34,520 I don't want to spread FUD. 140 00:08:34,840 --> 00:08:41,600 But there's legal liability assigned to the QSA if they were to certify organizations compliant when they shouldn't have. 141 00:08:42,040 --> 00:08:42,180 Okay? 142 00:08:43,920 --> 00:08:48,080 Also, this is really a rationale for bigger IT security budgets. 143 00:08:49,000 --> 00:08:51,840 It's somewhat dictating how you're going to have to spend the money. 144 00:08:51,980 --> 00:08:54,920 But it is a rationale for bigger IT security budgets. 145 00:08:56,100 --> 00:09:04,640 Another interesting way to look at it is, could this be really creating a race to the bottom for applications, approved scanning vendors? 146 00:09:04,920 --> 00:09:06,620 And I'll get into that in the next slide here. 147 00:09:06,800 --> 00:09:08,700 So what do I mean by a race to the bottom? 148 00:09:09,320 --> 00:09:11,500 So let's look at this from an economic perspective. 149 00:09:13,140 --> 00:09:20,840 If I'm evaluating, if I have to become PCI compliant, and I've decided to go with an approved scanning vendor to meet that compliance. 150 00:09:21,860 --> 00:09:24,180 So I'm going to evaluate the cost of that solution. 151 00:09:24,920 --> 00:09:28,780 I'm going to compare that with the solution's ability to find issues, or its quality. 152 00:09:29,360 --> 00:09:35,260 I'm going to compare that with the cost to my organization of remediating the findings from that ASV. 153 00:09:36,240 --> 00:09:40,900 I'm going to look at the annualized loss expectancy due to issues that it missed. 154 00:09:41,160 --> 00:09:41,640 Okay? 155 00:09:41,700 --> 00:09:47,120 And I'm going to look at the loss expectancy due to issues I have chosen not to remediate. 156 00:09:47,720 --> 00:09:54,460 The real problem here is that there's no market differentiator whatsoever between a PCI stamp of approval, 157 00:09:54,920 --> 00:09:56,400 from one ASV or another. 158 00:09:56,740 --> 00:09:58,480 They all have varying levels of quality. 159 00:09:58,740 --> 00:10:02,060 Some ASVs will identify more issues than others. 160 00:10:02,760 --> 00:10:10,940 But if I'm becoming PCI compliant, actually, a rational economic approach would say, 161 00:10:11,020 --> 00:10:15,160 by the cheapest, lowest quality scanning vendor I could find. 162 00:10:15,340 --> 00:10:16,860 They will identify the least issues. 163 00:10:17,080 --> 00:10:20,240 I will have to mitigate a smaller number of issues. 164 00:10:20,640 --> 00:10:24,900 And if I'm hit with a loss due to unrecognizable issues, 165 00:10:24,920 --> 00:10:26,940 unidentified issues, I'm going to write that off. 166 00:10:27,140 --> 00:10:28,100 But I'm PCI compliant. 167 00:10:28,440 --> 00:10:29,760 I spent very little on my solution. 168 00:10:30,200 --> 00:10:33,900 And I've identified very few issues because it's a crappy scanner. 169 00:10:36,460 --> 00:10:38,480 So, some concepts of mod security. 170 00:10:39,700 --> 00:10:44,060 One main concept is the ability to do virtual patching or just-in-time patching. 171 00:10:44,260 --> 00:10:47,900 The idea there is that you have a web app firewall in front of your web application. 172 00:10:48,280 --> 00:10:50,860 It gives you another option when you're patching. 173 00:10:50,900 --> 00:10:54,900 Instead of having to patch the application, fix the code, whatever it is, 174 00:10:54,920 --> 00:10:55,780 on the back-end web app, 175 00:10:55,920 --> 00:11:00,960 I can apply some controls on my web app firewall to mitigate the threat from that attack 176 00:11:01,700 --> 00:11:03,800 without actually having to patch my web servers. 177 00:11:04,020 --> 00:11:06,700 So it gives you a little more options of how to patch something. 178 00:11:06,920 --> 00:11:09,540 Maybe I could put some rules in real quickly to my WAF, 179 00:11:09,700 --> 00:11:11,860 and then two weeks later when the change window opens up, 180 00:11:11,980 --> 00:11:13,520 I'm going to be able to patch my web apps. 181 00:11:15,900 --> 00:11:17,480 There's the positive security model. 182 00:11:17,660 --> 00:11:19,820 So what that is is your input validation envelope. 183 00:11:20,120 --> 00:11:21,700 You have to model your application, 184 00:11:22,700 --> 00:11:24,900 what input is expected for different applications, 185 00:11:24,920 --> 00:11:25,340 different parameters, 186 00:11:25,480 --> 00:11:27,940 and basically enforce that model. 187 00:11:28,260 --> 00:11:31,060 So if the ID parameter is only supposed to be a number, 188 00:11:31,220 --> 00:11:34,000 we'll only allow numeric digits in that parameter. 189 00:11:34,300 --> 00:11:39,440 If a date parameter is supposed to be year, year, year, month, month, day, day, 190 00:11:39,440 --> 00:11:40,760 then enforce that. 191 00:11:40,980 --> 00:11:45,900 And don't let 4,000 A characters slide by in your date format. 192 00:11:47,420 --> 00:11:51,760 The negative security model is basically try to enumerate the bad stuff. 193 00:11:51,960 --> 00:11:52,860 Block the bad stuff. 194 00:11:53,200 --> 00:11:54,340 Look for SQL injection. 195 00:11:54,920 --> 00:11:55,960 Look for cross-site scripting. 196 00:11:56,420 --> 00:11:58,360 Those kind of things, and block it. 197 00:11:59,120 --> 00:12:00,360 So in the real world, 198 00:12:00,480 --> 00:12:03,980 it's extremely difficult to achieve this positive input validation envelope. 199 00:12:04,500 --> 00:12:05,620 There's a wide range, 200 00:12:05,760 --> 00:12:08,380 most large organizations have a wide range of web apps out there. 201 00:12:08,480 --> 00:12:09,420 There's a lot of code running. 202 00:12:09,780 --> 00:12:13,160 It's a major task to model these applications, 203 00:12:13,560 --> 00:12:15,060 identify the parameters, 204 00:12:15,340 --> 00:12:17,540 and create that positive input validation envelope. 205 00:12:18,040 --> 00:12:20,220 Now there are some tools, 206 00:12:20,560 --> 00:12:23,340 and these products typically have learning modes, 207 00:12:23,520 --> 00:12:24,900 where they observe the web apps, 208 00:12:24,920 --> 00:12:26,680 the web traffic on your application, 209 00:12:26,920 --> 00:12:29,400 and try to build that positive input validation envelope. 210 00:12:30,940 --> 00:12:32,160 And I want to give a quote. 211 00:12:32,300 --> 00:12:33,960 I'm not sure who gave this quote, 212 00:12:34,060 --> 00:12:36,160 but it's from a White Hat Security white paper, 213 00:12:36,260 --> 00:12:37,120 and I just really liked it. 214 00:12:37,280 --> 00:12:37,860 So it says, 215 00:12:37,960 --> 00:12:38,660 When you know nothing, 216 00:12:39,500 --> 00:12:41,400 permit all is your only option. 217 00:12:42,580 --> 00:12:43,580 When you know something, 218 00:12:44,940 --> 00:12:47,260 default permit is what you can and should do. 219 00:12:47,540 --> 00:12:49,580 But only when you know everything, 220 00:12:50,500 --> 00:12:51,780 then you can do default deny, 221 00:12:51,780 --> 00:12:52,680 and only then. 222 00:12:53,260 --> 00:12:54,940 So that kind of sums up the difficulty 223 00:12:55,660 --> 00:12:58,200 of building this positive input validation envelope, 224 00:12:58,360 --> 00:12:59,060 as it's been called. 225 00:13:00,980 --> 00:13:01,500 So, 226 00:13:01,500 --> 00:13:03,800 some more concepts around the ModSecurity 227 00:13:03,800 --> 00:13:04,920 web app firewall. 228 00:13:05,500 --> 00:13:07,920 So, ModSecurity breaks down 229 00:13:07,920 --> 00:13:09,800 its processing into several phases. 230 00:13:10,140 --> 00:13:11,980 And these are phase one through five. 231 00:13:12,200 --> 00:13:13,700 And when you look at the rules language, 232 00:13:13,780 --> 00:13:14,760 they're identified by number. 233 00:13:15,060 --> 00:13:16,260 So the first phase, 234 00:13:17,160 --> 00:13:19,300 ModSecurity is going to process all your request headers 235 00:13:19,300 --> 00:13:20,260 for that inbound request. 236 00:13:21,780 --> 00:13:22,760 If you have rules against the request headers, 237 00:13:22,960 --> 00:13:24,560 maybe you have a rule that says, 238 00:13:24,620 --> 00:13:26,960 HTTP 1.1 must have a host header. 239 00:13:27,160 --> 00:13:28,620 If not, it's a protocol anomaly. 240 00:13:29,100 --> 00:13:30,020 Block that request. 241 00:13:31,060 --> 00:13:32,320 After processing the headers, 242 00:13:32,520 --> 00:13:33,780 applying the rules to the headers, 243 00:13:34,420 --> 00:13:36,420 ModSecurity is going to go process the request body. 244 00:13:36,900 --> 00:13:37,900 So if it's a post, 245 00:13:38,160 --> 00:13:41,060 you may have some URL form encoded data 246 00:13:41,060 --> 00:13:42,060 in the request body. 247 00:13:42,900 --> 00:13:44,540 Or, you could have a rule that says, 248 00:13:44,700 --> 00:13:48,180 GET requests are not allowed to have a request body. 249 00:13:48,460 --> 00:13:49,120 Block that. 250 00:13:49,260 --> 00:13:49,820 That's no good. 251 00:13:51,780 --> 00:13:53,280 So after processing the request, 252 00:13:54,120 --> 00:13:56,100 ModSecurity is going to either block it, 253 00:13:56,160 --> 00:13:57,860 or let's say it passes that request along 254 00:13:57,860 --> 00:13:59,340 to the backend web server. 255 00:14:00,460 --> 00:14:01,460 The web server 256 00:14:01,460 --> 00:14:03,220 processes the request, generates a response. 257 00:14:03,420 --> 00:14:05,980 That response flows through the ModSecurity module as well. 258 00:14:07,060 --> 00:14:08,100 ModSecurity is going to process 259 00:14:08,100 --> 00:14:09,020 all the response headers. 260 00:14:09,740 --> 00:14:11,600 Similarly, it's going to match all its rules 261 00:14:11,600 --> 00:14:12,620 against response headers. 262 00:14:13,480 --> 00:14:14,920 If that looks okay, 263 00:14:15,060 --> 00:14:16,300 it will match the response body. 264 00:14:16,680 --> 00:14:18,820 So this could be a place where you would 265 00:14:18,820 --> 00:14:20,780 do data leakage protection, for instance. 266 00:14:21,780 --> 00:14:22,340 You could look for 267 00:14:22,340 --> 00:14:25,420 SQL Server error pages being returned 268 00:14:25,420 --> 00:14:26,160 from a request. 269 00:14:26,500 --> 00:14:28,240 Filter that out and give them a 500. 270 00:14:28,540 --> 00:14:30,200 A plain vanilla 500 or whatever. 271 00:14:30,480 --> 00:14:32,420 So this is the place you do some 272 00:14:32,420 --> 00:14:33,480 data leakage protection. 273 00:14:34,120 --> 00:14:36,580 And then finally, after processing all the 274 00:14:36,580 --> 00:14:37,800 request and 275 00:14:39,300 --> 00:14:40,620 the entire response, 276 00:14:42,460 --> 00:14:43,580 you basically do 277 00:14:43,580 --> 00:14:44,860 logging or take action. 278 00:14:45,340 --> 00:14:47,420 So that's kind of the five phases 279 00:14:47,420 --> 00:14:49,320 of how ModSecurity processes 280 00:14:49,320 --> 00:14:50,700 these requests and responses. 281 00:14:53,380 --> 00:14:54,660 ModSecurity also has the concept 282 00:14:54,660 --> 00:14:55,300 of a transformation. 283 00:14:56,160 --> 00:14:57,540 So the cool thing about these is 284 00:14:57,540 --> 00:14:58,660 you can nest them or basically 285 00:14:58,660 --> 00:14:59,440 run them in serial. 286 00:15:00,260 --> 00:15:02,060 Some of these are very useful. 287 00:15:02,320 --> 00:15:04,120 One of my favorites is the replace comments 288 00:15:04,120 --> 00:15:05,060 transformation. 289 00:15:05,660 --> 00:15:08,480 This is great for pre-processing 290 00:15:08,480 --> 00:15:09,580 a potential SQL injection. 291 00:15:10,340 --> 00:15:11,880 So a lot of times your SQL injection 292 00:15:11,880 --> 00:15:13,900 will have SQL comments in it 293 00:15:13,900 --> 00:15:16,220 and that will break up the request. 294 00:15:16,640 --> 00:15:19,100 So this transformation will basically 295 00:15:19,100 --> 00:15:20,820 strip out any SQL comments 296 00:15:21,780 --> 00:15:23,860 and present the decoded 297 00:15:23,860 --> 00:15:25,660 request to the rest of the 298 00:15:25,660 --> 00:15:26,320 ModSecurity engine. 299 00:15:26,920 --> 00:15:29,180 It's got transformations for URL encoding 300 00:15:29,180 --> 00:15:30,860 and decoding, hex. 301 00:15:31,520 --> 00:15:33,600 The JavaScript decode is a very cool 302 00:15:33,600 --> 00:15:35,220 transformation. It actually is an implementation 303 00:15:35,220 --> 00:15:36,460 of the JavaScript 304 00:15:37,540 --> 00:15:39,620 decode function, but it's in ModSecurity. 305 00:15:39,840 --> 00:15:41,360 So if you can identify a payload 306 00:15:41,360 --> 00:15:43,500 that's JavaScript encoded, ModSecurity 307 00:15:43,500 --> 00:15:45,140 can transform it for you and then present 308 00:15:45,140 --> 00:15:46,980 the decoded content to the rest of the 309 00:15:46,980 --> 00:15:47,680 matching engine. 310 00:15:48,440 --> 00:15:50,900 You do uppercase and lowercase transformations. 311 00:15:51,780 --> 00:15:53,460 So you don't have to worry about case in your rules. 312 00:15:53,580 --> 00:15:55,280 It can translate the whole request into 313 00:15:55,280 --> 00:15:56,220 uppercase or lowercase. 314 00:15:56,480 --> 00:15:58,020 That also will affect how it's logged. 315 00:15:59,040 --> 00:16:01,580 You can take MD5s and SHA1s of file 316 00:16:01,580 --> 00:16:02,660 uploads on the wire. 317 00:16:03,080 --> 00:16:05,520 So basically I could create a blacklist of 318 00:16:06,100 --> 00:16:07,740 files I never want to either 319 00:16:07,740 --> 00:16:09,100 be returned from my server 320 00:16:09,640 --> 00:16:11,420 or I never want to be able to be uploaded 321 00:16:11,420 --> 00:16:13,420 to my server. ModSecurity can 322 00:16:14,300 --> 00:16:15,500 reassemble the file upload 323 00:16:15,500 --> 00:16:16,880 or the return file 324 00:16:17,380 --> 00:16:19,760 and basically take an MD5 or a SHA1 of it 325 00:16:19,760 --> 00:16:21,040 and match it against your blacklist. 326 00:16:21,780 --> 00:16:22,140 Pretty cool. 327 00:16:22,940 --> 00:16:25,340 Also one very useful feature is 328 00:16:25,340 --> 00:16:27,480 it can normalize URI paths. 329 00:16:27,980 --> 00:16:29,500 So if you have directory traversal 330 00:16:29,500 --> 00:16:31,840 sequences, all sorts of 331 00:16:31,840 --> 00:16:33,460 strange directory traversals, 332 00:16:33,500 --> 00:16:34,580 it can normalize those 333 00:16:34,580 --> 00:16:36,720 into a nice standard 334 00:16:36,720 --> 00:16:39,320 normalized path that you can match against. 335 00:16:40,760 --> 00:16:41,900 It's important to understand 336 00:16:41,900 --> 00:16:43,540 the transformations when you're looking at 337 00:16:43,540 --> 00:16:45,200 how to write rules and how to protect things 338 00:16:45,200 --> 00:16:46,400 with the ModSecurity firewall. 339 00:16:48,020 --> 00:16:49,340 So the core rules. 340 00:16:50,220 --> 00:16:51,660 Without any rules, 341 00:16:51,780 --> 00:16:52,840 ModSecurity doesn't do anything. 342 00:16:53,080 --> 00:16:54,900 It just processes requests, passes it through. 343 00:16:55,200 --> 00:16:57,580 It's basically running almost like a proxy. 344 00:16:58,220 --> 00:16:59,640 So the core rules are available 345 00:16:59,640 --> 00:17:01,260 from ModSecurity.org. 346 00:17:01,340 --> 00:17:02,820 They're under the GPLv2 license. 347 00:17:03,480 --> 00:17:04,800 They offer some main 348 00:17:05,480 --> 00:17:06,500 areas of protection. 349 00:17:06,940 --> 00:17:09,620 One is controls around the 350 00:17:09,620 --> 00:17:10,320 HTTP protocol. 351 00:17:11,120 --> 00:17:13,440 So you can detect protocol 352 00:17:13,440 --> 00:17:15,120 anomalies, like I mentioned before, 353 00:17:15,280 --> 00:17:17,580 HTTP 1.1 requests 354 00:17:17,580 --> 00:17:19,040 without a host header. 355 00:17:19,480 --> 00:17:21,700 Or a GET request that has 356 00:17:21,780 --> 00:17:23,020 a request body. 357 00:17:23,280 --> 00:17:24,200 Those are anomalies. 358 00:17:25,020 --> 00:17:27,780 And you can also use that to have a defined policy 359 00:17:27,780 --> 00:17:29,900 on the HTTP protocol to enforce 360 00:17:29,900 --> 00:17:31,080 the RFCs, for instance. 361 00:17:31,920 --> 00:17:33,760 It offers protections against 362 00:17:33,760 --> 00:17:35,020 some of the most common web attacks. 363 00:17:35,300 --> 00:17:37,740 So we're talking about cross-site scripting, 364 00:17:38,520 --> 00:17:39,040 SQLI, 365 00:17:39,240 --> 00:17:41,380 cross-site request forgeries, response splitting. 366 00:17:42,520 --> 00:17:43,700 And it's not perfect. 367 00:17:43,960 --> 00:17:45,360 Cross-site scripting can be difficult 368 00:17:45,360 --> 00:17:46,820 to detect because it's immutable. 369 00:17:47,720 --> 00:17:49,440 But it offers some protections 370 00:17:49,440 --> 00:17:51,760 against these common web attacks. 371 00:17:51,780 --> 00:17:54,360 It also has some interesting features 372 00:17:54,360 --> 00:17:57,120 to detect automated requests. 373 00:17:57,540 --> 00:17:58,560 These would be crawlers, 374 00:17:58,780 --> 00:17:59,520 search bots, 375 00:17:59,840 --> 00:18:00,720 web scanners. 376 00:18:01,180 --> 00:18:03,000 So it can basically detect 377 00:18:03,640 --> 00:18:05,040 when the Google search bot 378 00:18:05,040 --> 00:18:06,300 is indexing your page. 379 00:18:06,820 --> 00:18:08,100 Why would you want to do that? 380 00:18:08,620 --> 00:18:10,540 Well, maybe I return completely different content 381 00:18:10,540 --> 00:18:11,840 when Google indexes my page 382 00:18:11,840 --> 00:18:12,960 than I actually host. 383 00:18:14,460 --> 00:18:16,580 It has some basic Trojan protections. 384 00:18:16,640 --> 00:18:19,640 So these would be Trojans on your network 385 00:18:19,640 --> 00:18:21,580 that are using HTTP command and control 386 00:18:21,780 --> 00:18:22,040 protocols. 387 00:18:22,500 --> 00:18:25,120 So ModSecurity is able to detect 388 00:18:25,120 --> 00:18:26,340 some of these command and control 389 00:18:26,340 --> 00:18:29,400 sequences between HTTP-based bots. 390 00:18:30,560 --> 00:18:32,800 And another interesting application 391 00:18:32,800 --> 00:18:34,800 is server error hiding 392 00:18:34,800 --> 00:18:36,600 or data loss prevention, 393 00:18:36,920 --> 00:18:37,920 data leakage prevention. 394 00:18:38,760 --> 00:18:40,880 So basically you can mask the errors 395 00:18:40,880 --> 00:18:42,580 that are coming out of your server. 396 00:18:42,780 --> 00:18:45,420 My classic example here is a SQL Server error 397 00:18:45,420 --> 00:18:47,360 that has an ODBC error string 398 00:18:47,360 --> 00:18:48,320 and all this stuff in there. 399 00:18:48,500 --> 00:18:50,100 You don't really want that being returned 400 00:18:51,780 --> 00:18:52,200 to the requester. 401 00:18:52,980 --> 00:18:55,340 And it may be a lot easier 402 00:18:55,340 --> 00:18:57,200 to block that kind of stuff 403 00:18:57,200 --> 00:18:58,100 with your web app firewall 404 00:18:58,100 --> 00:19:00,000 than to get all your developers 405 00:19:00,000 --> 00:19:02,520 to fix their code on the web app 406 00:19:02,520 --> 00:19:05,220 to stop throwing these ODBC SQL Server errors. 407 00:19:05,880 --> 00:19:07,520 Also, it can do some data loss prevention. 408 00:19:07,800 --> 00:19:09,720 You can look for certain content 409 00:19:09,720 --> 00:19:10,840 being returned, confidential, 410 00:19:12,400 --> 00:19:13,980 top secret, for instance, 411 00:19:14,200 --> 00:19:15,300 and block those responses. 412 00:19:18,000 --> 00:19:19,460 So to go over some of the 413 00:19:19,460 --> 00:19:21,260 keywords in that rule language, 414 00:19:21,780 --> 00:19:23,060 so we have a number of 415 00:19:23,720 --> 00:19:24,920 rule language keywords 416 00:19:24,920 --> 00:19:26,060 to match on requests. 417 00:19:26,820 --> 00:19:27,620 It's the method. 418 00:19:27,820 --> 00:19:29,920 That's, you know, get, post, trace, track, 419 00:19:30,060 --> 00:19:30,960 those kind of things. 420 00:19:31,420 --> 00:19:33,580 The URI, which is the entire... 421 00:19:34,180 --> 00:19:35,740 Well, actually, ModSecurity offers 422 00:19:35,740 --> 00:19:37,460 a very granular way to look at the URI. 423 00:19:37,960 --> 00:19:39,180 You have the request URI, 424 00:19:39,300 --> 00:19:40,060 which is that whole string. 425 00:19:40,260 --> 00:19:41,860 You have the file name part of it, 426 00:19:41,940 --> 00:19:43,680 which would be after the question mark, 427 00:19:43,820 --> 00:19:46,460 I believe, in a URI with parameters. 428 00:19:46,700 --> 00:19:48,060 Excuse me, before the question mark. 429 00:19:51,780 --> 00:19:53,500 Which would be the stuff after the question mark. 430 00:19:53,740 --> 00:19:55,180 You know, var equals value 431 00:19:55,640 --> 00:19:57,360 and var2 equals value, 432 00:19:57,620 --> 00:19:58,580 those kind of things. 433 00:19:59,240 --> 00:20:01,000 You could match against request headers, 434 00:20:01,580 --> 00:20:03,480 either the presence or absence of a header, 435 00:20:03,640 --> 00:20:04,820 the number of headers, 436 00:20:05,080 --> 00:20:07,000 the value of particular headers, 437 00:20:07,640 --> 00:20:09,700 and you could also match against the request body. 438 00:20:09,980 --> 00:20:11,160 So, you know, it's a post, 439 00:20:11,340 --> 00:20:13,500 and you want to look at the URL 440 00:20:13,500 --> 00:20:15,740 form-encoded content in that request body. 441 00:20:15,940 --> 00:20:17,520 So you could match on it with that keyword. 442 00:20:18,180 --> 00:20:19,220 There's a number of other 443 00:20:19,780 --> 00:20:21,360 options available to match 444 00:20:21,780 --> 00:20:22,560 on the responses. 445 00:20:23,280 --> 00:20:24,760 So you've got response status, 446 00:20:26,400 --> 00:20:27,440 404, 302, 447 00:20:27,640 --> 00:20:28,160 500, 448 00:20:29,180 --> 00:20:29,940 there you go. 449 00:20:31,500 --> 00:20:32,740 You've got the response body, 450 00:20:32,860 --> 00:20:34,580 so that could be the HTML content 451 00:20:34,580 --> 00:20:36,200 or whatever it is that's being returned back 452 00:20:36,200 --> 00:20:37,540 from that request. 453 00:20:38,500 --> 00:20:39,240 Headers, again. 454 00:20:40,220 --> 00:20:41,840 Content type, content length. 455 00:20:42,540 --> 00:20:43,900 So you could basically 456 00:20:43,900 --> 00:20:47,580 say I don't allow files greater than 10 megs 457 00:20:47,580 --> 00:20:49,020 to come back off my web server. 458 00:20:49,160 --> 00:20:51,100 Or I only allow text HTML 459 00:20:51,780 --> 00:20:51,900 to be returned. 460 00:20:52,400 --> 00:20:55,080 Or I never allow JPEGs. 461 00:20:55,660 --> 00:20:57,560 You basically could think of any number 462 00:20:57,560 --> 00:20:58,700 of ways to use these parameters 463 00:20:58,700 --> 00:21:00,280 to control the web app traffic. 464 00:21:02,160 --> 00:21:02,680 So, 465 00:21:02,700 --> 00:21:05,300 v2.5.x is the 466 00:21:05,300 --> 00:21:07,440 current release, most stable release 467 00:21:07,440 --> 00:21:08,100 of ModSecurity. 468 00:21:09,220 --> 00:21:11,080 With the release of v2.5, 469 00:21:11,240 --> 00:21:12,420 they released some interesting functionality 470 00:21:12,420 --> 00:21:13,640 around content injection. 471 00:21:14,900 --> 00:21:16,600 So there's two new keywords, 472 00:21:16,760 --> 00:21:17,640 prepend and append. 473 00:21:18,500 --> 00:21:20,080 When I detect a request, 474 00:21:21,780 --> 00:21:22,380 it matches some rule, 475 00:21:22,500 --> 00:21:23,280 for whatever reason, 476 00:21:23,440 --> 00:21:25,260 I can have the response 477 00:21:26,740 --> 00:21:28,980 basically have content injected 478 00:21:28,980 --> 00:21:30,700 in the response before or after. 479 00:21:30,820 --> 00:21:32,300 You know, the top or the bottom of it. 480 00:21:33,300 --> 00:21:34,400 So, for instance, 481 00:21:34,520 --> 00:21:36,080 if someone's attacking my web app, 482 00:21:36,660 --> 00:21:38,360 who here knows who Billy Hoffman is? 483 00:21:39,220 --> 00:21:40,280 You know, browsers 484 00:21:40,900 --> 00:21:42,200 and JavaScript engines, 485 00:21:42,360 --> 00:21:44,340 they shiver when Billy walks in the room here. 486 00:21:44,760 --> 00:21:47,080 So, you could take one of Billy Hoffman's 487 00:21:47,080 --> 00:21:49,400 evil, evil JavaScript payloads 488 00:21:49,400 --> 00:21:50,860 and shove it back into the response 489 00:21:51,780 --> 00:21:52,140 for the attacker. 490 00:21:53,580 --> 00:21:54,820 So, it also, 491 00:21:55,040 --> 00:21:56,620 we'll get into that a little bit later 492 00:21:56,620 --> 00:21:58,080 and talk about some uses of that. 493 00:21:59,380 --> 00:22:01,140 Anybody up for, you know, returning GOATC? 494 00:22:02,160 --> 00:22:02,660 And, 495 00:22:02,680 --> 00:22:04,600 a Ho-Corsic is a 496 00:22:04,600 --> 00:22:06,360 fast pattern matching algorithm. 497 00:22:07,160 --> 00:22:09,040 So basically, they've improved the performance 498 00:22:09,040 --> 00:22:10,860 of the engine by implementing, you know, 499 00:22:10,880 --> 00:22:12,540 efficient pattern matching algorithms. 500 00:22:13,080 --> 00:22:14,440 And that really helps when you have 501 00:22:14,440 --> 00:22:15,280 large sets of patterns. 502 00:22:16,060 --> 00:22:18,060 It caches the transformations now. 503 00:22:18,280 --> 00:22:21,100 So before, every transformation you went through 504 00:22:21,780 --> 00:22:22,920 it would reprocess the transformation. 505 00:22:23,220 --> 00:22:24,560 Now, it's actually caching the responses 506 00:22:24,560 --> 00:22:27,020 which can yield great performance improvements. 507 00:22:27,840 --> 00:22:29,400 Another awesome feature is 508 00:22:29,400 --> 00:22:30,460 GeoIP Lookup. 509 00:22:31,060 --> 00:22:33,180 You can use this as matching criteria 510 00:22:33,180 --> 00:22:34,020 in your rules. 511 00:22:34,480 --> 00:22:37,720 I can block, prepend, upend, 512 00:22:37,840 --> 00:22:39,520 content inject content based on your 513 00:22:39,520 --> 00:22:40,320 longitude and latitude. 514 00:22:40,680 --> 00:22:42,620 I can do it based on your country code. 515 00:22:43,220 --> 00:22:43,580 Okay? 516 00:22:43,820 --> 00:22:46,100 So, that can get kind of interesting as well. 517 00:22:46,300 --> 00:22:47,960 So, GeoIP Lookup is built in. 518 00:22:47,960 --> 00:22:49,780 It's an operator in the rules language. 519 00:22:51,760 --> 00:22:53,920 Another very cool operator is the 520 00:22:53,920 --> 00:22:56,080 Loon Checksum algorithm for credit cards. 521 00:22:56,460 --> 00:22:57,520 So there's actually a 522 00:22:57,520 --> 00:22:59,840 VerifyCC operator in there. 523 00:23:00,020 --> 00:23:01,980 If I can identify content that I 524 00:23:01,980 --> 00:23:03,560 believe may be a credit card number, 525 00:23:03,740 --> 00:23:06,360 I can run it through this VerifyCC operator 526 00:23:06,360 --> 00:23:07,840 and it will say, yes, 527 00:23:07,940 --> 00:23:09,680 that matches the Loon Checksum algorithm 528 00:23:09,680 --> 00:23:12,120 so it potentially is a valid credit card number. 529 00:23:12,460 --> 00:23:13,400 That's pretty interesting. 530 00:23:14,140 --> 00:23:15,980 One of the more advanced features is 531 00:23:16,600 --> 00:23:17,560 PDF Universal 532 00:23:17,960 --> 00:23:18,740 Cross-site Scripting Protection. 533 00:23:19,560 --> 00:23:21,360 I don't know if y'all remember, 534 00:23:21,600 --> 00:23:23,360 I think it was last year, there was a 535 00:23:23,740 --> 00:23:25,380 pretty bad vuln in PDF 536 00:23:25,780 --> 00:23:27,660 where you could basically execute 537 00:23:27,660 --> 00:23:29,820 arbitrary JavaScript for any PDF file 538 00:23:29,820 --> 00:23:31,820 off of any PDF file hosted 539 00:23:31,820 --> 00:23:33,980 on your website using the pound tag operator. 540 00:23:34,560 --> 00:23:35,820 This was pretty bad. 541 00:23:36,140 --> 00:23:37,780 So, what 542 00:23:37,780 --> 00:23:39,900 ModSecurity can do is it basically 543 00:23:39,900 --> 00:23:41,980 protects all PDFs on your site 544 00:23:41,980 --> 00:23:43,820 by generating one-time use 545 00:23:43,820 --> 00:23:44,860 random URIs. 546 00:23:45,080 --> 00:23:47,940 It will redirect visitors from that URI to the 547 00:23:47,960 --> 00:23:49,740 PDF file and it will actually 548 00:23:51,320 --> 00:23:51,760 defang 549 00:23:51,760 --> 00:23:53,860 and flush any malicious JavaScript in your 550 00:23:53,860 --> 00:23:55,300 browser when it gets back. 551 00:23:55,940 --> 00:23:57,960 So that's a pretty interesting feature there. 552 00:23:58,860 --> 00:23:59,800 They also built 553 00:23:59,800 --> 00:24:01,300 the Lua scripting language in. 554 00:24:01,540 --> 00:24:03,720 So if you can't figure out a way to do something 555 00:24:03,720 --> 00:24:05,720 with the rules language, well you can write a 556 00:24:05,720 --> 00:24:06,880 Lua script to do it, right? 557 00:24:07,460 --> 00:24:09,760 So you can make very complicated rules if you 558 00:24:09,760 --> 00:24:10,920 want to get into the Lua scripting. 559 00:24:13,120 --> 00:24:13,560 So, 560 00:24:13,560 --> 00:24:15,360 how do you deploy this thing? 561 00:24:15,620 --> 00:24:17,120 Well, there's some various ways to do it. 562 00:24:17,960 --> 00:24:19,520 It's pretty simple and it's typically for a smaller 563 00:24:20,160 --> 00:24:21,340 site would be embedded. 564 00:24:21,680 --> 00:24:23,780 You have an Apache HDPD 565 00:24:23,780 --> 00:24:25,820 instance. You're going to run 566 00:24:25,820 --> 00:24:27,280 the ModSecurity Apache module 567 00:24:27,840 --> 00:24:29,780 within that instance and it's 568 00:24:29,780 --> 00:24:31,800 going to basically filter through ModSecurity 569 00:24:31,800 --> 00:24:33,620 and hit your web application 570 00:24:33,620 --> 00:24:35,560 running inside that same Apache instance. 571 00:24:36,240 --> 00:24:37,720 There's also reverse proxy 572 00:24:37,720 --> 00:24:39,660 mode, which is more typical 573 00:24:39,660 --> 00:24:41,720 to a larger web app. Either 574 00:24:41,720 --> 00:24:43,980 you can do this in the cloud or other ways. 575 00:24:44,540 --> 00:24:46,060 So you use ModProxy, 576 00:24:46,200 --> 00:24:47,700 which is a standard Apache module 577 00:24:47,960 --> 00:24:49,780 you configure it in 578 00:24:49,780 --> 00:24:50,780 reverse proxy mode. 579 00:24:51,300 --> 00:24:53,140 So what that means is traffic is 580 00:24:53,140 --> 00:24:55,680 flowing through your WAF. The requests are 581 00:24:55,680 --> 00:24:57,580 flowing through your WAF. The responses 582 00:24:57,580 --> 00:24:59,760 are flowing back. You could 583 00:24:59,760 --> 00:25:01,440 achieve this through DNS configuration. 584 00:25:02,520 --> 00:25:03,960 So you could have a DNS 585 00:25:03,960 --> 00:25:05,680 record for your website that points to your 586 00:25:05,680 --> 00:25:07,700 web app firewall. And your web app firewall has 587 00:25:07,700 --> 00:25:09,160 configuration so it knows where to 588 00:25:09,160 --> 00:25:11,220 proxy the request back to. 589 00:25:11,440 --> 00:25:13,600 You could also do network layer redirection, 590 00:25:15,040 --> 00:25:16,000 NATing, IP rewrite, 591 00:25:16,180 --> 00:25:17,940 whatever you want to do to make that happen. 592 00:25:18,620 --> 00:25:19,580 So one 593 00:25:19,580 --> 00:25:21,820 option here is you can host this in the 594 00:25:21,820 --> 00:25:23,700 cloud. You could have a 595 00:25:23,700 --> 00:25:25,760 web app firewall that's protecting any 596 00:25:25,760 --> 00:25:27,780 number of websites and domains using 597 00:25:27,780 --> 00:25:29,680 Apache virtual hosts. And basically 598 00:25:29,680 --> 00:25:31,780 you do some DNS records, point 599 00:25:31,780 --> 00:25:33,360 the websites at your web app firewall, 600 00:25:33,660 --> 00:25:35,720 have configuration there so it knows where to send the 601 00:25:35,720 --> 00:25:37,560 request to based on virtual hosts. 602 00:25:38,660 --> 00:25:39,880 So in that sense, you could 603 00:25:39,880 --> 00:25:41,500 do this as a software as a service kind of play. 604 00:25:42,920 --> 00:25:43,400 So 605 00:25:43,960 --> 00:25:45,800 just to show a embedded 606 00:25:45,800 --> 00:25:47,940 deployment kind of scenario, you've 607 00:25:47,960 --> 00:25:49,940 got the Apache web server, and let's just say it's 608 00:25:49,940 --> 00:25:51,620 www.example.com. 609 00:25:51,780 --> 00:25:53,100 You've got a virtual host for that. 610 00:25:53,620 --> 00:25:55,840 So inside the web server, you've got the virtual host, 611 00:25:55,980 --> 00:25:57,900 you've got mod security configured to 612 00:25:57,900 --> 00:25:59,940 proxy through and talk to your document 613 00:25:59,940 --> 00:26:00,200 route. 614 00:26:02,120 --> 00:26:03,260 So site visitor 615 00:26:03,880 --> 00:26:05,080 hits your Apache server. 616 00:26:06,060 --> 00:26:07,620 Mod security receives the request. 617 00:26:08,420 --> 00:26:09,680 It processes the request. 618 00:26:11,500 --> 00:26:13,900 And it says, okay, this request 619 00:26:13,900 --> 00:26:14,660 looks good to me. 620 00:26:15,940 --> 00:26:17,800 After it processes it, it says the 621 00:26:17,960 --> 00:26:19,820 request is good. It passes it through to the document route. 622 00:26:20,440 --> 00:26:20,900 Apache 623 00:26:22,100 --> 00:26:23,240 processes the document route, 624 00:26:24,260 --> 00:26:25,920 returns the request through mod 625 00:26:25,920 --> 00:26:27,880 security back to the site visitor. 626 00:26:28,240 --> 00:26:29,480 That's very standard 627 00:26:29,480 --> 00:26:31,820 embedded Apache module kind of 628 00:26:31,820 --> 00:26:33,580 scenario. So 629 00:26:33,580 --> 00:26:35,500 what happens when an attacker 630 00:26:36,020 --> 00:26:38,020 comes along and wants to hit your web app? 631 00:26:38,900 --> 00:26:39,880 Well, the attacker's 632 00:26:39,880 --> 00:26:41,220 going to send its request into mod security. 633 00:26:42,300 --> 00:26:43,820 Mod security is going to process 634 00:26:43,820 --> 00:26:45,680 it, and it's going to say, nope, no good. 635 00:26:46,940 --> 00:26:47,720 After that, 636 00:26:48,280 --> 00:26:49,780 you're going to send Billy Hoffman 637 00:26:49,780 --> 00:26:50,740 back to go get the attacker. 638 00:26:52,940 --> 00:26:53,740 And hilarity 639 00:26:53,740 --> 00:26:54,120 ensues. 640 00:26:55,640 --> 00:26:57,860 So just an example of the embedded deployment there. 641 00:26:58,540 --> 00:26:59,700 And I'll give you a live demo 642 00:26:59,700 --> 00:27:00,540 right here of an embedded 643 00:27:01,460 --> 00:27:03,740 Apache embedded deployment. I've got a couple of VMs 644 00:27:03,740 --> 00:27:04,080 running here. 645 00:27:05,100 --> 00:27:07,400 This is my first attempt at live demos at DEF CON, 646 00:27:07,560 --> 00:27:09,000 so please be gentle. 647 00:27:24,400 --> 00:27:28,580 All right, right here, I've got an SSH session to www.example.com. 648 00:27:28,680 --> 00:27:29,660 It's a VM running down here. 649 00:27:30,120 --> 00:27:31,000 I'm in my 650 00:27:31,960 --> 00:27:33,600 Apache etsy httpd 651 00:27:33,600 --> 00:27:34,000 directory. 652 00:27:35,340 --> 00:27:36,220 You can see 653 00:27:37,620 --> 00:27:38,940 I've got conf.d 654 00:27:39,700 --> 00:27:41,440 linked to no mod security. 655 00:27:42,120 --> 00:27:43,760 So basically just a standard Apache 656 00:27:43,760 --> 00:27:45,780 configuration. Mod security's 657 00:27:45,780 --> 00:27:47,640 not running. Okay? 658 00:27:48,400 --> 00:27:48,720 Um... 659 00:27:51,620 --> 00:27:53,520 Let me make sure I've got the current config running. 660 00:27:55,800 --> 00:27:57,500 All right, so I'm going to bring up a web browser here. 661 00:28:11,180 --> 00:28:11,820 All right, 662 00:28:11,840 --> 00:28:13,500 so what we're going to do is we're going to tail 663 00:28:14,220 --> 00:28:14,820 the Apache 664 00:28:15,560 --> 00:28:16,140 access log. 665 00:28:22,000 --> 00:28:22,480 And... 666 00:28:23,240 --> 00:28:24,420 we're going to hit it with 667 00:28:24,420 --> 00:28:25,480 a normal request. 668 00:28:31,740 --> 00:28:32,220 Okay. 669 00:28:32,460 --> 00:28:33,240 You just saw 670 00:28:34,000 --> 00:28:34,480 there, 671 00:28:34,620 --> 00:28:37,060 we just saw a request from client.example.com, 672 00:28:37,320 --> 00:28:38,080 hit Apache, 673 00:28:38,400 --> 00:28:39,300 get request for slash, 674 00:28:39,620 --> 00:28:42,220 and you saw in my browser it just loaded the default 675 00:28:42,220 --> 00:28:43,720 Apache page. Okay? 676 00:28:44,680 --> 00:28:45,420 So now, 677 00:28:46,440 --> 00:28:47,940 remember, we're still not running Apache 678 00:28:47,940 --> 00:28:49,800 mod security in this environment yet. 679 00:28:50,040 --> 00:28:51,800 So let's send something that looks 680 00:28:51,800 --> 00:28:53,340 a little bit like cross-site scripting. 681 00:28:53,920 --> 00:28:54,440 Right? 682 00:28:57,400 --> 00:28:58,620 Gets through just fine. 683 00:28:59,820 --> 00:29:01,500 Apache access log, hit it. 684 00:29:01,700 --> 00:29:03,480 Okay, it returns the 685 00:29:03,480 --> 00:29:05,520 example page. Well, let's 686 00:29:05,520 --> 00:29:07,160 turn on mod security. Okay? 687 00:29:18,920 --> 00:29:20,080 Well, I should have done... 688 00:29:20,080 --> 00:29:21,100 Yeah. All right. 689 00:29:21,500 --> 00:29:23,680 So, mod security's running. 690 00:29:26,420 --> 00:29:27,780 Instead of tailing the Apache 691 00:29:27,780 --> 00:29:29,640 access log, let's tail the mod security 692 00:29:29,640 --> 00:29:30,380 audit log. 693 00:29:33,840 --> 00:29:35,740 All right. Now, we're going to 694 00:29:35,740 --> 00:29:37,140 send a standard request 695 00:29:38,360 --> 00:29:39,860 without that cross-site scripting 696 00:29:39,860 --> 00:29:40,320 junk in there. 697 00:29:45,320 --> 00:29:47,840 All right. Now, this didn't block anything. This is the 698 00:29:47,940 --> 00:29:49,780 audit log. So it just shows you how it 699 00:29:49,780 --> 00:29:50,520 processed the request. 700 00:29:51,460 --> 00:29:52,880 There was no alert generated. 701 00:29:53,580 --> 00:29:55,540 This is basically to show, you know, step through what 702 00:29:55,540 --> 00:29:57,820 mod security is doing. Now, let's 703 00:29:57,820 --> 00:29:59,860 send a potentially malicious request. 704 00:30:00,080 --> 00:30:01,840 Okay? Again, I'm going to put 705 00:30:01,840 --> 00:30:03,080 in that cross-site scripting stuff. 706 00:30:10,720 --> 00:30:11,520 Excuse me. 707 00:30:15,260 --> 00:30:15,660 Boom. 708 00:30:17,940 --> 00:30:19,920 So you see, at the very bottom, 709 00:30:20,040 --> 00:30:22,000 it says cross-site scripting 710 00:30:22,000 --> 00:30:22,180 attack 711 00:30:23,580 --> 00:30:25,180 right there. Well, there. 712 00:30:25,360 --> 00:30:27,340 And so that would be generated in your log. 713 00:30:28,020 --> 00:30:29,700 And if you look at my web browser 714 00:30:29,700 --> 00:30:31,440 here, I got a 500. 715 00:30:32,240 --> 00:30:33,860 Okay? That was returned by mod 716 00:30:33,860 --> 00:30:35,880 security. If we go look at the Apache 717 00:30:35,880 --> 00:30:37,300 access log, it never even hit 718 00:30:38,060 --> 00:30:39,560 the document root. Okay? 719 00:30:40,740 --> 00:30:41,840 So let's flip 720 00:30:41,840 --> 00:30:43,740 back to the slides now. 721 00:30:49,500 --> 00:30:49,900 ... 722 00:30:56,200 --> 00:30:56,600 ... 723 00:30:59,780 --> 00:31:00,180 ... 724 00:31:00,180 --> 00:31:01,680 All right. So let's talk about the reverse 725 00:31:01,680 --> 00:31:03,780 proxy deployment. This is a little more 726 00:31:03,780 --> 00:31:05,520 complicated deployment, but it's more typical 727 00:31:05,520 --> 00:31:07,620 of how you're going to actually do this in the real world. 728 00:31:07,800 --> 00:31:09,380 So you've got your web app firewall 729 00:31:09,900 --> 00:31:11,660 somewhere on the internet. You've got a site 730 00:31:11,660 --> 00:31:13,780 visitor. And you've got your web server, 731 00:31:13,900 --> 00:31:15,720 let's say, behind your standard network firewall. 732 00:31:16,500 --> 00:31:16,900 ... 733 00:31:18,480 --> 00:31:18,920 ... 734 00:31:22,220 --> 00:31:22,660 Okay. 735 00:31:24,280 --> 00:31:25,780 So if you try to go directly 736 00:31:26,960 --> 00:31:27,840 to the 737 00:31:27,840 --> 00:31:29,860 web server, you're going 738 00:31:29,860 --> 00:31:31,680 to get blocked. The firewall 739 00:31:31,680 --> 00:31:33,820 doesn't allow visitors to directly hit the web server. 740 00:31:33,960 --> 00:31:34,840 You have to go through the WAF. 741 00:31:35,960 --> 00:31:36,860 Now, if you 742 00:31:36,860 --> 00:31:37,180 ... 743 00:31:39,380 --> 00:31:40,720 go through the WAF, 744 00:31:40,840 --> 00:31:41,380 ... 745 00:31:43,080 --> 00:31:45,280 you're going to see the request hit the WAF. 746 00:31:46,000 --> 00:31:46,440 ... 747 00:31:47,940 --> 00:31:48,260 it's okay. 748 00:31:51,900 --> 00:31:53,280 It's going to regenerate a request. 749 00:31:53,580 --> 00:31:55,580 It's going to go back to the internet through your firewall. 750 00:31:55,800 --> 00:31:58,060 It's coming from the WAF. It's authorized. 751 00:31:58,400 --> 00:31:59,520 Your firewall's going to let it through. 752 00:32:00,340 --> 00:32:01,760 And then, it's going to basically 753 00:32:01,760 --> 00:32:03,060 hit your Apache server. 754 00:32:06,040 --> 00:32:06,800 It's going to be 755 00:32:07,560 --> 00:32:09,460 processed. The response is going to go back 756 00:32:09,920 --> 00:32:11,360 through the web app firewall. 757 00:32:11,680 --> 00:32:12,720 It's going to be processed. 758 00:32:13,160 --> 00:32:13,560 ... 759 00:32:15,200 --> 00:32:19,620 and then it would be rewritten, normalized, and then returned to the visitor. 760 00:32:19,920 --> 00:32:24,000 So that's kind of how the request response flow works in a reverse proxy deployment. 761 00:32:26,640 --> 00:32:30,460 So let's do a little quick live demo of the reverse proxy stuff here. 762 00:32:46,060 --> 00:32:46,740 All right. 763 00:32:49,260 --> 00:32:53,140 So let's go to, here we are on the www.example.com. 764 00:32:53,640 --> 00:32:57,440 What I'm going to do here is I'm going to turn off mod security like we had before. 765 00:33:02,600 --> 00:33:04,180 So no mod security. 766 00:33:12,260 --> 00:33:13,540 And I'm going to hop over here. 767 00:33:13,560 --> 00:33:17,400 I have ssh-2-waf.example.com, different host. 768 00:33:20,160 --> 00:33:23,780 So you can see comp.d is linked to no mod security over here. 769 00:33:24,500 --> 00:33:32,540 And then if you look at, this is all the configuration you need to set up a reverse proxy. 770 00:33:33,280 --> 00:33:34,280 You know, that's it. 771 00:33:35,000 --> 00:33:36,860 I'm not even using a virtual host here. 772 00:33:36,880 --> 00:33:37,960 I'm just saying slash. 773 00:33:38,100 --> 00:33:40,960 Anything under slash, you proxy to www.example.com. 774 00:33:41,120 --> 00:33:43,060 This is waf.example.com. 775 00:33:43,560 --> 00:33:47,280 And you're basically using mod proxy and proxy pass reverse mode. 776 00:33:48,360 --> 00:33:51,740 So that's all the configuration I've really got on the waf. 777 00:33:55,980 --> 00:33:59,540 Just make sure our current configuration is actually running. 778 00:34:00,540 --> 00:34:05,420 What we're going to do here, flip back to www. 779 00:34:06,180 --> 00:34:10,040 I'm going to tail the access log. 780 00:34:10,260 --> 00:34:10,520 Okay. 781 00:34:11,640 --> 00:34:13,260 And I'm going to show you that when I, 782 00:34:13,560 --> 00:34:15,480 when I do a request to waf.example.com, 783 00:34:15,680 --> 00:34:19,700 it proxies through and you'll see a request hit www.example.com. 784 00:34:19,840 --> 00:34:21,640 We're not running any mod security here right now. 785 00:34:26,520 --> 00:34:32,880 So instead of www, I'm going to go to waf.example.com. 786 00:34:34,560 --> 00:34:40,640 Now, remember in the background, we're tailing the access log on the web server, 787 00:34:40,740 --> 00:34:41,760 not the web app firewall. 788 00:34:43,560 --> 00:34:45,140 I just got the Apache file. 789 00:34:45,420 --> 00:34:45,860 Boom. 790 00:34:46,420 --> 00:34:50,700 See, the request came from waf.example.com, not client.example.com. 791 00:34:51,100 --> 00:34:51,400 Okay. 792 00:34:51,460 --> 00:34:55,240 So basically that request was hit the web, hit the web app firewall, 793 00:34:55,360 --> 00:34:57,480 was rewritten and sent to the web server. 794 00:34:57,580 --> 00:34:58,360 The response came back. 795 00:34:58,940 --> 00:35:01,480 Now let's go turn on mod security on the web app firewall. 796 00:35:02,280 --> 00:35:04,760 Actually, first I'll show you the cross-site scripting attack. 797 00:35:04,820 --> 00:35:06,840 We'll make it through because we're not running any mod security. 798 00:35:12,640 --> 00:35:16,040 Okay, it got the example page, hit the web server. 799 00:35:31,280 --> 00:35:36,820 All right, so now we're passing this through mod security on the web app firewall. 800 00:35:36,840 --> 00:35:43,840 Now let's go back over to here. 801 00:35:43,940 --> 00:35:44,900 We're still tailing the log. 802 00:35:46,880 --> 00:35:50,920 We're going to go here, do our request again. 803 00:35:51,900 --> 00:35:53,780 Lo and behold, hey, everything worked. 804 00:35:53,840 --> 00:35:56,680 That's a normal request that went through the reverse proxy. 805 00:35:57,120 --> 00:35:58,880 Now let's try to do this malicious request. 806 00:36:04,140 --> 00:36:05,080 Got a 500. 807 00:36:07,180 --> 00:36:08,020 Didn't even hit. 808 00:36:08,100 --> 00:36:11,100 There's no entry in there in the web server's Apache log. 809 00:36:11,600 --> 00:36:12,680 If we go over here, 810 00:36:20,940 --> 00:36:25,660 you can see that last request generated a cross-site scripting alert on the web app firewall. 811 00:36:26,480 --> 00:36:30,300 All right, so we just demonstrated reverse proxying, filtering out an attack, 812 00:36:30,540 --> 00:36:33,840 and basically letting normal traffic through. 813 00:36:53,300 --> 00:36:56,520 All right, so let's talk about content injection in the last few minutes I got here. 814 00:36:58,000 --> 00:37:00,540 I want to give credit to David Kierzowski. 815 00:37:00,900 --> 00:37:03,220 I apologize if I did not do your name right. 816 00:37:03,460 --> 00:37:05,320 He's associated with the GNU Citizen Group. 817 00:37:05,600 --> 00:37:06,800 Basically, he wrote this. 818 00:37:06,800 --> 00:37:07,680 It's an interesting blog post. 819 00:37:07,780 --> 00:37:10,540 I've got a link there called Content Injection, Hack the Hacker. 820 00:37:10,940 --> 00:37:13,980 So he looked at ModSecurity 2.5 and said, wow, this is kind of cool. 821 00:37:14,080 --> 00:37:16,260 I can inject content based on any of these rules. 822 00:37:16,880 --> 00:37:18,180 So you could do it for defense. 823 00:37:19,040 --> 00:37:20,120 You could do it for fun. 824 00:37:20,940 --> 00:37:26,360 Or you could hijack JavaScript functions, redefine alert as a logger, for instance. 825 00:37:27,180 --> 00:37:31,920 So really, with this capability, you've got almost a looking glass into the client's browser. 826 00:37:32,200 --> 00:37:35,280 You can inject arbitrary JavaScript code back into the responses. 827 00:37:36,800 --> 00:37:42,720 So an example of how to use this is we're going to inject a JavaScript applet called My Address. 828 00:37:42,900 --> 00:37:45,840 What it does is it runs the applet inside the user's browser, 829 00:37:46,000 --> 00:37:50,600 and it sends a callback back to us identifying the browser's actual IP address. 830 00:37:51,380 --> 00:37:52,880 It's not going to be affected by NAT. 831 00:37:54,400 --> 00:37:57,120 So it'll be interesting to actually see their internal IP address. 832 00:37:57,420 --> 00:38:00,040 So here's the rules that you're going to need to do that. 833 00:38:00,780 --> 00:38:02,200 You turn on content injection. 834 00:38:02,420 --> 00:38:03,240 It's off by default. 835 00:38:04,160 --> 00:38:06,540 You basically say, you know, you set an alert variable. 836 00:38:06,540 --> 00:38:07,340 Tx.alert. 837 00:38:07,700 --> 00:38:11,540 And basically, you're matching on Tx.alert in that security rule. 838 00:38:11,740 --> 00:38:13,920 And you see it says prepend colon. 839 00:38:14,380 --> 00:38:20,180 And you've got some stuff that's getting injected in there, an applet tag, myaddress.class. 840 00:38:20,540 --> 00:38:24,800 And then it's a submission to grabip.php. 841 00:38:25,200 --> 00:38:28,860 And it's going to grab the IP off the browser and return it in a parameter to me. 842 00:38:31,140 --> 00:38:35,960 So this is a snippet from the Apache access log when we do this. 843 00:38:36,580 --> 00:38:40,640 So you've got to imagine you've got a reverse proxy WAF at 10.0.0.10. 844 00:38:40,760 --> 00:38:43,700 And you've got the attacker at 1.7.2.16.0.20. 845 00:38:44,260 --> 00:38:48,220 So the first log, that's the first entry there. 846 00:38:48,320 --> 00:38:53,540 That's your web app firewall sending the request onto your web server, or it's logging it. 847 00:38:53,700 --> 00:38:56,580 And you can see it's a scripting document write. 848 00:38:56,720 --> 00:39:01,400 It's a nasty little image tag that's revealing the cookie to the hacker's site. 849 00:39:02,600 --> 00:39:05,840 So the next log is we returned. 850 00:39:06,540 --> 00:39:11,920 That myaddress.class to the browser. 851 00:39:12,120 --> 00:39:19,960 And we see immediately afterwards a request hit our server with grabip.php and ip equals 1.7.2.16.0.20. 852 00:39:20,380 --> 00:39:24,720 So by injecting that script, I've just revealed the IP address of the attacker. 853 00:39:26,620 --> 00:39:33,320 So another thing that's getting a lot of buzz lately is vulnerability assessment or web scanning plus web app firewalls. 854 00:39:34,240 --> 00:39:36,520 So the dream is that you could have... 855 00:39:36,540 --> 00:39:44,740 You could have this automated vulnerability assessment on your web apps that automagically identifies flaws and writes WAF rules for you that just work. 856 00:39:45,220 --> 00:39:45,380 Okay? 857 00:39:46,160 --> 00:39:49,220 Until recently, this was not really feasible. 858 00:39:49,620 --> 00:39:52,320 Web scanners generated way too many false positives. 859 00:39:52,560 --> 00:39:55,740 A lot of the vulnerabilities identified were actually duplicates. 860 00:39:55,840 --> 00:40:02,300 And because of this, the rules that would be automatically generated had many false positives and many duplicates. 861 00:40:02,320 --> 00:40:03,320 So performance would suffer. 862 00:40:04,000 --> 00:40:05,360 Vendors are trying again now. 863 00:40:06,620 --> 00:40:16,800 I know White Hat Security, their Sentinel service, and F5 have a partnership now where you scan your web apps with White Hat Security's tool. 864 00:40:16,940 --> 00:40:22,320 And it will automatically feed rules into your F5 web app firewall. 865 00:40:22,780 --> 00:40:24,640 I have never played with this in real life. 866 00:40:24,720 --> 00:40:25,980 I don't know how well it works. 867 00:40:26,120 --> 00:40:27,680 But people are attempting this now. 868 00:40:27,840 --> 00:40:30,360 And I expect to see a lot more synergy. 869 00:40:30,400 --> 00:40:31,260 I hate that word. 870 00:40:31,520 --> 00:40:34,640 Between vulnerability assessment and WAFs here. 871 00:40:35,840 --> 00:40:36,360 So... 872 00:40:36,360 --> 00:40:40,360 So as we're wrapping up, let's talk about the limitations of WAFs. 873 00:40:40,480 --> 00:40:40,600 You know? 874 00:40:40,680 --> 00:40:41,940 They're not a silver bullet. 875 00:40:42,420 --> 00:40:46,820 A lot of things can't really be handled with these. 876 00:40:47,040 --> 00:40:52,640 So insecure cookie handling or potential cookie tampering, insecure session handling. 877 00:40:53,760 --> 00:40:56,500 WAFs can do cookie encryption and decryption on the fly. 878 00:40:56,640 --> 00:40:57,640 So they can kind of handle that. 879 00:40:57,940 --> 00:41:00,900 The real hard one here is business logic flaws. 880 00:41:03,040 --> 00:41:03,920 Here's an example. 881 00:41:04,100 --> 00:41:06,000 A reliance on a predictable random... 882 00:41:06,360 --> 00:41:10,080 URL that just provides authentication and authorization. 883 00:41:10,520 --> 00:41:14,720 So if you know this weird URL, then you can get to content you shouldn't be able to get to. 884 00:41:15,260 --> 00:41:20,000 So WAFs can solve this by URL encryption where it's basically proxying the URLs back and forth. 885 00:41:20,860 --> 00:41:26,320 And that's kind of similar to how they're doing that PDF universal cross-site scripting protection I mentioned. 886 00:41:27,180 --> 00:41:31,920 But many flaws in business logic are extremely difficult to detect with automated scanning. 887 00:41:32,360 --> 00:41:35,600 They're even extremely difficult to detect with manual code review. 888 00:41:36,360 --> 00:41:37,960 These are the hardest bugs to find. 889 00:41:38,040 --> 00:41:38,920 Business logic flaws. 890 00:41:39,200 --> 00:41:48,960 I think Jeremiah Grossman and a colleague gave a talk at Black Hat the other day showing how business logic flaws can be used to defraud organizations of lots and lots of money. 891 00:41:49,980 --> 00:41:52,580 Those are difficult to mitigate with a web app firewall. 892 00:41:53,720 --> 00:41:59,280 So some closing thoughts on the future of web app firewalls and these kind of things. 893 00:41:59,920 --> 00:42:04,680 So vendors are going to increasingly add WAF-like functionality to their products. 894 00:42:05,440 --> 00:42:05,980 You know? 895 00:42:06,360 --> 00:42:10,900 High-end load balancers, firewalls, IPSs, UTM devices. 896 00:42:11,160 --> 00:42:14,480 They're all adding web protection kind of functionality. 897 00:42:15,500 --> 00:42:18,860 I could even see WAF-like functionality being wrapped into malware. 898 00:42:19,280 --> 00:42:23,600 I mean, a lot of these malware trojans already have SOX proxy functionality in it. 899 00:42:23,760 --> 00:42:28,840 So basically, you know, the attackers can proxy their traffic through your compromised host. 900 00:42:29,320 --> 00:42:34,320 So potentially they could add some sort of web app proxying functionality there. 901 00:42:35,300 --> 00:42:36,160 I'm wondering. 902 00:42:36,360 --> 00:42:47,340 If we're going to see, you know, rogue WAF attacks or malicious WAF attacks where an attacker-controlled web app firewall is there and it's basically intercepting your traffic, injecting bad stuff back into it. 903 00:42:47,520 --> 00:42:58,720 And this might be similar to, like, a WPAD, the Windows Proxy Auto Detection attack vector, or a WAF poisoning where, you know, an attacker puts some bad things into the injection rules. 904 00:42:59,640 --> 00:43:03,240 And also people are going to increasingly be releasing WAF bypass vulnerabilities. 905 00:43:03,700 --> 00:43:04,920 These things are getting deployed everywhere. 906 00:43:05,680 --> 00:43:08,540 Attackers are figuring out how to bypass them, subvert them, evade them. 907 00:43:08,760 --> 00:43:10,060 So you're going to see more and more of that. 908 00:43:11,520 --> 00:43:14,080 I'm going to give a plug for another talk that's going to happen today. 909 00:43:14,840 --> 00:43:17,080 Wendell Henrique, I don't know if he's here. 910 00:43:18,420 --> 00:43:22,300 Basically, he's giving a talk called Playing with Web App Firewalls this afternoon. 911 00:43:23,020 --> 00:43:28,520 And basically it seems to be more of an approach from an attacker's perspective, how to detect, how to fingerprint and evade WAFs. 912 00:43:28,720 --> 00:43:33,100 And I went through his slides this morning, and I tell you, I learned a few things about how to fingerprint these things. 913 00:43:33,180 --> 00:43:34,900 So if you're interested in web app firewalls, you should go to the website. 914 00:43:34,900 --> 00:43:40,700 And also from an attacker's perspective or a pen tester's perspective, I would recommend you go to Wendell's talk this afternoon. 915 00:43:41,860 --> 00:43:49,080 I just want to give a thanks to Dr. Tangent, the DEF CON goons, and everyone who worked their butts off to make this happen once again. 916 00:43:49,740 --> 00:43:52,840 And I've got to give greets to the DC-404 crew that's out here. 917 00:43:54,460 --> 00:43:59,880 We've got Dr. Chaos, Karek, David Maynor, Scott Moulton, Allen Bredgener. 918 00:44:00,080 --> 00:44:03,380 We're all giving talks here at DC-16. 919 00:44:03,380 --> 00:44:07,760 And I've got to give props to our very own Goon D. Code, who's a great friend. 920 00:44:08,620 --> 00:44:12,740 And if you have questions about this, I'm going to be heading off to the Q&A room as I wrap up. 921 00:44:12,840 --> 00:44:17,020 But you can also email me questions, and I'd be happy to discuss them with you over email. 922 00:44:17,740 --> 00:44:18,300 Thank you.