Saltar al contenido ForoHackers

Fuzzing: start here

Fuzzing
#3301 · · Citar · Denunciar

Fuzzing is automated testing with huge numbers of generated, malformed or random inputs, watching for crashes, hangs and sanitiser reports. It finds the bugs nobody thought to write a test for, especially in parsers and protocol code. Fuzz your own software, or open-source code on your own machine, and report what you find.

Key concepts

  • Input generation: random mutation of samples, or generation from a grammar or format description.
  • Coverage guidance: instrument the program, keep the inputs that reach new code, and mutate those further.
  • Oracles: a crash is only one signal; sanitisers turn silent memory errors into loud failures.
  • Harnesses: a small function that feeds bytes to the code under test, fast and without side effects.
  • Triage: reduce a crashing input, group duplicates and find the root cause.

Vocabulary

  • Corpus: the set of interesting inputs the fuzzer keeps.
  • Sanitiser: a compiler option that detects memory and undefined-behaviour errors at run time.
  • Seed: a valid input a fuzzer starts from.
  • Minimisation: shrinking a crashing input to the smallest that still fails.

What to study, in order

  1. How the program under test parses input, and which bugs a parser tends to have.
  2. Write a tiny parser in C with a deliberate bug of your own, and a harness for it.
  3. Fuzz it with a coverage-guided open-source fuzzer, compiled with sanitisers.
  4. Build a good seed corpus and a dictionary of tokens, and compare coverage with and without them.
  5. Fuzz a small open-source library on your machine; minimise each crash, find its root cause and write a regression test.

Related tags

#vulnerability-research #testing #static-analysis #c #protocol-analysis

No has iniciado sesión, así que esto se publica como anónimo: no se guarda con ello ninguna cuenta, nombre ni dirección, y no puede llevar enlaces ni imágenes. Inicia sesión o únete para publicar con tu nombre. Los registros de nuestro servidor web guardan la dirección y la hora de cada petición hasta 14 días; para que la tuya no quede en ellos, usa Tor. Para escribir al equipo de forma confidencial, usa el buzón. Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder