AFL++åããã¦ã¿ã
ã¯ããã«
AFL++ã£ã¦ãã¡ã¶ã¼ãåããã¦ã¿ãã®ã§ãåãããéç¨ã¨çµæã®ã¡ã¢
ç®æ¬¡
åè
IPAã®AFLè³æ qiitaã®è¨äºï¼AFLã§ãã¡ã¸ã³ã°ãã£ã¦ã¿ã
åããã¦ã¿ã
æºå
AFL++ã¤ã³ã¹ãã¼ã«
apt
ã§AFL++ãã¤ã³ã¹ãã¼ã«
$ sudo apt update $ sudo apt install afl++ afl++-clang afl++-doc
RAMãã£ã¹ã¯ä½æ
$ mkdir -p /tmp/afl-ramdisk && chmod 777 /tmp/afl-ramdisk/ $ sudo mount -t tmpfs -o size=512M tmpfs /tmp/afl-ramdisk/ $ cd /tmp/afl-ramdisk/
ãã¹ã対象ã³ã¼ã
#include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(int argc, char** argv) { char buf[8]; if(read(0, buf, 8) < 1) { exit(1); } printf(buf); exit(0); }
ã³ã³ãã¤ã«
example.cãafl-gcc
ã§ã³ã³ãã¤ã«
$ afl-gcc -o example example.c
ãã¡ã¸ã³ã°
ãã¹ãã±ã¼ã¹ãã¦ã³ãã¼ã
$ wget -O - https://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz | tar zxvf -
ãã¡ã¸ã³ã°ãã¹ãå®è¡
$ afl-fuzz -i afl-2.52b/testcases/others/text/ -o out/ ./example
afl++å®è¡æã®ç»é¢ IPAã®è³æã«ããAFLã®å®è¡æã®é 表示é ç®ã®èª¬æã¨é ç®åãå¤å°éããå 容ã¯åãã ã¨æãããã å®è¡æã®ã·ã¹ãã ã¢ãã¿ã¼ãã¿ãã¨ãCPU1ã®å®è¡ã100%ã«è²¼ãä»ãã¦ãã