Revamp usage info

This commit is contained in:
maride 2021-06-17 02:45:30 +02:00
parent 6619f7b966
commit fb288938e9

32
barf.sh
View File

@ -84,7 +84,7 @@ fi
# check if the arguments are valid
if [ ! -e "$TARGETFILE" ]; then
echo "The file $TARGETFILE does not exist."
exit 1
SHOWHELP=1
fi
# check if the persistent mode can be used
@ -94,26 +94,32 @@ if [[ "$PERSISTENT" == "1" && ("$STARTADDR" == "" || "$ENDADDR" == "" || "$BUFFA
echo "Set --start-addr to an address before your input reaches the program (e.g. before fgets())"
echo "Set --end-addr to an address after the program has checked if the input is good or not (e.g. somewhere after gets('Yay!') and gets('Nay!'))"
echo "Set --buffer-addr to the address where user input is stored (e.g. the address of b in case of fgets(b, 16, stdin)"
exit 1
SHOWHELP=1
fi
# see if the user needs our help
if [ "$SHOWHELP" == 1 ]; then
echo "Usage: ./barf.sh"
echo "Usage: ./barf.sh <options ...> ./path/to/your/binary"
echo ""
echo " BASIC OPTIONS"
echo " -p | --positive-addr 0x123456 a location to be counted as good hit"
echo " -n | --negative-addr 0x789ABC a location to be counted as bad hit"
echo " -w | --win-addr 0xDEF042 a location reached if your input is correct"
echo " -s | --start-addr 0xF0000D a location directly after your input is fed into the target (for persistent mode)"
echo " -e | --end-addr 0x133337 a location where the to-be-fuzzed logic is done (for persistent mode)"
echo " --buff-addr 0x424242 the location where user input is stored (for persistent mode)"
echo " -< | --prefix CTF{ a known prefix, e.g. the prefix of your flag"
echo " -> | --suffix } a known suffix, e.g. the suffix of your flag"
echo " -c | --chunksize 1 amount of characters to try at once"
echo " -n | --negative-addr 0x234567 a location to be counted as bad hit"
echo ""
echo " PERSISTENT MODE OPTIONS"
echo " -x | --persistent enable the experimental (!) persistent mode"
echo " -w | --win-addr 0x345678 a location reached if your input is correct"
echo " -s | --start-addr 0x456789 a location directly after your input is fed into the target"
echo " -e | --end-addr 0x56789A a location where the to-be-fuzzed logic is done"
echo " --buff-addr 0x6789AB the location where user input is stored"
echo ""
echo " MISC OPTIONS"
echo " -b | --prefix CTF{ a known prefix, e.g. the prefix of your flag"
echo " -a | --suffix } a known suffix, e.g. the suffix of your flag"
echo " -c | --chunksize 2 amount of characters to try at once (default: 1)"
echo " -h | --help a great and useful help message, you should try it!"
echo " ./path/to/your/crackme the path to the target to be fuzzed"
echo "Note that you need to either specify --positive-addr or --negative-addr and your target of course."
echo ""
echo "See https://github.com/maride/barf for more information and examples!"
exit 1
fi