Skip to content

reconFTW is a tool designed to perform automated recon on a target domain by running the best set of tools to perform scanning and finding out vulnerabilities

Broken links checking #164

Bilel Eljaamiiec7ca56a7b42
diff --git a/reconftw.sh b/reconftw.sh
index fb5c142..dffe93a 100755
--- a/reconftw.sh
+++ b/reconftw.sh
@@ -473,6 +473,35 @@ webprobe_full(){
fi
}
+brokenLinks(){
+ #check if this function is already processed
+ if [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] ; then
+ printf "${bgreen}#######################################################################\n"
+ printf "${bblue} Broken links checks ${reset}\n\n"
+ start=`date +%s`
+ for sub in $(cat ${domain}_probed.txt); do
+ sub_out=$(echo $sub | sed -e 's|^[^/]*//||' -e 's|/.*$||')
+ #check if subdomain is already processed
+ if [ ! -f "$called_fn_dir/.${FUNCNAME[0]}_$sub_out" ] ; then
+ wget --spider -r -nd -nv -H -l 1 -w 1 --no-check-certificate -U 'Mozilla' -o ${sub_out}_brokenLinks.tmp $sub_out
+ cat ${sub_out}_brokenLinks.tmp | grep "^http" | grep -v ':$' | anew -q ${domain}_brokenLinks.txt
+ touch $called_fn_dir/.${FUNCNAME[0]}_$sub_out
+ else
+ printf "${yellow} ${FUNCNAME[0]}_$sub_out is already processed, to force executing ${FUNCNAME[0]} delete $called_fn_dir/.${FUNCNAME[0]}_$sub_out ${reset}\n\n"
+ fi
+ done
+ rm *_brokenLinks.tmp
+ touch $called_fn_dir/.${FUNCNAME[0]}
+ end=`date +%s`
+ getElapsedTime $start $end
+ printf "${bblue}\n Broken links checks Finished in ${runtime}\n"
+ printf "${bblue} Results are saved in ${domain}_brokenLinks.txt ${reset}\n"
+ printf "${bgreen}#######################################################################\n\n"
+ else
+ printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
+ fi
+}
+
screenshot(){
if [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] && [ "$WEBSCREENSHOT" = true ]
then
@@ -1051,6 +1080,7 @@ all(){
subdomains_full
subtakeover
webprobe_full
+ brokenLinks
screenshot
portscan
nuclei_check
@@ -1077,6 +1107,7 @@ all(){
subdomains_full
subtakeover
webprobe_full
+ brokenLinks
screenshot
portscan
nuclei_check