From the course: Machine Learning for Red Team Hackers by Infosec

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Basic fuzzing and code coverage

Basic fuzzing and code coverage

- [Instructor] So now that we have a bit of a background about fuzzing, let's go ahead and implement some basic fuzzing. Let's go ahead and implement a basic toy_fuzzer. So what I want my fuzzer to do is to generate strings of a length that I'll specify. And then I also want the option to choose the set of characters. So I want to be able to choose digits or no digits. I want to be able to choose letters or no letters, and I want to be able to choose special characters or no special characters. So let's define toy_fuzzer. And this function will take a max length. And the reason I choose max is, because I want to be able to generate random lengths of strings, but no longer than the maximum length. And then I have a flag here whether to include punctuation, whether to include letters and digits. So the first thing we do is get the vocabulary from which the fuzzer will be drawing its strings. So it's going to be the flag times all punctuations. And then all ASCII letters and all digits…

Contents