fzem_doc.txt 02.25.2009 Krakow Labs Development [www.krakowlabs.com] fzem Documentation rush@KL (Jeremy Brown) [rush[at]krakowlabs[dot]com] ------------------------------------------------------------------------------------------------------------------------- WHAT IS IT? fzem is a MUA (mail user agent) fuzzer that fuzzes MAIL/MIME email headers as well as how clients handle SMTP, POP and IMAP responses. ------------------------------------------------------------------------------------------------------------------------- PURPOSE fzem's purpose is to fuzz MUAs as they process email content and handle server reponses. ------------------------------------------------------------------------------------------------------------------------- HOW DOES IT WORK? fzem has the three main mail protocols implemented as well as mail/mime headers. Using these we can manipulate emails and responses to include fuzzing data from our fuzzing oracle or from the user. A user can command fzem to run in various modes and perform differently in those modes. * Fuzz SMTP OK responses * Fuzz SMTP ERROR responses * Fuzz SMTP using custom fuzz data * Fuzz MAIL/MIME headers * Fuzz MAIL/MIME headers using custom fuzz data * Fuzz MAIL/MIME headers using custom headers * Fuzz POP3 OK responses * Fuzz POP3 ERROR responses * Fuzz POP3 using custom fuzz data * Fuzz IMAP4 OK responses * Fuzz IMAP4 ERROR responses * Fuzz IMAP4 using custom fuzz data We can also choose a specific port to listen on (-P) and take advantage of the useful debug option (-D). ------------------------------------------------------------------------------------------------------------------------- HOW DO I USE IT? 1) Make fzem (or use the binary that comes with the package). rush@linux:~/fzem$ make gcc fzem.c fzem_fuzz.c -o fzem rush@linux:~/fzem$ 2) Define how you want to use fzem then run it. Lets say you want to fuzz how a certain email client handles POP3 ok responses. You also have a custom fuzzing string you want to use instead of the included fuzzing oracle this time. Furthermore, you wish to use the debug option to see a more verbose output of fzem. rush@linux:~$ sudo ./fzem -o -K -F `perl -e 'print "ABCD" x 500'` -D ********** [POP3/Custom OK Responses] Mode ********** Krakow Labs Development [www.krakowlabs.com] -> fzem ********** [POP3/Custom OK Responses] Mode ********** INFO: fzem server is starting DEBUG: Creating Socket... SUCCESS DEBUG: Binding to PORT 110... SUCCESS DEBUG: listen() OK INFO: fzem server is running DEBUG: [1] Client 10.10.1.177 connected --> OK RESPONSE FUZZING WITH: (ABCDABCDABCDABCD [2000 bytes]) ..... rush@linux:~$ Ok, now maybe your moving on to fuzzing IMAP4. You want to fly through fuzzing error responses using fzem's fuzzing oracle, but you want to see whats going on at the same time. rush@linux:~$ sudo ./fzem -i -E -D ********** [IMAP4/ERROR Responses] Mode ********** Krakow Labs Development [www.krakowlabs.com] -> fzem ********** [IMAP4/ERROR Responses] Mode ********** INFO: fzem server is starting DEBUG: Creating Socket... SUCCESS DEBUG: Binding to PORT 143... SUCCESS DEBUG: listen() OK INFO: fzem server is running DEBUG: [1] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Overflow: A x 550) DEBUG: [2] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Overflow: A x 1100) DEBUG: [3] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Overflow: A x 2100) DEBUG: [4] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Overflow: A x 4200) DEBUG: [5] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Overflow: A x 8400) DEBUG: [6] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Overflow: A x 16500) DEBUG: [7] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Overflow: A x 33000) DEBUG: [8] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Overflow: A x 65800) DEBUG: [9] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Overflow: A x 131200) DEBUG: [10] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Overflow: A x 262400) DEBUG: [11] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Format String: %n x 5) DEBUG: [12] Client 10.10.1.177 connected --> ERROR RESPONSE FUZZING WITH: (Format String: %p x 5) ..... rush@linux:~$ Now you want to try something different. You want to fuzz a particular MIME header via email, of course using our very own fuzzing oracle. rush@linux:~$ sudo ./fzem -p -H "Content-Location" ********** [Headers/Custom Header] Mode ********** Krakow Labs Development [www.krakowlabs.com] -> fzem ********** [Headers/Custom Header] Mode ********** INFO: fzem server is starting INFO: fzem server is running ..... rush@linux:~$ ------------------------------------------------------------------------------------------------------------------------- Associated Files & Information: http://www.krakowlabs.com/dev/fuz/fzem/fzem http://www.krakowlabs.com/dev/fuz/fzem/fzem.c.txt http://www.krakowlabs.com/dev/fuz/fzem/fzem_fuzz.c.txt http://www.krakowlabs.com/dev/fuz/fzem/core.h.txt http://www.krakowlabs.com/dev/fuz/fzem/fuzz.h.txt http://www.krakowlabs.com/dev/fuz/fzem/Makefile.txt http://www.krakowlabs.com/dev/fuz/fzem/fzem_doc.txt http://www.krakowlabs.com/dev/fuz/fzem/fzem.tar.gz http://www.krakowlabs.com/dev/fuz/fzem/fzem.jpeg fzem_doc.txt