1 00:00:00,000 --> 00:00:02,700 Hello. Good afternoon all. How's everybody doing? 2 00:00:04,160 --> 00:00:07,640 Enjoying DEF CON? I know I saw a lot of people at Black Hat. 3 00:00:08,100 --> 00:00:11,240 Probably most of the people that saw it there aren't going to see it again. I don't blame them. 4 00:00:11,380 --> 00:00:12,780 It was worth seeing once, I think. 5 00:00:13,640 --> 00:00:17,220 Oh, we've got more people coming in. 6 00:00:18,780 --> 00:00:22,960 One of the things I like to do at the beginning of a talk is just sort of have everybody take their right hand, 7 00:00:23,420 --> 00:00:26,680 stretch it out like this, and shake the person's hand next to you, 8 00:00:26,740 --> 00:00:29,820 because you're going to see them next year if you come. I guarantee it. 9 00:00:30,000 --> 00:00:34,560 Every year you see the same, well, more, right? Some of the same people, but more. 10 00:00:37,000 --> 00:00:38,400 So, let's just get into this. 11 00:00:39,600 --> 00:00:42,560 The goal of the talk is to try and build a better fuzzer. 12 00:00:42,600 --> 00:00:47,420 That's the goal of my research. That's kind of what I've been doing for my academic work for the last year. 13 00:00:48,540 --> 00:00:50,980 And I'll briefly go through some background material, 14 00:00:51,700 --> 00:00:55,880 kind of just real quickly what's fuzzing, software testing, evolutionary testing. 15 00:00:56,220 --> 00:00:58,580 Then I'll talk about the actual system I built, EFS, 16 00:00:58,840 --> 00:00:59,940 and then talk about some initiatives. 17 00:01:00,000 --> 00:01:00,760 Then I'll talk about some initial benchmarking. 18 00:01:01,020 --> 00:01:05,000 And then talk about some initial results on real-world applications. 19 00:01:06,800 --> 00:01:11,440 So, there's no definitive proof that EFS is actually better than, say, like Spike or Sully 20 00:01:11,440 --> 00:01:13,000 or any of the other fuzzers that are out there, 21 00:01:13,180 --> 00:01:15,380 mainly because it depends a lot on the application, 22 00:01:15,620 --> 00:01:19,540 and it also depends a lot on sort of like what you were trying to do. 23 00:01:19,820 --> 00:01:21,540 And I mentioned this at the very end of the talk, 24 00:01:21,740 --> 00:01:27,300 but, like, for now, file fuzzing, as one of the iSec guys said at Black Hat, 25 00:01:27,420 --> 00:01:29,920 it's still depressingly easy just to take a file, 26 00:01:30,000 --> 00:01:32,000 flip a bunch of bits, feed it to the application, 27 00:01:32,220 --> 00:01:33,680 and the application crashes, right? 28 00:01:33,820 --> 00:01:37,020 So, there's no need to try and set up an evolutionary fuzzing system 29 00:01:37,020 --> 00:01:38,240 when you can just flip some bits. 30 00:01:38,520 --> 00:01:41,660 So, it kind of depends on your target, you know, what you're going after. 31 00:01:41,760 --> 00:01:46,160 Whereas, like, network applications are generally nowadays quite a bit harder to fuzz. 32 00:01:46,200 --> 00:01:48,960 They've been kind of hardened throughout the years, right? 33 00:01:49,040 --> 00:01:52,480 You can't just flip a few bits in an HTTP session and crash Apache, right? 34 00:01:52,540 --> 00:01:53,220 That's not going to work. 35 00:01:53,560 --> 00:01:56,940 So, it kind of depends, you know, on a lot of what's going on. 36 00:01:57,280 --> 00:01:59,780 To my knowledge, it's the first evolutionary fuzzing system 37 00:02:00,000 --> 00:02:00,900 that's been released publicly. 38 00:02:01,120 --> 00:02:04,000 You can go to my website, www.vdalabs.com, 39 00:02:04,080 --> 00:02:07,840 and download everything I'm talking about, the slides and the actual code, 40 00:02:08,000 --> 00:02:11,540 and GPF is there as well, general purpose fuzzer, something else I created. 41 00:02:13,820 --> 00:02:17,240 So, section one, software testing. 42 00:02:17,400 --> 00:02:19,760 This slide is just to say, and I mentioned this last year at DEF CON, 43 00:02:19,880 --> 00:02:21,400 that software testing is just hard. 44 00:02:21,700 --> 00:02:24,920 That's basically all this slide says, and that it's not an easy problem. 45 00:02:25,040 --> 00:02:25,980 It's not been solved. 46 00:02:26,080 --> 00:02:29,720 It's kind of an open problem, and there's a lot of companies looking at a lot 47 00:02:29,720 --> 00:02:29,980 of different problems. 48 00:02:30,000 --> 00:02:33,220 There's a lot of different ways to do it, but you got to test, right? 49 00:02:33,280 --> 00:02:35,880 It's the only way to give you any sort of confidence that your software is good. 50 00:02:36,020 --> 00:02:39,160 And fuzzing, as I said last year as well, is not the only way to test. 51 00:02:39,280 --> 00:02:40,080 There's a lot of other things. 52 00:02:40,160 --> 00:02:44,400 There's functional testing and GUI testing and quality assurance and formal methods 53 00:02:44,400 --> 00:02:49,200 of development, all that kind of good stuff, but fuzzing is just one element. 54 00:02:50,260 --> 00:02:55,660 So, the basic premise of fuzzing is you get a test case, deliver it to the application, 55 00:02:56,560 --> 00:02:58,760 and then if the application has a problem, 56 00:03:00,000 --> 00:03:05,260 then you obviously record that, and if it doesn't, then you keep going on to either 57 00:03:05,260 --> 00:03:09,500 the next randomly generated test case or the next test case that comes from a list of cases 58 00:03:09,500 --> 00:03:10,500 or however you're getting them. 59 00:03:10,880 --> 00:03:11,700 You sort of move on. 60 00:03:12,020 --> 00:03:16,840 And of course, the most interesting places to fuzz are where there's a change in privilege, right? 61 00:03:16,960 --> 00:03:20,960 Like, code that comes across a network interface is unprivileged data, I mean, 62 00:03:20,980 --> 00:03:24,280 that comes across a network interface, and if the service is running at some privilege 63 00:03:24,280 --> 00:03:25,620 and you can get a buffer overflow, right? 64 00:03:25,660 --> 00:03:29,800 You can elevate your privileges from nothing to something, so that's kind of part 65 00:03:29,800 --> 00:03:29,980 of the problem. 66 00:03:29,980 --> 00:03:34,620 The key, right, in any type of fuzzing is you're looking for some sort of elevation 67 00:03:34,620 --> 00:03:37,480 of privileges generally, or maybe you're just looking for robustness issues, 68 00:03:37,600 --> 00:03:38,440 whatever you're looking for. 69 00:03:40,560 --> 00:03:45,420 So, this is just to say that what you can fuzz is generally called the attack surface, 70 00:03:45,620 --> 00:03:47,420 and I think people understand this pretty well. 71 00:03:47,580 --> 00:03:50,620 I asked people at Black Hat as well, like, how many of the speakers have you heard mention 72 00:03:50,620 --> 00:03:54,520 the word either fuzzing or attack surface, and by and large, 73 00:03:55,340 --> 00:03:59,060 probably half the crowd raised their hand, which means that I think people finally sort 74 00:03:59,060 --> 00:03:59,960 of understand what these things are. 75 00:03:59,960 --> 00:04:05,500 The attack surface could be, you know, a local parsing of a file, the network interface, 76 00:04:05,980 --> 00:04:12,100 inter-process communication, any bit that could be influenced by dirty data, user data. 77 00:04:14,200 --> 00:04:22,360 So evolutionary testing uses GAs, genetic algorithms, and I'll talk about kind of how 78 00:04:22,360 --> 00:04:27,260 they work and where they failed in the past, just real quick, and kind of where they're 79 00:04:27,260 --> 00:04:27,480 going. 80 00:04:27,700 --> 00:04:28,120 So... 81 00:04:28,120 --> 00:04:33,540 Basically, the idea, if you haven't heard about this from last year or whatever, it's 82 00:04:33,540 --> 00:04:37,900 just sort of like survival of the fittest mentality, take, you know, mom and dad are 83 00:04:37,900 --> 00:04:40,280 so-so fit, and they mate and have kids, right? 84 00:04:40,580 --> 00:04:44,380 And then the children, ideally, are a little more fit, so it's kind of an each generation 85 00:04:44,380 --> 00:04:45,020 gets better. 86 00:04:45,100 --> 00:04:49,320 That's just, from a high level, that's the basic idea of genetic algorithms. 87 00:04:49,480 --> 00:04:52,780 They're searching algorithms, they're searching towards something. 88 00:04:53,040 --> 00:04:57,200 So if you have the source code and you do evolutionary testing, you're searching toward 89 00:04:57,580 --> 00:04:58,620 slash-slash-target. 90 00:04:58,700 --> 00:04:59,280 See that up there? 91 00:04:59,460 --> 00:05:06,740 So here's a function, it's called example, has four parameters, A, B, C, and D, and 92 00:05:06,740 --> 00:05:12,000 those four parameters were A is 10, B is 20, C is 30, D is 40. 93 00:05:12,120 --> 00:05:17,720 So the first check is, and this is like either the randomly generated or it's evolved this 94 00:05:17,720 --> 00:05:18,980 far so far, whatever data. 95 00:05:19,800 --> 00:05:23,620 If A is greater than or equal to B, then, oh, but it's not, right? 96 00:05:23,700 --> 00:05:26,860 So A is less than B. So you stop right there. 97 00:05:26,860 --> 00:05:28,600 So there were two more branches to get to the target. 98 00:05:28,700 --> 00:05:34,120 So the fitness is two branches, two plus normalization of 10, because 20 minus 10 is 10. 99 00:05:34,240 --> 00:05:38,500 So that's sort of how evolutionary testing works in general against software. 100 00:05:41,880 --> 00:05:47,620 And this slide is just to say that in the past, or even now, people are actually using 101 00:05:47,620 --> 00:05:48,560 evolutionary testing. 102 00:05:49,180 --> 00:05:51,800 In particular, it gets used in safety-critical situations. 103 00:05:51,940 --> 00:05:55,080 Like somebody might tell you, oh, denial of service isn't too big of a deal, right? 104 00:05:55,480 --> 00:05:56,740 I want code execution. 105 00:05:56,860 --> 00:05:58,180 Well, I want code execution, too. 106 00:05:58,300 --> 00:06:02,400 But if I'm on an iron lung and somebody DOSes my iron lung, that's bad, right? 107 00:06:02,580 --> 00:06:07,160 So denial of service can be really bad in safety-critical automobiles, airplanes, those 108 00:06:07,160 --> 00:06:07,540 kind of things. 109 00:06:07,620 --> 00:06:09,000 So they need to be really robust code. 110 00:06:09,400 --> 00:06:12,360 And so this is one of the places where that kind of testing gets done. 111 00:06:13,540 --> 00:06:19,520 Now this is just to show you, OK, so evolutionary testing, how does it do in some, in all cases? 112 00:06:19,580 --> 00:06:22,880 Well, I don't know about all cases, but here's a few cases where it doesn't do so great generally. 113 00:06:23,440 --> 00:06:25,980 Can anybody look at the code example on the left? 114 00:06:26,000 --> 00:06:26,840 Look where it says slide. 115 00:06:26,840 --> 00:06:28,320 That's where you're trying to get. 116 00:06:28,980 --> 00:06:33,660 It's called flag underscore example, takes two parameters, A and B. Does anybody see 117 00:06:33,660 --> 00:06:34,280 a problem with that? 118 00:06:38,780 --> 00:06:40,120 It'll never get there, is what you said? 119 00:06:40,760 --> 00:06:42,880 Yeah, well, it could get there. 120 00:06:43,020 --> 00:06:46,720 But what happens is there's a notion in evolutionary testing called the fitness landscape. 121 00:06:47,040 --> 00:06:50,300 And that's sort of like you're down here and you want to get up here. 122 00:06:50,580 --> 00:06:52,320 How easily can you climb the hill? 123 00:06:52,720 --> 00:06:56,220 It is a contiguous function, continuous function to get there. 124 00:06:56,220 --> 00:06:59,140 And in this case, the check is if flag, then target. 125 00:06:59,200 --> 00:07:01,080 But the problem is you don't control flag, right? 126 00:07:01,120 --> 00:07:05,740 You control A and B. So as a human looking at it, it's not too hard to see, well, if 127 00:07:05,740 --> 00:07:08,280 you set A and B both to zero, then you'll get to the target. 128 00:07:09,040 --> 00:07:13,240 But in the past, evolutionary testing didn't really take that into account. 129 00:07:13,400 --> 00:07:16,740 They didn't have any way of saying, I know what flag, they didn't know what flag is. 130 00:07:16,840 --> 00:07:17,840 So there's a way to deal with that. 131 00:07:17,880 --> 00:07:20,180 But that's called a flat spot in the fitness landscape. 132 00:07:20,840 --> 00:07:24,360 There's also something else called deceptive problems, which is if you look at the code 133 00:07:24,360 --> 00:07:25,180 snippet on the right. 134 00:07:25,260 --> 00:07:25,580 OK. 135 00:07:25,580 --> 00:07:31,920 You can see it's function under test takes a parameter, and you want to get to where 136 00:07:31,920 --> 00:07:32,720 target is again. 137 00:07:32,900 --> 00:07:37,020 It says if the inverse of that equals zero, then we'll get there. 138 00:07:37,360 --> 00:07:38,840 Does anybody see the problem here? 139 00:07:43,320 --> 00:07:48,620 So it looks like as you give it, say, 100, it'll go into the inverse function and do 140 00:07:48,620 --> 00:07:49,340 like 1 over 100. 141 00:07:49,560 --> 00:07:51,760 And then you give it 1,000, and it's like 1 over 1,000. 142 00:07:51,760 --> 00:07:52,400 So it's taking the inverse. 143 00:07:52,480 --> 00:07:53,320 So it's getting smaller. 144 00:07:53,820 --> 00:07:55,560 So it thinks it's getting closer to zero. 145 00:07:55,580 --> 00:07:55,840 Right? 146 00:07:56,000 --> 00:07:59,020 Your evolutionary testing algorithm believes that it's getting closer and closer and closer 147 00:07:59,020 --> 00:07:59,500 to zero. 148 00:07:59,640 --> 00:08:03,360 Well, actually, all along, as it gives it larger numbers, it's getting farther away. 149 00:08:03,840 --> 00:08:07,580 So if you just give it zero, though, it would actually hit the target, but it doesn't really 150 00:08:07,580 --> 00:08:07,820 know it. 151 00:08:07,880 --> 00:08:09,160 So that's what's called a deceptive landscape. 152 00:08:10,040 --> 00:08:11,920 So all that's just sort of background. 153 00:08:12,140 --> 00:08:12,800 This is section one. 154 00:08:13,940 --> 00:08:15,880 There's people working on that in academia. 155 00:08:16,100 --> 00:08:19,860 McMahon and Holcomb are coming up with what's called the extended chaining approach to 156 00:08:19,860 --> 00:08:22,260 do better with evolutionary testing. 157 00:08:22,800 --> 00:08:25,260 But the system that I designed is better. 158 00:08:25,260 --> 00:08:29,240 Or I don't want to say better, different, because it works on binaries, right? 159 00:08:29,380 --> 00:08:34,620 Oftentimes if you're auditing, say, IIS FTP or something, you're not going to have Microsoft's 160 00:08:34,620 --> 00:08:35,340 source code, right? 161 00:08:35,420 --> 00:08:38,540 So there's no way to really do the sort of traditional evolutionary testing. 162 00:08:38,960 --> 00:08:42,300 So you have to use a debugger and the binary and all that kind of good stuff. 163 00:08:42,420 --> 00:08:44,780 And I'll talk about how that works right now. 164 00:08:44,920 --> 00:08:45,460 Section two. 165 00:08:45,680 --> 00:08:46,860 So what is EFS? 166 00:08:47,320 --> 00:08:51,460 Well, it uses evolutionary algorithms, and it also uses fuzzing. 167 00:08:51,500 --> 00:08:54,840 I leveraged a tool that I'd written in the past called GPF, General Purpose Fuzzer. 168 00:08:54,840 --> 00:08:59,920 And it also leverages Pstalker, a heavily modified version of Pstalker in the PyMA framework, 169 00:09:00,180 --> 00:09:00,880 which you may have heard of. 170 00:09:01,800 --> 00:09:05,600 And this is an overview, a system view, of how EFS works. 171 00:09:06,260 --> 00:09:11,160 So you see GPF here is written in C down in the left-hand corner, and it's doing the 172 00:09:11,160 --> 00:09:12,220 evolutionary algorithms. 173 00:09:12,300 --> 00:09:15,140 All the fuzzing heuristics and stuff come from there. 174 00:09:15,740 --> 00:09:19,080 And the target monitoring is right there on the right-hand side. 175 00:09:19,240 --> 00:09:21,880 You've got the debugger monitoring the target. 176 00:09:21,940 --> 00:09:23,400 And then they both talk to a SQL database. 177 00:09:23,500 --> 00:09:24,820 So that each side is monitoring the target. 178 00:09:24,840 --> 00:09:26,780 And you can see that each session from each generation can be stored. 179 00:09:27,200 --> 00:09:29,800 And you say, well, what is a session and what's a generation? 180 00:09:30,020 --> 00:09:32,000 We'll take a look at that and see what the data structure looks like. 181 00:09:32,460 --> 00:09:35,940 And I should say right up front that this tool was originally designed with sort of 182 00:09:35,940 --> 00:09:39,340 network protocols in mind, but I am porting it to file fuzzing as well. 183 00:09:40,440 --> 00:09:42,400 But it is sort of network-centric. 184 00:09:42,500 --> 00:09:43,580 You'll see it feels that way. 185 00:09:43,780 --> 00:09:46,180 And it has some reporting you can do from PHP. 186 00:09:46,780 --> 00:09:51,840 So the basic protocol is just sort of like the fuzzer sort of asks the process stalker, 187 00:09:51,900 --> 00:09:52,280 are you ready? 188 00:09:52,400 --> 00:09:53,200 And he says, yeah, I'm ready. 189 00:09:53,200 --> 00:09:54,960 And then he talks to the target. 190 00:09:55,700 --> 00:10:00,500 And then the process stalker gives the coverage information, how many functions or basic blocks 191 00:10:00,500 --> 00:10:00,940 were hit. 192 00:10:01,080 --> 00:10:02,760 And those get stored in the SQL database. 193 00:10:04,420 --> 00:10:08,880 And OK, so if you don't, it should be fairly clear what functions are. 194 00:10:09,000 --> 00:10:10,860 And I think I talk about this a little later, too. 195 00:10:11,680 --> 00:10:16,500 And basic blocks, just in case you don't know, so you take the binary, you put it into IDA 196 00:10:16,500 --> 00:10:20,000 Pro, and you run pita dump, and you actually create what's called a pita file. 197 00:10:20,140 --> 00:10:23,040 So basically, you get a list of all the functions. 198 00:10:23,040 --> 00:10:25,740 So you can see where the function starts and all the basic blocks start, so that you can 199 00:10:25,740 --> 00:10:27,260 stalk on either functions or basic blocks. 200 00:10:27,420 --> 00:10:28,880 And a basic block is just like an assembly. 201 00:10:29,000 --> 00:10:31,160 You have like push, push, move, move, branch. 202 00:10:31,700 --> 00:10:32,560 That's a basic block. 203 00:10:32,700 --> 00:10:35,380 Whenever there's a branch, that's like starting another basic block. 204 00:10:35,560 --> 00:10:40,120 So basically, you have the choice when you stalk for coverage. 205 00:10:40,180 --> 00:10:41,980 You can either stalk on functions or basic blocks. 206 00:10:42,820 --> 00:10:44,400 And we'll talk about which one's better. 207 00:10:44,500 --> 00:10:46,320 There's a lot more basic blocks than there are functions. 208 00:10:46,780 --> 00:10:50,980 So it makes the stalking more granular, but it also makes it a bit slower. 209 00:10:51,160 --> 00:10:52,020 So there's pros and cons. 210 00:10:53,300 --> 00:10:54,580 And the fitness function. 211 00:10:54,700 --> 00:10:58,940 So genetic algorithms, basically, the key to a good genetic algorithm is having a good 212 00:10:58,940 --> 00:11:01,520 fitness function and a way to evaluate the fitness function. 213 00:11:02,020 --> 00:11:04,360 And in this case, the fitness function is two pieces. 214 00:11:04,520 --> 00:11:08,200 It's code coverage, how many functions or basic blocks were hit during the session 215 00:11:08,200 --> 00:11:10,540 that just ran, and also a measure of diversity. 216 00:11:10,680 --> 00:11:14,940 Because what happens over time in a genetic algorithm is there's what's called convergence. 217 00:11:15,340 --> 00:11:18,580 And that means that like you started out with all these good random pieces, and you were 218 00:11:18,580 --> 00:11:19,540 kind of diverse up here. 219 00:11:19,680 --> 00:11:21,920 And you see your fitness started out real low. 220 00:11:21,940 --> 00:11:23,020 It was all like kind of random. 221 00:11:23,040 --> 00:11:24,620 Random data mixed with basic blocks. 222 00:11:25,160 --> 00:11:29,760 And as the sessions get more and more fit, they all essentially become very, they become 223 00:11:29,760 --> 00:11:30,480 alike, right? 224 00:11:30,640 --> 00:11:31,860 They all start to look the same. 225 00:11:32,080 --> 00:11:34,420 The best guy is sort of winning, the strongest guy. 226 00:11:34,620 --> 00:11:37,400 And that means also that the diversity is sort of going down, right? 227 00:11:37,540 --> 00:11:40,300 Because all those other guys that weren't as strong kind of die out over time. 228 00:11:40,420 --> 00:11:44,160 And you don't want that to happen because what happens is you want to cover the entire 229 00:11:44,160 --> 00:11:49,420 attack surface, not just like the single session that's like gives you the biggest amount of 230 00:11:49,420 --> 00:11:50,240 functions that get hit. 231 00:11:50,300 --> 00:11:51,960 Because that's important to hit that guy, too. 232 00:11:51,960 --> 00:11:53,780 The best session that goes all the way through. 233 00:11:54,000 --> 00:11:57,760 But there's all these other little sessions that might, you know, trigger corner case 234 00:11:57,760 --> 00:11:58,820 bugs and stuff like that. 235 00:11:58,920 --> 00:12:03,080 So diversity is key because diversity will give you more total coverage of the attack 236 00:12:03,080 --> 00:12:03,320 surface. 237 00:12:03,500 --> 00:12:06,140 And ideally, you'll cover the entire attack surface. 238 00:12:06,340 --> 00:12:09,860 And that's a bit hard to actually measure, right? 239 00:12:09,940 --> 00:12:15,380 Because you may not know, like if you're, again, if you go back to the IIS FTP example, 240 00:12:16,340 --> 00:12:21,300 say you, you know, you put it into IDA Pro and you get a list of all the functions and 241 00:12:21,300 --> 00:12:25,660 say there's like 1,000 functions, well, how many of those 1,000 functions can you touch 242 00:12:25,660 --> 00:12:26,920 remotely through the network interface? 243 00:12:27,120 --> 00:12:27,780 You don't really know. 244 00:12:27,960 --> 00:12:31,100 I mean, there's not a real clear and easy way to tell. 245 00:12:31,320 --> 00:12:36,140 But if you could tell, if you could tell that it was 200 of those 1,000, then ideally 246 00:12:36,140 --> 00:12:38,980 you'd touch all 200 functions throughout the course of fuzzing. 247 00:12:39,020 --> 00:12:39,700 That's sort of the goal. 248 00:12:39,960 --> 00:12:44,100 And that's sort of, I use the academic keywords corollary, one and two. 249 00:12:44,240 --> 00:12:47,060 The first corollary is that code coverage doesn't equal security. 250 00:12:47,240 --> 00:12:50,020 But if you don't get code coverage, then you're even less secure, right? 251 00:12:50,080 --> 00:12:51,040 I mean, you've covered. 252 00:12:51,300 --> 00:12:51,760 You haven't covered it. 253 00:12:51,760 --> 00:12:52,340 You haven't covered it. 254 00:12:52,380 --> 00:12:53,200 So you can't find bugs. 255 00:12:53,380 --> 00:12:57,900 And the second one is true, which basically just says if you cover the entire tax service 256 00:12:57,900 --> 00:13:02,560 and you do it with diverse sessions that have fuzzing heuristics, like long strings and 257 00:13:02,560 --> 00:13:06,780 dot dot slash and percent end characters and all the kind of good fuzzing heuristics 258 00:13:06,780 --> 00:13:10,900 that should be in fuzzy data, then that's sort of the best I know how to do. 259 00:13:11,000 --> 00:13:11,720 That's kind of the goal. 260 00:13:14,580 --> 00:13:15,000 Okay. 261 00:13:15,060 --> 00:13:18,020 So how does the actual evolution work? 262 00:13:18,080 --> 00:13:20,220 We'll talk about that first before we talk about some results. 263 00:13:20,220 --> 00:13:26,500 So basically, it works by kind of recombining data and kind of slamming around, and any 264 00:13:26,500 --> 00:13:27,540 bit can be reorganized. 265 00:13:28,280 --> 00:13:31,700 And I'll show you how that actually works with a session crossover, session mutation, 266 00:13:32,140 --> 00:13:35,680 pool crossover, and pool mutation, because data gets organized in pools. 267 00:13:36,800 --> 00:13:37,500 Sessions of pool. 268 00:13:37,600 --> 00:13:38,520 I'll show you that in a second. 269 00:13:38,680 --> 00:13:43,300 But one thing to mention is this elitism, which means that the session that performs 270 00:13:43,300 --> 00:13:47,320 the best in each pool gets carried over to the next generation automatically. 271 00:13:47,360 --> 00:13:50,060 He doesn't have a chance of sort of breeding and dying. 272 00:13:50,220 --> 00:13:50,300 He doesn't have a chance of sort of starting out. 273 00:13:50,480 --> 00:13:52,440 He just sort of gets to go to the next generation. 274 00:13:52,620 --> 00:13:53,680 That's called elitism of one. 275 00:13:54,540 --> 00:13:56,320 So how is the data organized, then? 276 00:13:56,680 --> 00:14:01,580 Well, at the lowest level you have a token, and a token could be of different types, like 277 00:14:01,580 --> 00:14:06,940 binary, or ASCII, or space, or delimiter, or carriage return, or line feed, or whatever. 278 00:14:08,560 --> 00:14:13,060 So each token, maybe you have a string that has the word user or something like that. 279 00:14:13,280 --> 00:14:15,400 And each leg is like a read or a write. 280 00:14:15,400 --> 00:14:17,340 in the case of a network protocol. 281 00:14:17,760 --> 00:14:22,020 And so a session would be a series of reads and writes with tokens, obviously. 282 00:14:22,160 --> 00:14:23,640 And then those are all organized in the pool. 283 00:14:23,720 --> 00:14:25,920 And the idea of the pool is to help maintain that diversity 284 00:14:26,420 --> 00:14:28,660 because if you have different pools of sessions 285 00:14:28,660 --> 00:14:32,380 and they don't necessarily breed, though they can, they certainly can. 286 00:14:32,440 --> 00:14:34,840 Pools do breed, but you can set how often that happens. 287 00:14:35,620 --> 00:14:38,300 You can help maintain diversity, and we'll see that as well. 288 00:14:38,740 --> 00:14:41,960 So how does the actual session breeding take place? 289 00:14:42,000 --> 00:14:45,080 You have two fine-looking, beautiful sessions, A and B, 290 00:14:45,080 --> 00:14:46,560 and they want a bada-bing, bada-boom. 291 00:14:46,700 --> 00:14:47,720 How does that work exactly? 292 00:14:48,720 --> 00:14:51,240 Well, you draw, it's called single-point crossover. 293 00:14:51,400 --> 00:14:55,360 You basically draw a line, sort of randomly pick a spot between two tokens, 294 00:14:55,740 --> 00:15:00,340 and you copy up to that line in A, and then after the line in B, 295 00:15:00,520 --> 00:15:01,520 you continue copying. 296 00:15:01,640 --> 00:15:03,060 And the same thing for B prime. 297 00:15:03,300 --> 00:15:06,700 You go up to the red line in B and then after the red line in A, 298 00:15:06,740 --> 00:15:07,680 and you have two new sessions. 299 00:15:07,980 --> 00:15:10,640 And it's sort of unintuitive that this would work, right, 300 00:15:10,720 --> 00:15:13,920 because you don't really know how that data is organized. 301 00:15:13,920 --> 00:15:17,080 Like, if in order to log in, you need, like, user space, password, 302 00:15:17,400 --> 00:15:19,000 carriage return line feed, or something like that, 303 00:15:19,140 --> 00:15:21,200 it seems like this wouldn't work, right, 304 00:15:21,260 --> 00:15:26,760 because you're kind of recombining bits and pieces of just either what are called basic blocks, 305 00:15:26,960 --> 00:15:29,120 which we'll see, or random data. 306 00:15:29,260 --> 00:15:31,680 And it doesn't seem like this would actually work, but amazingly, it really does. 307 00:15:33,200 --> 00:15:36,440 So, I know, I was kind of amazed the first time I saw it work. 308 00:15:36,580 --> 00:15:37,160 I'll show you that. 309 00:15:37,520 --> 00:15:39,720 So here's an example of a session mutation. 310 00:15:40,200 --> 00:15:43,660 You see the word Jared just got a bunch of percent ends inserted into it. 311 00:15:43,700 --> 00:15:43,900 That's all it does. 312 00:15:43,900 --> 00:15:44,620 That's all a mutation. 313 00:15:46,260 --> 00:15:49,900 So it also could be, like, inserting, again, any sort of fuzzing heuristic. 314 00:15:49,980 --> 00:15:53,700 It doesn't necessarily always, like, just insert random data or flip bits, 315 00:15:53,800 --> 00:15:54,340 although it could. 316 00:15:54,440 --> 00:15:58,460 That's one of the fuzzing heuristics is to just, like, if it's a type binary, 317 00:15:58,560 --> 00:16:00,440 just, like, flip the bits in that token or something. 318 00:16:00,580 --> 00:16:02,280 But it might insert long strings or whatever. 319 00:16:02,400 --> 00:16:03,680 There's quite a few different things. 320 00:16:03,760 --> 00:16:07,360 And you can look through the source code that I have to see what are all the fuzzing heuristics 321 00:16:07,360 --> 00:16:10,040 and how do they actually work, you know. 322 00:16:10,760 --> 00:16:13,540 So pool crossover is very much like session crossover. 323 00:16:13,540 --> 00:16:16,720 And, like I said, you'd want this to happen less frequently to maintain diversity, 324 00:16:16,980 --> 00:16:21,360 maybe every, you know, 9 or 10, 13 generations, something like that, 325 00:16:21,540 --> 00:16:25,720 so that pools kind of have a chance to evolve a little bit separately to help maintain diversity. 326 00:16:26,020 --> 00:16:26,700 It's very similar. 327 00:16:26,760 --> 00:16:28,920 Draw a line, copy from one to the other. 328 00:16:30,220 --> 00:16:33,460 Pool mutation is basically just randomly adding or deleting a session. 329 00:16:33,580 --> 00:16:36,480 You wouldn't want to do that very often either because if you have a lot of good sessions 330 00:16:36,480 --> 00:16:38,480 in there you don't just want to lose that information. 331 00:16:38,840 --> 00:16:40,800 But every once in a while it's good to insert fresh blood 332 00:16:40,800 --> 00:16:43,280 because you might be missing a basic building block. 333 00:16:44,660 --> 00:16:48,240 So I'm very much like just show me, you know, a little bit of an example 334 00:16:48,240 --> 00:16:49,700 because it's kind of abstract, right. 335 00:16:49,920 --> 00:16:52,920 So this is just kind of a simple example. 336 00:16:53,040 --> 00:16:57,020 You see generation one starts out with a lot of randomness in it. 337 00:16:57,120 --> 00:17:00,840 And you see some basic blocks in there, right, user and pass. 338 00:17:01,420 --> 00:17:04,020 And I'll talk about that in a second where those come from. 339 00:17:04,060 --> 00:17:06,240 They come from what's called the seed file when you originally started. 340 00:17:06,320 --> 00:17:10,180 So if you know what the protocol is, you sort of know what the necessary strings are. 341 00:17:10,240 --> 00:17:13,520 Like if it's FTP, you know somewhere along the lines you need to see user and pass. 342 00:17:13,540 --> 00:17:14,440 Show up. 343 00:17:14,600 --> 00:17:16,380 Those are called the building blocks, right. 344 00:17:17,120 --> 00:17:22,440 And what happens is if you don't give them building blocks, it could ideally and theoretically 345 00:17:22,440 --> 00:17:24,300 eventually find the string user. 346 00:17:24,980 --> 00:17:28,620 It's just going to take a long, long, long time, right, because it would have to just 347 00:17:28,620 --> 00:17:31,660 randomly combine bits to come up with that string. 348 00:17:32,740 --> 00:17:37,500 And you see by generation 15, in the first generation it didn't really do much, right, 349 00:17:37,580 --> 00:17:39,940 because it just had the best one maybe was session one. 350 00:17:40,060 --> 00:17:41,760 He had user space and then some junk. 351 00:17:41,880 --> 00:17:43,520 So maybe he got like halfway through logging in. 352 00:17:43,520 --> 00:17:49,380 But not real fit, but by generation 15 it's got like user space, which is a delimiter, 353 00:17:49,520 --> 00:17:54,540 some junk line feed, which is good, and then pass and a delimiter and then some more junk. 354 00:17:54,740 --> 00:17:57,760 So that would actually be more fit when you're stocking that. 355 00:17:57,860 --> 00:17:59,620 You'll see that he actually progresses along. 356 00:18:00,460 --> 00:18:01,620 And that's kind of how they work. 357 00:18:01,640 --> 00:18:03,520 Just over time, you'll see them getting better and better. 358 00:18:03,900 --> 00:18:09,020 And if you dump the data out of the SQL database and actually look at the data that's in sessions, 359 00:18:09,840 --> 00:18:13,500 sometimes you're amazed like after 100 or 200 generations of evolution, you're like, 360 00:18:13,500 --> 00:18:16,400 you're looking at the most fit one and you're like, how is he the most fit? 361 00:18:16,480 --> 00:18:17,100 That is ugly. 362 00:18:17,860 --> 00:18:19,520 And then you look at it and you're like, no way. 363 00:18:19,700 --> 00:18:20,560 There's a carriage return. 364 00:18:20,660 --> 00:18:21,320 There's a line feed. 365 00:18:21,380 --> 00:18:25,140 There's a bunch of random, you know, a bunch of FFs, a bunch of random binary. 366 00:18:25,360 --> 00:18:27,280 But text-based protocols are pretty forgiving. 367 00:18:27,400 --> 00:18:31,380 So as long as the strings and stuff that it needs to see are in there, you can still 368 00:18:31,380 --> 00:18:35,800 log in and like actually work as long as it's got the basic things it's looking for. 369 00:18:36,360 --> 00:18:37,840 Binary protocols aren't quite as forgiving. 370 00:18:37,940 --> 00:18:38,780 We'll talk about that too. 371 00:18:39,620 --> 00:18:43,480 So what are the actual parameters that you give to GPF to start this off? 372 00:18:43,500 --> 00:18:44,260 And make this happen? 373 00:18:44,480 --> 00:18:50,500 Well, obviously you've got to give like the IP address of the stalker and the IP address 374 00:18:50,500 --> 00:18:55,780 of the database and all that kind of good stuff, the username and password and the number 375 00:18:55,780 --> 00:18:59,400 of sessions you want in each pool and how often you want the mutation to take place 376 00:18:59,400 --> 00:19:00,080 in each pool. 377 00:19:00,240 --> 00:19:03,700 The session mutation happens, session crossover happens every generation and all the other 378 00:19:03,700 --> 00:19:07,600 ones are configurable, pool mutation rate, pool crossover rate and all that good stuff. 379 00:19:07,840 --> 00:19:10,080 And there's some basic parameters to get you started. 380 00:19:10,180 --> 00:19:13,480 I'm not going to go through every parameter and what the optimal set is. 381 00:19:13,480 --> 00:19:16,340 The setting for each parameter is because it varies a lot based on the application you're 382 00:19:16,340 --> 00:19:16,640 testing. 383 00:19:17,900 --> 00:19:19,940 And there's also the seed file. 384 00:19:20,120 --> 00:19:20,440 You see that? 385 00:19:20,520 --> 00:19:21,160 And I talked about that. 386 00:19:21,220 --> 00:19:23,180 And here's an example again of the seed file that I'm talking about. 387 00:19:23,280 --> 00:19:28,040 So if you're going to fuzz SMTP with an evolutionary fuzzer, you might as well give it a seed file 388 00:19:28,040 --> 00:19:29,120 that looks something like that. 389 00:19:29,160 --> 00:19:33,140 It's got like hello and mail from and receipt to and stuff like that because that'll just 390 00:19:33,140 --> 00:19:35,760 help the evolution happen much quicker. 391 00:19:35,920 --> 00:19:37,400 It'll sort of give it a boost in the direction. 392 00:19:37,600 --> 00:19:43,220 But the key with the seed files is to give it really small basic blocks because if you 393 00:19:43,220 --> 00:19:47,640 give it like really big, like if you're fuzzing HTTP and you give a basic block of get 394 00:19:47,640 --> 00:19:53,160 space slash space HTTP slash 1.1 or something, that's like a really big basic block. 395 00:19:53,380 --> 00:19:59,900 And it'll use that and probably do okay with that, but it'll have a hard time like finding 396 00:19:59,900 --> 00:20:00,540 weird stuff. 397 00:20:00,680 --> 00:20:02,260 It probably won't find as many bugs and stuff. 398 00:20:02,420 --> 00:20:08,140 It'd be better if you give it get and a space and a slash and a space and an HTTP and a 399 00:20:08,140 --> 00:20:09,700 1.1, like all as separate seeds. 400 00:20:09,880 --> 00:20:12,140 Smaller building blocks are better in terms of evolutionary. 401 00:20:12,720 --> 00:20:13,200 Yeah. 402 00:20:13,980 --> 00:20:16,260 Fuzzing, but just in evolution in general, genetic algorithms. 403 00:20:16,420 --> 00:20:18,120 The smaller the building blocks, the better generally. 404 00:20:18,800 --> 00:20:22,840 So on the other side, not on the fuzzer like evolutionary side, on the other side, sort 405 00:20:22,840 --> 00:20:27,080 of the gooey side that's written, it's sort of like the modified version of PyME. 406 00:20:27,720 --> 00:20:28,720 What do you need to do? 407 00:20:28,840 --> 00:20:32,880 Well, again, you have to put, okay, there's two routes you can go here when you need to 408 00:20:32,880 --> 00:20:34,120 track code coverage. 409 00:20:34,480 --> 00:20:41,380 You could like sort of sample EIP or you could use what's called an MSR technique. 410 00:20:41,860 --> 00:20:43,180 Or you can create a pitiful. 411 00:20:43,200 --> 00:20:48,080 So basically you take the binary, you stick it into IDA Pro and you run what's called pitidump 412 00:20:48,080 --> 00:20:50,880 and it gives you that list of functions and basic blocks that I talked about. 413 00:20:51,180 --> 00:20:57,580 Give that to PyME and give it the normal startup and shutdown parameters that you have 414 00:20:57,580 --> 00:20:58,780 to give any application. 415 00:20:59,020 --> 00:21:01,940 That's kind of one of the key things when you're fuzzing is sort of like you got to 416 00:21:02,400 --> 00:21:05,960 figure out if it's a Windows service, it starts and stops different than if it's a user application. 417 00:21:06,580 --> 00:21:08,940 All those kind of things are very important to figure out ahead of time. 418 00:21:09,060 --> 00:21:10,300 How is this going to work if it crashes? 419 00:21:10,500 --> 00:21:11,520 Because you need to tell it. 420 00:21:11,820 --> 00:21:13,180 When it goes to restart it, it's going to start. 421 00:21:13,200 --> 00:21:16,260 But it needs to know how to do that well or it's not going to take place. 422 00:21:16,480 --> 00:21:19,580 So you got to have the SQL database set up, all that kind of good stuff. 423 00:21:20,400 --> 00:21:21,900 Here's a quick picture of how it works. 424 00:21:22,580 --> 00:21:23,620 And those are all the parameters. 425 00:21:23,820 --> 00:21:26,760 And again, I'm not going to go through all those parameters, but there's the settings 426 00:21:26,760 --> 00:21:33,700 for functions and basic blocks and what to do to attach or detach after a crash or like 427 00:21:33,700 --> 00:21:34,500 all these different settings. 428 00:21:36,380 --> 00:21:38,900 And one of the main things you see there, you see the little red scissors. 429 00:21:39,040 --> 00:21:40,580 You probably can't see it very good in the picture. 430 00:21:40,580 --> 00:21:43,540 But there's a notion of filtering. 431 00:21:44,060 --> 00:21:53,000 And you want to filter because for every session that, again, if you're fuzzing FTP, things 432 00:21:53,440 --> 00:21:57,480 that happen every time, like when you start it up and when you connect, like if you just 433 00:21:57,480 --> 00:22:01,680 connect it with Netcat and don't send anything and then shut it down, those are all common 434 00:22:01,680 --> 00:22:02,480 breakpoints. 435 00:22:02,620 --> 00:22:05,960 And you really don't want to stock on common breakpoints because they just slow down the 436 00:22:05,960 --> 00:22:08,240 evolution, slow down the running of the fuzzer. 437 00:22:08,440 --> 00:22:10,560 So it's best to filter those out. 438 00:22:10,560 --> 00:22:17,440 So you just manually start it up, connect, shut it down, save those hits to the PyMate 439 00:22:17,440 --> 00:22:17,740 database. 440 00:22:18,120 --> 00:22:22,080 And that's really kind of crucial in terms of speed. 441 00:22:24,060 --> 00:22:25,640 Okay, so that was section two. 442 00:22:25,780 --> 00:22:26,800 Section one was the background. 443 00:22:26,960 --> 00:22:29,180 Section two was what is it. 444 00:22:29,260 --> 00:22:32,000 And section three is kind of like how do we evaluate it? 445 00:22:32,100 --> 00:22:36,440 And the way to do that, in my mind, is sort of create a benchmarking toolkit. 446 00:22:36,840 --> 00:22:38,720 And this bit isn't... 447 00:22:38,720 --> 00:22:39,800 This research isn't complete. 448 00:22:39,800 --> 00:22:45,520 But we'll talk about tag service coverage and two servers, a text server and a binary 449 00:22:45,520 --> 00:22:47,120 server to see how well it does against both. 450 00:22:47,320 --> 00:22:50,100 And then we'll figure out, is it better to stock on functions or basic blocks? 451 00:22:51,280 --> 00:22:53,300 And did pools help maintain diversity? 452 00:22:53,740 --> 00:22:58,800 And if they didn't help as much, is there something else, some other measure, something 453 00:22:58,800 --> 00:23:00,460 else we can do to make diversity better? 454 00:23:00,560 --> 00:23:01,200 In fact, there is. 455 00:23:01,340 --> 00:23:06,300 I just recently added a bit to it that another diversity, and we'll see that. 456 00:23:06,480 --> 00:23:09,580 So there should be another paper coming on that as well. 457 00:23:09,800 --> 00:23:10,040 Sometimes. 458 00:23:10,320 --> 00:23:10,500 So... 459 00:23:11,440 --> 00:23:11,720 Okay. 460 00:23:11,840 --> 00:23:17,080 So like I said, this toolkit could help you see how well it would do against a clear 461 00:23:17,080 --> 00:23:18,620 text server, how well it would do against a binary server. 462 00:23:18,740 --> 00:23:21,620 And also, one thing that would be a really good thing to do if you want to benchmark 463 00:23:21,620 --> 00:23:23,160 and say, hey, is this as good as Spike? 464 00:23:23,640 --> 00:23:24,760 Is this as good as Sully? 465 00:23:24,920 --> 00:23:25,980 Is this as good as a different thing? 466 00:23:26,020 --> 00:23:26,540 Or is it better? 467 00:23:26,600 --> 00:23:26,960 Is it worse? 468 00:23:27,060 --> 00:23:27,260 Whatever. 469 00:23:27,680 --> 00:23:31,720 Well, one other idea, too, is you could insert bugs that are easy to find and bugs that are 470 00:23:31,720 --> 00:23:35,160 hard to find, and you can fuzz and just sort of evaluate them. 471 00:23:35,200 --> 00:23:35,320 Right? 472 00:23:37,200 --> 00:23:37,480 Okay. 473 00:23:37,600 --> 00:23:39,060 So this is how the text server works. 474 00:23:39,800 --> 00:23:43,380 It's basically just a standard text, you know, very texty type feeling. 475 00:23:43,620 --> 00:23:49,060 The server says welcome, and then you send it command X, command space, a number, character 476 00:23:49,060 --> 00:23:53,660 turn line feed, and it says okay, that one's good, and then you send it another number, 477 00:23:54,300 --> 00:23:57,920 character turn line feed, and then it says the sub command's okay, and then you send 478 00:23:57,920 --> 00:24:01,180 it calculate character turn line feed, and then it gives you basically the answer. 479 00:24:01,300 --> 00:24:02,200 So it's just adding two numbers. 480 00:24:02,260 --> 00:24:03,540 Very simple thing. 481 00:24:03,680 --> 00:24:04,220 But it has... 482 00:24:04,220 --> 00:24:07,500 The cool thing about it is that I wrote it so that it has three paths. 483 00:24:07,760 --> 00:24:09,780 You can set it on low, medium, and high. 484 00:24:09,800 --> 00:24:16,680 And that way it gives you the ability to say, okay, if the attack surface is really small, 485 00:24:17,000 --> 00:24:18,160 how does this guy work? 486 00:24:18,280 --> 00:24:21,280 Or if the attack surface is larger, if there's more paths, if there's more opportunities 487 00:24:21,280 --> 00:24:23,820 for diversity, how well does it work? 488 00:24:24,040 --> 00:24:28,700 And that's actually really helpful in terms of kind of evaluating something like this. 489 00:24:29,520 --> 00:24:33,500 Here's just an aside that I kind of found interesting, just kind of for my own research. 490 00:24:33,620 --> 00:24:36,080 So this was the text server set on medium. 491 00:24:36,080 --> 00:24:42,420 Just starting it and shutting it down was 137 basic blocks of 597 basic blocks. 492 00:24:42,600 --> 00:24:47,600 So 23% of the code was just literally like double-clicking it and clicking the X, right? 493 00:24:47,740 --> 00:24:49,100 So that's kind of interesting. 494 00:24:49,420 --> 00:24:52,100 You wouldn't think that there's a lot of code wrapped up in that, but there is quite 495 00:24:52,100 --> 00:24:54,400 a bit of code just in starting a service and shutting it down. 496 00:24:55,340 --> 00:24:59,840 So the actual network code, which is just like the TCP connect, right? 497 00:24:59,920 --> 00:25:01,900 That was 15 basic blocks, 3% of the code. 498 00:25:02,000 --> 00:25:05,980 And then the parsing, which is the only bit of code that actually has any opportunity 499 00:25:05,980 --> 00:25:06,840 to have bugs. 500 00:25:07,000 --> 00:25:08,700 So this is like the attack surface, right? 501 00:25:08,760 --> 00:25:10,320 This is the part that you want to fuzz. 502 00:25:10,500 --> 00:25:14,280 There was 94 basic blocks out of 597, so 16% of the code. 503 00:25:14,480 --> 00:25:16,440 So that's just kind of interesting. 504 00:25:16,560 --> 00:25:19,240 The other really interesting thing to me is that a large portion of the code is just 505 00:25:19,240 --> 00:25:19,960 unaccounted for. 506 00:25:22,440 --> 00:25:26,180 Just like libraries that got linked in that never get used, things like that. 507 00:25:26,240 --> 00:25:29,280 You can actually look through IDA Pro and figure out what all that code is that just 508 00:25:29,280 --> 00:25:29,820 never gets used. 509 00:25:29,920 --> 00:25:33,060 It's really interesting to find that a lot of it is essentially unaccounted for. 510 00:25:33,220 --> 00:25:35,960 So the C file for this fake text server. 511 00:25:35,960 --> 00:25:39,360 Fake text server would basically just be the nine numbers that are possible. 512 00:25:39,920 --> 00:25:44,180 And again, on low, only the number one is acceptable, and on medium, one through four 513 00:25:44,180 --> 00:25:44,880 is acceptable. 514 00:25:45,000 --> 00:25:46,860 On high, one through nine is acceptable. 515 00:25:47,780 --> 00:25:50,620 And then a couple other strings like character, turn line, feed, calculate, command. 516 00:25:50,800 --> 00:25:55,540 And it should be able to shuffle those all together and insert fuzzy heuristics and find 517 00:25:55,540 --> 00:25:56,640 bugs and do all that kind of stuff. 518 00:25:58,020 --> 00:26:01,600 So it had no problem learning the language, figuring out. 519 00:26:02,080 --> 00:26:03,280 It found the best session. 520 00:26:03,420 --> 00:26:05,780 And by best, I mean the correct session, right? 521 00:26:06,160 --> 00:26:07,880 Where it completed all the legs of the protocol. 522 00:26:08,040 --> 00:26:10,840 That's what I call, that's like the base session or the best session. 523 00:26:11,820 --> 00:26:14,060 It does not necessarily all of them, and we'll find that. 524 00:26:14,220 --> 00:26:17,260 But it didn't actually cover the entire attack surface. 525 00:26:17,480 --> 00:26:21,640 Does anybody know why it wouldn't cover the entire attack surface? 526 00:26:23,940 --> 00:26:25,280 Well I think we see that. 527 00:26:25,480 --> 00:26:26,500 No, we don't see that on the next slide. 528 00:26:26,540 --> 00:26:27,160 We'll see that in a few. 529 00:26:27,240 --> 00:26:28,820 But it's basically because there's a lot of corner cases. 530 00:26:29,200 --> 00:26:29,800 You know why. 531 00:26:30,020 --> 00:26:30,440 Go ahead. 532 00:26:30,520 --> 00:26:31,580 I got a question actually. 533 00:26:31,700 --> 00:26:32,060 Go ahead. 534 00:26:32,280 --> 00:26:34,100 When you say it didn't cover the whole attack surface. 535 00:26:34,240 --> 00:26:34,460 Yeah. 536 00:26:35,960 --> 00:26:36,520 So it didn't cover all the parsing code? 537 00:26:36,540 --> 00:26:36,900 Right. 538 00:26:37,360 --> 00:26:37,720 Okay. 539 00:26:37,820 --> 00:26:38,180 Yeah. 540 00:26:38,720 --> 00:26:39,380 It didn't. 541 00:26:39,380 --> 00:26:42,780 So it didn't cover all the parsing code, which is the attack surface was the question. 542 00:26:43,160 --> 00:26:48,140 And the reason why, if we go back and look at the protocol, is I'm not really showing 543 00:26:48,140 --> 00:26:49,340 you all the protocol here, am I? 544 00:26:49,440 --> 00:26:53,320 Because what happens if you send command and then a thousand A's instead of like a number 545 00:26:53,320 --> 00:26:54,000 like it's expecting? 546 00:26:54,160 --> 00:26:54,680 What's it gonna do? 547 00:26:54,840 --> 00:26:56,980 Well probably it has some sort of error code, right? 548 00:26:57,040 --> 00:27:00,260 It's gonna say like, you know, invalid command, try again or something like that. 549 00:27:00,420 --> 00:27:03,980 So I didn't really show you all the protocol, and that's kind of an important notion because 550 00:27:03,980 --> 00:27:10,640 this is, I think, the place where this kind of testing sort of dynamic learning testing 551 00:27:10,640 --> 00:27:15,100 where you're getting actual feedback from the subject under test as you test. 552 00:27:15,200 --> 00:27:20,920 This is where it excels in that if you create a fuzzer, like a spike file or whatever, 553 00:27:21,100 --> 00:27:25,400 and it's RFC compliant, it's gonna do, it's gonna be a good fuzzer, right? 554 00:27:25,440 --> 00:27:28,460 It's gonna do well because you designed the fuzzer based on the RFC, right? 555 00:27:28,500 --> 00:27:32,020 So it's gonna get good code coverage because you're designing it to get good code coverage. 556 00:27:32,240 --> 00:27:33,160 But what happens? 557 00:27:33,160 --> 00:27:36,780 What happens if there's some bit of the protocol that's not, like they didn't follow the RFC 558 00:27:36,780 --> 00:27:37,900 when they implemented it, right? 559 00:27:37,980 --> 00:27:38,560 And that's the whole idea. 560 00:27:38,660 --> 00:27:39,960 You're looking for implementation errors. 561 00:27:40,180 --> 00:27:44,960 There's either like a hidden command or a command they, you know, they allow one command 562 00:27:44,960 --> 00:27:47,840 earlier in the protocol when it really shouldn't be allowed until later. 563 00:27:48,120 --> 00:27:48,980 That kind of a thing. 564 00:27:49,060 --> 00:27:51,840 Like, you know, you can do pass first instead of user when really you shouldn't be able 565 00:27:51,840 --> 00:27:52,280 to do pass. 566 00:27:52,440 --> 00:27:54,240 It should, you know, first should be the user, right? 567 00:27:54,300 --> 00:27:55,340 So those kind of things. 568 00:27:55,400 --> 00:27:57,860 This is gonna be particularly good at doing that. 569 00:27:57,900 --> 00:28:03,040 And it's also particularly good at finding sort of like places where you need, you know, 570 00:28:03,160 --> 00:28:07,280 weird or fuzzy stuff throughout the various legs of the protocol, right? 571 00:28:07,380 --> 00:28:11,500 Because typically a spike file is gonna, it's gonna like fuzz the username first. 572 00:28:11,940 --> 00:28:13,080 And it's very sequential. 573 00:28:13,140 --> 00:28:14,520 And then it's gonna be a valid username. 574 00:28:14,600 --> 00:28:16,180 And then it's gonna fuzz the password next. 575 00:28:16,580 --> 00:28:18,980 And then it's gonna fuzz whatever else is after that. 576 00:28:19,060 --> 00:28:22,900 So it's gonna be a very organized, sequential kind of way of fuzzing where this is kind 577 00:28:22,900 --> 00:28:23,700 of craziness, right? 578 00:28:23,780 --> 00:28:29,120 It's gonna be slamming all over the place, coming up with weird sessions and all kinds 579 00:28:29,120 --> 00:28:29,840 of stuff like that. 580 00:28:30,060 --> 00:28:31,680 So that was the tech server. 581 00:28:31,840 --> 00:28:33,140 The binary server is very... 582 00:28:33,140 --> 00:28:34,380 It's very binary looking, right? 583 00:28:34,580 --> 00:28:37,460 It has the first four bytes are the total length of the packet. 584 00:28:37,740 --> 00:28:39,560 The second four bytes are the session ID. 585 00:28:40,200 --> 00:28:41,000 The second... 586 00:28:41,000 --> 00:28:42,960 Or the next two bytes are the length of the command. 587 00:28:43,160 --> 00:28:45,880 And then the final bytes are the actual command that you wanna send. 588 00:28:46,020 --> 00:28:47,800 And the server response is very much like that. 589 00:28:47,980 --> 00:28:51,820 So the question is, will a system like this be able to learn something like this? 590 00:28:51,920 --> 00:28:56,140 Because now you have to have a link that has to be correct and cover the whole packet, 591 00:28:56,720 --> 00:28:59,980 else the packet gets rejected sort of as the first check, right? 592 00:29:00,060 --> 00:29:01,700 That's kind of how binary protocols work. 593 00:29:03,520 --> 00:29:08,700 And sadly, I don't have much testing done on this bit yet, but it shouldn't be too hard. 594 00:29:08,960 --> 00:29:12,760 Talked to Charlie Miller and he did a little bit of testing on one binary protocol and 595 00:29:12,760 --> 00:29:13,080 it worked. 596 00:29:13,220 --> 00:29:15,120 So more to come on that. 597 00:29:15,880 --> 00:29:18,320 So next question, which is... 598 00:29:18,320 --> 00:29:21,140 So which should I stock on, functions or basic blocks? 599 00:29:21,280 --> 00:29:21,660 Does it matter? 600 00:29:21,980 --> 00:29:27,860 Well, in my experience, it didn't seem to matter a whole lot as long as the application 601 00:29:27,860 --> 00:29:29,140 was sufficiently large. 602 00:29:29,280 --> 00:29:29,700 But here... 603 00:29:29,700 --> 00:29:31,040 This is an example where... 604 00:29:31,040 --> 00:29:34,960 The tech server was being run on low and it did make a difference because there was 605 00:29:34,960 --> 00:29:35,940 only six functions. 606 00:29:36,080 --> 00:29:40,160 The best session is six functions long and it only found four of the six because the 607 00:29:40,160 --> 00:29:41,820 fitness landscape's very flat, right? 608 00:29:41,940 --> 00:29:42,680 It's got very like... 609 00:29:42,680 --> 00:29:44,860 It makes a breakthrough, but then it's flat and then it makes a breakthrough. 610 00:29:45,120 --> 00:29:46,180 It's not a nice smooth. 611 00:29:46,480 --> 00:29:48,720 Where you see the basic blocks did a little better, right? 612 00:29:48,820 --> 00:29:49,700 It was a little... 613 00:29:49,700 --> 00:29:51,240 On the right-hand side, you see the basic blocks. 614 00:29:51,340 --> 00:29:56,200 The graph is a little smoother as the diversity kind of went down and the fitness kind of 615 00:29:56,200 --> 00:29:56,580 went up. 616 00:29:57,760 --> 00:29:59,240 And it actually found... 617 00:29:59,240 --> 00:30:01,020 In the case of the basic blocks, it found 40% less than the basic blocks. 618 00:30:01,040 --> 00:30:05,180 It found 40 of 37, meaning that 37 is kind of that base case where it did everything 619 00:30:05,180 --> 00:30:08,140 right and it found 40, which means that it must have found one of the error cases as 620 00:30:08,140 --> 00:30:08,580 well, right? 621 00:30:08,640 --> 00:30:13,340 Because it found more than just the base case where the other one didn't. 622 00:30:13,460 --> 00:30:20,900 But if you run tech server on medium, you see that actually the functions did just as 623 00:30:20,900 --> 00:30:23,800 well and did it quicker, maybe slightly better in this case. 624 00:30:23,960 --> 00:30:27,520 So the graph isn't quite as pretty because with basic blocks, things tend to look a little 625 00:30:27,520 --> 00:30:27,980 smoother. 626 00:30:28,040 --> 00:30:30,800 So you see diversity coming down a little smoother and going up a little smoother. 627 00:30:30,800 --> 00:30:34,380 But either way, you found all six functions. 628 00:30:34,680 --> 00:30:38,780 So there to say, again, just to prove the point, all I'm trying to say with this slide 629 00:30:38,780 --> 00:30:43,880 is that if the application is sufficiently large, it's okay to stock on functions, which 630 00:30:43,880 --> 00:30:48,780 is kind of important because it speeds up the process enough that you'd rather, in my 631 00:30:48,780 --> 00:30:51,260 case, I think I'd rather stock on functions if I can. 632 00:30:51,920 --> 00:30:53,240 It's just that much quicker. 633 00:30:53,940 --> 00:30:58,340 Because the difference could be if you have a particularly large application, what does 634 00:30:58,340 --> 00:30:59,000 it really mean? 635 00:30:59,100 --> 00:31:00,780 I'm stocking on five. 636 00:31:00,800 --> 00:31:01,360 So I have 10 functions and I'm stocking on 20. 637 00:31:01,360 --> 00:31:02,060 functions or basic blocks. 638 00:31:02,140 --> 00:31:05,500 But what it really means is each of those are like a break point. 639 00:31:05,640 --> 00:31:08,920 So if you've got a list of all the functions in the application, when you start the application 640 00:31:08,920 --> 00:31:12,400 you have to set a break point on every one of those spots in order to get code coverage. 641 00:31:12,480 --> 00:31:15,120 You have to hit it, uncheck the break point, and keep going uncheck the break point. 642 00:31:15,300 --> 00:31:24,320 So if you're hitting, say, 50 to 100 functions versus 600 to 800 basic blocks, it's going 643 00:31:24,320 --> 00:31:25,420 to run slower with basic blocks. 644 00:31:25,520 --> 00:31:28,740 Because there's a lot more break points it's going to have to be unchecking, essentially. 645 00:31:29,840 --> 00:31:30,780 So, in the next slide, you'll see over here, this is the same thing. 646 00:31:30,780 --> 00:31:33,760 Next slide, I just want to show what were the effects of the pools. 647 00:31:33,860 --> 00:31:34,620 Did it actually help? 648 00:31:34,920 --> 00:31:36,620 And it turns out it did help having pools. 649 00:31:36,680 --> 00:31:40,520 It helped keep diversity up, but it still didn't cover the entire attack surface, right? 650 00:31:41,380 --> 00:31:46,020 And I wanted to add another bit to that to help it do even better because the pools helped, 651 00:31:46,140 --> 00:31:48,560 but this next thing actually helped even more. 652 00:31:48,660 --> 00:31:56,580 This is called niching or speciization or some way of rewarding those guys that look different, right? 653 00:31:56,580 --> 00:32:01,680 So all the sessions as they're growing, they all want to be like the doctor or something like that, 654 00:32:01,720 --> 00:32:03,280 but this guy, he's different. 655 00:32:03,520 --> 00:32:05,760 He wants to be the fireman or something, so we want to kind of reward them. 656 00:32:05,760 --> 00:32:07,860 Even if they're not as fit, they're not hitting as many functions, 657 00:32:08,240 --> 00:32:10,440 we want to give them some sort of reward, and I'll show you. 658 00:32:10,720 --> 00:32:13,380 That's the algorithm, and I'll show you just real practically 659 00:32:13,960 --> 00:32:17,420 because it's a little mathy looking, not terribly, but a little bit there. 660 00:32:17,580 --> 00:32:21,380 So real clear example, session one got ten hits. 661 00:32:21,600 --> 00:32:22,820 Session two got seven. 662 00:32:23,260 --> 00:32:24,780 Session three got five hits. 663 00:32:25,440 --> 00:32:25,800 Well. 664 00:32:26,580 --> 00:32:28,580 So, and I actually show you the hits, right? 665 00:32:28,640 --> 00:32:30,460 A, B, C, D, E, F, G, H, I, J. 666 00:32:30,720 --> 00:32:32,420 And what do those letters represent? 667 00:32:32,600 --> 00:32:34,680 The letters represent basically an address in memory. 668 00:32:34,760 --> 00:32:35,400 That's all they represent. 669 00:32:35,520 --> 00:32:39,460 So it might actually have been 08041234 or something like that. 670 00:32:40,340 --> 00:32:46,820 And so your initial thought might be that, well, session three doesn't really deserve to do, 671 00:32:46,940 --> 00:32:51,020 you know, he doesn't deserve to breed as frequently as session two because he didn't do as good. 672 00:32:51,080 --> 00:32:52,380 He only had five hits versus seven. 673 00:32:52,760 --> 00:32:56,240 But the thing you see there is that session seven looks like he's going to grow up, 674 00:32:56,240 --> 00:32:57,580 to be just like his dad, right? 675 00:32:57,660 --> 00:33:01,120 He's kind of an immature version of the ten hits. 676 00:33:01,640 --> 00:33:04,580 He's got all the exact same functions. 677 00:33:04,900 --> 00:33:06,380 He's headed along that same line. 678 00:33:06,440 --> 00:33:09,800 Where the other guy, he's hit five functions that the other two have never hit before. 679 00:33:10,580 --> 00:33:11,720 So you give him a reward. 680 00:33:11,940 --> 00:33:16,340 You take the unique hits divided by the total times the best minus one. 681 00:33:16,460 --> 00:33:20,420 So he ends up actually in the end, because of the fitness boost that he receives, 682 00:33:20,700 --> 00:33:23,760 his total fitness is 9.5, which is actually better than the second one, 683 00:33:23,800 --> 00:33:24,940 which I think makes sense. 684 00:33:25,000 --> 00:33:26,140 He should actually be better. 685 00:33:26,240 --> 00:33:30,280 He should be better in terms of overall fitness because of the fact that he's following a diverse path. 686 00:33:32,540 --> 00:33:34,980 So graphically, let's see how this works. 687 00:33:35,140 --> 00:33:39,880 So in the first case, we can see that we had only, this is the first one on the upper left, 688 00:33:39,980 --> 00:33:41,820 we only had one pool and a whole bunch of sessions. 689 00:33:42,100 --> 00:33:46,380 And we see diversity kind of going right down as fitness goes up. 690 00:33:46,480 --> 00:33:50,000 And that kind of confirmed my suspicions that as everybody's becoming more and more. 691 00:33:50,340 --> 00:33:51,080 Question, go ahead. 692 00:33:53,920 --> 00:33:55,160 Yes, I would love to. 693 00:34:04,600 --> 00:34:06,800 The first one does, but he's the best. 694 00:34:06,860 --> 00:34:08,520 So everything's baselined off the best. 695 00:34:08,780 --> 00:34:10,540 He doesn't get any boost for being unique. 696 00:34:16,440 --> 00:34:19,460 He's the best just based on the count, on the number of hits. 697 00:34:19,520 --> 00:34:23,620 So he hit 10 break points, whether it be functions or basic blocks. 698 00:34:26,240 --> 00:34:28,720 One down below, does that mean 10 is his best? 699 00:34:29,660 --> 00:34:30,880 Essentially, that's what it is. 700 00:34:30,960 --> 00:34:32,040 Yeah, 10 equals 10. 701 00:34:32,260 --> 00:34:35,300 So you see he had 10 hits, but he didn't have any unique because he's the best. 702 00:34:35,360 --> 00:34:36,820 So we don't count any uniqueness for him. 703 00:34:36,980 --> 00:34:39,560 And so his fitness, his overall fitness is still just 10. 704 00:34:43,180 --> 00:34:43,980 15 uniques? 705 00:34:44,100 --> 00:34:45,160 Well, overall, yes. 706 00:34:45,220 --> 00:34:48,120 So what you would call the total diversity, 707 00:34:48,160 --> 00:34:53,180 and that's what we see in the next slide when I talk about total diversity peak. 708 00:34:53,380 --> 00:34:56,140 See how it's measured like 80, 87, and 100? 709 00:34:56,240 --> 00:35:00,820 The diversity peak is the total count, so the count across the entire pool of diverse hits. 710 00:35:00,980 --> 00:35:02,600 And that's what you want to maximize, right? 711 00:35:02,660 --> 00:35:06,420 Because say if there's 150 total possibles, 712 00:35:07,080 --> 00:35:11,580 you want, ideally, the total diversity peak hits 150. 713 00:35:11,860 --> 00:35:15,320 At some point throughout the evolution, you've covered the entire tax service. 714 00:35:15,380 --> 00:35:15,940 That's the goal. 715 00:35:16,020 --> 00:35:16,780 That's what we're heading toward. 716 00:35:17,940 --> 00:35:19,820 So I didn't actually get that. 717 00:35:20,480 --> 00:35:23,080 But what I got is that when I added multiple pools, 718 00:35:23,280 --> 00:35:25,720 you see the trend of diversity is kind of up and down. 719 00:35:25,720 --> 00:35:27,360 The total diversity, what you're talking about, 720 00:35:27,420 --> 00:35:29,740 the count of all diverse hits throughout the pool, 721 00:35:29,840 --> 00:35:31,280 is the green line on top. 722 00:35:31,700 --> 00:35:34,140 And it did better than just with one pool. 723 00:35:34,260 --> 00:35:36,740 So multi-pools did seven better overall. 724 00:35:37,680 --> 00:35:42,920 And when we added that final metric of boosting or giving a boost to diverse sessions, 725 00:35:43,040 --> 00:35:44,440 then you see the total peak was 107. 726 00:35:44,600 --> 00:35:50,840 So it helps substantially to give a boost to people who are less fit hit-wise, 727 00:35:50,900 --> 00:35:52,040 but more fit diversity-wise. 728 00:35:54,060 --> 00:35:55,440 So that was the... 729 00:35:56,860 --> 00:35:58,580 evaluation, sections one, two, and three, and four. 730 00:35:58,680 --> 00:36:00,160 Section four is the actual results. 731 00:36:00,600 --> 00:36:02,400 So just some results. 732 00:36:03,120 --> 00:36:06,260 After fuzzing, GoldenFTP found lots of bugs. 733 00:36:06,400 --> 00:36:08,340 I don't know if you guys have heard of that before or use it, 734 00:36:08,420 --> 00:36:10,160 but I wouldn't recommend using it. 735 00:36:11,760 --> 00:36:14,960 IASFTP and SMTP did not find bugs there, 736 00:36:15,080 --> 00:36:19,100 but did find some instability that could probably mostly be attributed to the debugger. 737 00:36:19,140 --> 00:36:21,740 Wasn't able to identify those to any one session. 738 00:36:21,960 --> 00:36:25,420 So kind of the moral of the story, 739 00:36:25,440 --> 00:36:27,560 the moral of the story here is that really more testing needs to be done. 740 00:36:27,660 --> 00:36:31,020 It needs to be tested against lots of different applications and lots of different scenarios 741 00:36:31,580 --> 00:36:36,960 to really, for any real evaluation to be made of how well it does compared to other fuzzers. 742 00:36:37,140 --> 00:36:42,180 So this was just some pictures that I had generated a long time ago when I first started using it. 743 00:36:42,440 --> 00:36:45,960 And I just like this because I thought it was really cool when the little bubble popped up 744 00:36:45,960 --> 00:36:49,880 in the lower right-hand corner saying that GFTP, a user had logged in. 745 00:36:50,060 --> 00:36:51,580 Like I didn't even know that happened, right? 746 00:36:51,640 --> 00:36:55,420 When I just installed GFTP and just started fuzzing it without even really using it. 747 00:36:55,420 --> 00:36:57,960 So when the bubble popped up and I saw that a user had logged in, 748 00:36:57,980 --> 00:36:58,960 I was like, wow, that's really cool. 749 00:36:59,040 --> 00:36:59,380 It works. 750 00:36:59,480 --> 00:37:02,180 So I was very happy and impressed about that. 751 00:37:02,440 --> 00:37:05,120 And here's just a picture showing that it found a bug 752 00:37:05,120 --> 00:37:07,860 and it's kind of dumping the registers to the screen and stuff, 753 00:37:07,940 --> 00:37:10,520 which it also dumps to a file and also dumps to the database. 754 00:37:10,700 --> 00:37:11,960 And you can query the database later. 755 00:37:12,420 --> 00:37:16,440 And that's how the overall, you can tell how many total crashes you got, right? 756 00:37:16,540 --> 00:37:16,960 Go ahead. 757 00:37:22,800 --> 00:37:25,020 Does the debugger have to be on the same machine? 758 00:37:25,520 --> 00:37:27,720 As the process you're debugging? 759 00:37:31,160 --> 00:37:32,400 Yeah, kind of. 760 00:37:32,500 --> 00:37:33,940 So the answer is yes. 761 00:37:34,160 --> 00:37:38,400 Like, I mean, if you wanted to fuzz a Cisco router, then this wouldn't work, right? 762 00:37:38,420 --> 00:37:40,800 Because PyDebug isn't ported to Cisco routers. 763 00:37:40,960 --> 00:37:43,440 In fact, PyDebug only works right now on Win32. 764 00:37:43,860 --> 00:37:45,700 So it needs to be running on a Win application. 765 00:37:46,040 --> 00:37:47,200 There's people porting. 766 00:37:47,200 --> 00:37:50,140 I know Charlie's porting it to OSX and there's other people porting it to Linux. 767 00:37:50,600 --> 00:37:55,400 But if you're on Windows and if your target is on another Windows, 768 00:37:55,420 --> 00:37:56,900 Windows box, you can actually debug remotely. 769 00:37:57,100 --> 00:38:00,540 You could have the debugger running on a different Windows box, 770 00:38:00,660 --> 00:38:01,740 as long as they could talk to each other. 771 00:38:01,820 --> 00:38:03,340 You can do PyDebug remotely. 772 00:38:03,960 --> 00:38:06,180 So it's kind of yes is kind of the answer to both those. 773 00:38:07,380 --> 00:38:09,720 Again, yeah, feel free to ask questions any time throughout. 774 00:38:10,520 --> 00:38:14,740 So this is just kind of showing kind of the coarseness of the landscape initially, 775 00:38:14,880 --> 00:38:18,600 how it's not particularly smooth, especially in terms, this is called best fitness. 776 00:38:19,580 --> 00:38:22,640 And you see where the big spike is where it learns how to log in. 777 00:38:22,740 --> 00:38:24,320 And then shortly after it learns how to log in, 778 00:38:24,440 --> 00:38:25,220 it starts finding. 779 00:38:25,420 --> 00:38:25,820 Bugs. 780 00:38:25,840 --> 00:38:26,600 Those are the blue lines. 781 00:38:27,900 --> 00:38:30,140 And this is just the same kind of graph smoothed out. 782 00:38:30,320 --> 00:38:33,320 So basically, the moral of those two graphs is that after it learned how to log in, 783 00:38:33,340 --> 00:38:36,780 it started finding bugs pretty quickly, shortly thereafter, which is good to know. 784 00:38:37,140 --> 00:38:41,100 This this graph is just intended to show the same thing as the earlier graphs. 785 00:38:41,180 --> 00:38:45,660 The green line on the lower right hand graph, you see how it kind of keeps creeping up. 786 00:38:45,720 --> 00:38:49,100 It has an overall upward trend as opposed to the red line is one pool. 787 00:38:49,240 --> 00:38:53,260 And the diversity kind of went down and total fitness as well. 788 00:38:53,280 --> 00:38:55,060 Average fitness in the green line kind of goes up. 789 00:38:55,080 --> 00:38:55,220 So. 790 00:38:56,500 --> 00:39:01,220 It's just kind of to show you again that same thing that if you can help maintain diversity with pools. 791 00:39:02,520 --> 00:39:07,560 And this one just kind of shows that 10 pools did better in terms of finding unique crashes. 792 00:39:07,740 --> 00:39:11,940 So in the first case, with only one pool, I didn't even count. 793 00:39:12,020 --> 00:39:18,200 It's like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 unique crashes that it found, bugs, if you will. 794 00:39:18,200 --> 00:39:25,200 But with using 10 pools, it found like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15. 795 00:39:25,580 --> 00:39:25,880 I don't know. 796 00:39:26,000 --> 00:39:28,880 I'd count them up, but it found more unique crashes. 797 00:39:28,980 --> 00:39:29,560 And that's really key. 798 00:39:29,640 --> 00:39:30,180 That's really important. 799 00:39:30,360 --> 00:39:33,520 And it sort of speaks to the fuzzing, the diverse nature of the fuzzing. 800 00:39:34,400 --> 00:39:35,260 So let's see. 801 00:39:35,460 --> 00:39:36,760 I kind of went through that pretty fast. 802 00:39:36,820 --> 00:39:41,780 Good future work, porting it to fuzz files. 803 00:39:41,960 --> 00:39:47,720 Now that's that's a big one because file fuzzing is kind of a it's kind of like the bomb right now in terms of fuzzing, right? 804 00:39:47,780 --> 00:39:48,180 Because fuzzing. 805 00:39:48,180 --> 00:39:49,620 Fuzzing network applications is pretty hard. 806 00:39:49,880 --> 00:39:54,700 But fuzzing applications that receive files is still pretty doable. 807 00:39:54,840 --> 00:39:55,060 Go ahead. 808 00:39:55,420 --> 00:40:03,220 Yeah, for like the FDB example, how many generations do you go through before it's like you reach like sort of an issue return? 809 00:40:06,860 --> 00:40:12,840 Right, so the question was, how long does it need, does the tool run like minutes, hours, days? 810 00:40:13,080 --> 00:40:15,760 And specifically, how many generations is what you asked. 811 00:40:15,840 --> 00:40:16,400 How many generations? 812 00:40:17,200 --> 00:40:17,900 It's not. 813 00:40:18,180 --> 00:40:19,340 Like terribly long. 814 00:40:19,440 --> 00:40:22,160 It is long, though, maybe like a day or something. 815 00:40:22,240 --> 00:40:25,560 It's not like months or anything like that, but it takes a little while. 816 00:40:25,660 --> 00:40:33,760 It's a little bit slow because if each session takes, you know, say, I think my default setting is a session should take about 0.6 seconds. 817 00:40:34,200 --> 00:40:40,040 And if you have 100 sessions in a pool, then it takes like 100 times 0.6 just to do, you know, one generation. 818 00:40:40,100 --> 00:40:45,440 Basically, there's a little overhead at the end of the generation when it does the the breeding and stuff, but not terribly long. 819 00:40:46,140 --> 00:40:47,080 So go ahead. 820 00:40:48,180 --> 00:40:48,980 Other questions? 821 00:41:11,720 --> 00:41:12,600 Right, yeah. 822 00:41:12,980 --> 00:41:14,120 That's a great point. 823 00:41:14,580 --> 00:41:16,140 Good to see you again, too, by the way. 824 00:41:17,320 --> 00:41:17,760 Yeah. 825 00:41:17,760 --> 00:41:22,680 Yeah, so the question is, how do you know that it's unique bugs you're finding, right? 826 00:41:22,800 --> 00:41:24,420 Because that's what you want to find in this sort of thing. 827 00:41:24,520 --> 00:41:28,920 You don't want to, at the end of the day, you don't want to say, I found 30,000 crashes 828 00:41:29,420 --> 00:41:32,480 and then have to go and figure out what all 30,000 of those crashes are. 829 00:41:32,840 --> 00:41:38,340 And, well, I guess I sort of half solve the issue in that they're binned by exception address, basically. 830 00:41:38,860 --> 00:41:44,460 So as long as they have a unique exception address, like the exception address, I mean the actual line of code, right? 831 00:41:44,460 --> 00:41:48,200 As long as EIP is different for each crash, then they get put into a different bin. 832 00:41:48,300 --> 00:41:49,260 And you sort of see that. 833 00:41:49,800 --> 00:41:54,880 I'm sure you can't read the numbers, but like in the first case, see how there's like the big portion of the graph is purple? 834 00:41:55,420 --> 00:41:58,020 The actual number above that's like 31,000. 835 00:41:58,020 --> 00:42:00,020 So I found 31,000 of that bug. 836 00:42:00,400 --> 00:42:01,800 That's just one bug, basically. 837 00:42:01,880 --> 00:42:03,580 So it only gets counted one time, right? 838 00:42:04,300 --> 00:42:05,860 And that's true of all those, right? 839 00:42:05,880 --> 00:42:10,100 Because it's going to keep, like you said, it's going to keep hitting the same bug over and over and over again. 840 00:42:10,200 --> 00:42:14,340 So I actually thought about adding a sort of a fitness minus. 841 00:42:14,460 --> 00:42:14,680 Right? 842 00:42:14,840 --> 00:42:17,440 In terms of sessions that have already found a crash. 843 00:42:17,600 --> 00:42:20,020 It's sort of like penalize them if they keep hitting the same crash. 844 00:42:20,260 --> 00:42:22,260 And don't let them kind of grow down that road. 845 00:42:22,400 --> 00:42:24,240 But it didn't really seem to be a problem. 846 00:42:24,320 --> 00:42:27,980 Because eventually they sort of, one that doesn't crash will get further. 847 00:42:28,120 --> 00:42:29,180 And he becomes more fit. 848 00:42:29,280 --> 00:42:31,700 So it kind of ends up doing that by itself over time. 849 00:42:31,800 --> 00:42:33,240 You just get a lot of repeated crashes. 850 00:42:33,640 --> 00:42:36,100 But as long as you can bin them like this, it doesn't really matter. 851 00:42:36,200 --> 00:42:36,920 You only count it once. 852 00:42:37,060 --> 00:42:37,520 So go ahead. 853 00:42:58,040 --> 00:43:00,460 Okay, I didn't quite hear it all. 854 00:43:00,520 --> 00:43:00,880 I'm sorry. 855 00:43:01,040 --> 00:43:03,780 Can you say the crux of it one more time? 856 00:43:07,980 --> 00:43:11,220 Yes, the basic building blocks you give it in a seed file are critical. 857 00:43:14,460 --> 00:43:17,260 And I see it's not going to be naturally on the long view of the product. 858 00:43:17,480 --> 00:43:19,640 Will it get to the point where you see the same? 859 00:43:20,020 --> 00:43:21,880 Well, it does both, actually. 860 00:43:21,940 --> 00:43:25,320 So when you give it a seed file, it doesn't just pick building blocks from there. 861 00:43:25,440 --> 00:43:28,980 It has like, I forget, it's either a 30 or a 60. 862 00:43:29,100 --> 00:43:30,420 I don't remember what the percentage is. 863 00:43:30,460 --> 00:43:31,620 But there's a percent, basically. 864 00:43:32,040 --> 00:43:35,800 Whenever it goes to build a token, it's sort of like, okay, I'm going to build a token. 865 00:43:35,900 --> 00:43:37,140 Should I grab it from the seed file? 866 00:43:37,380 --> 00:43:38,580 Or should I build it randomly? 867 00:43:38,680 --> 00:43:42,680 And if it grabs it from the seed file, it's not just a piece of ASCII or binary data. 868 00:43:42,880 --> 00:43:44,440 But also, I didn't really show it. 869 00:43:44,460 --> 00:43:47,880 So it wasn't a perfect explanation of the seed file. 870 00:43:48,060 --> 00:43:49,680 But if you actually look at it, you can download all this code. 871 00:43:49,780 --> 00:43:53,680 If you look at one of the seed files that's in there, you'll see that you give it like a type, too. 872 00:43:53,800 --> 00:43:59,660 So you'll say the length is 4, the type is ASCII, and whatever, and here's the data. 873 00:43:59,800 --> 00:44:01,580 So it might grab that token and just use it. 874 00:44:01,620 --> 00:44:03,420 Or it might just totally randomly create one, right? 875 00:44:03,500 --> 00:44:07,120 Like say, I want to create a binary token that's 2,000 bytes long. 876 00:44:07,240 --> 00:44:07,980 Okay, five minutes. 877 00:44:09,460 --> 00:44:10,720 So it kind of does both. 878 00:44:11,320 --> 00:44:13,420 I know that doesn't completely answer your question. 879 00:44:13,980 --> 00:44:14,300 Yeah. 880 00:44:14,460 --> 00:44:16,980 Your question was, what if you don't give it a seed file at all? 881 00:44:17,320 --> 00:44:20,140 And you just truly, truly go random. 882 00:44:20,300 --> 00:44:21,400 It still will evolve. 883 00:44:21,640 --> 00:44:23,960 Like I mentioned, Charlie, he actually tried this, right? 884 00:44:24,020 --> 00:44:26,280 He didn't give it a seed file against a binary protocol. 885 00:44:26,680 --> 00:44:29,140 And it actually did get better over time, right? 886 00:44:29,200 --> 00:44:31,560 Because it was flipping bits and stuff like that. 887 00:44:31,620 --> 00:44:35,380 And eventually found that this sequence of bits did better than this sequence, right? 888 00:44:35,580 --> 00:44:36,900 It doesn't really know anyway. 889 00:44:37,860 --> 00:44:39,260 It's just a way where... 890 00:44:39,620 --> 00:44:43,660 So particularly if it's a small binary protocol, maybe you don't want to give it seeds. 891 00:44:43,660 --> 00:44:46,240 But for ASCII protocols, I think you really want to give it seeds. 892 00:44:46,400 --> 00:44:47,640 Because it's going to take it a long time. 893 00:44:47,780 --> 00:44:49,000 Like if it needs to find... 894 00:44:49,000 --> 00:44:52,120 Before it can really do much fuzzing, if it needs to find user, space, Jared, 895 00:44:52,300 --> 00:44:55,900 character, turn, line, feed, pass, space, Frank, character, turn, line, feed. 896 00:44:55,920 --> 00:44:58,340 It's going to take it a long time to find those strings, right? 897 00:44:59,560 --> 00:45:02,200 Okay, I think I have time for maybe one or two more questions. 898 00:45:03,780 --> 00:45:04,640 So let's see. 899 00:45:04,740 --> 00:45:05,220 Did I... 900 00:45:05,220 --> 00:45:07,820 Oh, I didn't really finish the challenges. 901 00:45:08,520 --> 00:45:09,540 Normal fuzzing challenges. 902 00:45:11,320 --> 00:45:11,680 Yeah. 903 00:45:11,980 --> 00:45:12,700 File fuzzing. 904 00:45:12,780 --> 00:45:13,520 Oh, I mentioned. 905 00:45:13,660 --> 00:45:16,180 I said that early on that, you know, depending on your target, you know, 906 00:45:16,180 --> 00:45:18,200 is going to make a big difference in how you go. 907 00:45:18,600 --> 00:45:21,040 So I think I mentioned most all these anyway. 908 00:45:21,300 --> 00:45:23,460 So any more questions? 909 00:45:24,280 --> 00:45:24,900 Go ahead. 910 00:45:31,440 --> 00:45:31,880 Microeconomies? 911 00:45:32,100 --> 00:45:34,160 Yeah, I think I've heard of that. 912 00:45:37,060 --> 00:45:37,500 Yeah. 913 00:45:38,260 --> 00:45:38,700 Yeah. 914 00:45:39,000 --> 00:45:41,300 Mm-hmm. 915 00:45:46,040 --> 00:45:46,420 Right. 916 00:45:46,620 --> 00:45:49,220 So the question, I think, overall is sort of like, 917 00:45:49,320 --> 00:45:51,300 have you tried other evolutionary techniques, 918 00:45:51,460 --> 00:45:53,600 other genetic algorithm techniques and stuff like that? 919 00:45:53,660 --> 00:45:54,960 The answer is I haven't. 920 00:45:54,960 --> 00:45:56,000 This is all I've tried. 921 00:45:56,820 --> 00:45:58,380 Probably wouldn't hurt to try, right? 922 00:45:58,420 --> 00:46:00,640 It just takes a long time to implement all that kind of stuff. 923 00:46:00,760 --> 00:46:02,220 So I haven't done that yet. 924 00:46:03,000 --> 00:46:03,380 Any... 925 00:46:03,380 --> 00:46:03,820 Go ahead. 926 00:46:03,880 --> 00:46:04,920 Is there another question over here? 927 00:46:07,640 --> 00:46:08,580 I think that's it. 928 00:46:08,640 --> 00:46:11,380 I think I will be going to the question room after this. 929 00:46:11,460 --> 00:46:12,740 If people want to talk more, 930 00:46:12,740 --> 00:46:13,940 please follow me there. 931 00:46:14,040 --> 00:46:15,060 So thank you very much.