Provide links to C file and diff for download.

This commit is contained in:
Florian Obser
2022-12-02 17:11:25 +01:00
parent 7a3ccf4eae
commit ae9808f343
4 changed files with 168 additions and 2 deletions
+4 -2
View File
@@ -45,7 +45,7 @@ I installed =afl++= from packages and glanced at
+ Compile the program with =afl-clang-fast=.
+ Run =afl-fuzz=.
=test.c:=
[[file:fuzzing-ping/test.c][=test.c=]]:
#+begin_src C
/* Written by Florian Obser, Public Domain */
#include <err.h>
@@ -98,7 +98,7 @@ Here is a file where the length byte and file size agree. Create
folders =in= and =out= and place =test.txt= into =in/test.txt=. Don't
forget the newline.
=test.txt=:
[[file:fuzzing-ping/test.txt][=test.txt=]]:
#+begin_example
ABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
#+end_example
@@ -132,6 +132,8 @@ parsing is handled by =pr_pack()=, so that's what we should fuzz.
We need some sample data. An ICMP package is binary data
on-wire. Crafting it by hand is annoying. So let's just hack =ping(8)=
to dump the packet to disk.
[[file:fuzzing-ping/ping_output_hack.diff][=ping_output_hack.diff=]]:
#+begin_src diff
diff --git sbin/ping/ping.c sbin/ping/ping.c
index a3b3d650eb5..78b571b95b4 100644