|
| 1 | +## Definition |
| 2 | +Testing a system ([[SUT]]) using input that are wholly or partially randomly-generated. |
| 3 | + |
| 4 | +The goal is to get the interesting behaviour to aide in finding bugs. |
| 5 | +- *interesting* is application dependent, most often it means crashing the system. |
| 6 | +### Fuzzer Types |
| 7 | +- [[Generation-Based Fuzzer]]s and [[Mutation-Based Fuzzer]]s as well as combinations of both. |
| 8 | +- [[Dumb Fuzzing]] versus [[Smart Fuzzing]] |
| 9 | +- [[Feedback-Directed Fuzzing]] |
| 10 | +- [[Black-Box Fuzzing]] vs [[Grey-Box Fuzzing]] vs [[White-Box Fuzzing]] |
| 11 | +## Input Types |
| 12 | +| Input | For Compiler Fuzzing | |
| 13 | +| ---- | ---- | |
| 14 | +| Totally Invalid | Random invalid strings to check invalid inputs are not acceptable. | |
| 15 | +| Malformed Inputs | Sequences of tokens structurally correct, but invalid. | |
| 16 | +| Inputs with high validity | Token sequences that are in the language's grammar, but are ensured to be not semantically valid | |
| 17 | +| High Integrity | Well formed programs free from undefined behaviour. | |
| 18 | +Whenever using random inputs, it is important to consider their distribution (e.g. generating numbers, what should be distribution be like to get maximal coverage?). One way to improve this is with [[Swarm Testing]]. |
| 19 | +### Minimal Requirements |
| 20 | +| Component | Description | |
| 21 | +| ---- | ---- | |
| 22 | +| [[SUT]] | The system to provide input to | |
| 23 | +| [[Oracle]] | To determine which behaviours are *interesting* | |
| 24 | +### Advantages |
| 25 | +- Effective in finding edge-case inputs missed by human written test suites |
| 26 | +- Can automatically increase coverage of a codebase |
| 27 | +*Note: Can be used to find exploitable defects in programs. We consider it an advantage for the developer to find them first!* |
| 28 | +## Early Days |
| 29 | +> *_We didn't call it fuzzing back in the 1950s, but it was our standard practice to test programs by inputting decks of punch cards taken from the trash. We also used decks of random number punch cards. We weren't networked in those days, so we weren't much worried about security, but our random/trash decks often turned up undesirable behavior. Every programmer I knew (and there weren't many of us back then, so I knew a great proportion of them) used the trash-deck technique._* |
| 30 | +> **- [Gerald Weinberg's Secrets of Writing and Consulting: Fuzz Testing and Fuzz History (secretsofconsulting.blogspot.com)](http://secretsofconsulting.blogspot.com/2017/02/fuzz-testing-and-fuzz-history.html) |
| 31 | +
|
| 32 | +### Introduction of *Fuzzing* |
| 33 | +In 1990 the term *fuzzing*was introduced by a paper testing linux utilities with random data. |
| 34 | +- The paper: [An empirical study of the reliability of UNIX utilities | Communications of the ACM](https://dl.acm.org/doi/10.1145/96267.96279) |
| 35 | +- Tested if random inputs could cause the utilities to crash. |
| 36 | +- This was a [[Generation-Based Fuzzer|generating]] [[Dumb Fuzzing|dumb]] fuzzer |
| 37 | +- |
| 38 | + |
| 39 | + |
| 40 | +## Example |
| 41 | +### GLFuzz |
| 42 | +Generates OpenGL shader programs by mutation (transforms existing programs), but also can insert some randomly generated code fragments (generation). |
| 43 | +### [[American Fuzzy Lop (AFL)]] |
0 commit comments