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
Shell bug-bountybugbountybugbounty-tooldnshackingnucleiosintpenetration-testingpentestpentest-toolpentestingreconreconnaissancescannersecuritysecurity-toolssubdomainsubdomain-enumerationvulnerabilities
Code quality improvements and fixes, resolved_trusted axiom version
six2dez4acc5789eacb
diff --git a/reconftw.sh b/reconftw.shindex fa09620..3628b50 100755--- a/reconftw.sh+++ b/reconftw.sh@@ -287,7 +287,7 @@ function subdomains_full(){notification "- ${NUMOFLINES_probed} new web probed" good[ -f "webs/webs.txt" ] && cat webs/webs.txt 2>>"$LOGFILE" | sortnotification "Subdomain Enumeration Finished" good- printf "${bblue} Results are saved in subdomains/subdomains.txt and webs/webs.txt${reset}\n"+ printf "${bblue} Results are saved in $domain/subdomains/subdomains.txt and webs/webs.txt${reset}\n"printf "${bgreen}#######################################################################\n\n"}@@ -395,19 +395,19 @@ function sub_scraping(){start_subfunc "Running : Source code scraping subdomain search"touch .tmp/scrap_subs.txtif [ -s "$dir/subdomains/subdomains.txt" ]; then- cat subdomains/subdomains.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout 15 -silent -retries 2 -no-color | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txt- cat .tmp/probed_tmp_scrap.txt | httpx -csp-probe -random-agent -status-code -threads $HTTPX_THREADS -timeout 15 -silent -retries 2 -no-color | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains | anew -q .tmp/scrap_subs.txt- cat .tmp/probed_tmp_scrap.txt | httpx -tls-grab -tls-probe -random-agent -status-code -threads $HTTPX_THREADS -timeout 15 -silent -retries 2 -no-color | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains | anew -q .tmp/scrap_subs.txt+ cat subdomains/subdomains.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txt+ cat .tmp/probed_tmp_scrap.txt | httpx -csp-probe -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains | anew -q .tmp/scrap_subs.txt+ cat .tmp/probed_tmp_scrap.txt | httpx -tls-grab -tls-probe -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains | anew -q .tmp/scrap_subs.txtif [ "$DEEP" = true ]; thengospider -S .tmp/probed_tmp_scrap.txt --js -t $GOSPIDER_THREADS -d 3 --sitemap --robots -w -r > .tmp/gospider.txtelsegospider -S .tmp/probed_tmp_scrap.txt --js -t $GOSPIDER_THREADS -d 2 --sitemap --robots -w -r > .tmp/gospider.txtfised -i '/^.\{2048\}./d' .tmp/gospider.txt- cat .tmp/gospider.txt | egrep -o 'https?://[^ ]+' | sed 's/]$//' | unfurl --unique domains | grep ".$domain$" | anew -q .tmp/scrap_subs.txt+ cat .tmp/gospider.txt | grep -Eo 'https?://[^ ]+' | sed 's/]$//' | unfurl --unique domains | grep ".$domain$" | anew -q .tmp/scrap_subs.txtpuredns 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 &>>"$LOGFILE"NUMOFLINES=$(cat .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | tee .tmp/diff_scrap.txt | wc -l)- cat .tmp/diff_scrap.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout 15 -silent -retries 2 -no-color | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txt+ cat .tmp/diff_scrap.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txtend_subfunc "${NUMOFLINES} new subs (code scraping)" ${FUNCNAME[0]}elseend_subfunc "No subdomains to search (code scraping)" ${FUNCNAME[0]}@@ -498,7 +498,7 @@ function sub_recursive(){NUMOFLINES=$(cat .tmp/permute_recursive.txt .tmp/brute_recursive.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | wc -l)end_subfunc "${NUMOFLINES} new subs (recursive)" ${FUNCNAME[0]}else- notification "Skipping Recursive: Too Much Subdomains" warn+ notification "Skipping Recursive: Too Many Subdomains" warnfielseif [ "$SUBRECURSIVE" = false ]; then@@ -569,13 +569,13 @@ function s3buckets(){function webprobe_simple(){if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$WEBPROBESIMPLE" = true ]; then- start_subfunc "Running : Http probing"+ start_subfunc "Running : Http probing $domain"if [ -s ".tmp/probed_tmp_scrap.txt" ]; thenmv .tmp/probed_tmp_scrap.txt .tmp/probed_tmp.txtelse- cat subdomains/subdomains.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout 15 -silent -retries 2 -no-color | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp.txt+ cat subdomains/subdomains.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp.txtfi- if [ -s ".tmp/probed_tmp_.txt" ]; then+ if [ -s ".tmp/probed_tmp.txt" ]; thendeleteOutScoped $outOfScope_file .tmp/probed_tmp.txtNUMOFLINES=$(cat .tmp/probed_tmp.txt 2>>"$LOGFILE" | anew webs/webs.txt | wc -l)end_subfunc "${NUMOFLINES} new websites resolved" ${FUNCNAME[0]}@@ -583,6 +583,8 @@ function webprobe_simple(){notification "Sending websites to proxy" infoffuf -mc all -w webs/webs.txt -u FUZZ -replay-proxy $proxy_url &>>"$LOGFILE"fi+ else+ end_subfunc "No new websites to probe" ${FUNCNAME[0]}fielseif [ "$WEBPROBESIMPLE" = false ]; then@@ -596,14 +598,14 @@ function webprobe_simple(){function webprobe_full(){if ([ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]) && [ "$WEBPROBEFULL" = true ]; thenstart_func "Http probing non standard ports"- nmap -p $UNCOMMON_PORTS_WEB --max-retries 2 -Pn -iL subdomains/subdomains.txt -oG .tmp/nmap_uncommonweb.txt &>>"$LOGFILE" && uncommon_ports_checked=$(cat .tmp/nmap_uncommonweb.txt | egrep -v "^#|Status: Up" | cut -d' ' -f4- | sed -n -e 's/Ignored.*//p' | tr ',' '\n' | sed -e 's/^[ \t]*//' | sort -u | grep "open" | cut -d '/' -f1 | sed -e 'H;${x;s/\n/,/g;s/^,//;p;};d')+ nmap -p $UNCOMMON_PORTS_WEB --max-retries 2 -Pn -iL subdomains/subdomains.txt -oG .tmp/nmap_uncommonweb.txt &>>"$LOGFILE" && uncommon_ports_checked=$(cat .tmp/nmap_uncommonweb.txt | grep -Ev "^#|Status: Up" | cut -d' ' -f4- | sed -n -e 's/Ignored.*//p' | tr ',' '\n' | sed -e 's/^[ \t]*//' | sort -u | grep "open" | cut -d '/' -f1 | sed -e 'H;${x;s/\n/,/g;s/^,//;p;};d')if [ -n "$uncommon_ports_checked" ]; thencat subdomains/subdomains.txt | httpx -ports $uncommon_ports_checked -follow-host-redirects -random-agent -status-code -threads $HTTPX_UNCOMMONPORTS_THREADS -timeout 10 -silent -retries 2 -no-color | cut -d ' ' -f1 | grep ".$domain" | anew -q .tmp/probed_uncommon_ports_tmp.txtfiNUMOFLINES=$(cat .tmp/probed_uncommon_ports_tmp.txt 2>>"$LOGFILE" | anew webs/webs_uncommon_ports.txt | wc -l)notification "Uncommon web ports: ${NUMOFLINES} new websites" goodcat webs/webs_uncommon_ports.txt 2>>"$LOGFILE"- end_func "Results are saved in webs/webs_uncommon_ports.txt" ${FUNCNAME[0]}+ end_func "Results are saved in $domain/webs/webs_uncommon_ports.txt" ${FUNCNAME[0]}if [ "$PROXY" = true ] && [ -n "$proxy_url" ] && [[ $(cat webs/webs_uncommon_ports.txt| wc -l) -le 1500 ]]; thennotification "Sending websites uncommon ports to proxy" infoffuf -mc all -w webs/webs_uncommon_ports.txt -u FUZZ -replay-proxy $proxy_url &>>"$LOGFILE"@@ -666,8 +668,8 @@ function portscan(){echo "$sub $(dig +short a $sub | tail -n1)" | anew -q .tmp/subs_ips.txtdoneawk '{ print $2 " " $1}' .tmp/subs_ips.txt | sort -k2 -n | anew -q hosts/subs_ips_vhosts.txt- cat hosts/subs_ips_vhosts.txt 2>>"$LOGFILE" | cut -d ' ' -f1 | egrep -iv "^(127|10|169\.154|172\.1[6789]|172\.2[0-9]|172\.3[01]|192\.168)\." | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | anew -q hosts/ips.txt- cat hosts/ips.txt 2>>"$LOGFILE" | cf-check | egrep -iv "^(127|10|169\.154|172\.1[6789]|172\.2[0-9]|172\.3[01]|192\.168)\." | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | anew -q .tmp/ips_nowaf.txt+ cat hosts/subs_ips_vhosts.txt 2>>"$LOGFILE" | cut -d ' ' -f1 | grep -Eiv "^(127|10|169\.154|172\.1[6789]|172\.2[0-9]|172\.3[01]|192\.168)\." | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | anew -q hosts/ips.txt+ cat hosts/ips.txt 2>>"$LOGFILE" | cf-check | grep -Eiv "^(127|10|169\.154|172\.1[6789]|172\.2[0-9]|172\.3[01]|192\.168)\." | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | anew -q .tmp/ips_nowaf.txtprintf "${bblue}\n Resolved IP addresses (No WAF) ${reset}\n\n";cat .tmp/ips_nowaf.txt 2>>"$LOGFILE" | sortprintf "${bblue}\n Scanning ports... ${reset}\n\n";@@ -712,11 +714,19 @@ function cloudprovider(){function waf_checks(){if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$WAF_DETECTION" = true ]; thenstart_func "Website's WAF detection"- wafw00f -i webs/webs.txt -o .tmp/wafs.txt &>/dev/null- cat .tmp/wafs.txt | sed -e 's/^[ \t]*//' -e 's/ \+ /\t/g' -e '/(None)/d' | tr -s "\t" ";" > webs/webs_wafs.txt- NUMOFLINES=$(cat webs/webs_wafs.txt 2>>"$LOGFILE" | wc -l)- notification "${NUMOFLINES} websites protected by waf" info- end_func "Results are saved in webs/webs_wafs.txt" ${FUNCNAME[0]}+ if [ -s "./webs/webs.txt" ]; then+ wafw00f -i webs/webs.txt -o .tmp/wafs.txt &>>"$LOGFILE"+ if [ -f ".tmp/wafs.txt" ]; then+ cat .tmp/wafs.txt | sed -e 's/^[ \t]*//' -e 's/ \+ /\t/g' -e '/(None)/d' | tr -s "\t" ";" > webs/webs_wafs.txt+ NUMOFLINES=$(cat webs/webs_wafs.txt 2>>"$LOGFILE" | wc -l)+ notification "${NUMOFLINES} websites protected by waf" info+ end_func "Results are saved in $domain/webs/webs_wafs.txt" ${FUNCNAME[0]}+ else+ end_func "No results found" ${FUNCNAME[0]}+ fi+ else+ end_func "No websites to scan" ${FUNCNAME[0]}+ fielseif [ "$WAF" = false ]; thenprintf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"@@ -861,17 +871,17 @@ function urlchecks(){fifised -i '/^.\{2048\}./d' .tmp/gospider.txt- cat .tmp/gospider.txt | egrep -o 'https?://[^ ]+' | sed 's/]$//' | grep ".$domain$" | anew -q .tmp/url_extract_tmp.txt+ cat .tmp/gospider.txt | grep -Eo 'https?://[^ ]+' | sed 's/]$//' | grep ".$domain$" | anew -q .tmp/url_extract_tmp.txtif [ -s "${GITHUB_TOKENS}" ]; thengithub-endpoints -q -k -d $domain -t ${GITHUB_TOKENS} -o .tmp/github-endpoints.txt &>>"$LOGFILE"cat .tmp/github-endpoints.txt 2>>"$LOGFILE" | anew -q .tmp/url_extract_tmp.txtfi- cat .tmp/url_extract_tmp.txt webs/param.txt 2>>"$LOGFILE" | grep "${domain}" | grep "=" | qsreplace -a 2>>"$LOGFILE" | egrep -iv "\.(eot|jpg|jpeg|gif|css|tif|tiff|png|ttf|otf|woff|woff2|ico|pdf|svg|txt|js)$" | anew -q .tmp/url_extract_tmp2.txt- cat .tmp/url_extract_tmp.txt | grep "${domain}" | egrep -i "\.(js)" | anew -q js/url_extract_js.txt+ cat .tmp/url_extract_tmp.txt webs/param.txt 2>>"$LOGFILE" | grep "${domain}" | grep "=" | qsreplace -a 2>>"$LOGFILE" | grep -Eiv "\.(eot|jpg|jpeg|gif|css|tif|tiff|png|ttf|otf|woff|woff2|ico|pdf|svg|txt|js)$" | anew -q .tmp/url_extract_tmp2.txt+ cat .tmp/url_extract_tmp.txt | grep "${domain}" | grep -Ei "\.(js)" | anew -q js/url_extract_js.txtuddup -u .tmp/url_extract_tmp2.txt -o .tmp/url_extract_uddup.txt &>>"$LOGFILE"NUMOFLINES=$(cat .tmp/url_extract_uddup.txt 2>>"$LOGFILE" | anew webs/url_extract.txt | wc -l)notification "${NUMOFLINES} new urls with params" info- end_func "Results are saved in webs/url_extract.txt" ${FUNCNAME[0]}+ end_func "Results are saved in $domain/webs/url_extract.txt" ${FUNCNAME[0]}if [ "$PROXY" = true ] && [ -n "$proxy_url" ] && [[ $(cat webs/url_extract.txt | wc -l) -le 1500 ]]; thennotification "Sending urls to proxy" infoffuf -mc all -w webs/url_extract.txt -u FUZZ -replay-proxy $proxy_url &>>"$LOGFILE"@@ -892,7 +902,7 @@ function url_gf(){gf redirect webs/url_extract.txt | anew -q gf/redirect.txt && cat gf/ssrf.txt | anew -q gf/redirect.txtgf rce webs/url_extract.txt | anew -q gf/rce.txtgf potential webs/url_extract.txt | cut -d ':' -f3-5 |anew -q gf/potential.txt- cat .tmp/url_extract_tmp.txt | egrep -iv "\.(eot|jpg|jpeg|gif|css|tif|tiff|png|ttf|otf|woff|woff2|ico|pdf|svg|txt|js)$" | unfurl -u format %s://%d%p | anew -q gf/endpoints.txt+ cat .tmp/url_extract_tmp.txt | grep -Eiv "\.(eot|jpg|jpeg|gif|css|tif|tiff|png|ttf|otf|woff|woff2|ico|pdf|svg|txt|js)$" | unfurl -u format %s://%d%p | anew -q gf/endpoints.txtgf lfi webs/url_extract.txt | anew -q gf/lfi.txtend_func "Results are saved in $domain/gf folder" ${FUNCNAME[0]}else@@ -909,10 +919,10 @@ function url_ext(){ext=("7z" "achee" "action" "adr" "apk" "arj" "ascx" "asmx" "asp" "aspx" "axd" "backup" "bak" "bat" "bin" "bkf" "bkp" "bok" "cab" "cer" "cfg" "cfm" "cfml" "cgi" "cnf" "conf" "config" "cpl" "crt" "csr" "csv" "dat" "db" "dbf" "deb" "dmg" "dmp" "doc" "docx" "drv" "email" "eml" "emlx" "env" "exe" "gadget" "gz" "html" "ica" "inf" "ini" "iso" "jar" "java" "jhtml" "json" "jsp" "key" "log" "lst" "mai" "mbox" "mbx" "md" "mdb" "msg" "msi" "nsf" "ods" "oft" "old" "ora" "ost" "pac" "passwd" "pcf" "pdf" "pem" "pgp" "php" "php3" "php4" "php5" "phtm" "phtml" "pkg" "pl" "plist" "pst" "pwd" "py" "rar" "rb" "rdp" "reg" "rpm" "rtf" "sav" "sh" "shtm" "shtml" "skr" "sql" "swf" "sys" "tar" "tar.gz" "tmp" "toast" "tpl" "txt" "url" "vcd" "vcf" "wml" "wpd" "wsdl" "wsf" "xls" "xlsm" "xlsx" "xml" "xsd" "yaml" "yml" "z" "zip")echo "" > webs/url_extract.txtfor t in "${ext[@]}"; do- NUMOFLINES=$(cat .tmp/url_extract_tmp.txt | egrep -i "\.(${t})($|\/|\?)" | sort -u | wc -l)+ NUMOFLINES=$(cat .tmp/url_extract_tmp.txt | grep -Ei "\.(${t})($|\/|\?)" | sort -u | wc -l)if [[ ${NUMOFLINES} -gt 0 ]]; thenecho -e "\n############################\n + ${t} + \n############################\n" >> webs/urls_by_ext.txt- cat .tmp/url_extract_tmp.txt | egrep -i "\.(${t})($|\/|\?)" | sort -u >> webs/urls_by_ext.txt+ cat .tmp/url_extract_tmp.txt | grep -Ei "\.(${t})($|\/|\?)" | sort -u >> webs/urls_by_ext.txtfidoneend_func "Results are saved in $domain/webs/urls_by_ext.txt" ${FUNCNAME[0]}@@ -933,7 +943,7 @@ function jschecks(){cat js/url_extract_js.txt | cut -d '?' -f 1 | grep -iE "\.js$" | grep "$domain$" | anew -q js/jsfile_links.txtcat js/url_extract_js.txt | subjs | grep "$domain$" | anew -q js/jsfile_links.txtprintf "${yellow} Running : Resolving JS Urls 2/5${reset}\n"- cat js/jsfile_links.txt | httpx -follow-redirects -random-agent -silent -timeout 15 -threads $HTTPX_THREADS -status-code -retries 2 -no-color | grep "[200]" | cut -d ' ' -f1 | anew -q js/js_livelinks.txt+ cat js/jsfile_links.txt | httpx -follow-redirects -random-agent -silent -timeout $HTTPX_TIMEOUT -threads $HTTPX_THREADS -status-code -retries 2 -no-color | grep "[200]" | cut -d ' ' -f1 | anew -q js/js_livelinks.txtprintf "${yellow} Running : Gathering endpoints 3/5${reset}\n"if [ -s "js/js_livelinks.txt" ]; theninterlace -tL js/js_livelinks.txt -threads 10 -c "python3 $tools/LinkFinder/linkfinder.py -d -i _target_ -o cli >> .tmp/js_endpoints.txt" &>/dev/null@@ -998,7 +1008,7 @@ function brokenLinks(){fifised -i '/^.\{2048\}./d' .tmp/gospider.txt- cat .tmp/gospider.txt | egrep -o 'https?://[^ ]+' | sed 's/]$//' | sort -u | httpx -follow-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout 15 -silent -retries 2 -no-color | grep "\[4" | cut -d ' ' -f1 | anew -q .tmp/brokenLinks_total.txt+ cat .tmp/gospider.txt | grep -Eo 'https?://[^ ]+' | sed 's/]$//' | sort -u | httpx -follow-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color | grep "\[4" | cut -d ' ' -f1 | anew -q .tmp/brokenLinks_total.txtNUMOFLINES=$(cat .tmp/brokenLinks_total.txt 2>>"$LOGFILE" | anew webs/brokenLinks.txt | wc -l)notification "${NUMOFLINES} new broken links found" infoend_func "Results are saved in webs/brokenLinks.txt" ${FUNCNAME[0]}@@ -1238,7 +1248,7 @@ function spraying(){function 4xxbypass(){if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$BYPASSER4XX" = true ]; thenstart_func "403 bypass"- cat fuzzing/*.txt 2>>"$LOGFILE" | egrep '^4' | egrep -v '^404' | cut -d ' ' -f3 | dirdar -only-ok > .tmp/dirdar.txt+ cat fuzzing/*.txt 2>>"$LOGFILE" | grep -E '^4' | grep -Ev '^404' | cut -d ' ' -f3 | dirdar -only-ok > .tmp/dirdar.txtcat .tmp/dirdar.txt 2>>"$LOGFILE" | sed -e '1,12d' | sed '/^$/d' | anew -q vulns/4xxbypass.txtend_func "Results are saved in vulns/4xxbypass.txt" ${FUNCNAME[0]}else@@ -1361,8 +1371,9 @@ function resolvers_update(){if [ "$update_resolvers" = true ]; thenif [[ $(find "$resolvers" -mtime +1 -print) ]]; thennotification "Resolvers seem older than 1 day\n Generating custom resolvers..." warn- dnsvalidator -tL https://public-dns.info/nameservers.txt -threads 100 -o $resolvers &>>"$LOGFILE"+ dnsvalidator -tL https://public-dns.info/nameservers.txt -threads 100 -o $resolvers &>/dev/nullnotification "Updated\n" good+ update_resolvers=falsefifi}@@ -1622,6 +1633,33 @@ function subs_menu(){end}+function webs_menu(){+ subtakeover+ s3buckets+ waf_checks+ nuclei_check+ cms_scanner+ fuzz+ 4xxbypass+ cors+ params+ urlchecks+ url_gf+ jschecks+ wordlist_gen+ open_redirect+ ssrf_checks+ crlf_checks+ lfi+ ssti+ sqli+ xss+ spraying+ brokenLinks+ test_ssl+ end+}+function help(){printf "\n Usage: $0 [-d domain.tld] [-m name] [-l list.txt] [-x oos.txt] [-i in.txt] "printf "\n [-r] [-s] [-p] [-a] [-w] [-i] [-h] [--deep] [--fs] [-o OUTPUT]\n\n"@@ -1637,7 +1675,7 @@ function help(){printf " -s Subdomains - Search subdomains, check tko and web probe\n"printf " -p Passive - Performs only passive steps \n"printf " -a All - Perform all checks and exploitations\n"- printf " -w Web - Just web checks from list provided${reset}\n"+ printf " -w Web - Just web checks from list provided\n"printf " -h Help - Show this help\n"printf " \n"printf " ${bblue}GENERAL OPTIONS${reset}\n"@@ -1750,30 +1788,7 @@ while getopts ":hd:-:l:m:x:i:varspxwo:" opt; docp $SCRIPTPATH/$list $dir/webs/webs.txtfifi- subtakeover- s3buckets- waf_checks- nuclei_check- cms_scanner- fuzz- 4xxbypass- cors- params- urlchecks- url_gf- jschecks- wordlist_gen- open_redirect- ssrf_checks- crlf_checks- lfi- ssti- sqli- xss- spraying- brokenLinks- test_ssl- end+ webs_menuexit;;p ) if [ -n "$list" ]; thendiff --git a/reconftw_axiom.sh b/reconftw_axiom.shindex a32d2b1..b32ff7f 100755--- a/reconftw_axiom.sh+++ b/reconftw_axiom.sh@@ -349,7 +349,7 @@ function sub_active(){cat .tmp/*_subs.txt | anew -q .tmp/subs_no_resolved.txtdeleteOutScoped $outOfScope_file .tmp/subs_no_resolved.txtaxiom-scan .tmp/subs_no_resolved.txt -m puredns-resolve -r /home/op/lists/resolvers.txt -o .tmp/subdomains_tmp.txt &>>"$LOGFILE"- echo $domain | dnsx -retry 3 -silent -r /home/op/recon/puredns/trusted.txt 2>>"$LOGFILE" | anew -q .tmp/subdomains_tmp.txt+ echo $domain | dnsx -retry 3 -silent -r /home/op/lists/resolvers_trusted.txt 2>>"$LOGFILE" | anew -q .tmp/subdomains_tmp.txtNUMOFLINES=$(cat .tmp/subdomains_tmp.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | wc -l)end_subfunc "${NUMOFLINES} new subs (active resolution)" ${FUNCNAME[0]}else@@ -396,18 +396,18 @@ function sub_scraping(){if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUBSCRAPING" = true ]; thenstart_subfunc "Running : Source code scraping subdomain search"touch .tmp/scrap_subs.txt- if [ -s "$dir/subdomains/subdomains.txt" ]; then+ if [ -s "$dir/subdomains/subdomains.txt" ]; thenaxiom-scan subdomains/subdomains.txt -m httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color -o .tmp/probed_tmp_scrap1.txt &>>"$LOGFILE" && cat .tmp/probed_tmp_scrap1.txt | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txtaxiom-scan .tmp/probed_tmp_scrap.txt -m httpx -csp-probe -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color -o .tmp/probed_tmp_scrap2.txt &>>"$LOGFILE" && cat .tmp/probed_tmp_scrap2.txt | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains | anew -q .tmp/scrap_subs.txtaxiom-scan .tmp/probed_tmp_scrap.txt -m httpx -tls-grab -tls-probe -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color -o .tmp/probed_tmp_scrap3.txt &>>"$LOGFILE" && cat .tmp/probed_tmp_scrap3.txt | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains | anew -q .tmp/scrap_subs.txt- if [ "$DEEP" = true ] ; then+ if [ "$DEEP" = true ]; thenaxiom-scan .tmp/probed_tmp_scrap.txt -m gospider --js -d 3 --sitemap --robots -w -r -o .tmp/gospider &>>"$LOGFILE"elseaxiom-scan .tmp/probed_tmp_scrap.txt -m gospider --js -d 2 --sitemap --robots -w -r -o .tmp/gospider &>>"$LOGFILE"fiNUMFILES=$(find .tmp/gospider/ -type f | wc -l)[[ $NUMFILES -gt 0 ]] && cat .tmp/gospider/* | sed '/^.\{2048\}./d' | anew -q .tmp/gospider.txt- grep -E -o 'https?://[^ ]+' .tmp/gospider.txt | sed 's/]$//' | unfurl --unique domains | grep ".$domain$" | anew -q .tmp/scrap_subs.txt+ grep -Eo 'https?://[^ ]+' .tmp/gospider.txt | sed 's/]$//' | unfurl --unique domains | grep ".$domain$" | anew -q .tmp/scrap_subs.txtaxiom-scan .tmp/scrap_subs.txt -m puredns-resolve -r /home/op/lists/resolvers.txt -o .tmp/scrap_subs_resolved.txt &>>"$LOGFILE"NUMOFLINES=$(cat .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | tee .tmp/diff_scrap.txt | wc -l)axiom-scan .tmp/diff_scrap.txt -m httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color -o .tmp/probed_tmp_scrap4.txt &>>"$LOGFILE" && cat .tmp/probed_tmp_scrap4.txt 2>>"$LOGFILE" | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txt@@ -588,7 +588,7 @@ function webprobe_simple(){ffuf -mc all -w webs/webs.txt -u FUZZ -replay-proxy $proxy_url &>>"$LOGFILE"fielse- end_subfunc "No new websites to probe" ${FUNCNAME[0]}+ end_subfunc "No new websites to probe" ${FUNCNAME[0]}fielseif [ "$WEBPROBESIMPLE" = false ]; then@@ -600,7 +600,7 @@ function webprobe_simple(){}function webprobe_full(){- if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$WEBPROBEFULL" = true ]; then+ if ([ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]) && [ "$WEBPROBEFULL" = true ]; thenstart_func "Http probing non standard ports"axiom-scan subdomains/subdomains.txt -m naabu -p $UNCOMMON_PORTS_WEB -o .tmp/nmap_uncommonweb.txt &>>"$LOGFILE" && uncommon_ports_checked=$(cat .tmp/nmap_uncommonweb.txt | cut -d ':' -f2 | sort -u | sed -e 'H;${x;s/\n/,/g;s/^,//;p;};d')if [ -n "$uncommon_ports_checked" ]; then@@ -729,7 +729,7 @@ function waf_checks(){end_func "No results found" ${FUNCNAME[0]}fielse- end_func "No websites to scan" ${FUNCNAME[0]}+ end_func "No websites to scan" ${FUNCNAME[0]}fielseif [ "$WAF" = false ]; then@@ -746,15 +746,15 @@ function nuclei_check(){nuclei -update-templates &>>"$LOGFILE"mkdir -p nuclei_outputprintf "${yellow}\n Running : Nuclei Info${reset}\n\n"- axiom-scan webs/webs.txt -m nuclei -severity info -r /home/op/recon/puredns/trusted.txt -o nuclei_output/info.txt &>>"$LOGFILE"+ axiom-scan webs/webs.txt -m nuclei -severity info -r /home/op/lists/resolvers_trusted.txt -o nuclei_output/info.txt &>>"$LOGFILE"printf "${yellow}\n\n Running : Nuclei Low${reset}\n\n"- axiom-scan webs/webs.txt -m nuclei -severity low -r /home/op/recon/puredns/trusted.txt -o nuclei_output/low.txt &>>"$LOGFILE"+ axiom-scan webs/webs.txt -m nuclei -severity low -r /home/op/lists/resolvers_trusted.txt -o nuclei_output/low.txt &>>"$LOGFILE"printf "${yellow}\n\n Running : Nuclei Medium${reset}\n\n"- axiom-scan webs/webs.txt -m nuclei -severity medium -r /home/op/recon/puredns/trusted.txt -o nuclei_output/medium.txt &>>"$LOGFILE"+ axiom-scan webs/webs.txt -m nuclei -severity medium -r /home/op/lists/resolvers_trusted.txt -o nuclei_output/medium.txt &>>"$LOGFILE"printf "${yellow}\n\n Running : Nuclei High${reset}\n\n"- axiom-scan webs/webs.txt -m nuclei -severity high -r /home/op/recon/puredns/trusted.txt -o nuclei_output/high.txt &>>"$LOGFILE"+ axiom-scan webs/webs.txt -m nuclei -severity high -r /home/op/lists/resolvers_trusted.txt -o nuclei_output/high.txt &>>"$LOGFILE"printf "${yellow}\n\n Running : Nuclei Critical${reset}\n\n"- axiom-scan webs/webs.txt -m nuclei -severity critical -r /home/op/recon/puredns/trusted.txt -o nuclei_output/critical.txt &>>"$LOGFILE"+ axiom-scan webs/webs.txt -m nuclei -severity critical -r /home/op/lists/resolvers_trusted.txt -o nuclei_output/critical.txt &>>"$LOGFILE"printf "\n\n"end_func "Results are saved in $domain/nuclei_output folder" ${FUNCNAME[0]}else@@ -875,13 +875,13 @@ function urlchecks(){ficat .tmp/gospider/* | sed '/^.\{2048\}./d' | anew -q .tmp/gospider.txtfi- cat .tmp/gospider.txt | grep -oE 'https?://[^ ]+' | sed 's/]$//' | grep ".$domain$" | anew -q .tmp/url_extract_tmp.txt+ cat .tmp/gospider.txt | grep -Eo 'https?://[^ ]+' | sed 's/]$//' | grep ".$domain$" | anew -q .tmp/url_extract_tmp.txtif [ -s "${GITHUB_TOKENS}" ]; thengithub-endpoints -q -k -d $domain -t ${GITHUB_TOKENS} -o .tmp/github-endpoints.txt &>>"$LOGFILE"cat .tmp/github-endpoints.txt 2>>"$LOGFILE" | anew -q .tmp/url_extract_tmp.txtfi- cat .tmp/url_extract_tmp.txt webs/param.txt 2>>"$LOGFILE" | grep "${domain}" | grep "=" | qsreplace -a 2>>"$LOGFILE" | egrep -iv "\.(eot|jpg|jpeg|gif|css|tif|tiff|png|ttf|otf|woff|woff2|ico|pdf|svg|txt|js)$" | anew -q .tmp/url_extract_tmp2.txt- cat .tmp/url_extract_tmp.txt | grep "${domain}" | egrep -i "\.(js)" | anew -q js/url_extract_js.txt+ cat .tmp/url_extract_tmp.txt webs/param.txt 2>>"$LOGFILE" | grep "${domain}" | grep "=" | qsreplace -a 2>>"$LOGFILE" | grep -Eiv "\.(eot|jpg|jpeg|gif|css|tif|tiff|png|ttf|otf|woff|woff2|ico|pdf|svg|txt|js)$" | anew -q .tmp/url_extract_tmp2.txt+ cat .tmp/url_extract_tmp.txt | grep "${domain}" | grep -Ei "\.(js)" | anew -q js/url_extract_js.txtuddup -u .tmp/url_extract_tmp2.txt -o .tmp/url_extract_uddup.txt &>>"$LOGFILE"NUMOFLINES=$(cat .tmp/url_extract_uddup.txt 2>>"$LOGFILE" | anew webs/url_extract.txt | wc -l)notification "${NUMOFLINES} new urls with params" info@@ -958,7 +958,7 @@ function jschecks(){fiprintf "${yellow} Running : Gathering secrets 4/5${reset}\n"if [ -s "js/js_livelinks.txt" ]; then- axiom-scan js/js_livelinks.txt -m nuclei -w /home/op/recon/nuclei/exposures/ -r /home/op/recon/puredns/trusted.txt -o js/js_secrets.txt &>>"$LOGFILE"+ axiom-scan js/js_livelinks.txt -m nuclei -w /home/op/recon/nuclei/exposures/ -r /home/op/lists/resolvers_trusted.txt -o js/js_secrets.txt &>>"$LOGFILE"fiprintf "${yellow} Running : Building wordlist 5/5${reset}\n"if [ -s "js/js_livelinks.txt" ]; then@@ -1296,6 +1296,17 @@ function getElapsedTime {runtime="$runtime$S seconds."}+function zipSnedOutputFolder {+ zip_name=`date +"%Y_%m_%d-%H.%M.%S"`+ zip_name="$zip_name"_"$domain.zip"+ cd $SCRIPTPATH && zip -r $zip_name $dir 1>>"$LOGFILE"+ if [ -f "$SCRIPTPATH/$zip_name" ]; then+ printf "\n${yellow} @TODO send it ${reset}\n"+ else+ printf "\n${yellow} no Zip file to send ${reset}\n"+ fi+}+function isAsciiText {IS_ASCII="False";if [[ $(file $1 | grep -o 'ASCII text$') == "ASCII text" ]]; then@@ -1364,10 +1375,11 @@ function resolvers_update(){if [ "$update_resolvers" = true ]; thennotification "Checking resolvers lists...\n Accurate resolvers are the key to great results\n This may take around 10 minutes if it's not updated" warn# shellcheck disable=SC2016- axiom-exec 'if [ \$(find "/home/op/lists/resolvers.txt" -mtime +1 -print) ] || [ \$(cat /home/op/lists/resolvers.txt | wc -l) -le 40 ] ; then dnsvalidator -tL https://public-dns.info/nameservers.txt -threads 200 -o /home/op/lists/resolvers.txt ; cp /home/op/lists/resolvers.txt /home/op/recon/puredns/resolvers.txt; fi' &>/dev/null+ axiom-exec 'if [ \$(find "/home/op/lists/resolvers.txt" -mtime +1 -print) ] || [ \$(cat /home/op/lists/resolvers.txt | wc -l) -le 40 ] ; then dnsvalidator -tL https://public-dns.info/nameservers.txt -threads 200 -o /home/op/lists/resolvers.txt ; fi' &>/dev/nullnotification "Updated\n" goodupdate_resolvers=falsefi+ axiom-exec 'wget -O /home/op/lists/resolvers_trusted.txt https://gist.githubusercontent.com/six2dez/ae9ed7e5c786461868abd3f2344401b6/raw' &>/dev/null}function start(){@@ -1444,6 +1456,8 @@ function end(){elsefinaldir=$dirfi+ #Zip the output folder and send it via tg/discord/slack+ zipSnedOutputFolderglobal_end=$(date +%s)getElapsedTime $global_start $global_endprintf "${bgreen}#######################################################################${reset}\n"@@ -1619,7 +1633,7 @@ function multi_recon(){nuclei_checkfor domain in $targets; dodir=$workdir/targets/$domain- called_fn_dir=$dir/.called_fn+ called_fn_dir=$dir/.called_fncd "$dir" || { echo "Failed to cd directory '$dir' in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }fuzzparams@@ -1811,7 +1825,7 @@ while getopts ":hd:-:l:m:x:i:varspxwo:" opt; dofiwebs_menuexit- ;;+ ;;p ) if [ -n "$list" ]; thenfor domain in $(cat $list); dopassive