-1

I am trying to make a simple script to start multiple fuzzers with AFL, I am prompting the users for the amount of fuzzers they want to start, storing the variable, and then want to issue the same command the number of times they specified.

I.E., "afl-fuzz -i /input -o /output ./binary fuzzer1 @@"

is this possible?

Soumendra Mishra
  • 3,483
  • 1
  • 12
  • 38

2 Answers2

0

Something like this, maybe, if you want to run your process in parallel in the background?

for ((i=0;i<${nb_process};i++)); do
    afl-fuzz -i /input -o /output.$i ... &
done

Remove the & if you want to run them one after the other in the foreground.

If you want to run your jobs in parallel with different files for input, a solution to consider might be xargs:

find . -name "*input*" -print0 | xargs -0 --max-procs=16 --max-args=3 afl-fuzz ...

(See man page for xargs for details.)

Qeole
  • 8,284
  • 1
  • 24
  • 52
0

You could use seq, which "prints a sequence of numbers".

So if you have your number in $num :

for i in $(seq 1 $num); do
    afl-fuzz -i /input -o /output-$i ./binary ... &
done

& makes it run in the background, so all your processes start immediately

mivk
  • 13,452
  • 5
  • 76
  • 69
  • Depending on what `/input` and `/output` mean I'm guessing you would want to use a different output one (at least) for each run, like in the other answer. – tripleee Nov 26 '20 at 12:31
  • @tripleee : yes, I guess you are right, though I don't know what `afl-fuzz` actually does. Corrected the answer. Thanks. – mivk Nov 26 '20 at 13:01