Skip to content

Commit

Permalink
Merge pull request six2dez#592 from six2dez/dev
Browse files Browse the repository at this point in the history
Web cache poisoning added
  • Loading branch information
six2dez authored Oct 2, 2022
2 parents e5c5650 + ba043af commit 2d2831e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 2 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions reconftw.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 25 additions & 1 deletion reconftw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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]}
Expand All @@ -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 #####################################################
###############################################################################################################
Expand Down Expand Up @@ -2323,6 +2346,7 @@ function vulns(){
command_injection
prototype_pollution
smuggling
webcache
spraying
brokenLinks
test_ssl
Expand Down

0 comments on commit 2d2831e

Please sign in to comment.