1 00:00:00,000 --> 00:00:01,240 Good morning. 2 00:00:02,360 --> 00:00:07,440 We are going to start a little earlier since I have some cool demo for you guys. 3 00:00:09,760 --> 00:00:14,840 I presented this in black hat, but I think I will change a little bit of style to DEF CON 4 00:00:14,840 --> 00:00:15,100 style. 5 00:00:16,460 --> 00:00:19,280 Before I start it, I want to have a quick survey. 6 00:00:19,580 --> 00:00:27,580 How many people here for the job reason or for care list reason that at least have hacked 7 00:00:27,580 --> 00:00:31,120 one website and gained the data from the back end? 8 00:00:31,460 --> 00:00:32,600 Can you raise your hand? 9 00:00:32,980 --> 00:00:34,460 Pretty good, cool. 10 00:00:36,520 --> 00:00:42,680 My name is Fan and today I'm going to present our next generation web application vulnerability 11 00:00:43,420 --> 00:00:47,840 scanner with deep injection, high performance and low false alarm. 12 00:00:49,600 --> 00:00:55,820 Everybody knows web application security is a big problem, so we are just going to skip. 13 00:00:55,820 --> 00:01:03,140 Most of the database in back end, interestingly enough, Oracle SQL Server, DB2 and MySQL, I 14 00:01:03,140 --> 00:01:07,540 think took 90% of the shares, more than that. 15 00:01:08,200 --> 00:01:11,380 This is about a pen test tool, first time revealed. 16 00:01:13,700 --> 00:01:16,280 It's not a so blind SQL injection tool. 17 00:01:16,540 --> 00:01:18,160 I will show you a bit later. 18 00:01:18,860 --> 00:01:25,800 Fully automated, powerful and with a bunch of... 19 00:01:25,820 --> 00:01:29,060 Pen test policy for different database. 20 00:01:30,260 --> 00:01:36,380 Here's a quick glance of how this tool looks like, but I will show you a flash demo very 21 00:01:36,380 --> 00:01:36,720 soon. 22 00:01:37,300 --> 00:01:47,180 In the left side, you can see is the web URL, then it has the Oracle detected in the 23 00:01:47,180 --> 00:01:48,580 back end automatically. 24 00:01:49,160 --> 00:01:53,720 The SQL injection type, tables, belongs to this web user. 25 00:01:54,720 --> 00:01:55,360 Columns. 26 00:01:55,820 --> 00:01:56,880 And even the contents. 27 00:01:57,470 --> 00:01:59,420 Right side is the vulnerability report. 28 00:02:00,520 --> 00:02:09,120 In short, this is a cross database support pen test tool with 100,000 lines of C++ code. 29 00:02:09,520 --> 00:02:15,940 High performance, very flexible, extensible pen test framework, which I will describe 30 00:02:15,940 --> 00:02:16,260 later. 31 00:02:16,640 --> 00:02:21,340 Very low false alarm, because if you already gain all the data, do you think it's still 32 00:02:21,340 --> 00:02:21,840 false alarm? 33 00:02:23,660 --> 00:02:25,460 And it's fully automated. 34 00:02:25,460 --> 00:02:25,800 So, this is the first step. 35 00:02:28,000 --> 00:02:33,420 So, we all know that through the firewall is just not enough with this case. 36 00:02:33,820 --> 00:02:36,880 And there's so many things from a database that you can gain. 37 00:02:37,160 --> 00:02:43,420 So before I continue, I would like to present the first part of the flash demo for you. 38 00:02:49,740 --> 00:02:52,320 So here we have a movie rental program. 39 00:02:53,220 --> 00:02:55,160 Pretty cool web application. 40 00:02:55,160 --> 00:02:57,740 It's not Netflix, by the way, OK? 41 00:02:57,900 --> 00:02:59,240 It just looks like. 42 00:02:59,660 --> 00:03:01,160 So there is a movie. 43 00:03:01,620 --> 00:03:03,600 You can go to the movie. 44 00:03:03,720 --> 00:03:04,880 It's called a Zions movie. 45 00:03:05,320 --> 00:03:07,700 But unfortunately it's also a sign of the SQL injection. 46 00:03:09,600 --> 00:03:12,840 So you can just paste to the matrix tool. 47 00:03:13,140 --> 00:03:14,880 And then right click, scan. 48 00:03:16,140 --> 00:03:21,680 Now you can see that it detects the back end is the Oracle and the SQL injection type, 49 00:03:21,940 --> 00:03:24,620 the instance name, and the user name. 50 00:03:24,620 --> 00:03:26,340 Who connect to the back end database. 51 00:03:27,240 --> 00:03:31,180 So you will see that most of the time it's right click, left click style. 52 00:03:31,520 --> 00:03:37,240 So now you right click and then get a table content, sorry, get a table count. 53 00:03:37,580 --> 00:03:39,840 How many tables belongs to this user? 54 00:03:40,460 --> 00:03:44,420 So that's a, I will come to the slides later. 55 00:03:45,220 --> 00:03:53,340 Matrix has a very complex sequence to do all the pen test from beginning to the very deep. 56 00:03:53,340 --> 00:03:56,520 So now we get the table count is 11. 57 00:03:57,600 --> 00:04:02,460 Now if you right click again, the syntax, the menu is different. 58 00:04:02,620 --> 00:04:03,900 Now you can get the table names. 59 00:04:04,680 --> 00:04:09,100 So all the table name, you can just select a few or select everything. 60 00:04:09,700 --> 00:04:13,480 So here, and try to gain a table name in the back end. 61 00:04:13,940 --> 00:04:16,460 So there are different ways to gain the table names. 62 00:04:17,780 --> 00:04:18,600 Date dictionary. 63 00:04:19,000 --> 00:04:20,160 You can also brute force. 64 00:04:20,400 --> 00:04:21,720 You can also error based. 65 00:04:21,720 --> 00:04:25,540 So, several ways that can count in. 66 00:04:27,940 --> 00:04:32,080 So here is the vulnerabilities that is already reported in back end. 67 00:04:32,220 --> 00:04:36,000 So that later on we can export to the CSV or whatever. 68 00:04:36,900 --> 00:04:50,140 So the get table name phase, it will gain the information with only like about 10 seconds. 69 00:04:50,140 --> 00:04:56,920 So with all that iteration, we get is our address, table name. 70 00:04:57,140 --> 00:04:58,620 So this is only one way. 71 00:04:58,800 --> 00:05:00,680 We'll show you another way which is brute force. 72 00:05:01,180 --> 00:05:07,720 Think about how many times you design your tables like user, username, profile, member, 73 00:05:08,040 --> 00:05:09,280 order, right? 74 00:05:09,720 --> 00:05:11,680 So this is just a common sense. 75 00:05:12,060 --> 00:05:17,740 If you want to, so now we already get the table name, another table name is the member. 76 00:05:17,740 --> 00:05:25,900 So now we come to the auditing panel, which is, you can choose, there's many policies 77 00:05:27,040 --> 00:05:33,240 has been built in to audit the back end database. 78 00:05:33,940 --> 00:05:38,920 So since we already know the database type, for example, right now we have default password 79 00:05:38,920 --> 00:05:45,280 checking and also the password complexity checking. 80 00:05:45,500 --> 00:05:47,300 All the parameter configurations. 81 00:05:47,740 --> 00:05:50,540 The dictionary accessibility and the user privileges. 82 00:05:50,940 --> 00:05:53,000 This is an important piece, right? 83 00:05:53,160 --> 00:05:54,620 And also the SQL area. 84 00:05:54,940 --> 00:05:57,200 What's the raw SQL in the back end? 85 00:05:57,360 --> 00:06:00,240 All this is done through the web interface. 86 00:06:00,860 --> 00:06:06,820 Now I reverse select and then I try to gain all the hash and the name from the back end 87 00:06:06,820 --> 00:06:07,100 database. 88 00:06:07,680 --> 00:06:10,720 Since the Oracle is hashed, right, the password. 89 00:06:11,100 --> 00:06:12,160 But that's okay. 90 00:06:12,540 --> 00:06:17,240 The matrix has the building password crack for the Oracle. 91 00:06:17,240 --> 00:06:18,860 Which is extremely fast. 92 00:06:19,020 --> 00:06:25,700 You can see that my password is pretty good, QAZWSX, but the matrix is even better. 93 00:06:26,040 --> 00:06:27,560 So it's cracked on the fly. 94 00:06:28,740 --> 00:06:30,520 The password is cracked on the fly. 95 00:06:31,020 --> 00:06:36,420 So also you can see that there is default password in there as well. 96 00:06:38,860 --> 00:06:41,140 So we will come back to this later. 97 00:06:41,300 --> 00:06:44,560 So here we have the cross-site scripting functionality. 98 00:06:45,540 --> 00:06:45,640 Okay. 99 00:06:46,220 --> 00:06:46,960 Thank you. 100 00:06:46,960 --> 00:06:47,260 And here it is. 101 00:06:47,260 --> 00:06:49,640 So you can have this functionality and also your own defined abilities. 102 00:06:53,340 --> 00:06:59,260 So also you can get a proxy list so that all your traffic can be distributed. 103 00:06:59,840 --> 00:07:02,920 It will look like from all over the world. 104 00:07:03,120 --> 00:07:07,100 So it's pretty neat to have. 105 00:07:12,880 --> 00:07:13,960 Here's the... 106 00:07:20,320 --> 00:07:28,720 And here's the hijacking feature, and here's another cool thing, okay? 107 00:07:29,160 --> 00:07:35,240 So we'll come back to the slides, come back to normal, okay? 108 00:07:36,540 --> 00:07:39,220 So what's the essential fact it's based? 109 00:07:39,220 --> 00:07:47,300 Basically, first, parameter defense is just not enough, right, with web-based and the 110 00:07:47,300 --> 00:07:48,200 database securities. 111 00:07:48,760 --> 00:07:53,240 Database are all different, all different vulnerabilities, different design, but there 112 00:07:53,240 --> 00:07:56,480 are many things in common, which I will describe later. 113 00:07:57,220 --> 00:08:00,820 And database has to maintain a lot of information in the backend. 114 00:08:01,460 --> 00:08:07,020 And the coolest the database, and the cooler it is, and the more information you need to 115 00:08:07,020 --> 00:08:07,240 gain. 116 00:08:07,400 --> 00:08:08,800 For example, Oracle 10G. 117 00:08:08,800 --> 00:08:10,500 Oracle 10G, the flashback, is a good example. 118 00:08:11,020 --> 00:08:17,040 If it want to get back to the previous data, it has to think about it from design, right? 119 00:08:17,160 --> 00:08:20,380 It has to maintain the SQL that it used before. 120 00:08:21,120 --> 00:08:26,460 So think if you can get that SQL, that's useful for you, right, through the web applications. 121 00:08:27,200 --> 00:08:29,040 User context, another example. 122 00:08:30,920 --> 00:08:33,640 Finally, hard on database is not so easy. 123 00:08:33,860 --> 00:08:37,840 At least it's much difficult than just talking, right? 124 00:08:38,260 --> 00:08:38,780 Okay. 125 00:08:38,800 --> 00:08:41,580 So here's the pentest sequence that it will take. 126 00:08:41,940 --> 00:08:48,060 First, just like normal scanner will do, it will detect if it is SQL injectable. 127 00:08:48,520 --> 00:08:50,560 But that is far less than enough, right? 128 00:08:50,980 --> 00:08:59,420 Then second, just as Nmap will send tens of packets to detect the OS types, right, based 129 00:08:59,420 --> 00:09:06,600 on TTL, window size, Matrix will send tens of different requests to determine what's 130 00:09:06,600 --> 00:09:07,900 the database type in backend. 131 00:09:08,180 --> 00:09:08,780 And I'll show you how. 132 00:09:08,800 --> 00:09:08,840 First, you'll send the space. 133 00:09:08,840 --> 00:09:09,360 Then, you'll just set the word and what's the version. 134 00:09:09,800 --> 00:09:16,220 And then it will get the current database properties such as what web user has connected 135 00:09:16,220 --> 00:09:25,300 to the database and what's the instance name, all stuff in versions, and then you can get 136 00:09:25,300 --> 00:09:25,860 the basic... 137 00:09:25,860 --> 00:09:27,760 Pretty much the whole database dictionary. 138 00:09:28,200 --> 00:09:30,060 That's the one thing. 139 00:09:30,220 --> 00:09:32,680 But also, like I said, there's other ways to gain. 140 00:09:32,680 --> 00:09:38,300 and then you can start dancing because you can do advanced injection and advanced auditing 141 00:09:38,300 --> 00:09:40,120 because you already know the context. 142 00:09:42,240 --> 00:09:49,400 I will have to skip some of the slides because I have very limited time, 36 slides, but pretty 143 00:09:49,400 --> 00:09:56,340 much it's very detailed here, database in common things, roles and privileges for different 144 00:09:56,340 --> 00:10:03,280 databases and special spots, there's always interesting part, extended procedures and 145 00:10:03,280 --> 00:10:10,420 it can even use to guess, for example, just the UTLTCP, even that can use to guess the 146 00:10:10,420 --> 00:10:18,580 SA password, a lot of things that you cannot even, maybe it's beyond your imagination and 147 00:10:18,580 --> 00:10:20,100 weak password, port stuff. 148 00:10:20,680 --> 00:10:24,240 Here's the mind manager function on the graph. 149 00:10:24,580 --> 00:10:25,120 So... 150 00:10:25,120 --> 00:10:34,440 So you can either configure your browser to point to the port, which matrix will listen. 151 00:10:34,760 --> 00:10:42,180 So matrix will monitor the session and the traffic automatically, and then detect if 152 00:10:42,180 --> 00:10:48,780 the URL you are browsing is, sorry, it reminds me more demos. 153 00:10:51,060 --> 00:10:57,920 So, it will automatically detect the web URL if it's vulnerable. 154 00:10:58,480 --> 00:11:06,740 But of course you can always just directly targeting the web URL and then gain all the 155 00:11:06,740 --> 00:11:07,380 vulnerability information. 156 00:11:07,940 --> 00:11:13,720 Then you can gain the database dictionary, blind injection, search the interesting tables, 157 00:11:13,960 --> 00:11:16,400 and then even do the brute force. 158 00:11:16,640 --> 00:11:18,760 You can also audit many things. 159 00:11:18,760 --> 00:11:19,840 Authentication, authorization. 160 00:11:20,400 --> 00:11:28,020 You can also do the penetration test for specific spots, like privilege escalation and all kinds 161 00:11:28,020 --> 00:11:28,540 of stuff. 162 00:11:30,120 --> 00:11:30,840 Here's a snapshot. 163 00:11:31,180 --> 00:11:32,740 You probably already saw it. 164 00:11:33,020 --> 00:11:38,400 So URL type, database name, username, task, get everything. 165 00:11:38,740 --> 00:11:40,980 Field name, field count, all fields. 166 00:11:41,240 --> 00:11:45,260 You can search for specific spots, like a password, user. 167 00:11:45,960 --> 00:11:46,600 So... 168 00:11:46,600 --> 00:11:47,160 Okay. 169 00:11:48,280 --> 00:11:57,720 For auditing stuff, you can check the password, check configuration weakness, and the versions. 170 00:11:58,120 --> 00:11:59,560 Oracle ADI. 171 00:11:59,880 --> 00:12:00,800 This is pretty old. 172 00:12:01,100 --> 00:12:02,820 The one I was using was better, 10G. 173 00:12:03,660 --> 00:12:09,240 So get the user password and hashes, and OS commands. 174 00:12:09,920 --> 00:12:14,880 So here's an example here that you already got the... 175 00:12:14,880 --> 00:12:18,780 Based on the hash you get, it's cracked on the fly. 176 00:12:18,980 --> 00:12:28,800 Because based on the username and the hash, you already can do a rainbow style crack. 177 00:12:30,340 --> 00:12:30,920 Penta style. 178 00:12:31,320 --> 00:12:33,840 If you do the... 179 00:12:34,700 --> 00:12:42,520 Just browsing the browser and using matrix as proxy, then you can hijack the sessions 180 00:12:43,080 --> 00:12:43,620 in between. 181 00:12:43,620 --> 00:12:47,180 So it can even hijack the SSL. 182 00:12:47,340 --> 00:12:49,460 So I will mention that a little bit later. 183 00:12:50,000 --> 00:12:52,720 But it can be much easier. 184 00:12:52,960 --> 00:12:58,360 For example, here, all the pen tests, it's again, right click style. 185 00:12:59,210 --> 00:13:02,380 So here, you can get all the extended procedures. 186 00:13:03,080 --> 00:13:04,800 You can run OS command. 187 00:13:07,320 --> 00:13:11,720 And doing whatever you want, pretty much. 188 00:13:11,720 --> 00:13:21,920 So authentication, current user privileges, password check, system user views, and as 189 00:13:22,810 --> 00:13:28,000 I mentioned, the system and DBSNP, password can be pre-generated, right? 190 00:13:28,120 --> 00:13:29,460 Because you already know the username. 191 00:13:29,780 --> 00:13:32,960 So based on diction, you can generate the hash already. 192 00:13:35,580 --> 00:13:39,360 And for Oracle 10G, there's a pretty huge leak. 193 00:13:39,500 --> 00:13:40,500 Which is that... 194 00:13:40,500 --> 00:13:45,260 The DBSNP password can be get through a simple query. 195 00:13:45,940 --> 00:13:50,320 So the reason is that it's not hashed, it's encrypted. 196 00:13:51,100 --> 00:13:54,420 And more importantly, the... 197 00:13:54,420 --> 00:14:02,080 For 10G, the default installation will put system and the DBSNP share the same password. 198 00:14:02,380 --> 00:14:06,840 So once you know the DBSNP password, you will know the system. 199 00:14:07,360 --> 00:14:08,520 Think about it. 200 00:14:09,200 --> 00:14:09,920 Okay. 201 00:14:10,800 --> 00:14:11,560 So... 202 00:14:11,560 --> 00:14:12,280 Database configuration. 203 00:14:13,220 --> 00:14:14,220 Init parameters. 204 00:14:14,720 --> 00:14:16,520 Many parameters auditing. 205 00:14:17,660 --> 00:14:18,420 And... 206 00:14:21,200 --> 00:14:25,720 For different database, for different context and policies. 207 00:14:27,520 --> 00:14:28,280 Configurations. 208 00:14:28,540 --> 00:14:33,120 So an important feature about the matrix is that it's extremely extendable. 209 00:14:33,220 --> 00:14:37,300 So that if there's a vulnerability release, for example. 210 00:14:38,340 --> 00:14:39,860 There's no need to... 211 00:14:39,860 --> 00:14:41,580 Change the code. 212 00:14:41,740 --> 00:14:44,060 Or 99% of the time. 213 00:14:44,500 --> 00:14:45,680 No need to change the code. 214 00:14:45,780 --> 00:14:47,140 Just add a configuration file. 215 00:14:47,420 --> 00:14:49,960 And then it will automatically add to your pen test policies. 216 00:14:51,040 --> 00:14:51,580 So... 217 00:14:51,580 --> 00:14:53,300 Raw SQL auditing. 218 00:14:54,280 --> 00:14:59,120 An important thing from the web interface, you may very, very interested in what is 219 00:14:59,120 --> 00:15:00,440 the SQL running back end. 220 00:15:00,620 --> 00:15:00,740 Right? 221 00:15:01,240 --> 00:15:01,800 So... 222 00:15:01,800 --> 00:15:07,160 To gain the SQLs, to give you much more abilities to gain the things. 223 00:15:08,080 --> 00:15:08,640 Okay. 224 00:15:09,280 --> 00:15:09,840 So... 225 00:15:09,840 --> 00:15:14,500 I always like to use Taiji to describe the two modes of the matrix. 226 00:15:14,840 --> 00:15:15,980 One is the Yin mode. 227 00:15:16,160 --> 00:15:17,460 Basically passive, right? 228 00:15:17,620 --> 00:15:18,520 Very silent. 229 00:15:18,760 --> 00:15:19,500 And quiet. 230 00:15:19,780 --> 00:15:21,400 But it detects everything for you. 231 00:15:21,500 --> 00:15:23,200 If it's acting as a proxy mode. 232 00:15:23,620 --> 00:15:25,320 Because you are just browsing, right? 233 00:15:25,420 --> 00:15:26,080 And then... 234 00:15:26,080 --> 00:15:26,440 Uh-oh. 235 00:15:26,560 --> 00:15:28,840 Suddenly, there's a report in back end. 236 00:15:29,040 --> 00:15:30,000 And Yang mode. 237 00:15:30,240 --> 00:15:32,540 Basically, you already see from the Flash demo. 238 00:15:33,200 --> 00:15:35,400 It's direct targeting the web. 239 00:15:35,800 --> 00:15:36,320 And... 240 00:15:36,320 --> 00:15:37,300 Hard... 241 00:15:37,300 --> 00:15:38,560 Multi-threading. 242 00:15:39,220 --> 00:15:39,820 Proxy mode. 243 00:15:39,820 --> 00:15:43,180 As long as your browser point to it, it's all right to do everything. 244 00:15:43,420 --> 00:15:47,740 But here's a very cool SSL man in the middle. 245 00:15:49,560 --> 00:15:50,040 I... 246 00:15:50,040 --> 00:15:54,140 At least on top of my head, I don't know there's any tool that do that. 247 00:15:54,240 --> 00:15:55,020 Does anybody know? 248 00:15:56,540 --> 00:15:59,120 To do the hijacking for HTTPS. 249 00:15:59,440 --> 00:16:02,660 The reason is that it's supposed to secure the channel, right? 250 00:16:02,980 --> 00:16:09,160 But here, Matrix did a special way, which is that it's a special matrix in the middle. 251 00:16:09,160 --> 00:16:13,480 So, then, it will assemble the HTTP traffic. 252 00:16:13,720 --> 00:16:20,880 It will listen in a local port, 127, and assemble the HTTP traffic to the HTTPS, representing, 253 00:16:21,500 --> 00:16:25,540 and send it to remotely, and then get it and disassemble it. 254 00:16:25,720 --> 00:16:32,540 From that way, it can audit all the sessions, all the parameters in between, so you can 255 00:16:32,540 --> 00:16:33,100 hijack it. 256 00:16:33,820 --> 00:16:34,400 In mode. 257 00:16:34,480 --> 00:16:35,500 Here's an in mode example. 258 00:16:36,380 --> 00:16:37,260 Automatically detect. 259 00:16:37,500 --> 00:16:37,740 Okay. 260 00:16:38,040 --> 00:16:38,960 MS SQL. 261 00:16:39,160 --> 00:16:39,760 Number. 262 00:16:40,160 --> 00:16:41,280 SQL injection type. 263 00:16:41,660 --> 00:16:43,360 YARN mode, I already described. 264 00:16:44,680 --> 00:16:45,820 Get post. 265 00:16:46,140 --> 00:16:52,480 And also, you can use proxy to targeting the stuff. 266 00:16:53,680 --> 00:16:56,340 Advanced features, like privilege escalation. 267 00:16:56,480 --> 00:16:59,000 For example, 9i, DBMS metadata. 268 00:16:59,800 --> 00:17:02,240 Pretty much, you can make use of the... 269 00:17:02,240 --> 00:17:07,620 Some SQL injection in the procedures to gain more privileges. 270 00:17:09,040 --> 00:17:10,500 10g, DBMS advisor. 271 00:17:11,020 --> 00:17:20,780 And even the more SQL stuff, if it's installed, then it will give you much more power to do 272 00:17:20,780 --> 00:17:22,940 the special pen test. 273 00:17:23,440 --> 00:17:28,520 And there's many things, such as HTML DB, XML DB, and the report servers. 274 00:17:28,980 --> 00:17:32,720 This is a specific things, but it's also very interesting. 275 00:17:33,120 --> 00:17:35,660 So keep adding the policy, like I said. 276 00:17:35,780 --> 00:17:37,380 To gain more and more. 277 00:17:37,380 --> 00:17:40,580 It's very important, because you always want to keep the pace. 278 00:17:40,700 --> 00:17:47,540 You don't want to have something that's last year or two years ago, and that's not so useful. 279 00:17:47,660 --> 00:17:49,240 That's needed, but not so useful. 280 00:17:50,120 --> 00:17:59,780 There's also, you can audit some network related or some evil procedures using the outbound 281 00:18:01,300 --> 00:18:02,180 SQL injection. 282 00:18:03,840 --> 00:18:05,940 Pen test capability, plug-in. 283 00:18:06,040 --> 00:18:06,840 I already mentioned. 284 00:18:06,840 --> 00:18:09,900 But again, this is one of the key. 285 00:18:10,120 --> 00:18:12,340 You can add the policies on the fly. 286 00:18:12,620 --> 00:18:14,880 So similar tools. 287 00:18:17,040 --> 00:18:20,040 I don't know if it's so similar, but I'll put it here. 288 00:18:20,800 --> 00:18:21,560 Evasion techniques. 289 00:18:22,580 --> 00:18:24,700 So this is an interesting part, right? 290 00:18:24,980 --> 00:18:31,300 If most of the ideas will detect, okay, one equals to one, or some of the patterns. 291 00:18:31,400 --> 00:18:32,140 But it's an iteration. 292 00:18:32,520 --> 00:18:35,120 Last year in Black Hat, I presented the... 293 00:18:35,120 --> 00:18:35,760 The... 294 00:18:36,540 --> 00:18:38,640 Defense techniques about SQL injection. 295 00:18:39,100 --> 00:18:40,880 So it's quite hard. 296 00:18:41,020 --> 00:18:41,720 It's quite hard. 297 00:18:41,920 --> 00:18:43,100 I mean, think about it. 298 00:18:43,140 --> 00:18:44,320 There's so many variations. 299 00:18:44,700 --> 00:18:46,140 I want to get to there. 300 00:18:46,480 --> 00:18:49,620 There's also some interesting evasion. 301 00:18:49,740 --> 00:18:51,120 For example, you can use soundex. 302 00:18:51,240 --> 00:18:53,200 A function equals to something, right? 303 00:18:53,300 --> 00:18:54,200 Looks totally different. 304 00:18:54,460 --> 00:18:58,080 So that way, to catch that pattern is really difficult. 305 00:18:58,520 --> 00:19:01,260 You can also lower down your threads. 306 00:19:01,560 --> 00:19:02,820 So it will look... 307 00:19:02,820 --> 00:19:04,920 And also distribute by proxies. 308 00:19:05,140 --> 00:19:05,740 So that way... 309 00:19:05,740 --> 00:19:07,600 So that way, it will look more normal. 310 00:19:08,600 --> 00:19:09,880 Defense techniques. 311 00:19:10,360 --> 00:19:12,880 Default installation and configuration is usually lame. 312 00:19:13,360 --> 00:19:14,620 Dictionary protection. 313 00:19:15,100 --> 00:19:15,980 Least privileges. 314 00:19:16,540 --> 00:19:21,280 Always bear in mind for application, especially for different applications. 315 00:19:22,080 --> 00:19:28,800 And do regularly pen testing and continuous monitoring. 316 00:19:29,500 --> 00:19:35,500 So before I come to the next demo, I want to thank you, everyone, for listening. 317 00:19:35,500 --> 00:19:38,740 And I have to mention my partner, Xiaorong. 318 00:19:38,940 --> 00:19:40,600 He did a really fantastic job. 319 00:19:40,740 --> 00:19:41,340 He's really cool. 320 00:19:41,860 --> 00:19:46,060 But sorry he couldn't come join me. 321 00:19:46,460 --> 00:19:49,520 And special thanks to Alexander for great comments. 322 00:19:49,960 --> 00:19:55,440 And one of the big reasons I'm here, which is I want to get your feedback. 323 00:19:55,740 --> 00:20:00,240 I want to get your comments so that make it better and better. 324 00:20:00,540 --> 00:20:05,480 If you have any suggestions or comments, then to... 325 00:20:05,480 --> 00:20:08,060 Send to the info dbappsecurity.com. 326 00:20:09,280 --> 00:20:12,260 So we will come to the next demo. 327 00:20:14,620 --> 00:20:17,060 We have two minutes, I think. 328 00:20:17,900 --> 00:20:18,380 Oh. 329 00:20:18,520 --> 00:20:19,160 I have ten? 330 00:20:19,380 --> 00:20:19,580 Yes. 331 00:20:19,840 --> 00:20:20,340 Oh. 332 00:20:20,580 --> 00:20:21,080 Cool. 333 00:20:21,500 --> 00:20:21,740 One. 334 00:20:21,920 --> 00:20:22,280 Five? 335 00:20:23,280 --> 00:20:23,780 Sure. 336 00:20:24,160 --> 00:20:24,760 How much do you need? 337 00:20:25,340 --> 00:20:26,180 Ten is fine. 338 00:20:26,540 --> 00:20:26,700 All right. 339 00:20:26,800 --> 00:20:27,300 I... 340 00:20:27,300 --> 00:20:30,920 I should not make so hard if I know I have ten. 341 00:20:31,520 --> 00:20:32,020 So... 342 00:20:33,380 --> 00:20:34,380 Here's another... 343 00:20:34,380 --> 00:20:35,360 Web application. 344 00:20:35,480 --> 00:20:36,900 JSP books. 345 00:20:37,080 --> 00:20:38,220 Selling the book, right? 346 00:20:38,420 --> 00:20:39,180 Security book. 347 00:20:39,380 --> 00:20:40,140 Looks like. 348 00:20:40,880 --> 00:20:41,560 So... 349 00:20:42,620 --> 00:20:43,740 Right click. 350 00:20:47,680 --> 00:20:49,680 This time it's MS SQL. 351 00:20:50,260 --> 00:20:51,600 Number SQL injection. 352 00:20:52,280 --> 00:20:55,720 And the database name is web. 353 00:20:56,080 --> 00:20:58,860 Username is SA, okay? 354 00:21:00,880 --> 00:21:03,620 The vulnerability level is, of course, high. 355 00:21:08,900 --> 00:21:14,660 So again, here, you already have 23 tables in backend, not bad. 356 00:21:15,660 --> 00:21:16,180 So... 357 00:21:17,820 --> 00:21:19,240 Can get the table name. 358 00:21:22,800 --> 00:21:23,900 And get a few. 359 00:21:24,040 --> 00:21:27,620 Here, the advanced one, you can basically search the table name. 360 00:21:27,860 --> 00:21:33,140 Sometimes, if that has, like, 200 tables, you just want to search some of the specific 361 00:21:33,140 --> 00:21:33,600 points. 362 00:21:33,600 --> 00:21:35,460 So it's getting easier. 363 00:21:35,980 --> 00:21:42,780 Now you have quite a few tables, and the customer info looks interesting, right? 364 00:21:42,840 --> 00:21:43,480 Customer info. 365 00:21:43,900 --> 00:21:45,300 That's always the... 366 00:21:46,260 --> 00:21:50,020 I mean, from my point of view, but I'm sure you've seen. 367 00:21:51,300 --> 00:21:51,780 So... 368 00:21:55,020 --> 00:21:58,220 Now you get a field account, then you can get all the fields. 369 00:22:00,300 --> 00:22:01,840 Again, it's a right click style. 370 00:22:03,040 --> 00:22:07,580 And coming later, there's the end, there's OS command execution. 371 00:22:08,360 --> 00:22:12,860 That's probably one of the few places that you need to use the keyboard to type. 372 00:22:13,000 --> 00:22:17,600 Because you need to run OS commands to as you wish. 373 00:22:17,920 --> 00:22:26,620 So now you have a few interesting fields, name, password, so customer ID, login name. 374 00:22:26,720 --> 00:22:31,240 So we can just gain a field just for demo purpose. 375 00:22:32,360 --> 00:22:38,700 So, again, I have to emphasize, all this is through the web application interface. 376 00:22:39,240 --> 00:22:40,460 There's no need... 377 00:22:40,460 --> 00:22:42,660 Any more information about it. 378 00:22:43,300 --> 00:22:48,100 So here is coming for another... 379 00:22:48,100 --> 00:22:49,300 Come to another fun part. 380 00:22:49,880 --> 00:22:52,980 It will get all the content from the tables. 381 00:22:53,580 --> 00:22:54,920 Welcome to the matrix. 382 00:22:57,720 --> 00:22:58,400 Okay. 383 00:23:02,000 --> 00:23:02,680 So... 384 00:23:02,680 --> 00:23:05,320 The speed is quite fast, at least in real speed. 385 00:23:05,520 --> 00:23:08,040 Because the engine is optimized... 386 00:23:27,680 --> 00:23:29,040 All right. 387 00:23:30,060 --> 00:23:30,400 So... 388 00:23:33,520 --> 00:23:37,880 Now we can come to another fun part, which is the panel chasing. 389 00:23:39,540 --> 00:23:41,840 So now you have all the context, right? 390 00:23:41,920 --> 00:23:43,540 What database it is in back end? 391 00:23:43,740 --> 00:23:45,380 What's the web user connected? 392 00:23:45,620 --> 00:23:47,420 What's the vulnerabilities of the web application? 393 00:23:48,140 --> 00:23:49,780 Now you can look at the... 394 00:23:49,780 --> 00:23:51,600 Like what's the DSN name? 395 00:23:53,180 --> 00:23:53,680 Okay. 396 00:23:54,480 --> 00:23:57,120 I don't know why I have my name in here. 397 00:23:57,640 --> 00:23:58,140 So... 398 00:24:01,240 --> 00:24:01,820 You can also... 399 00:24:02,380 --> 00:24:06,360 Another thing is that you can also look at how many evil procedures is available. 400 00:24:06,800 --> 00:24:08,080 So that's another thing. 401 00:24:08,240 --> 00:24:12,600 Because you first want to see how many things you can do in hand, right? 402 00:24:12,880 --> 00:24:14,360 Then you can do more things. 403 00:24:14,760 --> 00:24:19,480 So you can see that from the beginning to the end, it's always step-by-step, but helping 404 00:24:19,480 --> 00:24:22,880 each other to get deeper and deeper for all the injection. 405 00:24:24,060 --> 00:24:24,540 So... 406 00:24:26,160 --> 00:24:26,640 Okay. 407 00:24:26,720 --> 00:24:28,660 We have read error log. 408 00:24:29,000 --> 00:24:30,060 Get protocol. 409 00:24:31,240 --> 00:24:31,620 Stop. 410 00:24:31,960 --> 00:24:32,560 Okay. 411 00:24:32,660 --> 00:24:36,640 You can always get more things, because it just... 412 00:24:36,640 --> 00:24:41,560 It will give you from the number of things that you can choose. 413 00:24:44,940 --> 00:24:45,540 Okay. 414 00:24:46,120 --> 00:24:51,740 So enum error logs. 415 00:24:52,480 --> 00:24:53,740 That's not bad, right? 416 00:24:54,940 --> 00:24:56,420 Now you have OS command. 417 00:24:56,620 --> 00:24:59,200 Type cboot.init file. 418 00:25:00,620 --> 00:25:01,220 Okay. 419 00:25:01,240 --> 00:25:01,760 So... 420 00:25:01,760 --> 00:25:05,200 So the run OS command for you and then tell you everything. 421 00:25:05,720 --> 00:25:12,400 So I will let the demo go on, and thank you very much for listening, and I'm taking questions. 422 00:25:14,640 --> 00:25:15,440 Thank you. 423 00:25:17,660 --> 00:25:18,220 Cool. 424 00:25:18,360 --> 00:25:18,940 Thank you, Mike. 425 00:25:26,920 --> 00:25:27,620 Yes, sir? 426 00:25:29,120 --> 00:25:29,680 Yes. 427 00:25:29,680 --> 00:25:29,840 Yes? 428 00:25:30,240 --> 00:25:30,680 Male Speaker 2. 429 00:25:30,680 --> 00:25:34,900 Number one, does it save state so you can start a session and then terminate it and 430 00:25:34,900 --> 00:25:35,820 come back to where you were? 431 00:25:36,920 --> 00:25:37,600 Say again. 432 00:25:37,720 --> 00:25:37,940 Sorry. 433 00:25:38,160 --> 00:25:38,240 Male Speaker 2. 434 00:25:38,380 --> 00:25:40,340 Will it save the state of your test? 435 00:25:40,700 --> 00:25:44,560 So you start a session and then have the tables and then save it and come back to where 436 00:25:44,560 --> 00:25:44,680 Yeah. 437 00:25:44,780 --> 00:25:45,240 Good question. 438 00:25:45,620 --> 00:25:47,220 There is a project save. 439 00:25:47,480 --> 00:25:52,800 So no matter where you are, if you save a project, next time if you restart, it will 440 00:25:52,800 --> 00:25:54,240 already in a state in there. 441 00:25:55,340 --> 00:25:56,140 Good question. 442 00:25:56,420 --> 00:25:56,680 Male Speaker 2. 443 00:25:56,680 --> 00:25:57,220 Next question. 444 00:25:57,220 --> 00:26:02,520 Does it support various middlewares like ColdFusion with the tick doubling stuff? 445 00:26:05,140 --> 00:26:05,720 Yeah. 446 00:26:05,880 --> 00:26:11,880 So for middleware, basically right now, the current version is we'll try to inject as 447 00:26:11,880 --> 00:26:12,620 much as possible. 448 00:26:12,840 --> 00:26:17,640 So it will depend on how middleware process the parameters, et cetera. 449 00:26:17,880 --> 00:26:25,400 And also, we are planning to add in more like specific middleware like in the policies 450 00:26:25,970 --> 00:26:26,420 for it. 451 00:26:26,420 --> 00:26:26,600 Yeah. 452 00:26:30,460 --> 00:26:31,660 Any other questions? 453 00:26:32,280 --> 00:26:32,660 Yes, sir. 454 00:26:39,180 --> 00:26:40,340 Male Speaker 2. 455 00:26:40,340 --> 00:26:46,120 Specifically, I did not, but my friend did once. 456 00:26:46,220 --> 00:26:46,380 Yeah. 457 00:26:46,520 --> 00:26:47,260 Thank you. 458 00:26:47,680 --> 00:26:48,260 Male Speaker 2. 459 00:26:49,180 --> 00:26:52,300 No, I'm not kidding because we already have... 460 00:26:53,260 --> 00:26:53,840 Okay. 461 00:26:54,420 --> 00:26:55,440 Yeah, trust me. 462 00:26:55,540 --> 00:26:55,740 Okay. 463 00:26:55,820 --> 00:26:56,400 Because... 464 00:26:56,420 --> 00:27:01,760 We already have a beta tester which is a very big company, so they can test their 465 00:27:01,760 --> 00:27:04,340 own applications through the pen test. 466 00:27:04,820 --> 00:27:09,600 So I'm so busy with this, so I won't have time to hack stuff. 467 00:27:10,540 --> 00:27:11,060 So... 468 00:27:13,220 --> 00:27:14,260 Male Speaker 2. 469 00:27:14,540 --> 00:27:15,320 Yes, sir. 470 00:27:15,580 --> 00:27:16,360 Male Speaker 2. 471 00:27:17,940 --> 00:27:18,460 Yeah. 472 00:27:18,500 --> 00:27:22,180 We'll have beta test plan like slowly going, yeah. 473 00:27:22,280 --> 00:27:24,980 So you can send emails to request it, yeah. 474 00:27:26,060 --> 00:27:26,520 Yes? 475 00:27:27,500 --> 00:27:27,960 Female Speaker 2. 476 00:27:29,820 --> 00:27:31,990 Oh, you mean for the SSL hijacking? 477 00:27:32,940 --> 00:27:33,040 Male Speaker 2. 478 00:27:33,280 --> 00:27:33,740 Okay. 479 00:27:33,980 --> 00:27:37,160 So basically, what it do is that... 480 00:27:37,160 --> 00:27:40,040 Actually, I have a SSL Flash, later I can show you. 481 00:27:40,200 --> 00:27:41,640 But basically, what it do is that... 482 00:27:41,640 --> 00:27:44,300 Because this tool is in your machine, right? 483 00:27:44,500 --> 00:27:45,960 So in the 127. 484 00:27:46,340 --> 00:27:47,920 So it's your trusted man. 485 00:27:48,100 --> 00:27:49,800 So it's like a trusted man in the middle. 486 00:27:50,040 --> 00:27:51,400 So then you... 487 00:27:51,400 --> 00:27:54,100 So the HTTP, for example, browsing the local. 488 00:27:54,500 --> 00:27:54,960 So you can see that... 489 00:27:54,980 --> 00:27:59,340 Just like your local port that matches where we're listening. 490 00:27:59,620 --> 00:28:08,220 So for example, if you want the HTTPS www.abc.com, then something, then the machine knows that 491 00:28:08,220 --> 00:28:12,380 this traffic in this port is talking to that HTTPS. 492 00:28:12,660 --> 00:28:15,620 Then it will assemble all your... 493 00:28:16,760 --> 00:28:22,100 From your point of view, from browser still looking at the remote website, right? 494 00:28:22,220 --> 00:28:22,640 Browsing. 495 00:28:22,720 --> 00:28:23,080 Browsing. 496 00:28:23,080 --> 00:28:28,860 But actually, in the middle, it will assemble all the HTTPS traffic for you, and then monitoring 497 00:28:28,860 --> 00:28:33,200 the sessions, even if that's vulnerabilities or parameter vulnerabilities inside. 498 00:28:33,660 --> 00:28:35,820 So that's basically how it works. 499 00:28:35,980 --> 00:28:38,580 But I can show you Flash later on. 500 00:28:39,340 --> 00:28:39,860 Male Speaker 2. 501 00:28:43,080 --> 00:28:43,600 Yeah. 502 00:28:43,840 --> 00:28:44,360 It's traceable. 503 00:28:44,520 --> 00:28:50,040 So if you turn on hijack, that option, then it will stop there. 504 00:28:50,200 --> 00:28:52,100 And then you can change something. 505 00:28:52,100 --> 00:28:56,360 Add a parameter and then click send, it will send it, so. 506 00:29:00,400 --> 00:29:01,300 Any questions? 507 00:29:01,600 --> 00:29:02,420 More questions? 508 00:29:02,860 --> 00:29:03,260 All right. 509 00:29:03,300 --> 00:29:04,640 Thank you very much for listening. 510 00:29:04,900 --> 00:29:07,760 And yeah, send me email if you have any comments.