@@ -256,6 +256,10 @@ function tools_installed() {
256256
257257 printf " %b[%s] Tools check finished%b\n" " $bblue " " $( date +' %Y-%m-%d %H:%M:%S' ) " " $reset "
258258 printf " %b#######################################################################\n%b" " $bgreen " " $reset "
259+
260+ if [[ $CHECK_TOOLS_OR_EXIT == true && $all_installed != true ]]; then
261+ exit 2
262+ fi
259263}
260264
261265# ####################################################################cc##########################################
@@ -6007,6 +6011,7 @@ function help() {
60076011 printf " -o output/path Define output folder\n"
60086012 printf " -v, --vps Axiom distributed VPS \n"
60096013 printf " -q Rate limit in requests per second \n"
6014+ printf " --check-tools Exit if one of the tools is missing\n"
60106015 printf " \n"
60116016 printf " ${bblue} USAGE EXAMPLES${reset} \n"
60126017 printf " ${byellow} Perform full recon (without attacks):${reset} \n"
@@ -6041,7 +6046,12 @@ if [[ $OSTYPE == "darwin"* ]]; then
60416046 PATH=" /usr/local/opt/coreutils/libexec/gnubin:$PATH "
60426047fi
60436048
6044- PROGARGS=$( getopt -o ' d:m:l:x:i:o:f:q:c:z:rspanwvh::' --long ' domain:,list:,recon,subdomains,passive,all,web,osint,zen,deep,help,vps' -n ' reconFTW' -- " $@ " )
6049+ PROGARGS=$( getopt -o ' d:m:l:x:i:o:f:q:c:z:rspanwvh::' --long ' domain:,list:,recon,subdomains,passive,all,web,osint,zen,deep,help,vps,check-tools' -n ' reconFTW' -- " $@ " )
6050+
6051+ exit_status=$?
6052+ if [[ $exit_status -ne 0 ]]; then
6053+ UNKNOWN_ARGUMENT=true
6054+ fi
60456055
60466056# Note the quotes around "$PROGARGS": they are essential!
60476057eval set -- " $PROGARGS "
@@ -6158,13 +6168,18 @@ while true; do
61586168 shift
61596169 break
61606170 ;;
6161- ' --help' | ' -h' | * )
6171+ ' --check-tools' )
6172+ CHECK_TOOLS_OR_EXIT=true
6173+ shift
6174+ continue
6175+ ;;
6176+ ' --help' | ' -h' )
6177+ break
6178+ ;;
6179+ * )
61626180 # echo "Unknown argument: $1"
6163- . ./reconftw.cfg
6164- banner
6165- help
6166- tools_installed
6167- exit 1
6181+ UNKNOWN_ARGUMENT=true
6182+ break
61686183 ;;
61696184 esac
61706185done
@@ -6396,6 +6411,8 @@ case $opt_mode in
63966411* )
63976412 help
63986413 tools_installed
6399- exit 1
6414+ if [[ $UNKNOWN_ARGUMENT == true ]]; then
6415+ exit 1
6416+ fi
64006417 ;;
64016418esac
0 commit comments