1 00:00:00,000 --> 00:00:10,520 Hi all. Sorry for the delay to start. I have some problems in the laptop with the web application file we should use to the demonstration. 2 00:00:14,340 --> 00:00:21,960 Well, who am I? My name is Wendel. I work in information technology more than 10 years. 3 00:00:21,960 --> 00:00:27,760 I work for a company in Brazil called Security Labs. We work for a credit card company, government, 4 00:00:28,480 --> 00:00:35,300 and other big companies in Brazil. I'm affiliated to Hockeyaholic, which is an international 5 00:00:35,300 --> 00:00:42,840 group of security research. I had been working with penetration testing the last three years. 6 00:00:43,940 --> 00:00:49,580 I had discovered some vulnerabilities in web mails, like OpenWebMail, WebMeow, and 7 00:00:49,580 --> 00:00:51,940 the others. Access points, like deletion, etc. 8 00:00:51,940 --> 00:01:00,500 Link, Citrix Metaframe, and the other softwares. I wrote some tools that was used in some magazines 9 00:01:00,500 --> 00:01:07,660 famous around the world, like Hacking9, and the PC World. I also spoke to some conference 10 00:01:07,660 --> 00:01:13,180 very famous in Brazil, like Hackers to Hackers Conference, Code Breakers, and was invited 11 00:01:13,180 --> 00:01:19,180 to speak to others, like IT Underground in Italy, and the It One Take One Mexico. 12 00:01:20,600 --> 00:01:21,920 Well, I am from Brazil. I am from Brazil. I am from Brazil. I am from Brazil. I am from 13 00:01:21,920 --> 00:01:32,920 Brazil. When I arrived here, everybody spoke to me about Brazil. 14 00:01:34,320 --> 00:01:40,280 Soccer, what do you think about the next games, holiday stuff. So yes, I'm from Brazil, 15 00:01:40,380 --> 00:01:43,700 the city of Pelé, and the slides again speak by itself. 16 00:01:48,240 --> 00:01:50,720 What do you see in this presentation? 17 00:01:52,340 --> 00:02:14,160 What is the WAF we are speaking about, type of operations, common topology, passive and reactive modes, tricks to detect WAF systems, tricks to fingerprint WAF systems, genetic evasion techniques, specific techniques to evade WAF systems, and what they fail to protect. 18 00:02:16,040 --> 00:02:42,480 Well, we have a small description retrieved from the web application security consourcing glossary that basically say that web application firewalls are a kind of firewalls specific to layer 7 applications, in the case to the web application, that try to protect the application from hostility attacks in this specific layer. 19 00:02:45,080 --> 00:03:04,460 Well, they are also called deep impact inspection firewalls because they look at every request and they are able to look at response, looking for problems in HTTP, HTTPS, SOAP, XML, services, web services, and the others. 20 00:03:06,220 --> 00:03:12,000 Some web application firewalls look to signature attacks, like you see in many firewalls. 21 00:03:12,000 --> 00:03:12,720 And also, 22 00:03:12,960 --> 00:03:13,700 uh, 23 00:03:14,160 --> 00:03:23,420 abnormal content behavior problems that, basically, are the same we see in EDS and EPS technology. 24 00:03:24,440 --> 00:03:28,880 The web application firewalls can be either softer, harder, or appliance. 25 00:03:30,160 --> 00:03:34,020 And, basically, uh, they try to protect a web server. 26 00:03:39,480 --> 00:03:41,880 Well, some notes about the definition. 27 00:03:42,720 --> 00:03:43,100 Uh, 28 00:03:44,160 --> 00:03:53,560 some new web application firewalls can work both with attack signatures and abnormal behavior. 29 00:03:54,740 --> 00:04:03,160 Some systems not necessarily need to be in front of a web server, as most, uh, where in most places we're accustomed to see. 30 00:04:03,800 --> 00:04:09,220 They can be directly putted in the machine where the web server is running. 31 00:04:09,960 --> 00:04:14,000 There is not only, as described in some older documentation, 32 00:04:14,000 --> 00:04:14,140 There is not only, as described in some older documentation, 33 00:04:14,140 --> 00:04:16,420 that are really used as reference, 34 00:04:16,740 --> 00:04:20,340 able to detect only attacks in the incoming packets. 35 00:04:20,540 --> 00:04:24,660 It's able to detect attacks in inbound and the outbound packets. 36 00:04:27,320 --> 00:04:30,800 Basically, there are three types of operation modes. 37 00:04:31,120 --> 00:04:32,960 There are negative modes, 38 00:04:33,780 --> 00:04:36,300 that are based in a kind of black list. 39 00:04:36,580 --> 00:04:38,160 There are positive modes, 40 00:04:38,340 --> 00:04:40,680 which are a kind of white list based. 41 00:04:41,160 --> 00:04:42,300 And mixed mode, 42 00:04:42,580 --> 00:04:42,700 and mixed mode, 43 00:04:42,700 --> 00:04:44,120 that's what the modes are based on. 44 00:04:44,120 --> 00:04:53,160 The most famous web application nowadays uses a kind of negative mode and a kind of positive mode. 45 00:04:56,080 --> 00:05:02,080 Negative security model recognizes attack by relaying a database of expected attack signatures, 46 00:05:02,440 --> 00:05:08,560 like most of the EDS and EPS that we have today on the market. 47 00:05:08,560 --> 00:05:19,800 For example, look for any page or any argument with the user input matching any potential cross-site scripting strings. 48 00:05:20,160 --> 00:05:28,260 This can be, for example, strings, string.fronsharkode, and a combination of all these strings. 49 00:05:29,560 --> 00:05:37,300 The good point of this kind of operation mode is that it's very fast to install and use. 50 00:05:37,520 --> 00:05:38,200 Basically, 51 00:05:38,560 --> 00:05:44,500 you have a pre-built group of rules that try to detect the most common attacks. 52 00:05:44,840 --> 00:05:49,160 So you basically get an appliance or a software, install, and this is running. 53 00:05:50,060 --> 00:05:56,100 The bad point is it's so generic, so in general you have a high number of false positives, 54 00:05:56,420 --> 00:06:02,200 more time to process, and also a small number of protection. 55 00:06:05,980 --> 00:06:07,790 Positive security model also... 56 00:06:10,720 --> 00:06:15,980 Basically, it's a kind of enforcement of the application logic. 57 00:06:16,820 --> 00:06:22,340 For example, if you have a script called the news.jsp, 58 00:06:22,560 --> 00:06:26,900 and it has a field called the ID of identification, 59 00:06:27,360 --> 00:06:33,300 that only accepts numbers from number 0 to number 10, 60 00:06:33,440 --> 00:06:38,060 and always starting from number 0 and going to 65534. 61 00:06:38,180 --> 00:06:44,060 Basically, they construct a kind of rule that only allows this kind of data, 62 00:06:44,220 --> 00:06:47,320 this kind of digit, start from this number to this number, 63 00:06:47,440 --> 00:06:52,660 and all other data will be exceptions and not be processed. 64 00:06:54,340 --> 00:06:59,280 Well, by the nature of the rule that's much more small, 65 00:06:59,540 --> 00:07:02,800 and it's much more fast and have better performance, 66 00:07:03,100 --> 00:07:07,540 and they also provide less false positives when you have good rules. 67 00:07:08,840 --> 00:07:12,360 The bads are it takes much more time to implement. 68 00:07:12,740 --> 00:07:16,500 Some web application files in the market provide some tools 69 00:07:16,500 --> 00:07:19,500 to automatically generate this kind of rules. 70 00:07:20,460 --> 00:07:25,520 What they call, in general, automatic learning mode, or similar name. 71 00:07:26,640 --> 00:07:31,900 This kind of stuff is good, and they are helping a lot in generating these rules. 72 00:07:32,000 --> 00:07:35,340 The big problem is that this rule is never perfect, 73 00:07:35,520 --> 00:07:37,280 and it should work automatically. 74 00:07:37,280 --> 00:07:41,980 They need basic to have human reviews, 75 00:07:42,240 --> 00:07:45,260 else they will also be so leaked in a fashion 76 00:07:45,260 --> 00:07:47,520 that it doesn't generate a lot of false positives. 77 00:07:49,240 --> 00:07:53,100 And it makes the attacker's life much more easy. 78 00:07:55,160 --> 00:08:04,780 Well, the mixed mode is basically the use of positive and negative models together, 79 00:08:05,060 --> 00:08:07,260 which is happening most of the time. 80 00:08:07,280 --> 00:08:10,220 It's the result of the today's web application file. 81 00:08:10,600 --> 00:08:14,520 However, in general, all have one that is predominant. 82 00:08:14,620 --> 00:08:16,240 Negative or positive model. 83 00:08:17,120 --> 00:08:17,800 Well. 84 00:08:23,080 --> 00:08:27,600 In general, WAF systems can be used in three different network topologies. 85 00:08:28,180 --> 00:08:30,820 Between a web server and a web client. 86 00:08:31,300 --> 00:08:34,700 This is the most common that we see in the internet. 87 00:08:34,700 --> 00:08:38,080 Also, which people call, like, reverse proxy. 88 00:08:38,380 --> 00:08:41,160 We have a web application file in a reverse proxy. 89 00:08:42,320 --> 00:08:46,960 Appliance, or a machine that is seated between the web client and the web server. 90 00:08:47,260 --> 00:08:51,080 The second is integrated in the all web server, 91 00:08:51,240 --> 00:08:54,060 which is more common in small companies. 92 00:08:54,700 --> 00:08:57,120 And the third option that's not so common, 93 00:08:57,220 --> 00:09:00,060 that's directly connected in the switch, 94 00:09:00,260 --> 00:09:02,260 in part mirror, 95 00:09:02,560 --> 00:09:03,360 span, 96 00:09:03,360 --> 00:09:07,520 or HAP that are other asynchronous names to the same, 97 00:09:07,680 --> 00:09:10,520 that basically get a copy of all the data 98 00:09:10,520 --> 00:09:11,980 that a network, 99 00:09:12,340 --> 00:09:13,820 that a port get. 100 00:09:14,000 --> 00:09:18,200 It's replied to another one when it's running the WAF system. 101 00:09:20,940 --> 00:09:22,040 Passive or reactive. 102 00:09:23,500 --> 00:09:27,160 Most WAF systems work both passive and reactive mode. 103 00:09:27,760 --> 00:09:32,300 In general, in the first days, they are running in passive mode 104 00:09:32,300 --> 00:09:34,560 to identify false positives, 105 00:09:34,880 --> 00:09:39,480 and in special when you are using some kind of automatic learning mode technology 106 00:09:40,260 --> 00:09:43,960 to detect this kind of problems, 107 00:09:44,300 --> 00:09:49,040 and fix before putting it in a production environment. 108 00:09:49,580 --> 00:09:54,300 In general, when it's running very well with .generate false positives, 109 00:09:54,580 --> 00:09:56,960 it starts to run in reactive mode. 110 00:10:00,140 --> 00:10:01,600 A little back from Brazil. 111 00:10:02,300 --> 00:10:05,860 Here we have some famous guys from Brazil that probably all should be. 112 00:10:06,100 --> 00:10:09,380 The second thing that everybody asked me when I arrived here, 113 00:10:09,620 --> 00:10:11,140 Hey, and Brazilian Jiu-Jitsu? 114 00:10:11,320 --> 00:10:13,520 What happened? It really works? Blah, blah, blah. 115 00:10:13,700 --> 00:10:16,240 That's the answer. Brazilian Jiu-Jitsu really works. 116 00:10:16,820 --> 00:10:18,540 We can see Anderson Silva, 117 00:10:19,100 --> 00:10:19,600 Royce Grace, 118 00:10:20,000 --> 00:10:20,940 Rodrigo Minotaur, 119 00:10:21,040 --> 00:10:21,660 and many others. 120 00:10:24,580 --> 00:10:28,980 Well, here we have some tricks to the fat WAF systems. 121 00:10:29,360 --> 00:10:31,500 Well, WAF systems. 122 00:10:32,300 --> 00:10:34,480 Leave several points that can be used 123 00:10:34,480 --> 00:10:36,740 that permit us to detect them. 124 00:10:38,300 --> 00:10:38,980 Example. 125 00:10:39,220 --> 00:10:39,900 Cooks. 126 00:10:40,020 --> 00:10:42,960 We have example of Citrix Net Scholar. 127 00:10:43,540 --> 00:10:46,060 Citrix Net Scholar, some case that 128 00:10:46,060 --> 00:10:50,840 on cook in the application that allow us to detect it's running. 129 00:10:51,220 --> 00:10:54,440 As we can see in the cook field, 130 00:10:54,680 --> 00:10:56,500 we have NES that is a 131 00:10:57,220 --> 00:10:59,380 a synchron of Net Scholar 132 00:11:00,580 --> 00:11:01,940 underline AF, 133 00:11:02,300 --> 00:11:03,140 and the other names. 134 00:11:03,260 --> 00:11:06,640 This kind of cook allow us to identify this kind of system. 135 00:11:06,880 --> 00:11:08,100 We can see in a 136 00:11:08,100 --> 00:11:10,640 in a real life site. 137 00:11:31,040 --> 00:11:31,600 Here. 138 00:11:32,220 --> 00:11:34,420 This site is a real site on the internet 139 00:11:34,420 --> 00:11:36,180 using Net Scholar from Citrix. 140 00:11:36,420 --> 00:11:38,260 We can see the cooks. 141 00:11:38,440 --> 00:11:39,200 It's added. 142 00:11:40,640 --> 00:11:41,420 To the application. 143 00:11:42,160 --> 00:11:43,420 And consequently, 144 00:11:44,380 --> 00:11:46,360 allow us to detect the presence 145 00:11:46,360 --> 00:11:47,840 of the web application file. 146 00:11:48,320 --> 00:11:50,400 It's a common example of 147 00:11:50,400 --> 00:11:52,540 single pointing that the 148 00:11:52,540 --> 00:11:54,080 the web application files 149 00:11:54,080 --> 00:11:55,980 add and should never 150 00:11:56,480 --> 00:11:58,380 happen since it should be 151 00:11:58,380 --> 00:11:59,820 stealth to the attackers. 152 00:12:10,640 --> 00:12:10,840 Well. 153 00:12:11,360 --> 00:12:12,460 Header rewrite. 154 00:12:13,480 --> 00:12:17,400 Some WAF products allow rewriting of HTTP readers. 155 00:12:17,760 --> 00:12:21,120 The most common is the server field. 156 00:12:21,760 --> 00:12:22,740 What happen? 157 00:12:23,280 --> 00:12:25,300 Sometimes, some web application files, 158 00:12:25,500 --> 00:12:28,620 when you request a normal and valid 159 00:12:29,740 --> 00:12:31,760 URI or URL, 160 00:12:32,640 --> 00:12:37,560 they respond with a valid 200 code. 161 00:12:37,560 --> 00:12:40,980 And the server field is set for 162 00:12:40,980 --> 00:12:42,720 the name of the web server 163 00:12:42,720 --> 00:12:43,800 or Apache, 164 00:12:44,880 --> 00:12:46,540 Internet Information Service, 165 00:12:46,880 --> 00:12:47,720 whatever. 166 00:12:48,440 --> 00:12:49,160 However, 167 00:12:49,400 --> 00:12:51,700 some products, when we request 168 00:12:51,700 --> 00:12:52,700 a invalid 169 00:12:53,700 --> 00:12:55,480 or a still 170 00:12:55,480 --> 00:12:57,980 URL or URI, 171 00:12:58,160 --> 00:12:59,280 it is simple. 172 00:12:59,820 --> 00:13:01,680 Removing the server field. 173 00:13:01,960 --> 00:13:04,560 So, it's a thing that we can identify 174 00:13:04,560 --> 00:13:06,660 that there are some systems that can be a WAF 175 00:13:06,660 --> 00:13:08,680 that is protecting the site. 176 00:13:08,840 --> 00:13:10,140 And also some others 177 00:13:10,660 --> 00:13:11,920 WAF applications 178 00:13:13,060 --> 00:13:13,860 only 179 00:13:14,660 --> 00:13:15,260 override 180 00:13:15,260 --> 00:13:16,200 or 181 00:13:16,200 --> 00:13:18,360 allow the reader rewrite 182 00:13:18,360 --> 00:13:20,720 when we send some bad content. 183 00:13:21,120 --> 00:13:21,980 For example, 184 00:13:22,640 --> 00:13:23,400 requesting a 185 00:13:24,780 --> 00:13:25,940 hostility content. 186 00:13:26,400 --> 00:13:27,880 Below we have an example. 187 00:13:28,320 --> 00:13:30,760 A valid and non-hostility request 188 00:13:30,760 --> 00:13:32,120 should return a 200 189 00:13:32,660 --> 00:13:34,720 OK status code 190 00:13:34,720 --> 00:13:36,220 and with the server 191 00:13:36,660 --> 00:13:38,560 that is the real server content. 192 00:13:38,960 --> 00:13:41,420 Apache 2.2.9 193 00:13:41,420 --> 00:13:42,380 running in Unix. 194 00:13:42,440 --> 00:13:43,760 Within the same server 195 00:13:44,300 --> 00:13:46,560 we request a hostility request. 196 00:13:46,820 --> 00:13:47,400 For example, 197 00:13:47,900 --> 00:13:49,500 a well-known web 198 00:13:50,340 --> 00:13:52,160 exploit that this web application 199 00:13:52,160 --> 00:13:54,120 triggered, we can get 200 00:13:54,120 --> 00:13:56,160 the following response. 201 00:13:56,320 --> 00:13:57,840 The server was changed to 202 00:13:57,840 --> 00:14:00,080 Netscape Enterprise 4.0. 203 00:14:00,300 --> 00:14:02,280 So, it's another problem in some web 204 00:14:02,280 --> 00:14:04,480 application products. They only apply 205 00:14:04,480 --> 00:14:05,500 the HTTP 206 00:14:06,660 --> 00:14:08,520 the reader rewrite 207 00:14:08,520 --> 00:14:10,180 in some circumstances 208 00:14:11,220 --> 00:14:12,660 that allow us to 209 00:14:12,660 --> 00:14:14,200 identify their presence too. 210 00:14:16,740 --> 00:14:18,520 Some WAF vendors 211 00:14:18,520 --> 00:14:20,540 return different HTTP response 212 00:14:20,540 --> 00:14:21,700 error codes 213 00:14:22,860 --> 00:14:23,660 in 214 00:14:24,320 --> 00:14:25,280 the same URL. 215 00:14:27,280 --> 00:14:28,260 Valid one 216 00:14:28,260 --> 00:14:28,920 or not. 217 00:14:29,740 --> 00:14:32,540 If you insert a hostility parameter 218 00:14:33,340 --> 00:14:34,440 for example 219 00:14:34,440 --> 00:14:35,820 just to be more clear 220 00:14:36,660 --> 00:14:38,700 it's far away to be good. 221 00:14:40,300 --> 00:14:41,720 Suppose we had 222 00:14:41,720 --> 00:14:43,160 not in this case 223 00:14:43,160 --> 00:14:44,880 for example 224 00:14:45,400 --> 00:14:46,220 a page 225 00:14:46,220 --> 00:14:47,200 no is 226 00:14:47,200 --> 00:14:50,600 index.php 227 00:14:50,600 --> 00:14:51,400 dot 228 00:14:53,600 --> 00:14:54,520 ID 229 00:14:57,280 --> 00:14:58,200 equal 230 00:14:58,200 --> 00:14:58,660 123 231 00:14:59,180 --> 00:15:00,200 For example 232 00:15:00,200 --> 00:15:01,560 it's a kind of 233 00:15:01,560 --> 00:15:03,360 suppose valid request 234 00:15:03,360 --> 00:15:04,600 and is processed. 235 00:15:06,660 --> 00:15:07,960 If we put in the same request 236 00:15:07,960 --> 00:15:09,620 that always return the code 237 00:15:09,620 --> 00:15:11,380 200 for example 238 00:15:11,380 --> 00:15:14,000 it should be processed 239 00:15:14,000 --> 00:15:15,660 OK. If we just 240 00:15:16,560 --> 00:15:17,880 change the 123 241 00:15:17,880 --> 00:15:19,300 to something like 242 00:15:21,340 --> 00:15:22,140 pipeline 243 00:15:22,640 --> 00:15:23,720 ID or 244 00:15:25,200 --> 00:15:26,000 ID 245 00:15:26,420 --> 00:15:28,120 that is hostility content 246 00:15:28,480 --> 00:15:29,940 in general people trying to 247 00:15:29,940 --> 00:15:31,840 execute operating system command 248 00:15:31,840 --> 00:15:33,880 this can return for us 249 00:15:33,880 --> 00:15:36,120 a different HTTP response code 250 00:15:36,660 --> 00:15:36,980 for example 251 00:15:38,360 --> 00:15:40,520 404 as if the page 252 00:15:40,520 --> 00:15:42,180 index.php 253 00:15:42,180 --> 00:15:44,240 doesn't exist which is not true. 254 00:15:44,440 --> 00:15:45,400 So we can 255 00:15:45,400 --> 00:15:47,960 be sure that it's not the content 256 00:15:47,960 --> 00:15:49,900 of the web server and the 257 00:15:50,380 --> 00:15:52,360 application in the middle like a web 258 00:15:52,360 --> 00:15:54,360 application file. Also the same 259 00:15:54,360 --> 00:15:55,780 happen if you request 260 00:15:55,780 --> 00:15:57,720 parameters that doesn't exist. 261 00:15:58,080 --> 00:15:58,880 For example 262 00:16:03,780 --> 00:16:05,140 no exist 263 00:16:06,660 --> 00:16:08,760 and the same parameters. It will return 264 00:16:08,760 --> 00:16:10,420 in general errors 265 00:16:11,140 --> 00:16:11,840 424 266 00:16:12,820 --> 00:16:13,520 423 267 00:16:15,020 --> 00:16:16,600 500 and the 268 00:16:16,600 --> 00:16:17,580 other. So this kind of 269 00:16:17,580 --> 00:16:18,300 of 270 00:16:20,350 --> 00:16:21,940 returns can help us to 271 00:16:22,490 --> 00:16:24,200 identify the web application 272 00:16:24,200 --> 00:16:26,400 files. Here is a valid 273 00:16:26,400 --> 00:16:28,060 example that was used 274 00:16:28,060 --> 00:16:30,300 in one of the application files 275 00:16:30,300 --> 00:16:31,800 we tested. 276 00:16:32,220 --> 00:16:34,580 A valid request with hostility 277 00:16:34,580 --> 00:16:36,340 parameter that doesn't exist 278 00:16:36,660 --> 00:16:37,020 returned 279 00:16:39,080 --> 00:16:40,600 501 status code 280 00:16:40,600 --> 00:16:42,480 method not implemented. For sure 281 00:16:42,480 --> 00:16:44,600 it's not valid. And also we could 282 00:16:44,600 --> 00:16:46,240 note that the options 283 00:16:47,100 --> 00:16:48,280 sorry, the allow 284 00:16:48,280 --> 00:16:50,360 was changed because the allow 285 00:16:50,360 --> 00:16:52,520 option of this HTTP header 286 00:16:52,520 --> 00:16:54,040 in the normal request 287 00:16:54,500 --> 00:16:56,500 never returned the 288 00:16:56,500 --> 00:16:58,220 trace option. So there 289 00:16:58,220 --> 00:17:00,580 are a lot of small points that can be 290 00:17:00,580 --> 00:17:02,260 used to detect this kind of systems. 291 00:17:07,060 --> 00:17:08,140 Well, back in. 292 00:17:09,360 --> 00:17:10,260 Some web 293 00:17:11,180 --> 00:17:12,360 some of 294 00:17:12,360 --> 00:17:14,480 vendors provide a filter 295 00:17:14,480 --> 00:17:16,560 to close connection. You can use 296 00:17:16,560 --> 00:17:18,000 it to drop the connection, 297 00:17:18,780 --> 00:17:19,820 block users 298 00:17:19,820 --> 00:17:22,420 and they also have the possibility to interact 299 00:17:22,420 --> 00:17:24,500 with files, external 300 00:17:24,500 --> 00:17:26,720 files. Well, ModSecurity 301 00:17:26,720 --> 00:17:28,000 is a common example. 302 00:17:28,500 --> 00:17:29,720 They have a 303 00:17:30,620 --> 00:17:32,200 filter called the drop action 304 00:17:32,200 --> 00:17:34,480 that immediately initiate 305 00:17:34,480 --> 00:17:36,020 a connection close action. 306 00:17:36,660 --> 00:17:38,320 Using a thin packet 307 00:17:38,320 --> 00:17:39,960 attackers can launch 308 00:17:40,320 --> 00:17:42,500 well-known attacks that 309 00:17:42,500 --> 00:17:44,280 mismatch the 310 00:17:44,280 --> 00:17:46,740 built-in rules from ModSecurity 311 00:17:46,740 --> 00:17:47,900 and analyze 312 00:17:47,900 --> 00:17:50,440 the back to the thin packet and 313 00:17:50,440 --> 00:17:51,940 try to identify the presence 314 00:17:52,340 --> 00:17:54,480 of a web application 315 00:17:54,480 --> 00:17:55,900 file possibility 316 00:17:56,840 --> 00:17:58,620 ModSecurity. This kind 317 00:17:58,620 --> 00:18:00,080 of filter is not available in 318 00:18:00,080 --> 00:18:02,260 other versions of ModSecurity. 319 00:18:04,520 --> 00:18:06,500 Some of these techniques we are 320 00:18:06,660 --> 00:18:08,120 using to identify 321 00:18:08,660 --> 00:18:10,320 web application files 322 00:18:10,320 --> 00:18:12,240 can be used also to identify 323 00:18:12,240 --> 00:18:14,060 intrusion prevention systems 324 00:18:15,000 --> 00:18:16,540 that are available 325 00:18:16,540 --> 00:18:17,460 on the market. 326 00:18:19,080 --> 00:18:20,320 What more about 327 00:18:20,320 --> 00:18:20,720 Brazil? 328 00:18:24,840 --> 00:18:26,180 Well, back in. 329 00:18:27,220 --> 00:18:28,600 Tricks to fingerprint 330 00:18:28,600 --> 00:18:29,780 WAF systems. 331 00:18:32,440 --> 00:18:34,740 All WAF systems have a built-in 332 00:18:34,740 --> 00:18:36,440 group of rules in negative 333 00:18:36,660 --> 00:18:38,400 mode that are 334 00:18:38,400 --> 00:18:40,360 that rule is based in black 335 00:18:40,360 --> 00:18:42,380 list that you spoke on the start 336 00:18:42,380 --> 00:18:43,180 of the presentation. 337 00:18:44,320 --> 00:18:46,340 These rules are different in 338 00:18:46,340 --> 00:18:47,280 each product. 339 00:18:49,040 --> 00:18:50,560 These rules can be 340 00:18:50,560 --> 00:18:51,880 specific to a 341 00:18:51,880 --> 00:18:54,480 well-known vulnerability. For example, 342 00:18:54,540 --> 00:18:56,600 the old EES Unicode 343 00:18:56,600 --> 00:18:58,500 attack can be 344 00:18:58,500 --> 00:19:00,120 a generic rule 345 00:19:00,120 --> 00:19:02,040 for a well-known 346 00:19:02,440 --> 00:19:03,620 class of vulnerability 347 00:19:04,580 --> 00:19:06,140 like SQL injection, 348 00:19:06,660 --> 00:19:08,680 cross-site scripting, and the others. 349 00:19:08,960 --> 00:19:10,560 And in general, these rules are 350 00:19:10,560 --> 00:19:12,180 associated with a action 351 00:19:12,180 --> 00:19:14,360 like drop the request, 352 00:19:14,800 --> 00:19:16,700 redirect to another page, 353 00:19:17,080 --> 00:19:17,580 etc. 354 00:19:24,740 --> 00:19:26,480 Attackers can create a set of 355 00:19:26,480 --> 00:19:28,360 attacks that test for a range of 356 00:19:28,360 --> 00:19:28,980 vulnerabilities 357 00:19:30,520 --> 00:19:32,620 that most WAF systems protect 358 00:19:32,620 --> 00:19:34,320 against or not. 359 00:19:34,580 --> 00:19:36,640 In this way, we are able to identify 360 00:19:36,660 --> 00:19:38,500 building rules of a product 361 00:19:38,500 --> 00:19:39,960 and consequently 362 00:19:40,430 --> 00:19:42,420 what product it is, what it means. 363 00:19:43,020 --> 00:19:44,200 We can generate 364 00:19:44,200 --> 00:19:45,800 a database 365 00:19:46,330 --> 00:19:46,680 of 366 00:19:46,680 --> 00:19:50,000 a big variant 367 00:19:50,000 --> 00:19:52,400 of web application 368 00:19:52,400 --> 00:19:54,180 attacks that some 369 00:19:54,180 --> 00:19:56,340 web application files detect and the 370 00:19:56,340 --> 00:19:58,340 others not. Based in the detection 371 00:19:58,340 --> 00:20:00,160 or not detection, 372 00:20:00,320 --> 00:20:02,000 we can identify the software's 373 00:20:02,000 --> 00:20:04,400 For example, suppose we send a 374 00:20:04,400 --> 00:20:05,760 request with a HTTP 375 00:20:06,660 --> 00:20:08,340 method that is different from 376 00:20:08,340 --> 00:20:10,960 1.0 or 1.1 377 00:20:10,960 --> 00:20:11,960 For example, using 378 00:20:12,880 --> 00:20:14,200 0.9 379 00:20:15,660 --> 00:20:16,460 Some 380 00:20:16,460 --> 00:20:18,220 web application files detect 381 00:20:18,220 --> 00:20:20,260 this and block the contents or 382 00:20:20,260 --> 00:20:22,140 return a different HTTP code 383 00:20:22,520 --> 00:20:24,460 or can redirect you to another 384 00:20:24,460 --> 00:20:26,280 page, etc. 385 00:20:27,760 --> 00:20:28,560 Request 386 00:20:28,560 --> 00:20:30,160 content language 387 00:20:30,160 --> 00:20:32,480 in a method which is different from 388 00:20:32,480 --> 00:20:34,240 POST. It's the same. 389 00:20:34,440 --> 00:20:35,100 It's not 390 00:20:37,700 --> 00:20:38,800 a valid 391 00:20:38,800 --> 00:20:40,680 request that all web application 392 00:20:40,680 --> 00:20:42,340 files detect but 393 00:20:42,340 --> 00:20:43,140 some detect 394 00:20:45,040 --> 00:20:45,840 URI 395 00:20:46,660 --> 00:20:48,320 with recursive path 396 00:20:48,320 --> 00:20:49,700 even invalid. 397 00:20:49,980 --> 00:20:51,800 We can request, for example, 398 00:20:51,860 --> 00:20:53,600 URI accessing 399 00:20:54,500 --> 00:20:56,660 recursive paths even that doesn't 400 00:20:56,660 --> 00:20:58,300 exist. Some web application 401 00:20:58,300 --> 00:21:00,500 files will detect the recursive 402 00:21:00,500 --> 00:21:01,880 path using 403 00:21:02,400 --> 00:21:04,480 UNIX notation or Windows 404 00:21:04,480 --> 00:21:06,460 notation. Also it can be used to 405 00:21:06,660 --> 00:21:08,580 detect the difference between 406 00:21:08,580 --> 00:21:10,460 them. Request where 407 00:21:10,460 --> 00:21:12,480 cookie matches the 408 00:21:12,480 --> 00:21:14,140 CMD name that 409 00:21:14,660 --> 00:21:16,340 is also detected by the 410 00:21:16,340 --> 00:21:18,060 full by some web application files 411 00:21:18,060 --> 00:21:19,240 by old or not. 412 00:21:21,060 --> 00:21:22,180 Request where 413 00:21:22,180 --> 00:21:24,180 the URI matches the string 414 00:21:24,180 --> 00:21:25,680 or the URI itself 415 00:21:27,120 --> 00:21:27,800 USER 416 00:21:29,660 --> 00:21:30,340 X11R6 417 00:21:30,340 --> 00:21:32,400 being externe. In general, 418 00:21:32,480 --> 00:21:34,140 we can create a really big database 419 00:21:34,360 --> 00:21:36,400 of this kind of 420 00:21:36,660 --> 00:21:37,640 attacks and run 421 00:21:38,340 --> 00:21:40,520 against most web application files 422 00:21:40,520 --> 00:21:41,620 and we can detect 423 00:21:41,620 --> 00:21:44,360 based in what can detect 424 00:21:44,360 --> 00:21:46,620 and provide a different response 425 00:21:46,620 --> 00:21:48,480 for us or not and 426 00:21:48,480 --> 00:21:50,600 in this way identify what web application 427 00:21:50,600 --> 00:21:51,500 file it is. 428 00:21:52,920 --> 00:21:54,420 More or less like we do 429 00:21:55,440 --> 00:21:56,380 probes in 430 00:21:56,380 --> 00:21:58,260 operation system. Basically 431 00:21:58,260 --> 00:21:59,740 the idea is the same. 432 00:22:03,140 --> 00:22:04,540 The attacker can go 433 00:22:04,540 --> 00:22:06,440 deeper and create several 434 00:22:06,660 --> 00:22:08,420 mutations of the same attack 435 00:22:08,420 --> 00:22:09,940 using for example 436 00:22:10,840 --> 00:22:12,120 evasion methods. 437 00:22:12,480 --> 00:22:14,600 These evasion methods can make 438 00:22:14,600 --> 00:22:16,820 a well known 439 00:22:16,820 --> 00:22:18,640 rule be bypassed 440 00:22:18,640 --> 00:22:20,700 or not and this also can be 441 00:22:20,700 --> 00:22:22,580 really useful to 442 00:22:22,580 --> 00:22:24,780 identify more precisely 443 00:22:24,780 --> 00:22:26,400 systems. Sometimes identify 444 00:22:26,400 --> 00:22:28,660 different versions. A new version 445 00:22:28,660 --> 00:22:30,120 from an old version. 446 00:22:32,660 --> 00:22:34,060 Also some attacks 447 00:22:34,400 --> 00:22:35,600 presented on the start 448 00:22:36,660 --> 00:22:38,300 on the tricks to detect 449 00:22:38,300 --> 00:22:40,460 WAF systems in the first slide 450 00:22:40,460 --> 00:22:42,420 can be used and help 451 00:22:42,420 --> 00:22:44,640 to identify systems like the example 452 00:22:44,640 --> 00:22:46,140 of Citrix Net Scholar. 453 00:22:47,440 --> 00:22:48,680 These techniques 454 00:22:48,680 --> 00:22:49,900 can be used to generate 455 00:22:50,460 --> 00:22:52,540 a big database and as 456 00:22:52,540 --> 00:22:54,420 we've spoken to create tools 457 00:22:54,420 --> 00:22:56,640 to detect this kind of web application 458 00:22:56,640 --> 00:22:58,020 files automatically. 459 00:23:02,560 --> 00:23:04,000 Well, generic 460 00:23:04,660 --> 00:23:06,460 evasion techniques. Today 461 00:23:06,660 --> 00:23:08,460 we have a wide range of 462 00:23:08,460 --> 00:23:10,480 techniques to evade EPS and 463 00:23:10,480 --> 00:23:12,600 some WAF systems. Most of 464 00:23:12,600 --> 00:23:14,220 these attacks works because 465 00:23:14,220 --> 00:23:16,540 we have bad normalization 466 00:23:16,540 --> 00:23:18,520 for example encoding 467 00:23:19,480 --> 00:23:20,140 etc. 468 00:23:20,500 --> 00:23:22,380 and the canalization 469 00:23:22,380 --> 00:23:24,200 that the implementation in the 470 00:23:24,200 --> 00:23:26,440 WAF does not work very 471 00:23:26,440 --> 00:23:26,760 well. 472 00:23:28,470 --> 00:23:30,360 Weak hulis. The full weak hulis 473 00:23:30,360 --> 00:23:32,100 built in the WAF systems. 474 00:23:32,360 --> 00:23:34,600 We can see a big number of 475 00:23:34,600 --> 00:23:36,580 products in the marketing that have 476 00:23:36,660 --> 00:23:38,560 pre-built hulis that are 477 00:23:38,560 --> 00:23:39,980 really weak and they allow 478 00:23:39,980 --> 00:23:46,560 a big number of possibilities 479 00:23:46,560 --> 00:23:47,660 of evasion. 480 00:23:48,520 --> 00:23:50,320 Evasion at network 481 00:23:50,320 --> 00:23:52,400 transport layer in 482 00:23:52,400 --> 00:23:54,460 some EPS and 483 00:23:54,460 --> 00:23:55,760 some WAF systems depending 484 00:23:56,400 --> 00:23:58,340 when they are running. For example 485 00:23:58,340 --> 00:23:59,620 if they are running 486 00:23:59,620 --> 00:24:01,400 in port mirroring. 487 00:24:09,220 --> 00:24:10,580 Well, here 488 00:24:10,580 --> 00:24:12,220 we have some examples of common 489 00:24:12,220 --> 00:24:13,640 generic evasion techniques. 490 00:24:14,260 --> 00:24:16,020 A very common 491 00:24:16,500 --> 00:24:18,440 generic evasion techniques to 492 00:24:18,440 --> 00:24:20,040 bypass some WAF systems 493 00:24:20,600 --> 00:24:22,740 is adding SQL comments 494 00:24:22,740 --> 00:24:24,300 to parameters 495 00:24:25,600 --> 00:24:26,480 instead 496 00:24:26,480 --> 00:24:28,440 of space to try 497 00:24:28,440 --> 00:24:30,460 bypass WAF systems and 498 00:24:30,460 --> 00:24:31,580 some EPS systems. 499 00:24:32,260 --> 00:24:34,460 I also use putty 500 00:24:34,460 --> 00:24:36,540 words in case sensitivity and 501 00:24:36,660 --> 00:24:38,640 in case insensitive to try 502 00:24:38,640 --> 00:24:40,820 to defect some of these hulis too. 503 00:24:40,980 --> 00:24:42,480 This too is very common. 504 00:24:44,180 --> 00:24:46,160 SQL query encoding 505 00:24:46,160 --> 00:24:48,280 is common. We use 506 00:24:49,460 --> 00:24:50,560 resources that 507 00:24:50,560 --> 00:24:52,520 the own database provides for us 508 00:24:52,520 --> 00:24:53,820 like stored procedures 509 00:24:54,740 --> 00:24:56,260 etc. that allows 510 00:24:56,260 --> 00:24:58,560 the attacker to encode and 511 00:24:58,560 --> 00:25:00,360 decode data. For example to 512 00:25:00,360 --> 00:25:01,180 exit the small 513 00:25:02,500 --> 00:25:03,780 directly in the database. 514 00:25:04,140 --> 00:25:06,480 In this way we can bypass some 515 00:25:06,660 --> 00:25:08,580 EPS and the WAF system in some case. 516 00:25:11,080 --> 00:25:12,120 Double encoding 517 00:25:12,620 --> 00:25:14,500 that basically is the same idea 518 00:25:14,500 --> 00:25:15,020 of the 519 00:25:16,340 --> 00:25:18,300 original encoding but 520 00:25:18,300 --> 00:25:20,380 the sigging itself 521 00:25:20,380 --> 00:25:22,360 for example the percent is 522 00:25:22,360 --> 00:25:24,420 encoded too. So you add a double 523 00:25:24,420 --> 00:25:24,720 encoding. 524 00:25:26,960 --> 00:25:28,400 URI encoding 525 00:25:28,400 --> 00:25:30,180 like for example 526 00:25:30,180 --> 00:25:31,600 unicode forward 527 00:25:32,600 --> 00:25:34,140 slash that was 528 00:25:35,740 --> 00:25:36,460 possible 529 00:25:36,660 --> 00:25:38,420 some time ago 530 00:25:38,420 --> 00:25:40,400 don't remember exactly how much 531 00:25:40,400 --> 00:25:42,420 for example in the tipping 532 00:25:42,420 --> 00:25:43,480 point EPS 533 00:25:44,400 --> 00:25:46,220 using this kind of technique 534 00:25:46,220 --> 00:25:48,400 also applies to some EPS and some 535 00:25:48,400 --> 00:25:49,080 WAF systems. 536 00:25:49,780 --> 00:25:52,540 HTTP request smuggling 537 00:25:52,540 --> 00:25:54,040 that basically 538 00:25:54,450 --> 00:25:56,360 is a technique that some attackers 539 00:25:57,900 --> 00:25:58,640 use 540 00:25:58,640 --> 00:26:00,220 to create 541 00:26:00,220 --> 00:26:01,800 HTTP packet 542 00:26:02,660 --> 00:26:04,500 that will be parsed differently 543 00:26:04,500 --> 00:26:06,500 in the backend web server 544 00:26:06,660 --> 00:26:08,060 and in the 545 00:26:08,660 --> 00:26:10,240 web application file 546 00:26:10,240 --> 00:26:10,600 or 547 00:26:12,460 --> 00:26:14,560 reverse proxy or whatever that is 548 00:26:14,560 --> 00:26:16,300 in the middle of the connection. 549 00:26:17,660 --> 00:26:18,860 IP packet 550 00:26:19,260 --> 00:26:20,080 fragmentation 551 00:26:20,080 --> 00:26:22,400 in some case depending on 552 00:26:22,400 --> 00:26:24,400 the topology is possible 553 00:26:24,400 --> 00:26:26,720 that basically is the question of 554 00:26:26,720 --> 00:26:28,080 fragmentation 555 00:26:28,420 --> 00:26:30,220 and the reassembly to bypass 556 00:26:30,220 --> 00:26:31,180 the same. 557 00:26:33,980 --> 00:26:34,780 Brazilian 558 00:26:34,780 --> 00:26:36,420 carnival that everyone 559 00:26:36,660 --> 00:26:38,160 always ask 560 00:26:39,420 --> 00:26:40,140 probability 561 00:26:40,320 --> 00:26:42,280 all of you know and who 562 00:26:42,280 --> 00:26:44,460 don't know should go to Brazil to the 563 00:26:44,460 --> 00:26:45,680 carnival and you appreciate 564 00:26:46,540 --> 00:26:47,820 boys, girls, everybody. 565 00:26:50,480 --> 00:26:51,940 Specific techniques to 566 00:26:52,620 --> 00:26:53,720 evade WAF systems. 567 00:26:56,420 --> 00:26:58,220 Similar as attackers can fingerprint 568 00:26:58,220 --> 00:27:00,300 WAF system as presented they can 569 00:27:00,300 --> 00:27:02,300 use a technique to precisely 570 00:27:02,300 --> 00:27:04,100 identify which restriction 571 00:27:04,660 --> 00:27:06,240 of a rule applies to 572 00:27:06,660 --> 00:27:08,060 a specific class of vulnerability. 573 00:27:08,780 --> 00:27:09,840 What I mean. 574 00:27:10,200 --> 00:27:11,820 An attacker can insert 575 00:27:11,820 --> 00:27:14,360 a hostility SQL injection 576 00:27:14,360 --> 00:27:16,200 for example to a parameter 577 00:27:16,200 --> 00:27:18,440 and is expected to be 578 00:27:18,440 --> 00:27:20,060 detected and the action taken. 579 00:27:20,240 --> 00:27:22,320 For example a different HTTP 580 00:27:22,320 --> 00:27:23,740 error code be returned 581 00:27:24,280 --> 00:27:26,500 a page redirection 582 00:27:26,500 --> 00:27:28,100 etc or simply 583 00:27:29,280 --> 00:27:30,080 generate 584 00:27:30,340 --> 00:27:31,880 error code or 585 00:27:31,880 --> 00:27:34,080 the normal page be displayed 586 00:27:34,080 --> 00:27:36,240 depending of the web application 587 00:27:36,660 --> 00:27:38,960 the big point is 588 00:27:38,960 --> 00:27:40,640 we can try 589 00:27:40,640 --> 00:27:42,660 a high number of different 590 00:27:42,660 --> 00:27:43,920 hostility queries 591 00:27:44,260 --> 00:27:46,000 and discover exactly 592 00:27:46,660 --> 00:27:48,380 what SQL query 593 00:27:48,380 --> 00:27:50,260 is blocked and 594 00:27:50,260 --> 00:27:51,860 which is not. What word 595 00:27:51,860 --> 00:27:54,040 for example select from 596 00:27:54,500 --> 00:27:54,960 where 597 00:27:56,720 --> 00:27:57,640 exec 598 00:28:00,520 --> 00:28:00,980 XP 599 00:28:00,980 --> 00:28:04,380 underlying exec and the others 600 00:28:04,380 --> 00:28:05,360 query are used. 601 00:28:06,660 --> 00:28:08,480 If we are able to detect 602 00:28:08,480 --> 00:28:09,860 these strings that are 603 00:28:09,860 --> 00:28:11,400 used by the web application 604 00:28:11,400 --> 00:28:14,080 built in Hulus we can try to 605 00:28:14,080 --> 00:28:14,780 bypass them. 606 00:28:16,380 --> 00:28:18,400 Using try and error it's 607 00:28:18,400 --> 00:28:19,960 possible to identify the combinations 608 00:28:19,960 --> 00:28:21,840 of these strings which is allowed 609 00:28:21,840 --> 00:28:24,240 and which is not. Also it's 610 00:28:24,240 --> 00:28:26,120 common we have Hulus that is 611 00:28:26,120 --> 00:28:27,720 based on combinations. 612 00:28:28,160 --> 00:28:30,120 For example only select 613 00:28:30,120 --> 00:28:32,260 is not blacklisted but if we 614 00:28:32,260 --> 00:28:34,260 use together select from 615 00:28:34,260 --> 00:28:36,440 and where together it starts 616 00:28:36,660 --> 00:28:37,840 to be blacklisted. 617 00:28:38,060 --> 00:28:40,700 So basically in this information 618 00:28:40,700 --> 00:28:42,300 we can try to construct 619 00:28:42,300 --> 00:28:44,340 SQL injections 620 00:28:44,340 --> 00:28:45,940 in the case to bypass 621 00:28:45,940 --> 00:28:47,600 the web application file. 622 00:28:48,480 --> 00:28:49,180 Also 623 00:28:49,180 --> 00:28:56,060 also this can be used 624 00:28:56,660 --> 00:28:58,520 to deny 625 00:29:00,280 --> 00:29:02,480 also it can be used to detect 626 00:29:02,480 --> 00:29:04,200 how the rule was 627 00:29:04,200 --> 00:29:06,060 built. Let's get a 628 00:29:06,660 --> 00:29:07,060 real example. 629 00:29:08,400 --> 00:29:09,980 It's not can be used only with 630 00:29:09,980 --> 00:29:12,360 SQL injection. It can be used with 631 00:29:12,360 --> 00:29:14,440 a lot of other attacks like 632 00:29:14,440 --> 00:29:15,620 cross-site scripting 633 00:29:16,480 --> 00:29:17,800 and the others. 634 00:29:18,380 --> 00:29:20,460 Real life. In a penetration 635 00:29:20,460 --> 00:29:21,860 test we realized 636 00:29:21,860 --> 00:29:23,700 maybe three months ago 637 00:29:23,700 --> 00:29:26,500 we had a client in Brazil which is a bank 638 00:29:26,500 --> 00:29:28,040 that had 639 00:29:28,500 --> 00:29:30,540 we had made a penetration test 640 00:29:30,540 --> 00:29:31,840 before and we had 641 00:29:32,580 --> 00:29:34,400 we got the access to the system. 642 00:29:34,640 --> 00:29:36,500 So they got the solution 643 00:29:36,660 --> 00:29:38,240 from Citrix Net Scholar 644 00:29:38,240 --> 00:29:39,980 and now we made the 645 00:29:40,660 --> 00:29:41,800 penetration test again. 646 00:29:42,040 --> 00:29:43,840 All we have to do to bypass 647 00:29:43,840 --> 00:29:46,460 the Citrix with the same 648 00:29:46,460 --> 00:29:47,980 problem was to identify 649 00:29:48,560 --> 00:29:50,400 what strings was 650 00:29:50,400 --> 00:29:51,940 blacklisted and what not. 651 00:29:52,120 --> 00:29:53,960 What combination was and what 652 00:29:53,960 --> 00:29:56,480 not like in the previous 653 00:29:56,480 --> 00:29:58,380 slide. And then we identified 654 00:29:58,380 --> 00:30:00,520 the same query we used 655 00:30:00,520 --> 00:30:02,520 in the last time to retrieve 656 00:30:02,520 --> 00:30:04,100 a lot of information from 657 00:30:04,620 --> 00:30:06,200 the bank we could use 658 00:30:06,660 --> 00:30:08,660 just removing, remolding the query 659 00:30:08,660 --> 00:30:10,420 without new words 660 00:30:10,420 --> 00:30:12,200 in the query, using some 661 00:30:12,200 --> 00:30:13,300 database 662 00:30:14,440 --> 00:30:16,480 query encoding and removing 663 00:30:16,480 --> 00:30:18,020 all the single quotes. 664 00:30:18,300 --> 00:30:20,140 And the Citrix Net Scholar 665 00:30:20,660 --> 00:30:21,880 was bypassed. 666 00:30:22,060 --> 00:30:24,380 So a lot of the systems that 667 00:30:24,380 --> 00:30:26,680 people sell today 668 00:30:26,680 --> 00:30:28,580 that are WAF systems 669 00:30:28,580 --> 00:30:30,040 are really good but 670 00:30:30,040 --> 00:30:32,560 we cannot trust in the built-in rules. 671 00:30:32,780 --> 00:30:34,620 They are only, they help 672 00:30:34,620 --> 00:30:36,360 but they are really far away 673 00:30:36,660 --> 00:30:36,960 from being perfect. 674 00:30:38,680 --> 00:30:40,620 In general, what are 675 00:30:40,620 --> 00:30:42,340 big pitfalls that 676 00:30:42,340 --> 00:30:43,700 web application firewall 677 00:30:44,760 --> 00:30:45,840 have to 678 00:30:46,560 --> 00:30:48,120 have problems to detect? 679 00:30:48,760 --> 00:30:50,120 Cross-site scripting. 680 00:30:50,180 --> 00:30:52,520 Cross-site scripting is really hard 681 00:30:52,520 --> 00:30:54,100 to effectively detect 682 00:30:54,480 --> 00:30:56,540 and block. It's extremely 683 00:30:56,540 --> 00:30:58,320 mutable and consequently 684 00:30:58,320 --> 00:30:59,940 very hard to detect. 685 00:31:00,160 --> 00:31:02,600 In special when we are dealing with 686 00:31:02,600 --> 00:31:04,480 outbound traffic. 687 00:31:04,860 --> 00:31:06,180 The outbound traffic 688 00:31:06,660 --> 00:31:08,100 has rules that in general 689 00:31:08,440 --> 00:31:09,820 can't be so 690 00:31:11,120 --> 00:31:11,800 enforced 691 00:31:11,800 --> 00:31:14,540 like inbound. For example, in general 692 00:31:14,540 --> 00:31:16,480 we get a lot of news from third 693 00:31:16,480 --> 00:31:18,080 sites and 694 00:31:18,080 --> 00:31:19,760 other contents. 695 00:31:20,100 --> 00:31:22,040 These other sites or other 696 00:31:22,400 --> 00:31:24,500 contents can be hacked and used 697 00:31:24,500 --> 00:31:26,260 as a source to 698 00:31:26,260 --> 00:31:28,400 infect your site in the outbound 699 00:31:28,400 --> 00:31:30,400 connection even if using a web 700 00:31:30,400 --> 00:31:31,180 application firewall. 701 00:31:32,460 --> 00:31:33,020 File upload. 702 00:31:34,180 --> 00:31:36,400 Many web application firewalls do 703 00:31:36,660 --> 00:31:38,440 a great job in file upload. 704 00:31:38,880 --> 00:31:39,540 However, 705 00:31:40,220 --> 00:31:42,420 we have some tricks that's really 706 00:31:42,420 --> 00:31:44,340 hard to bypass. For example, 707 00:31:44,460 --> 00:31:45,520 when you insert 708 00:31:47,160 --> 00:31:48,480 web shells 709 00:31:49,560 --> 00:31:50,220 inside 710 00:31:53,000 --> 00:31:54,600 images and call 711 00:31:54,600 --> 00:31:55,500 it for example via 712 00:31:57,860 --> 00:31:59,860 local file inclusions 713 00:32:00,630 --> 00:32:01,980 via comments in 714 00:32:02,490 --> 00:32:03,840 JPEG and the others. 715 00:32:05,120 --> 00:32:06,460 Also, remote 716 00:32:06,660 --> 00:32:08,240 command execution based in 717 00:32:08,240 --> 00:32:10,380 server response is very hard to 718 00:32:10,380 --> 00:32:11,960 detect. Some web application 719 00:32:12,340 --> 00:32:13,440 firewalls in the 720 00:32:13,440 --> 00:32:15,460 last year maybe 721 00:32:15,460 --> 00:32:17,540 tried to detect some 722 00:32:17,540 --> 00:32:20,260 remote code execution like for example 723 00:32:20,260 --> 00:32:22,460 the return that when we type 724 00:32:22,460 --> 00:32:24,380 in a Unix machine the command 725 00:32:24,380 --> 00:32:25,780 id, the command 726 00:32:26,320 --> 00:32:27,740 uname, ps, 727 00:32:28,220 --> 00:32:30,700 ls. They have a kind of 728 00:32:30,700 --> 00:32:32,080 standard format and 729 00:32:32,080 --> 00:32:34,360 there are rules that try to identify 730 00:32:34,360 --> 00:32:36,460 this standard to identify 731 00:32:36,660 --> 00:32:38,100 it in the outbound traffic. 732 00:32:38,380 --> 00:32:40,340 It's a good idea at 733 00:32:40,340 --> 00:32:42,420 last in the start since it could 734 00:32:42,420 --> 00:32:44,320 detect a lot of people that had 735 00:32:44,320 --> 00:32:46,420 broke into the web server. But 736 00:32:46,420 --> 00:32:47,860 if the attacker had the access 737 00:32:48,560 --> 00:32:49,700 he's able to 738 00:32:50,480 --> 00:32:52,300 execute command on the web 739 00:32:52,300 --> 00:32:54,520 server, it's not possible 740 00:32:54,520 --> 00:32:56,160 to really detect since 741 00:32:56,160 --> 00:32:57,580 he can use a lot of 742 00:32:57,580 --> 00:32:59,300 tools that they all 743 00:33:00,160 --> 00:33:02,440 encode providing the Linux or even 744 00:33:02,440 --> 00:33:04,280 they all shell like 745 00:33:04,280 --> 00:33:06,300 bash. You can turn it in 746 00:33:07,760 --> 00:33:08,360 Xcode, 747 00:33:08,540 --> 00:33:10,320 you can do shift right, 748 00:33:10,460 --> 00:33:12,280 shift left and a lot of 749 00:33:13,160 --> 00:33:14,740 encoding in the output 750 00:33:14,740 --> 00:33:16,340 that will not 751 00:33:16,340 --> 00:33:18,480 trigger the rule. So this kind of 752 00:33:18,480 --> 00:33:19,300 detection is not 753 00:33:20,660 --> 00:33:22,680 always useful and can be 754 00:33:22,680 --> 00:33:24,220 easily bypassed. 755 00:33:24,420 --> 00:33:26,300 Other problems that is probably 756 00:33:26,300 --> 00:33:27,940 one of the most hard 757 00:33:27,940 --> 00:33:30,080 to detect 758 00:33:30,500 --> 00:33:31,400 is logical 759 00:33:31,400 --> 00:33:34,440 and design flaws which is 760 00:33:34,440 --> 00:33:36,380 extremely hard by the nature of the 761 00:33:36,660 --> 00:33:38,020 problem. Basically, 762 00:33:38,940 --> 00:33:40,180 suppose you have 763 00:33:40,180 --> 00:33:44,540 a bank and 764 00:33:44,540 --> 00:33:45,560 this bank have 765 00:33:45,560 --> 00:33:48,540 a place where you can check 766 00:33:48,540 --> 00:33:50,300 how much money you have in your 767 00:33:50,300 --> 00:33:52,480 account. It's 768 00:33:52,480 --> 00:33:54,480 common that this data like 769 00:33:54,480 --> 00:33:56,640 agency, account number 770 00:33:56,640 --> 00:33:58,600 is passed as parameter. 771 00:33:58,880 --> 00:33:59,660 If there are 772 00:33:59,660 --> 00:34:01,920 there is not a 773 00:34:02,380 --> 00:34:04,420 stronger check in the application to 774 00:34:04,420 --> 00:34:06,380 grant that your sessions, your cooks 775 00:34:06,660 --> 00:34:08,540 is related with your 776 00:34:08,540 --> 00:34:10,360 with this data that's 777 00:34:10,360 --> 00:34:12,600 passed this parameter, attackers 778 00:34:12,600 --> 00:34:14,600 can manipulate this kind of data 779 00:34:14,600 --> 00:34:16,640 and the access information from 780 00:34:16,640 --> 00:34:18,580 other users. This kind of problem 781 00:34:18,580 --> 00:34:20,640 is very hard to web application 782 00:34:20,640 --> 00:34:22,320 files detect and block 783 00:34:22,320 --> 00:34:24,620 and the holders 784 00:34:24,620 --> 00:34:25,840 in the same idea. 785 00:34:26,700 --> 00:34:28,540 Well, our time is 786 00:34:28,540 --> 00:34:30,800 finishing. We had 10 minutes. 787 00:34:30,940 --> 00:34:31,420 It's over. 788 00:34:32,390 --> 00:34:34,680 I would like to thank you, all of you. 789 00:34:35,120 --> 00:34:36,340 Also the site 790 00:34:37,180 --> 00:34:38,600 is looking for 791 00:34:38,600 --> 00:34:39,840 new members. 792 00:34:40,420 --> 00:34:42,400 We have a private forum where we 793 00:34:42,400 --> 00:34:44,260 share a lot of stuff. 794 00:34:44,760 --> 00:34:46,100 If someone is 795 00:34:46,100 --> 00:34:48,620 interested, we are looking for new members. 796 00:34:48,800 --> 00:34:50,040 Thank you all and sorry 797 00:34:50,600 --> 00:34:51,980 for the problems in the laptop 798 00:34:51,980 --> 00:34:53,440 and the delay to start.