- Timestamp:
- Jan 1, 2007, 10:35:54 PM (15 years ago)
- Location:
- zzuf/trunk
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/doc/zzuf.1
r1531 r1532 5 5 .B zzuf 6 6 [ 7 .B \- vqdhic7 .B \-cdhiqSv 8 8 ] [ 9 9 .B \-r … … 87 87 regular expression. This option supersedes anything that is specified by the 88 88 .B \-\-exclude 89 flag. Use this for instance if you do not know for surewhat files your90 application is going to read , butdo not want it to fuzz files in the89 flag. Use this for instance if you are unsure of what files your 90 application is going to read and do not want it to fuzz files in the 91 91 .B /etc 92 92 directory. … … 120 120 .B \-I 121 121 flags can be specified, in which case files matching any one of the regular 122 expressions will be fuzzed. 122 expressions will be fuzzed. See also the 123 .B \-c 124 flag. 123 125 .TP 124 126 .B \-q, \-\-quiet 125 127 Hide the output of the fuzzed application. This is useful if the application 126 is very verbose but only its exit code is really useful to you. 128 is very verbose but only its exit code or signaled status is really useful to 129 you. 127 130 .TP 128 131 .B \-r, \-\-ratio <ratio> … … 153 156 will run the application several times, each time with a different seed, and 154 157 report the behaviour of each run. 158 .TP 159 .B \-S, \-\-signal 160 Prevent children from installing signal handlers for signals that usually 161 cause coredumps. These signals are 162 .BR SIGABRT , 163 .BR SIGFPE , 164 .BR SIGILL , 165 .BR SIGQUIT , 166 .BR SIGSEGV , 167 .B SIGTRAP 168 and, if available on the running platform, 169 .BR SIGSYS , 170 .BR SIGEMT , 171 .BR SIGBUS , 172 .B SIGXCPU 173 and 174 .BR SIGXFSZ . 175 Instead of calling the signal handler, the application will simply crash. If 176 you do not want core dumps, you should set appropriate limits with the 177 .B limit coredumpsize 178 command. See your shell's documentation on how to set such limits. 155 179 .TP 156 180 .B \-T, \-\-max\-time <n> … … 188 212 files from fuzzing (because 189 213 .B convert 190 will also open its own configuration files and we do not want214 will also open its own XML configuration files and we do not want 191 215 .B zzuf 192 216 to fuzz them): … … 216 240 217 241 .fi 218 Fuzz 242 Fuzz 2% of 219 243 .BR mplayer 's 220 input with seeds 0 to 9999, launching up to 3 simultaneous child processes 221 and killing 222 .BR mplayer 223 if it takes more than one minute to read the file: 244 input bits 245 .RB ( \-r 246 .BR 0.02 ) 247 with seeds 0 to 9999 248 .RB ( \-s 249 .BR 0:10000 ), 250 disabling its standard output messages 251 .RB ( \-q ), 252 launching up to three simultaneous child processes 253 .RB ( \-F 254 .BR 3 ), 255 killing 256 .B mplayer 257 if it takes more than one minute to read the file 258 .RB ( \-T 259 .BR 60 ) 260 and disabling its 261 .B SIGSEGV 262 signal handler 263 .RB ( \-S ): 224 264 .fn 225 265 … … 240 280 drop bytes from the input, to fuzz according to the file format, or to do 241 281 all these complicated operations. They are planned, though. 282 283 Due to 284 .B zzuf 285 using 286 .B LD_PRELOAD 287 to run its child processes, it will fail in the presence of any mechanism 288 that disables preloading. For instance setuid root binaries will not be 289 fuzzed. 242 290 .RI 243 291 .SH AUTHOR -
zzuf/trunk/src/Makefile.am
r1517 r1532 6 6 pkglib_LTLIBRARIES = libzzuf.la 7 7 libzzuf_la_SOURCES = libzzuf.c libzzuf.h fuzz.c fuzz.h debug.c debug.h \ 8 load-fd.c load-stream.c load.h random.c random.h 8 load-fd.c load-signal.c load-stream.c load.h \ 9 random.c random.h 9 10 libzzuf_la_LDFLAGS = -module -avoid-version -no-undefined 10 11 libzzuf_la_LIBADD = -ldl -
zzuf/trunk/src/libzzuf.c
r1529 r1532 41 41 int _zz_ready = 0; 42 42 int _zz_hasdebug = 0; 43 float _zz_ratio = 0.004f; 43 44 int _zz_seed = 0; 44 float _zz_ratio = 0.004f;45 int _zz_signal = 0; 45 46 46 47 /* Local variables */ … … 58 59 59 60 tmp = getenv("ZZUF_DEBUG"); 60 if(tmp && *tmp )61 if(tmp && *tmp == '1') 61 62 _zz_hasdebug = 1; 62 63 … … 87 88 } 88 89 90 tmp = getenv("ZZUF_SIGNAL"); 91 if(tmp && *tmp == '1') 92 _zz_signal = 1; 93 89 94 _zz_fd_init(); 90 95 … … 94 99 95 100 _zz_load_fd(); 101 _zz_load_signal(); 96 102 _zz_load_stream(); 97 103 -
zzuf/trunk/src/libzzuf.h
r1527 r1532 32 32 extern int _zz_ready; 33 33 extern int _zz_hasdebug; 34 extern float _zz_ratio; 34 35 extern int _zz_seed; 35 extern float _zz_ratio;36 extern int _zz_signal; 36 37 37 38 /* Library initialisation shit */ -
zzuf/trunk/src/load.h
r1523 r1532 28 28 29 29 extern void _zz_load_fd(void); 30 extern void _zz_load_signal(void); 30 31 extern void _zz_load_stream(void); 31 32 -
zzuf/trunk/src/zzuf.c
r1531 r1532 97 97 { 98 98 /* Long option, needs arg, flag, short option */ 99 { "max-bytes", 1, NULL, 'B' }, 100 { "cmdline", 0, NULL, 'c' }, 101 { "debug", 0, NULL, 'd' }, 102 { "exclude", 1, NULL, 'E' }, 103 { "fork", 1, NULL, 'F' }, 104 { "help", 0, NULL, 'h' }, 105 { "stdin", 0, NULL, 'i' }, 99 106 { "include", 1, NULL, 'I' }, 100 { "exclude", 1, NULL, 'E' }, 101 { "cmdline", 0, NULL, 'c' }, 102 { "stdin", 0, NULL, 'i' }, 107 { "quiet", 0, NULL, 'q' }, 108 { "ratio", 1, NULL, 'r' }, 103 109 { "seed", 1, NULL, 's' }, 104 { "ratio", 1, NULL, 'r' }, 105 { "fork", 1, NULL, 'F' }, 106 { "max-bytes", 1, NULL, 'B' }, 110 { "signal", 0, NULL, 'S' }, 107 111 { "max-time", 1, NULL, 'T' }, 108 { "quiet", 0, NULL, 'q' },109 { "debug", 0, NULL, 'd' },110 { "help", 0, NULL, 'h' },111 112 { "version", 0, NULL, 'v' }, 112 113 }; 113 int c = getopt_long(argc, argv, "B:cdE:F:hiI:qr:s: T:v",114 int c = getopt_long(argc, argv, "B:cdE:F:hiI:qr:s:ST:v", 114 115 long_options, &option_index); 115 116 # else 116 117 # define MOREINFO "Try `%s -h' for more information.\n" 117 int c = getopt(argc, argv, "B:cdE:F:hiI:qr:s: T:v");118 int c = getopt(argc, argv, "B:cdE:F:hiI:qr:s:ST:v"); 118 119 # endif 119 120 if(c == -1) … … 163 164 case 'q': /* --quiet */ 164 165 quiet = 1; 166 break; 167 case 'S': /* --signal */ 168 setenv("ZZUF_SIGNAL", "1", 1); 165 169 break; 166 170 case 'd': /* --debug */ … … 529 533 printf(" -s, --seed <seed> random seed (default 0)\n"); 530 534 printf(" --seed <start:stop> specify a seed range\n"); 535 printf(" -S, --signal prevent children from diverting crashing signals\n"); 531 536 printf(" -T, --max-time <n> kill children that run for more than <n> seconds\n"); 532 537 printf(" -v, --version output version information and exit\n"); … … 544 549 printf(" -s <seed> random seed (default 0)\n"); 545 550 printf(" <start:stop> specify a seed range\n"); 551 printf(" -S prevent children from diverting crashing signals\n"); 546 552 printf(" -T <n> kill children that run for more than <n> seconds\n"); 547 553 printf(" -v output version information and exit\n");
Note: See TracChangeset
for help on using the changeset viewer.