Hello. Good afternoon all. How's everybody doing? Enjoying DEF CON? I know I saw a lot of people at Black Hat. Probably most of the people that saw it there aren't going to see it again. I don't blame them. It was worth seeing once, I think. Oh, we've got more people coming in. One of the things I like to do at the beginning of a talk is just sort of have everybody take their right hand, stretch it out like this, and shake the person's hand next to you, because you're going to see them next year if you come. I guarantee it. Every year you see the same, well, more, right? Some of the same people, but more. So, let's just get into this. The goal of the talk is to try and build a better fuzzer. That's the goal of my research. That's kind of what I've been doing for my academic work for the last year. And I'll briefly go through some background material, kind of just real quickly what's fuzzing, software testing, evolutionary testing. Then I'll talk about the actual system I built, EFS, and then talk about some initiatives. Then I'll talk about some initial benchmarking. And then talk about some initial results on real-world applications. So, there's no definitive proof that EFS is actually better than, say, like Spike or Sully or any of the other fuzzers that are out there, mainly because it depends a lot on the application, and it also depends a lot on sort of like what you were trying to do. And I mentioned this at the very end of the talk, but, like, for now, file fuzzing, as one of the iSec guys said at Black Hat, it's still depressingly easy just to take a file, flip a bunch of bits, feed it to the application, and the application crashes, right? So, there's no need to try and set up an evolutionary fuzzing system when you can just flip some bits. So, it kind of depends on your target, you know, what you're going after. Whereas, like, network applications are generally nowadays quite a bit harder to fuzz. They've been kind of hardened throughout the years, right? You can't just flip a few bits in an HTTP session and crash Apache, right? That's not going to work. So, it kind of depends, you know, on a lot of what's going on. To my knowledge, it's the first evolutionary fuzzing system that's been released publicly. You can go to my website, www.vdalabs.com, and download everything I'm talking about, the slides and the actual code, and GPF is there as well, general purpose fuzzer, something else I created. So, section one, software testing. This slide is just to say, and I mentioned this last year at DEF CON, that software testing is just hard. That's basically all this slide says, and that it's not an easy problem. It's not been solved. It's kind of an open problem, and there's a lot of companies looking at a lot of different problems. There's a lot of different ways to do it, but you got to test, right? It's the only way to give you any sort of confidence that your software is good. And fuzzing, as I said last year as well, is not the only way to test. There's a lot of other things. There's functional testing and GUI testing and quality assurance and formal methods of development, all that kind of good stuff, but fuzzing is just one element. So, the basic premise of fuzzing is you get a test case, deliver it to the application, and then if the application has a problem, then you obviously record that, and if it doesn't, then you keep going on to either the next randomly generated test case or the next test case that comes from a list of cases or however you're getting them. You sort of move on. And of course, the most interesting places to fuzz are where there's a change in privilege, right? Like, code that comes across a network interface is unprivileged data, I mean, that comes across a network interface, and if the service is running at some privilege and you can get a buffer overflow, right? You can elevate your privileges from nothing to something, so that's kind of part of the problem. The key, right, in any type of fuzzing is you're looking for some sort of elevation of privileges generally, or maybe you're just looking for robustness issues, whatever you're looking for. So, this is just to say that what you can fuzz is generally called the attack surface, and I think people understand this pretty well. I asked people at Black Hat as well, like, how many of the speakers have you heard mention the word either fuzzing or attack surface, and by and large, probably half the crowd raised their hand, which means that I think people finally sort of understand what these things are. The attack surface could be, you know, a local parsing of a file, the network interface, inter-process communication, any bit that could be influenced by dirty data, user data. So evolutionary testing uses GAs, genetic algorithms, and I'll talk about kind of how they work and where they failed in the past, just real quick, and kind of where they're going. So... Basically, the idea, if you haven't heard about this from last year or whatever, it's just sort of like survival of the fittest mentality, take, you know, mom and dad are so-so fit, and they mate and have kids, right? And then the children, ideally, are a little more fit, so it's kind of an each generation gets better. That's just, from a high level, that's the basic idea of genetic algorithms. They're searching algorithms, they're searching towards something. So if you have the source code and you do evolutionary testing, you're searching toward slash-slash-target. See that up there? So here's a function, it's called example, has four parameters, A, B, C, and D, and those four parameters were A is 10, B is 20, C is 30, D is 40. So the first check is, and this is like either the randomly generated or it's evolved this far so far, whatever data. If A is greater than or equal to B, then, oh, but it's not, right? So A is less than B. So you stop right there. So there were two more branches to get to the target. So the fitness is two branches, two plus normalization of 10, because 20 minus 10 is 10. So that's sort of how evolutionary testing works in general against software. And this slide is just to say that in the past, or even now, people are actually using evolutionary testing. In particular, it gets used in safety-critical situations. Like somebody might tell you, oh, denial of service isn't too big of a deal, right? I want code execution. Well, I want code execution, too. But if I'm on an iron lung and somebody DOSes my iron lung, that's bad, right? So denial of service can be really bad in safety-critical automobiles, airplanes, those kind of things. So they need to be really robust code. And so this is one of the places where that kind of testing gets done. Now this is just to show you, OK, so evolutionary testing, how does it do in some, in all cases? Well, I don't know about all cases, but here's a few cases where it doesn't do so great generally. Can anybody look at the code example on the left? Look where it says slide. That's where you're trying to get. It's called flag underscore example, takes two parameters, A and B. Does anybody see a problem with that? It'll never get there, is what you said? Yeah, well, it could get there. But what happens is there's a notion in evolutionary testing called the fitness landscape. And that's sort of like you're down here and you want to get up here. How easily can you climb the hill? It is a contiguous function, continuous function to get there. And in this case, the check is if flag, then target. But the problem is you don't control flag, right? You control A and B. So as a human looking at it, it's not too hard to see, well, if you set A and B both to zero, then you'll get to the target. But in the past, evolutionary testing didn't really take that into account. They didn't have any way of saying, I know what flag, they didn't know what flag is. So there's a way to deal with that. But that's called a flat spot in the fitness landscape. There's also something else called deceptive problems, which is if you look at the code snippet on the right. OK. You can see it's function under test takes a parameter, and you want to get to where target is again. It says if the inverse of that equals zero, then we'll get there. Does anybody see the problem here? So it looks like as you give it, say, 100, it'll go into the inverse function and do like 1 over 100. And then you give it 1,000, and it's like 1 over 1,000. So it's taking the inverse. So it's getting smaller. So it thinks it's getting closer to zero. Right? Your evolutionary testing algorithm believes that it's getting closer and closer and closer to zero. Well, actually, all along, as it gives it larger numbers, it's getting farther away. So if you just give it zero, though, it would actually hit the target, but it doesn't really know it. So that's what's called a deceptive landscape. So all that's just sort of background. This is section one. There's people working on that in academia. McMahon and Holcomb are coming up with what's called the extended chaining approach to do better with evolutionary testing. But the system that I designed is better. Or I don't want to say better, different, because it works on binaries, right? Oftentimes if you're auditing, say, IIS FTP or something, you're not going to have Microsoft's source code, right? So there's no way to really do the sort of traditional evolutionary testing. So you have to use a debugger and the binary and all that kind of good stuff. And I'll talk about how that works right now. Section two. So what is EFS? Well, it uses evolutionary algorithms, and it also uses fuzzing. I leveraged a tool that I'd written in the past called GPF, General Purpose Fuzzer. And it also leverages Pstalker, a heavily modified version of Pstalker in the PyMA framework, which you may have heard of. And this is an overview, a system view, of how EFS works. So you see GPF here is written in C down in the left-hand corner, and it's doing the evolutionary algorithms. All the fuzzing heuristics and stuff come from there. And the target monitoring is right there on the right-hand side. You've got the debugger monitoring the target. And then they both talk to a SQL database. So that each side is monitoring the target. And you can see that each session from each generation can be stored. And you say, well, what is a session and what's a generation? We'll take a look at that and see what the data structure looks like. And I should say right up front that this tool was originally designed with sort of network protocols in mind, but I am porting it to file fuzzing as well. But it is sort of network-centric. You'll see it feels that way. And it has some reporting you can do from PHP. So the basic protocol is just sort of like the fuzzer sort of asks the process stalker, are you ready? And he says, yeah, I'm ready. And then he talks to the target. And then the process stalker gives the coverage information, how many functions or basic blocks were hit. And those get stored in the SQL database. And OK, so if you don't, it should be fairly clear what functions are. And I think I talk about this a little later, too. And basic blocks, just in case you don't know, so you take the binary, you put it into IDA Pro, and you run pita dump, and you actually create what's called a pita file. So basically, you get a list of all the functions. So you can see where the function starts and all the basic blocks start, so that you can stalk on either functions or basic blocks. And a basic block is just like an assembly. You have like push, push, move, move, branch. That's a basic block. Whenever there's a branch, that's like starting another basic block. So basically, you have the choice when you stalk for coverage. You can either stalk on functions or basic blocks. And we'll talk about which one's better. There's a lot more basic blocks than there are functions. So it makes the stalking more granular, but it also makes it a bit slower. So there's pros and cons. And the fitness function. So genetic algorithms, basically, the key to a good genetic algorithm is having a good fitness function and a way to evaluate the fitness function. And in this case, the fitness function is two pieces. It's code coverage, how many functions or basic blocks were hit during the session that just ran, and also a measure of diversity. Because what happens over time in a genetic algorithm is there's what's called convergence. And that means that like you started out with all these good random pieces, and you were kind of diverse up here. And you see your fitness started out real low. It was all like kind of random. Random data mixed with basic blocks. And as the sessions get more and more fit, they all essentially become very, they become alike, right? They all start to look the same. The best guy is sort of winning, the strongest guy. And that means also that the diversity is sort of going down, right? Because all those other guys that weren't as strong kind of die out over time. And you don't want that to happen because what happens is you want to cover the entire attack surface, not just like the single session that's like gives you the biggest amount of functions that get hit. Because that's important to hit that guy, too. The best session that goes all the way through. But there's all these other little sessions that might, you know, trigger corner case bugs and stuff like that. So diversity is key because diversity will give you more total coverage of the attack surface. And ideally, you'll cover the entire attack surface. And that's a bit hard to actually measure, right? Because you may not know, like if you're, again, if you go back to the IIS FTP example, say you, you know, you put it into IDA Pro and you get a list of all the functions and say there's like 1,000 functions, well, how many of those 1,000 functions can you touch remotely through the network interface? You don't really know. I mean, there's not a real clear and easy way to tell. But if you could tell, if you could tell that it was 200 of those 1,000, then ideally you'd touch all 200 functions throughout the course of fuzzing. That's sort of the goal. And that's sort of, I use the academic keywords corollary, one and two. The first corollary is that code coverage doesn't equal security. But if you don't get code coverage, then you're even less secure, right? I mean, you've covered. You haven't covered it. You haven't covered it. So you can't find bugs. And the second one is true, which basically just says if you cover the entire tax service and you do it with diverse sessions that have fuzzing heuristics, like long strings and dot dot slash and percent end characters and all the kind of good fuzzing heuristics that should be in fuzzy data, then that's sort of the best I know how to do. That's kind of the goal. Okay. So how does the actual evolution work? We'll talk about that first before we talk about some results. So basically, it works by kind of recombining data and kind of slamming around, and any bit can be reorganized. And I'll show you how that actually works with a session crossover, session mutation, pool crossover, and pool mutation, because data gets organized in pools. Sessions of pool. I'll show you that in a second. But one thing to mention is this elitism, which means that the session that performs the best in each pool gets carried over to the next generation automatically. He doesn't have a chance of sort of breeding and dying. He doesn't have a chance of sort of starting out. He just sort of gets to go to the next generation. That's called elitism of one. So how is the data organized, then? Well, at the lowest level you have a token, and a token could be of different types, like binary, or ASCII, or space, or delimiter, or carriage return, or line feed, or whatever. So each token, maybe you have a string that has the word user or something like that. And each leg is like a read or a write. in the case of a network protocol. And so a session would be a series of reads and writes with tokens, obviously. And then those are all organized in the pool. And the idea of the pool is to help maintain that diversity because if you have different pools of sessions and they don't necessarily breed, though they can, they certainly can. Pools do breed, but you can set how often that happens. You can help maintain diversity, and we'll see that as well. So how does the actual session breeding take place? You have two fine-looking, beautiful sessions, A and B, and they want a bada-bing, bada-boom. How does that work exactly? Well, you draw, it's called single-point crossover. You basically draw a line, sort of randomly pick a spot between two tokens, and you copy up to that line in A, and then after the line in B, you continue copying. And the same thing for B prime. You go up to the red line in B and then after the red line in A, and you have two new sessions. And it's sort of unintuitive that this would work, right, because you don't really know how that data is organized. Like, if in order to log in, you need, like, user space, password, carriage return line feed, or something like that, it seems like this wouldn't work, right, because you're kind of recombining bits and pieces of just either what are called basic blocks, which we'll see, or random data. And it doesn't seem like this would actually work, but amazingly, it really does. So, I know, I was kind of amazed the first time I saw it work. I'll show you that. So here's an example of a session mutation. You see the word Jared just got a bunch of percent ends inserted into it. That's all it does. That's all a mutation. So it also could be, like, inserting, again, any sort of fuzzing heuristic. It doesn't necessarily always, like, just insert random data or flip bits, although it could. That's one of the fuzzing heuristics is to just, like, if it's a type binary, just, like, flip the bits in that token or something. But it might insert long strings or whatever. There's quite a few different things. And you can look through the source code that I have to see what are all the fuzzing heuristics and how do they actually work, you know. So pool crossover is very much like session crossover. And, like I said, you'd want this to happen less frequently to maintain diversity, maybe every, you know, 9 or 10, 13 generations, something like that, so that pools kind of have a chance to evolve a little bit separately to help maintain diversity. It's very similar. Draw a line, copy from one to the other. Pool mutation is basically just randomly adding or deleting a session. You wouldn't want to do that very often either because if you have a lot of good sessions in there you don't just want to lose that information. But every once in a while it's good to insert fresh blood because you might be missing a basic building block. So I'm very much like just show me, you know, a little bit of an example because it's kind of abstract, right. So this is just kind of a simple example. You see generation one starts out with a lot of randomness in it. And you see some basic blocks in there, right, user and pass. And I'll talk about that in a second where those come from. They come from what's called the seed file when you originally started. So if you know what the protocol is, you sort of know what the necessary strings are. Like if it's FTP, you know somewhere along the lines you need to see user and pass. Show up. Those are called the building blocks, right. And what happens is if you don't give them building blocks, it could ideally and theoretically eventually find the string user. It's just going to take a long, long, long time, right, because it would have to just randomly combine bits to come up with that string. And you see by generation 15, in the first generation it didn't really do much, right, because it just had the best one maybe was session one. He had user space and then some junk. So maybe he got like halfway through logging in. But not real fit, but by generation 15 it's got like user space, which is a delimiter, some junk line feed, which is good, and then pass and a delimiter and then some more junk. So that would actually be more fit when you're stocking that. You'll see that he actually progresses along. And that's kind of how they work. Just over time, you'll see them getting better and better. And if you dump the data out of the SQL database and actually look at the data that's in sessions, sometimes you're amazed like after 100 or 200 generations of evolution, you're like, you're looking at the most fit one and you're like, how is he the most fit? That is ugly. And then you look at it and you're like, no way. There's a carriage return. There's a line feed. There's a bunch of random, you know, a bunch of FFs, a bunch of random binary. But text-based protocols are pretty forgiving. So as long as the strings and stuff that it needs to see are in there, you can still log in and like actually work as long as it's got the basic things it's looking for. Binary protocols aren't quite as forgiving. We'll talk about that too. So what are the actual parameters that you give to GPF to start this off? And make this happen? Well, obviously you've got to give like the IP address of the stalker and the IP address of the database and all that kind of good stuff, the username and password and the number of sessions you want in each pool and how often you want the mutation to take place in each pool. The session mutation happens, session crossover happens every generation and all the other ones are configurable, pool mutation rate, pool crossover rate and all that good stuff. And there's some basic parameters to get you started. I'm not going to go through every parameter and what the optimal set is. The setting for each parameter is because it varies a lot based on the application you're testing. And there's also the seed file. You see that? And I talked about that. And here's an example again of the seed file that I'm talking about. So if you're going to fuzz SMTP with an evolutionary fuzzer, you might as well give it a seed file that looks something like that. It's got like hello and mail from and receipt to and stuff like that because that'll just help the evolution happen much quicker. It'll sort of give it a boost in the direction. But the key with the seed files is to give it really small basic blocks because if you give it like really big, like if you're fuzzing HTTP and you give a basic block of get space slash space HTTP slash 1.1 or something, that's like a really big basic block. And it'll use that and probably do okay with that, but it'll have a hard time like finding weird stuff. It probably won't find as many bugs and stuff. It'd be better if you give it get and a space and a slash and a space and an HTTP and a 1.1, like all as separate seeds. Smaller building blocks are better in terms of evolutionary. Yeah. Fuzzing, but just in evolution in general, genetic algorithms. The smaller the building blocks, the better generally. So on the other side, not on the fuzzer like evolutionary side, on the other side, sort of the gooey side that's written, it's sort of like the modified version of PyME. What do you need to do? Well, again, you have to put, okay, there's two routes you can go here when you need to track code coverage. You could like sort of sample EIP or you could use what's called an MSR technique. Or you can create a pitiful. So basically you take the binary, you stick it into IDA Pro and you run what's called pitidump and it gives you that list of functions and basic blocks that I talked about. Give that to PyME and give it the normal startup and shutdown parameters that you have to give any application. That's kind of one of the key things when you're fuzzing is sort of like you got to figure out if it's a Windows service, it starts and stops different than if it's a user application. All those kind of things are very important to figure out ahead of time. How is this going to work if it crashes? Because you need to tell it. When it goes to restart it, it's going to start. But it needs to know how to do that well or it's not going to take place. So you got to have the SQL database set up, all that kind of good stuff. Here's a quick picture of how it works. And those are all the parameters. And again, I'm not going to go through all those parameters, but there's the settings for functions and basic blocks and what to do to attach or detach after a crash or like all these different settings. And one of the main things you see there, you see the little red scissors. You probably can't see it very good in the picture. But there's a notion of filtering. And you want to filter because for every session that, again, if you're fuzzing FTP, things that happen every time, like when you start it up and when you connect, like if you just connect it with Netcat and don't send anything and then shut it down, those are all common breakpoints. And you really don't want to stock on common breakpoints because they just slow down the evolution, slow down the running of the fuzzer. So it's best to filter those out. So you just manually start it up, connect, shut it down, save those hits to the PyMate database. And that's really kind of crucial in terms of speed. Okay, so that was section two. Section one was the background. Section two was what is it. And section three is kind of like how do we evaluate it? And the way to do that, in my mind, is sort of create a benchmarking toolkit. And this bit isn't... This research isn't complete. But we'll talk about tag service coverage and two servers, a text server and a binary server to see how well it does against both. And then we'll figure out, is it better to stock on functions or basic blocks? And did pools help maintain diversity? And if they didn't help as much, is there something else, some other measure, something else we can do to make diversity better? In fact, there is. I just recently added a bit to it that another diversity, and we'll see that. So there should be another paper coming on that as well. Sometimes. So... Okay. So like I said, this toolkit could help you see how well it would do against a clear text server, how well it would do against a binary server. And also, one thing that would be a really good thing to do if you want to benchmark and say, hey, is this as good as Spike? Is this as good as Sully? Is this as good as a different thing? Or is it better? Is it worse? Whatever. Well, one other idea, too, is you could insert bugs that are easy to find and bugs that are hard to find, and you can fuzz and just sort of evaluate them. Right? Okay. So this is how the text server works. It's basically just a standard text, you know, very texty type feeling. The server says welcome, and then you send it command X, command space, a number, character turn line feed, and it says okay, that one's good, and then you send it another number, character turn line feed, and then it says the sub command's okay, and then you send it calculate character turn line feed, and then it gives you basically the answer. So it's just adding two numbers. Very simple thing. But it has... The cool thing about it is that I wrote it so that it has three paths. You can set it on low, medium, and high. And that way it gives you the ability to say, okay, if the attack surface is really small, how does this guy work? Or if the attack surface is larger, if there's more paths, if there's more opportunities for diversity, how well does it work? And that's actually really helpful in terms of kind of evaluating something like this. Here's just an aside that I kind of found interesting, just kind of for my own research. So this was the text server set on medium. Just starting it and shutting it down was 137 basic blocks of 597 basic blocks. So 23% of the code was just literally like double-clicking it and clicking the X, right? So that's kind of interesting. You wouldn't think that there's a lot of code wrapped up in that, but there is quite a bit of code just in starting a service and shutting it down. So the actual network code, which is just like the TCP connect, right? That was 15 basic blocks, 3% of the code. And then the parsing, which is the only bit of code that actually has any opportunity to have bugs. So this is like the attack surface, right? This is the part that you want to fuzz. There was 94 basic blocks out of 597, so 16% of the code. So that's just kind of interesting. The other really interesting thing to me is that a large portion of the code is just unaccounted for. Just like libraries that got linked in that never get used, things like that. You can actually look through IDA Pro and figure out what all that code is that just never gets used. It's really interesting to find that a lot of it is essentially unaccounted for. So the C file for this fake text server. Fake text server would basically just be the nine numbers that are possible. And again, on low, only the number one is acceptable, and on medium, one through four is acceptable. On high, one through nine is acceptable. And then a couple other strings like character, turn line, feed, calculate, command. And it should be able to shuffle those all together and insert fuzzy heuristics and find bugs and do all that kind of stuff. So it had no problem learning the language, figuring out. It found the best session. And by best, I mean the correct session, right? Where it completed all the legs of the protocol. That's what I call, that's like the base session or the best session. It does not necessarily all of them, and we'll find that. But it didn't actually cover the entire attack surface. Does anybody know why it wouldn't cover the entire attack surface? Well I think we see that. No, we don't see that on the next slide. We'll see that in a few. But it's basically because there's a lot of corner cases. You know why. Go ahead. I got a question actually. Go ahead. When you say it didn't cover the whole attack surface. Yeah. So it didn't cover all the parsing code? Right. Okay. Yeah. It didn't. So it didn't cover all the parsing code, which is the attack surface was the question. And the reason why, if we go back and look at the protocol, is I'm not really showing you all the protocol here, am I? Because what happens if you send command and then a thousand A's instead of like a number like it's expecting? What's it gonna do? Well probably it has some sort of error code, right? It's gonna say like, you know, invalid command, try again or something like that. So I didn't really show you all the protocol, and that's kind of an important notion because this is, I think, the place where this kind of testing sort of dynamic learning testing where you're getting actual feedback from the subject under test as you test. This is where it excels in that if you create a fuzzer, like a spike file or whatever, and it's RFC compliant, it's gonna do, it's gonna be a good fuzzer, right? It's gonna do well because you designed the fuzzer based on the RFC, right? So it's gonna get good code coverage because you're designing it to get good code coverage. But what happens? What happens if there's some bit of the protocol that's not, like they didn't follow the RFC when they implemented it, right? And that's the whole idea. You're looking for implementation errors. There's either like a hidden command or a command they, you know, they allow one command earlier in the protocol when it really shouldn't be allowed until later. That kind of a thing. Like, you know, you can do pass first instead of user when really you shouldn't be able to do pass. It should, you know, first should be the user, right? So those kind of things. This is gonna be particularly good at doing that. And it's also particularly good at finding sort of like places where you need, you know, weird or fuzzy stuff throughout the various legs of the protocol, right? Because typically a spike file is gonna, it's gonna like fuzz the username first. And it's very sequential. And then it's gonna be a valid username. And then it's gonna fuzz the password next. And then it's gonna fuzz whatever else is after that. So it's gonna be a very organized, sequential kind of way of fuzzing where this is kind of craziness, right? It's gonna be slamming all over the place, coming up with weird sessions and all kinds of stuff like that. So that was the tech server. The binary server is very... It's very binary looking, right? It has the first four bytes are the total length of the packet. The second four bytes are the session ID. The second... Or the next two bytes are the length of the command. And then the final bytes are the actual command that you wanna send. And the server response is very much like that. So the question is, will a system like this be able to learn something like this? Because now you have to have a link that has to be correct and cover the whole packet, else the packet gets rejected sort of as the first check, right? That's kind of how binary protocols work. And sadly, I don't have much testing done on this bit yet, but it shouldn't be too hard. Talked to Charlie Miller and he did a little bit of testing on one binary protocol and it worked. So more to come on that. So next question, which is... So which should I stock on, functions or basic blocks? Does it matter? Well, in my experience, it didn't seem to matter a whole lot as long as the application was sufficiently large. But here... This is an example where... The tech server was being run on low and it did make a difference because there was only six functions. The best session is six functions long and it only found four of the six because the fitness landscape's very flat, right? It's got very like... It makes a breakthrough, but then it's flat and then it makes a breakthrough. It's not a nice smooth. Where you see the basic blocks did a little better, right? It was a little... On the right-hand side, you see the basic blocks. The graph is a little smoother as the diversity kind of went down and the fitness kind of went up. And it actually found... In the case of the basic blocks, it found 40% less than the basic blocks. It found 40 of 37, meaning that 37 is kind of that base case where it did everything right and it found 40, which means that it must have found one of the error cases as well, right? Because it found more than just the base case where the other one didn't. But if you run tech server on medium, you see that actually the functions did just as well and did it quicker, maybe slightly better in this case. So the graph isn't quite as pretty because with basic blocks, things tend to look a little smoother. So you see diversity coming down a little smoother and going up a little smoother. But either way, you found all six functions. So there to say, again, just to prove the point, all I'm trying to say with this slide is that if the application is sufficiently large, it's okay to stock on functions, which is kind of important because it speeds up the process enough that you'd rather, in my case, I think I'd rather stock on functions if I can. It's just that much quicker. Because the difference could be if you have a particularly large application, what does it really mean? I'm stocking on five. So I have 10 functions and I'm stocking on 20. functions or basic blocks. But what it really means is each of those are like a break point. So if you've got a list of all the functions in the application, when you start the application you have to set a break point on every one of those spots in order to get code coverage. You have to hit it, uncheck the break point, and keep going uncheck the break point. So if you're hitting, say, 50 to 100 functions versus 600 to 800 basic blocks, it's going to run slower with basic blocks. Because there's a lot more break points it's going to have to be unchecking, essentially. So, in the next slide, you'll see over here, this is the same thing. Next slide, I just want to show what were the effects of the pools. Did it actually help? And it turns out it did help having pools. It helped keep diversity up, but it still didn't cover the entire attack surface, right? And I wanted to add another bit to that to help it do even better because the pools helped, but this next thing actually helped even more. This is called niching or speciization or some way of rewarding those guys that look different, right? So all the sessions as they're growing, they all want to be like the doctor or something like that, but this guy, he's different. He wants to be the fireman or something, so we want to kind of reward them. Even if they're not as fit, they're not hitting as many functions, we want to give them some sort of reward, and I'll show you. That's the algorithm, and I'll show you just real practically because it's a little mathy looking, not terribly, but a little bit there. So real clear example, session one got ten hits. Session two got seven. Session three got five hits. Well. So, and I actually show you the hits, right? A, B, C, D, E, F, G, H, I, J. And what do those letters represent? The letters represent basically an address in memory. That's all they represent. So it might actually have been 08041234 or something like that. And so your initial thought might be that, well, session three doesn't really deserve to do, you know, he doesn't deserve to breed as frequently as session two because he didn't do as good. He only had five hits versus seven. But the thing you see there is that session seven looks like he's going to grow up, to be just like his dad, right? He's kind of an immature version of the ten hits. He's got all the exact same functions. He's headed along that same line. Where the other guy, he's hit five functions that the other two have never hit before. So you give him a reward. You take the unique hits divided by the total times the best minus one. So he ends up actually in the end, because of the fitness boost that he receives, his total fitness is 9.5, which is actually better than the second one, which I think makes sense. He should actually be better. He should be better in terms of overall fitness because of the fact that he's following a diverse path. So graphically, let's see how this works. So in the first case, we can see that we had only, this is the first one on the upper left, we only had one pool and a whole bunch of sessions. And we see diversity kind of going right down as fitness goes up. And that kind of confirmed my suspicions that as everybody's becoming more and more. Question, go ahead. Yes, I would love to. The first one does, but he's the best. So everything's baselined off the best. He doesn't get any boost for being unique. He's the best just based on the count, on the number of hits. So he hit 10 break points, whether it be functions or basic blocks. One down below, does that mean 10 is his best? Essentially, that's what it is. Yeah, 10 equals 10. So you see he had 10 hits, but he didn't have any unique because he's the best. So we don't count any uniqueness for him. And so his fitness, his overall fitness is still just 10. 15 uniques? Well, overall, yes. So what you would call the total diversity, and that's what we see in the next slide when I talk about total diversity peak. See how it's measured like 80, 87, and 100? The diversity peak is the total count, so the count across the entire pool of diverse hits. And that's what you want to maximize, right? Because say if there's 150 total possibles, you want, ideally, the total diversity peak hits 150. At some point throughout the evolution, you've covered the entire tax service. That's the goal. That's what we're heading toward. So I didn't actually get that. But what I got is that when I added multiple pools, you see the trend of diversity is kind of up and down. The total diversity, what you're talking about, the count of all diverse hits throughout the pool, is the green line on top. And it did better than just with one pool. So multi-pools did seven better overall. And when we added that final metric of boosting or giving a boost to diverse sessions, then you see the total peak was 107. So it helps substantially to give a boost to people who are less fit hit-wise, but more fit diversity-wise. So that was the... evaluation, sections one, two, and three, and four. Section four is the actual results. So just some results. After fuzzing, GoldenFTP found lots of bugs. I don't know if you guys have heard of that before or use it, but I wouldn't recommend using it. IASFTP and SMTP did not find bugs there, but did find some instability that could probably mostly be attributed to the debugger. Wasn't able to identify those to any one session. So kind of the moral of the story, the moral of the story here is that really more testing needs to be done. It needs to be tested against lots of different applications and lots of different scenarios to really, for any real evaluation to be made of how well it does compared to other fuzzers. So this was just some pictures that I had generated a long time ago when I first started using it. And I just like this because I thought it was really cool when the little bubble popped up in the lower right-hand corner saying that GFTP, a user had logged in. Like I didn't even know that happened, right? When I just installed GFTP and just started fuzzing it without even really using it. So when the bubble popped up and I saw that a user had logged in, I was like, wow, that's really cool. It works. So I was very happy and impressed about that. And here's just a picture showing that it found a bug and it's kind of dumping the registers to the screen and stuff, which it also dumps to a file and also dumps to the database. And you can query the database later. And that's how the overall, you can tell how many total crashes you got, right? Go ahead. Does the debugger have to be on the same machine? As the process you're debugging? Yeah, kind of. So the answer is yes. Like, I mean, if you wanted to fuzz a Cisco router, then this wouldn't work, right? Because PyDebug isn't ported to Cisco routers. In fact, PyDebug only works right now on Win32. So it needs to be running on a Win application. There's people porting. I know Charlie's porting it to OSX and there's other people porting it to Linux. But if you're on Windows and if your target is on another Windows, Windows box, you can actually debug remotely. You could have the debugger running on a different Windows box, as long as they could talk to each other. You can do PyDebug remotely. So it's kind of yes is kind of the answer to both those. Again, yeah, feel free to ask questions any time throughout. So this is just kind of showing kind of the coarseness of the landscape initially, how it's not particularly smooth, especially in terms, this is called best fitness. And you see where the big spike is where it learns how to log in. And then shortly after it learns how to log in, it starts finding. Bugs. Those are the blue lines. And this is just the same kind of graph smoothed out. So basically, the moral of those two graphs is that after it learned how to log in, it started finding bugs pretty quickly, shortly thereafter, which is good to know. This this graph is just intended to show the same thing as the earlier graphs. The green line on the lower right hand graph, you see how it kind of keeps creeping up. It has an overall upward trend as opposed to the red line is one pool. And the diversity kind of went down and total fitness as well. Average fitness in the green line kind of goes up. So. It's just kind of to show you again that same thing that if you can help maintain diversity with pools. And this one just kind of shows that 10 pools did better in terms of finding unique crashes. So in the first case, with only one pool, I didn't even count. It's like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 unique crashes that it found, bugs, if you will. But with using 10 pools, it found like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15. I don't know. I'd count them up, but it found more unique crashes. And that's really key. That's really important. And it sort of speaks to the fuzzing, the diverse nature of the fuzzing. So let's see. I kind of went through that pretty fast. Good future work, porting it to fuzz files. 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? Because fuzzing. Fuzzing network applications is pretty hard. But fuzzing applications that receive files is still pretty doable. Go ahead. 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? Right, so the question was, how long does it need, does the tool run like minutes, hours, days? And specifically, how many generations is what you asked. How many generations? It's not. Like terribly long. It is long, though, maybe like a day or something. It's not like months or anything like that, but it takes a little while. 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. And if you have 100 sessions in a pool, then it takes like 100 times 0.6 just to do, you know, one generation. Basically, there's a little overhead at the end of the generation when it does the the breeding and stuff, but not terribly long. So go ahead. Other questions? Right, yeah. That's a great point. Good to see you again, too, by the way. Yeah. Yeah, so the question is, how do you know that it's unique bugs you're finding, right? Because that's what you want to find in this sort of thing. You don't want to, at the end of the day, you don't want to say, I found 30,000 crashes and then have to go and figure out what all 30,000 of those crashes are. And, well, I guess I sort of half solve the issue in that they're binned by exception address, basically. So as long as they have a unique exception address, like the exception address, I mean the actual line of code, right? As long as EIP is different for each crash, then they get put into a different bin. And you sort of see that. 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? The actual number above that's like 31,000. So I found 31,000 of that bug. That's just one bug, basically. So it only gets counted one time, right? And that's true of all those, right? Because it's going to keep, like you said, it's going to keep hitting the same bug over and over and over again. So I actually thought about adding a sort of a fitness minus. Right? In terms of sessions that have already found a crash. It's sort of like penalize them if they keep hitting the same crash. And don't let them kind of grow down that road. But it didn't really seem to be a problem. Because eventually they sort of, one that doesn't crash will get further. And he becomes more fit. So it kind of ends up doing that by itself over time. You just get a lot of repeated crashes. But as long as you can bin them like this, it doesn't really matter. You only count it once. So go ahead. Okay, I didn't quite hear it all. I'm sorry. Can you say the crux of it one more time? Yes, the basic building blocks you give it in a seed file are critical. And I see it's not going to be naturally on the long view of the product. Will it get to the point where you see the same? Well, it does both, actually. So when you give it a seed file, it doesn't just pick building blocks from there. It has like, I forget, it's either a 30 or a 60. I don't remember what the percentage is. But there's a percent, basically. Whenever it goes to build a token, it's sort of like, okay, I'm going to build a token. Should I grab it from the seed file? Or should I build it randomly? And if it grabs it from the seed file, it's not just a piece of ASCII or binary data. But also, I didn't really show it. So it wasn't a perfect explanation of the seed file. But if you actually look at it, you can download all this code. If you look at one of the seed files that's in there, you'll see that you give it like a type, too. So you'll say the length is 4, the type is ASCII, and whatever, and here's the data. So it might grab that token and just use it. Or it might just totally randomly create one, right? Like say, I want to create a binary token that's 2,000 bytes long. Okay, five minutes. So it kind of does both. I know that doesn't completely answer your question. Yeah. Your question was, what if you don't give it a seed file at all? And you just truly, truly go random. It still will evolve. Like I mentioned, Charlie, he actually tried this, right? He didn't give it a seed file against a binary protocol. And it actually did get better over time, right? Because it was flipping bits and stuff like that. And eventually found that this sequence of bits did better than this sequence, right? It doesn't really know anyway. It's just a way where... So particularly if it's a small binary protocol, maybe you don't want to give it seeds. But for ASCII protocols, I think you really want to give it seeds. Because it's going to take it a long time. Like if it needs to find... Before it can really do much fuzzing, if it needs to find user, space, Jared, character, turn, line, feed, pass, space, Frank, character, turn, line, feed. It's going to take it a long time to find those strings, right? Okay, I think I have time for maybe one or two more questions. So let's see. Did I... Oh, I didn't really finish the challenges. Normal fuzzing challenges. Yeah. File fuzzing. Oh, I mentioned. I said that early on that, you know, depending on your target, you know, is going to make a big difference in how you go. So I think I mentioned most all these anyway. So any more questions? Go ahead. Microeconomies? Yeah, I think I've heard of that. Yeah. Yeah. Mm-hmm. Right. So the question, I think, overall is sort of like, have you tried other evolutionary techniques, other genetic algorithm techniques and stuff like that? The answer is I haven't. This is all I've tried. Probably wouldn't hurt to try, right? It just takes a long time to implement all that kind of stuff. So I haven't done that yet. Any... Go ahead. Is there another question over here? I think that's it. I think I will be going to the question room after this. If people want to talk more, please follow me there. So thank you very much.