diff --git a/install.sh b/install.sh index f769b2ec..d1ad3ceb 100755 --- a/install.sh +++ b/install.sh @@ -79,6 +79,7 @@ gotools["dsieve"]="go install -v github.com/trickest/dsieve@master" gotools["inscope"]="go install github.com/tomnomnom/hacks/inscope@latest" gotools["rush"]="go install github.com/shenwei356/rush@latest" gotools["enumerepo"]="go install github.com/trickest/enumerepo@latest" +gotools["Web-Cache-Vulnerability-Scanner"]="go install -v github.com/Hackmanit/Web-Cache-Vulnerability-Scanner@latest" declare -A repos repos["dorks_hunter"]="six2dez/dorks_hunter" @@ -106,6 +107,7 @@ repos["gitdorks_go"]="damit5/gitdorks_go" repos["urless"]="xnl-h4ck3r/urless" repos["trufflehog"]="trufflesecurity/trufflehog" repos["smuggler"]="defparam/smuggler" +repos["Web-Cache-Vulnerability-Scanner"]="Hackmanit/Web-Cache-Vulnerability-Scanner" printf "\n\n${bgreen}#######################################################################${reset}\n" printf "${bgreen} reconFTW installer/updater script ${reset}\n\n" diff --git a/reconftw.cfg b/reconftw.cfg index 565f410c..dd149fcf 100644 --- a/reconftw.cfg +++ b/reconftw.cfg @@ -122,6 +122,7 @@ SPRAY=true # Performs password spraying COMM_INJ=true # Check for command injections with commix PROTO_POLLUTION=true # Check for prototype pollution flaws SMUGGLING=true # Check for HTTP request smuggling flaws +WEBCACHE=true # Check for HTTP request smuggling flaws # Extra features NOTIFICATION=false # Notification for every function diff --git a/reconftw.sh b/reconftw.sh index eb54aa17..3e58c788 100755 --- a/reconftw.sh +++ b/reconftw.sh @@ -107,6 +107,7 @@ function tools_installed(){ which inscope &>/dev/null || { printf "${bred} [*] inscope [NO]${reset}\n${reset}"; allinstalled=false;} which enumerepo &>/dev/null || { printf "${bred} [*] enumerepo [NO]${reset}\n${reset}"; allinstalled=false;} which trufflehog &>/dev/null || { printf "${bred} [*] trufflehog [NO]${reset}\n${reset}"; allinstalled=false;} + which Web-Cache-Vulnerability-Scanner &>/dev/null || { printf "${bred} [*] Web-Cache-Vulnerability-Scanner [NO]${reset}\n"; allinstalled=false;} if [ "${allinstalled}" = true ]; then printf "${bgreen} Good! All installed! ${reset}\n\n" @@ -1842,7 +1843,7 @@ function smuggling(){ [ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt if [ "$DEEP" = true ] || [[ $(cat .tmp/webs_all.txt | wc -l) -le $DEEP_LIMIT ]]; then cd "$tools/smuggler" || { echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; } - cat .tmp/webs_all.txt | python3 smuggler.py -q --no-color 2>/dev/null | anew -q $dir/.tmp/smuggling.txt + cat $dir/.tmp/webs_all.txt | python3 smuggler.py -q --no-color 2>/dev/null | anew -q $dir/.tmp/smuggling.txt cd "$dir" || { echo "Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; } [ -s ".tmp/smuggling.txt" ] && cat .tmp/smuggling.txt | anew -q vulns/smuggling.txt end_func "Results are saved in vulns/smuggling.txt" ${FUNCNAME[0]} @@ -1858,6 +1859,28 @@ function smuggling(){ fi } +function webcache(){ + if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$WEBCACHE" = true ] ; then + start_func ${FUNCNAME[0]} "Web Cache Poisoning checks" + [ ! -s ".tmp/webs_all.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_all.txt + if [ "$DEEP" = true ] || [[ $(cat .tmp/webs_all.txt | wc -l) -le $DEEP_LIMIT ]]; then + cd "$tools/Web-Cache-Vulnerability-Scanner" || { echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; } + Web-Cache-Vulnerability-Scanner -u file:$dir/.tmp/webs_all.txt -v 0 2>/dev/null | anew -q $dir/.tmp/webcache.txt + cd "$dir" || { echo "Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; } + [ -s ".tmp/webcache.txt" ] && cat .tmp/webcache.txt | anew -q vulns/webcache.txt + end_func "Results are saved in vulns/webcache.txt" ${FUNCNAME[0]} + else + end_func "Web Cache Poisoning: Too many webs to test, try with --deep flag" ${FUNCNAME[0]} + fi + else + if [ "$WEBCACHE" = false ]; then + printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n" + else + printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n" + fi + fi +} + ############################################################################################################### ########################################## OPTIONS & MGMT ##################################################### ############################################################################################################### @@ -2323,6 +2346,7 @@ function vulns(){ command_injection prototype_pollution smuggling + webcache spraying brokenLinks test_ssl