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

inscope fix

six2dez5299848f9a04
diff --git a/reconftw.sh b/reconftw.sh
index 6096996..9024fec 100755
--- a/reconftw.sh
+++ b/reconftw.sh
@@ -375,8 +375,8 @@ function sub_passive(){
fi
fi
if [ "$INSCOPE" = true ]; then
- check_inscope .tmp/amass_psub.txt
- check_inscope .tmp/github_subdomains_psub.txt
+ check_inscope .tmp/amass_psub.txt 2>>"$LOGFILE" &>/dev/null
+ check_inscope .tmp/github_subdomains_psub.txt 2>>"$LOGFILE" &>/dev/null
fi
NUMOFLINES=$(find .tmp -type f -iname "*_psub.txt" -exec cat {} + | sed "s/*.//" | anew .tmp/passive_subs.txt | sed '/^$/d' | wc -l)
end_subfunc "${NUMOFLINES} new subs (passive)" ${FUNCNAME[0]}
@@ -426,7 +426,7 @@ function sub_active(){
cat .tmp/subdomains_tmp.txt | tlsx -san -cn -silent -ro -c $TLSX_THREADS | anew -q .tmp/subdomains_tmp.txt
fi
if [ "$INSCOPE" = true ]; then
- check_inscope .tmp/subdomains_tmp.txt
+ check_inscope .tmp/subdomains_tmp.txt 2>>"$LOGFILE" &>/dev/null
fi
NUMOFLINES=$(cat .tmp/subdomains_tmp.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
end_subfunc "${NUMOFLINES} subs DNS resolved from passive" ${FUNCNAME[0]}
@@ -446,7 +446,7 @@ function sub_noerror(){
dnsx -d $domain -r $resolvers -silent -rcode noerror -w $subs_wordlist | cut -d' ' -f1 | anew -q .tmp/subs_noerror.txt 2>>"$LOGFILE" &>/dev/null
fi
if [ "$INSCOPE" = true ]; then
- check_inscope .tmp/subs_noerror.txt
+ check_inscope .tmp/subs_noerror.txt 2>>"$LOGFILE" &>/dev/null
fi
NUMOFLINES=$(cat .tmp/subs_noerror.txt 2>>"$LOGFILE" | sed "s/*.//" | grep ".$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
end_subfunc "${NUMOFLINES} new subs (DNS noerror)" ${FUNCNAME[0]}
@@ -483,7 +483,7 @@ function sub_dns(){
[ -s ".tmp/subdomains_dns.txt" ] && axiom-scan .tmp/subdomains_dns.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/subdomains_dns_resolved.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null
fi
if [ "$INSCOPE" = true ]; then
- check_inscope .tmp/subdomains_dns_resolved.txt
+ check_inscope .tmp/subdomains_dns_resolved.txt 2>>"$LOGFILE" &>/dev/null
fi
NUMOFLINES=$(cat .tmp/subdomains_dns_resolved.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
end_subfunc "${NUMOFLINES} new subs (dns resolution)" ${FUNCNAME[0]}
@@ -513,7 +513,7 @@ function sub_brute(){
[ -s ".tmp/subs_brute.txt" ] && axiom-scan .tmp/subs_brute.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/subs_brute_valid.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null
fi
if [ "$INSCOPE" = true ]; then
- check_inscope .tmp/subs_brute_valid.txt
+ check_inscope .tmp/subs_brute_valid.txt 2>>"$LOGFILE" &>/dev/null
fi
NUMOFLINES=$(cat .tmp/subs_brute_valid.txt 2>>"$LOGFILE" | sed "s/*.//" | grep ".$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
end_subfunc "${NUMOFLINES} new subs (bruteforce)" ${FUNCNAME[0]}
@@ -548,7 +548,7 @@ function sub_scraping(){
[ -s ".tmp/gospider.txt" ] && cat .tmp/gospider.txt | grep -aEo 'https?://[^ ]+' | sed 's/]$//' | unfurl -u domains 2>>"$LOGFILE" | grep ".$domain$" | anew -q .tmp/scrap_subs.txt
[ -s ".tmp/scrap_subs.txt" ] && puredns resolve .tmp/scrap_subs.txt -w .tmp/scrap_subs_resolved.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT 2>>"$LOGFILE" &>/dev/null
if [ "$INSCOPE" = true ]; then
- check_inscope .tmp/scrap_subs_resolved.txt
+ check_inscope .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" &>/dev/null
fi
NUMOFLINES=$(cat .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | tee .tmp/diff_scrap.txt | sed '/^$/d' | wc -l)
[ -s ".tmp/diff_scrap.txt" ] && cat .tmp/diff_scrap.txt | httpx -follow-host-redirects -H "${HEADER}" -status-code -threads $HTTPX_THREADS -rl $HTTPX_RATELIMIT -timeout $HTTPX_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -location -no-color -json -o .tmp/web_full_info3.txt 2>>"$LOGFILE" &>/dev/null
@@ -570,7 +570,7 @@ function sub_scraping(){
[ -s ".tmp/gospider.txt" ] && cat .tmp/gospider.txt | grep -aEo 'https?://[^ ]+' | sed 's/]$//' | unfurl -u domains 2>>"$LOGFILE" | grep ".$domain$" | anew -q .tmp/scrap_subs.txt
[ -s ".tmp/scrap_subs.txt" ] && axiom-scan .tmp/scrap_subs.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/scrap_subs_resolved.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null
if [ "$INSCOPE" = true ]; then
- check_inscope .tmp/scrap_subs_resolved.txt
+ check_inscope .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" &>/dev/null
fi
NUMOFLINES=$(cat .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | tee .tmp/diff_scrap.txt | sed '/^$/d' | wc -l)
[ -s ".tmp/diff_scrap.txt" ] && axiom-scan .tmp/diff_scrap.txt -m httpx -follow-host-redirects -H \"${HEADER}\" -status-code -threads $HTTPX_THREADS -rl $HTTPX_RATELIMIT -timeout $HTTPX_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -location -no-color -json -o .tmp/web_full_info3.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null
@@ -609,7 +609,7 @@ function sub_analytics(){
fi
fi
if [ "$INSCOPE" = true ]; then
- check_inscope .tmp/analytics_subs_resolved.txt
+ check_inscope .tmp/analytics_subs_resolved.txt 2>>"$LOGFILE" &>/dev/null
fi
NUMOFLINES=$(cat .tmp/analytics_subs_resolved.txt 2>>"$LOGFILE" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
end_subfunc "${NUMOFLINES} new subs (analytics relationship)" ${FUNCNAME[0]}
@@ -665,7 +665,7 @@ function sub_permut(){
if [ -s ".tmp/permute_subs.txt" ]; then
deleteOutScoped $outOfScope_file .tmp/permute_subs.txt
if [ "$INSCOPE" = true ]; then
- check_inscope .tmp/permute_subs.txt
+ check_inscope .tmp/permute_subs.txt 2>>"$LOGFILE" &>/dev/null
fi
NUMOFLINES=$(cat .tmp/permute_subs.txt 2>>"$LOGFILE" | grep ".$domain$" | anew subdomains/subdomains.txt | sed '/^$/d' | wc -l)
else
@@ -697,7 +697,7 @@ function sub_recursive_passive(){
[ -s ".tmp/passive_recursive.txt" ] && axiom-scan .tmp/passive_recursive.txt -m puredns-resolve -r /home/op/lists/resolvers.txt --resolvers-trusted /home/op/lists/resolvers_trusted.txt --wildcard-tests $PUREDNS_WILDCARDTEST_LIMIT --wildcard-batch $PUREDNS_WILDCARDBATCH_LIMIT -o .tmp/passive_recurs_tmp.txt $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null
fi
if [ "$INSCOPE" = true ]; then
- check_inscope .tmp/passive_recurs_tmp.txt
+ check_inscope .tmp/passive_recurs_tmp.txt 2>>"$LOGFILE" &>/dev/null
fi
NUMOFLINES=$(cat .tmp/passive_recurs_tmp.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | sed '/^$/d' | anew subdomains/subdomains.txt | wc -l)
end_subfunc "${NUMOFLINES} new subs (recursive)" ${FUNCNAME[0]}
@@ -753,8 +753,8 @@ function sub_recursive_brute(){
end_subfunc "skipped in this mode or defined in reconftw.cfg" ${FUNCNAME[0]}
fi
if [ "$INSCOPE" = true ]; then
- check_inscope .tmp/permute_recursive.txt
- check_inscope .tmp/brute_recursive.txt
+ check_inscope .tmp/permute_recursive.txt 2>>"$LOGFILE" &>/dev/null
+ check_inscope .tmp/brute_recursive.txt 2>>"$LOGFILE" &>/dev/null
fi
NUMOFLINES=$(cat .tmp/permute_recursive.txt .tmp/brute_recursive.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | sed '/^$/d' | anew subdomains/subdomains.txt | wc -l)
end_subfunc "${NUMOFLINES} new subs (recursive)" ${FUNCNAME[0]}