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

1st bbrf approach, nmap-parser, IP target && fixes

six2dez8cf8a26ecab7
diff --git a/install.sh b/install.sh
index 21d5bab..f09b45e 100755
--- a/install.sh
+++ b/install.sh
@@ -61,6 +61,7 @@ repos["commix"]="commixproject/commix"
repos["JSA"]="six2dez/JSA"
repos["urldedupe"]="ameenmaali/urldedupe"
repos["cloud_enum"]="initstring/cloud_enum"
+repos["nmap-parse-output"]="ernw/nmap-parse-output"
dir=${tools}
double_check=false
@@ -315,6 +316,20 @@ if [ "$double_check" = "true" ]; then
done
fi
+# BBRF Setup
+if [ -d "$HOME/.bbrf/" ] && [ ! -s "$HOME/.bbrf/config.json" ]; then
+ cat > $HOME/.bbrf/config.json << EOF
+{
+ "username": "bbrf",
+ "password": "<your secure password>",
+ "couchdb": "https://<your-bbrf-server>/bbrf",
+ "slack_token": "<a slack token to receive notifications>",
+ "discord_webhook": "<your discord webhook if you want one>",
+ "ignore_ssl_errors": false
+}
+EOF
+fi
+
printf "${bblue} Running: Performing last configurations ${reset}\n\n"
## Last steps
if [ ! -s "resolvers.txt" ] || [ $(find "resolvers.txt" -mtime +1 -print) ]; then
diff --git a/reconftw.cfg b/reconftw.cfg
index 30fac62..c06b8d5 100644
--- a/reconftw.cfg
+++ b/reconftw.cfg
@@ -55,7 +55,7 @@ SUBSCRAPING=true
SUBPERMUTE=true
SUBTAKEOVER=true
SUBRECURSIVE=true
-SUB_RECURSIVE_PASSIVE=false # Uses a lot of API keys queries
+SUB_RECURSIVE_PASSIVE=true # Uses a lot of API keys queries
ZONETRANSFER=true
S3BUCKETS=true
REVERSE_IP=false
@@ -107,13 +107,13 @@ PROTO_POLLUTION=true
NOTIFICATION=false # Notification for every function
SOFT_NOTIFICATION=false # Only for start/end
DEEP=false
-DEEP_LIMIT=1000
+DEEP_LIMIT=500
DIFF=false
-REMOVETMP=true
+REMOVETMP=false
REMOVELOG=false
PROXY=false
SENDZIPNOTIFY=false
-PRESERVE=false # set to true to avoid deleting the .called_fn files on really large scans
+PRESERVE=true # set to true to avoid deleting the .called_fn files on really large scans
# HTTP options
HEADER="User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0"
@@ -160,6 +160,12 @@ AXIOM_FLEET_SHUTDOWN=true
# This is a script on your reconftw host that might prep things your way...
#AXIOM_POST_START="~/Tools/axiom_config.sh"
+# BBRF
+BBRF_CONNECTION=false
+BBRF_SERVER=https://demo.bbrf.me/bbrf
+BBRF_USERNAME=user
+BBRF_PASSWORD=password
+
# TERM COLORS
bred='\033[1;31m'
bblue='\033[1;34m'
diff --git a/reconftw.sh b/reconftw.sh
index 7d5079e..81b538a 100755
--- a/reconftw.sh
+++ b/reconftw.sh
@@ -44,7 +44,7 @@ function tools_installed(){
[ -n "$GOPATH" ] || { printf "${bred} [*] GOPATH var [NO]${reset}\n"; allinstalled=false;}
[ -n "$GOROOT" ] || { printf "${bred} [*] GOROOT var [NO]${reset}\n"; allinstalled=false;}
[ -n "$PATH" ] || { printf "${bred} [*] PATH var [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/uDork/uDork.sh" ] || { printf "${bred} [*] uDork [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/udork/uDork.sh" ] || { printf "${bred} [*] uDork [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/brutespray/brutespray.py" ] || { printf "${bred} [*] brutespray [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/dnsrecon/dnsrecon.py" ] || { printf "${bred} [*] dnsrecon [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/fav-up/favUp.py" ] || { printf "${bred} [*] fav-up [NO]${reset}\n"; allinstalled=false;}
@@ -56,10 +56,10 @@ function tools_installed(){
[ -f "$tools/LinkFinder/linkfinder.py" ] || { printf "${bred} [*] LinkFinder [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/GitDorker/GitDorker.py" ] || { printf "${bred} [*] GitDorker [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/commix/commix.py" ] || { printf "${bred} [*] commix [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/degoogle_hunter/degoogle_hunter.sh" ] || { printf "${bred} [*] degoogle_hunter [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/getjswords.py" ] || { printf "${bred} [*] getjswords [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/JSA/jsa.py" ] || { printf "${bred} [*] JSA [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/cloud_enum/cloud_enum.py" ] || { printf "${bred} [*] cloud_enum [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/nmap-parse-output/nmap-parse-output" ] || { printf "${bred} [*] nmap-parse-output [NO]${reset}\n"; allinstalled=false;}
type -P github-endpoints &>/dev/null || { printf "${bred} [*] github-endpoints [NO]${reset}\n"; allinstalled=false;}
type -P github-subdomains &>/dev/null || { printf "${bred} [*] github-subdomains [NO]${reset}\n"; allinstalled=false;}
type -P gospider &>/dev/null || { printf "${bred} [*] gospider [NO]${reset}\n"; allinstalled=false;}
@@ -263,7 +263,8 @@ function subdomains_full(){
NUMOFLINES_subs="0"
NUMOFLINES_probed="0"
printf "${bgreen}#######################################################################\n\n"
- printf "${bblue} Subdomain Enumeration $domain\n\n"
+ ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]] && printf "${bblue} Subdomain Enumeration $domain\n\n"
+ [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]] && printf "${bblue} Scanning IP $domain\n\n"
[ -s "subdomains/subdomains.txt" ] && cp subdomains/subdomains.txt .tmp/subdomains_old.txt
[ -s "webs/webs.txt" ] && cp webs/webs.txt .tmp/probed_old.txt
@@ -283,6 +284,11 @@ function subdomains_full(){
notification "IP/CIDR detected, subdomains search skipped" info
echo $domain | anew -q subdomains/subdomains.txt
fi
+
+ if [ "$BBRF_CONNECTION" = true ]; then
+ cat subdomains/subdomains.txt | bbrf domain add -
+ fi
+
webprobe_simple
if [ -s "subdomains/subdomains.txt" ]; then
deleteOutScoped $outOfScope_file subdomains/subdomains.txt
@@ -293,7 +299,7 @@ function subdomains_full(){
NUMOFLINES_probed=$(cat webs/webs.txt 2>>"$LOGFILE" | anew .tmp/probed_old.txt | wc -l)
fi
printf "${bblue}\n Total subdomains: ${reset}\n\n"
- notification "- ${NUMOFLINES_subs} new alive subdomains" good
+ notification "- ${NUMOFLINES_subs} alive" good
[ -s "subdomains/subdomains.txt" ] && cat subdomains/subdomains.txt | sort
notification "- ${NUMOFLINES_probed} new web probed" good
[ -s "webs/webs.txt" ] && cat webs/webs.txt | sort
@@ -402,9 +408,9 @@ function sub_scraping(){
start_subfunc "Running : Source code scraping subdomain search"
touch .tmp/scrap_subs.txt
if [ -s "$dir/subdomains/subdomains.txt" ]; then
- 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
- [ -s ".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 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
- [ -s ".tmp/probed_tmp_scrap.txt" ] && cat .tmp/probed_tmp_scrap.txt | httpx -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 2>>"$LOGFILE" | 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 -title -web-server -tech-detect -no-color | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txt
+ [ -s ".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 -title -web-server -tech-detect -no-color | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
+ [ -s ".tmp/probed_tmp_scrap.txt" ] && cat .tmp/probed_tmp_scrap.txt | httpx -tls-probe -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -no-color | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
if [ "$DEEP" = true ]; then
[ -s ".tmp/probed_tmp_scrap.txt" ] && gospider -S .tmp/probed_tmp_scrap.txt --js -t $GOSPIDER_THREADS -d 3 --sitemap --robots -w -r > .tmp/gospider.txt
else
@@ -414,7 +420,7 @@ function sub_scraping(){
[ -s ".tmp/gospider.txt" ] && cat .tmp/gospider.txt | grep -Eo '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 2>>"$LOGFILE" &>/dev/null
NUMOFLINES=$(cat .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" | grep "\.$domain$\|^$domain$" | anew subdomains/subdomains.txt | tee .tmp/diff_scrap.txt | wc -l)
- [ -s ".tmp/diff_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.txt
+ [ -s ".tmp/diff_scrap.txt" ] && cat .tmp/diff_scrap.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -no-color | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txt
end_subfunc "${NUMOFLINES} new subs (code scraping)" ${FUNCNAME[0]}
else
end_subfunc "No subdomains to search (code scraping)" ${FUNCNAME[0]}
@@ -465,6 +471,7 @@ function sub_permut(){
[ -s ".tmp/gotator2.txt" ] && puredns resolve .tmp/gotator2.txt -w .tmp/permute2_tmp.txt -r $resolvers --resolvers-trusted $resolvers_trusted -l $PUREDNS_PUBLIC_LIMIT --rate-limit-trusted $PUREDNS_TRUSTED_LIMIT 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/permute2_tmp.txt" ] && cat .tmp/permute2_tmp.txt | anew -q .tmp/permute2.txt
eval rm -rf .tmp/gotator*.txt 2>>"$LOGFILE"
+ eval rm -rf .tmp/permute*.txt 2>>"$LOGFILE"
cat .tmp/permute1.txt .tmp/permute2.txt 2>>"$LOGFILE" | anew -q .tmp/permute_subs.txt
if [ -s ".tmp/permute_subs.txt" ]; then
@@ -513,6 +520,7 @@ function sub_recursive(){
cat .tmp/permute1_recursive.txt .tmp/permute2_recursive_tmp.txt 2>>"$LOGFILE" | anew -q .tmp/permute_recursive.txt
eval rm -rf .tmp/gotator*.txt 2>>"$LOGFILE"
eval rm -rf .tmp/brute_recursive_wordlist.txt.txt 2>>"$LOGFILE"
+ eval rm -rf .tmp/permute*.txt 2>>"$LOGFILE"
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
@@ -531,11 +539,14 @@ function subtakeover(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$SUBTAKEOVER" = true ]; then
start_func "Looking for possible subdomain takeover"
touch .tmp/tko.txt
- [ -s "webs/webs.txt" ] && cat webs/webs.txt | nuclei -silent -t ~/nuclei-templates/takeovers/ -r $resolvers_trusted -o .tmp/tko.txt
+ [ -s "webs/webs.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | nuclei -silent -t ~/nuclei-templates/takeovers/ -r $resolvers_trusted -o .tmp/tko.txt
NUMOFLINES=$(cat .tmp/tko.txt 2>>"$LOGFILE" | anew webs/takeover.txt | wc -l)
if [ "$NUMOFLINES" -gt 0 ]; then
notification "${NUMOFLINES} new possible takeovers found" info
fi
+ if [ "$BBRF_CONNECTION" = true ]; then
+ cat webs/takeover.txt | grep -Eo 'https?://[^ ]+' | bbrf url add - -t subtko:true
+ fi
end_func "Results are saved in $domain/webs/takeover.txt" ${FUNCNAME[0]}
else
if [ "$SUBTAKEOVER" = false ]; then
@@ -568,7 +579,7 @@ function s3buckets(){
start_func "AWS S3 buckets search"
# S3Scanner
- [ -s "subdomains/subdomains.txt" ] && s3scanner scan -f subdomains/subdomains.txt 2>>"$LOGFILE" | grep -iv "not_exist" | grep -iv "Warning:" | anew -q .tmp/s3buckets.txt
+ [ -s "subdomains/subdomains.txt" ] && s3scanner scan -f subdomains/subdomains.txt | grep -iv "not_exist" | grep -iv "Warning:" | grep -iv "invalid_name" | anew -q .tmp/s3buckets.txt
# Cloudenum
keyword=${domain%%.*}
python3 ~/Tools/cloud_enum/cloud_enum.py -k $keyword -qs -l .tmp/output_cloud.txt 2>>"$LOGFILE" &>/dev/null
@@ -581,6 +592,12 @@ function s3buckets(){
if [ "$NUMOFLINES2" -gt 0 ]; then
notification "${NUMOFLINES} new S3 buckets found" info
fi
+
+ if [ "$BBRF_CONNECTION" = true ]; then
+ cat subdomains/cloud_assets.txt | grep -Eo 'https?://[^ ]+' | sed 's/[ \t]*$//' | bbrf url add - -t cloud_assets:true
+ cat subdomains/s3buckets.txt | cut -d'|' -f1 | sed 's/[ \t]*$//' | bbrf domain update - -t s3bucket:true
+ fi
+
end_func "Results are saved in subdomains/s3buckets.txt and subdomains/cloud_assets.txt" ${FUNCNAME[0]}
else
if [ "$S3BUCKETS" = false ]; then
@@ -602,12 +619,13 @@ function webprobe_simple(){
mv .tmp/probed_tmp_scrap.txt .tmp/probed_tmp.txt
else
if [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
- 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 | 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 -title -web-server -tech-detect -no-color | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | anew -q .tmp/probed_tmp.txt
else
- 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.txt
+ cat subdomains/subdomains.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -no-color | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | grep "$domain$" | anew -q .tmp/probed_tmp.txt
fi
fi
if [ -s ".tmp/probed_tmp.txt" ]; then
+ cat .tmp/web_full_info.txt | anew -q webs/web_full_info.txt
deleteOutScoped $outOfScope_file .tmp/probed_tmp.txt
NUMOFLINES=$(cat .tmp/probed_tmp.txt 2>>"$LOGFILE" | anew webs/webs.txt | wc -l)
end_subfunc "${NUMOFLINES} new websites resolved" ${FUNCNAME[0]}
@@ -615,6 +633,9 @@ function webprobe_simple(){
notification "Sending websites to proxy" info
ffuf -mc all -fc 404 -w webs/webs.txt -u FUZZ -replay-proxy $proxy_url 2>>"$LOGFILE" &>/dev/null
fi
+ if [ "$BBRF_CONNECTION" = true ]; then
+ cat webs/webs.txt | bbrf url add -
+ fi
else
end_subfunc "No new websites to probe" ${FUNCNAME[0]}
fi
@@ -640,11 +661,12 @@ function webprobe_full(){
fi
if [ -s ".tmp/nmap_uncommonweb.txt" ]; then
if [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
- cat .tmp/nmap_uncommonweb.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_UNCOMMONPORTS_THREADS -timeout $HTTPX_UNCOMMONPORTS_TIMEOUT -silent -retries 2 -no-color 2>>"$LOGFILE" | cut -d ' ' -f1 | anew -q .tmp/probed_uncommon_ports_tmp.txt
+ cat .tmp/nmap_uncommonweb.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_UNCOMMONPORTS_THREADS -timeout $HTTPX_UNCOMMONPORTS_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -no-color | anew .tmp/web_full_info_uncommon.txt | cut -d ' ' -f1 | anew -q .tmp/probed_uncommon_ports_tmp.txt
else
- cat .tmp/nmap_uncommonweb.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_UNCOMMONPORTS_THREADS -timeout $HTTPX_UNCOMMONPORTS_TIMEOUT -silent -retries 2 -no-color 2>>"$LOGFILE" | cut -d ' ' -f1 | grep "$domain" | anew -q .tmp/probed_uncommon_ports_tmp.txt
+ cat .tmp/nmap_uncommonweb.txt | httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_UNCOMMONPORTS_THREADS -timeout $HTTPX_UNCOMMONPORTS_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -no-color | anew .tmp/web_full_info_uncommon.txt | cut -d ' ' -f1 | grep "$domain" | anew -q .tmp/probed_uncommon_ports_tmp.txt
fi
fi
+ cat .tmp/web_full_info_uncommon.txt | anew -q webs/web_full_info_uncommon.txt
NUMOFLINES=$(cat .tmp/probed_uncommon_ports_tmp.txt 2>>"$LOGFILE" | anew webs/webs_uncommon_ports.txt | wc -l)
notification "Uncommon web ports: ${NUMOFLINES} new websites" good
[ -s "webs/webs_uncommon_ports.txt" ] && cat webs/webs_uncommon_ports.txt
@@ -654,6 +676,9 @@ function webprobe_full(){
notification "Sending websites uncommon ports to proxy" info
ffuf -mc all -fc 404 -w webs/webs_uncommon_ports.txt -u FUZZ -replay-proxy $proxy_url 2>>"$LOGFILE" &>/dev/null
fi
+ if [ "$BBRF_CONNECTION" = true ]; then
+ cat webs/webs_uncommon_ports.txt | bbrf url add -
+ fi
else
if [ "$WEBPROBEFULL" = false ]; then
printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
@@ -728,6 +753,9 @@ function portscan(){
if [ "$PORTSCAN_ACTIVE" = true ]; then
[ -s ".tmp/ips_nowaf.txt" ] && sudo nmap --top-ports 200 -sV -n --max-retries 2 -Pn --open -iL .tmp/ips_nowaf.txt -oA hosts/portscan_active 2>>"$LOGFILE" &>/dev/null
fi
+ if [ "$BBRF_CONNECTION" = true ]; then
+ [ -s "hosts/portscan_active.xml" ] && $tools/nmap-parse-output/nmap-parse-output hosts/portscan_active.xml host-ports | bbrf service add -
+ fi
[ -s "hosts/portscan_active.xml" ] && searchsploit --nmap hosts/portscan_active.xml > hosts/searchsploit.txt
end_func "Results are saved in hosts/portscan_[passive|active].txt" ${FUNCNAME[0]}
else
@@ -768,6 +796,9 @@ function waf_checks(){
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
+ if [ "$BBRF_CONNECTION" = true ]; then
+ [ -s "webs/webs_wafs.txt" ] && cat webs/webs_wafs.txt | bbrf url add - -t waf:true
+ fi
end_func "Results are saved in $domain/webs/webs_wafs.txt" ${FUNCNAME[0]}
else
end_func "No results found" ${FUNCNAME[0]}
@@ -801,6 +832,13 @@ function nuclei_check(){
cat .tmp/webs_nuclei.txt | nuclei -silent -t ~/nuclei-templates/ -severity high -r $resolvers_trusted -o nuclei_output/high.txt
printf "${yellow}\n\n Running : Nuclei Critical${reset}\n\n"
cat .tmp/webs_nuclei.txt | nuclei -silent -t ~/nuclei-templates/ -severity critical -r $resolvers_trusted -o nuclei_output/critical.txt
+ if [ "$BBRF_CONNECTION" = true ]; then
+ [ -s "nuclei_output/info.txt" ] && cat nuclei_output/info.txt | cut -d' ' -f6 | sort -u | bbrf url add - -t nuclei:info
+ [ -s "nuclei_output/low.txt" ] && cat nuclei_output/low.txt | cut -d' ' -f6 | sort -u | bbrf url add - -t nuclei:low
+ [ -s "nuclei_output/medium.txt" ] && cat nuclei_output/medium.txt | cut -d' ' -f6 | sort -u | bbrf url add - -t nuclei:medium
+ [ -s "nuclei_output/high.txt" ] && cat nuclei_output/high.txt | cut -d' ' -f6 | sort -u | bbrf url add - -t nuclei:high
+ [ -s "nuclei_output/critical.txt" ] && cat nuclei_output/critical.txt | cut -d' ' -f6 | sort -u | bbrf url add - -t nuclei:critical
+ fi
printf "\n\n"
fi
end_func "Results are saved in $domain/nuclei_output folder" ${FUNCNAME[0]}
@@ -1046,7 +1084,6 @@ function wordlist_gen_roboxtractor(){
fi
}
-
###############################################################################################################
######################################### VULNERABILITIES #####################################################
###############################################################################################################
@@ -1311,7 +1348,7 @@ function command_injection(){
start_func "Command Injection checks"
[ -s "gf/rce.txt" ] && cat gf/rce.txt | qsreplace FUZZ | anew -q .tmp/tmp_rce.txt
if [ "$DEEP" = true ] || [[ $(cat .tmp/tmp_rce.txt | wc -l) -le $DEEP_LIMIT ]]; then
- [ -s ".tmp/tmp_rce.txt" ] && python3 $tools/commix/commix.py --batch -m .tmp/tmp_rce.txt --output-dir vulns/command_injection txt 2>>"$LOGFILE" &>/dev/null
+ [ -s ".tmp/tmp_rce.txt" ] && python3 $tools/commix/commix.py --batch -m .tmp/tmp_rce.txt --output-dir vulns/command_injection.txt 2>>"$LOGFILE" &>/dev/null
end_func "Results are saved in vulns/command_injection folder" ${FUNCNAME[0]}
else
end_func "Skipping Command injection: Too many URLs to test, try with --deep flag" ${FUNCNAME[0]}
@@ -1330,9 +1367,13 @@ function command_injection(){
function prototype_pollution(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$PROTO_POLLUTION" = true ] ; then
start_func "Prototype Pollution checks"
- [ -s "webs/url_extract.txt" ] && ppfuzz -l webs/url_extract.txt -c $PPFUZZ_THREADS > anew -q .tmp/prototype_pollution.txt
- [ -s ".tmp/prototype_pollution.txt" ] && cat .tmp/prototype_pollution.txt | sed -e '1,8d' | sed '/^\[ERR/d' | anew -q vulns/prototype_pollution.txt
- end_func "Results are saved in vulns/prototype_pollution.txt" ${FUNCNAME[0]}
+ if [ "$DEEP" = true ] || [[ $(cat webs/url_extract.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ [ -s "webs/url_extract.txt" ] && ppfuzz -l webs/url_extract.txt -c $PPFUZZ_THREADS > anew -q .tmp/prototype_pollution.txt
+ [ -s ".tmp/prototype_pollution.txt" ] && cat .tmp/prototype_pollution.txt | sed -e '1,8d' | sed '/^\[ERR/d' | anew -q vulns/prototype_pollution.txt
+ end_func "Results are saved in vulns/prototype_pollution.txt" ${FUNCNAME[0]}
+ else
+ end_func "Skipping Prototype Pollution: Too many URLs to test, try with --deep flag" ${FUNCNAME[0]}
+ fi
else
if [ "$PROTO_POLLUTION" = false ]; then
printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
@@ -1397,7 +1438,7 @@ function isAsciiText {
function output(){
mkdir -p $dir_output
- mv $dir $dir_output
+ mv $dir/* $dir_output/*
}
function notification(){
@@ -1489,7 +1530,7 @@ function resolvers_update(){
function ipcidr_target(){
if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
- echo $1 | mapcidr -silent > target_reconftw_ipcidr.txt
+ echo $1 | mapcidr -silent | anew -q target_reconftw_ipcidr.txt
if [ -s "./target_reconftw_ipcidr.txt" ]; then
[ "$REVERSE_IP" = true ] && cat ./target_reconftw_ipcidr.txt | dnsx -ptr -resp-only -silent | unfurl -u domains 2>/dev/null | sed 's/\.$//' | anew -q ./target_reconftw_ipcidr.txt
if [[ $(cat ./target_reconftw_ipcidr.txt | wc -l) -eq 1 ]]; then
@@ -1563,6 +1604,13 @@ function start(){
VT_API_KEY=$findomain_virustotal_token
fi
+ if [ "$BBRF_CONNECTION" = true ]; then
+ program_bbrf=${echo $domain | awk -F. '{print $1"_"$2}'}
+ bbrf new ${program_bbrf}
+ bbrf use ${program_bbrf}
+ bbrf inscope add '*.${domain}'
+ fi
+
printf "\n"
printf "${bred} Target: ${domain}\n\n"
}
@@ -1712,9 +1760,9 @@ function recon(){
zonetransfer
favicon
subdomains_full
- subtakeover
- s3buckets
webprobe_full
+ s3buckets
+ subtakeover
screenshot
portscan
waf_checks
@@ -1803,8 +1851,8 @@ function multi_recon(){
called_fn_dir=$dir/.called_fn
cd "$dir" || { echo "Failed to cd directory '$dir' in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
subdomains_full
- subtakeover
webprobe_full
+ subtakeover
screenshot
portscan
cloudprovider
@@ -1899,8 +1947,8 @@ function subs_menu(){
start
subdomains_full
webprobe_full
- screenshot
subtakeover
+ screenshot
zonetransfer
s3buckets
end
diff --git a/reconftw_axiom.sh b/reconftw_axiom.sh
index 8d9ee2a..53f0548 100755
--- a/reconftw_axiom.sh
+++ b/reconftw_axiom.sh
@@ -44,7 +44,7 @@ function tools_installed(){
[ -n "$GOPATH" ] || { printf "${bred} [*] GOPATH var [NO]${reset}\n"; allinstalled=false;}
[ -n "$GOROOT" ] || { printf "${bred} [*] GOROOT var [NO]${reset}\n"; allinstalled=false;}
[ -n "$PATH" ] || { printf "${bred} [*] PATH var [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/uDork/uDork.sh" ] || { printf "${bred} [*] uDork [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/udork/uDork.sh" ] || { printf "${bred} [*] uDork [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/brutespray/brutespray.py" ] || { printf "${bred} [*] brutespray [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/dnsrecon/dnsrecon.py" ] || { printf "${bred} [*] dnsrecon [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/fav-up/favUp.py" ] || { printf "${bred} [*] fav-up [NO]${reset}\n"; allinstalled=false;}
@@ -56,10 +56,10 @@ function tools_installed(){
[ -f "$tools/LinkFinder/linkfinder.py" ] || { printf "${bred} [*] LinkFinder [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/GitDorker/GitDorker.py" ] || { printf "${bred} [*] GitDorker [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/commix/commix.py" ] || { printf "${bred} [*] commix [NO]${reset}\n"; allinstalled=false;}
- [ -f "$tools/degoogle_hunter/degoogle_hunter.sh" ] || { printf "${bred} [*] degoogle_hunter [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/getjswords.py" ] || { printf "${bred} [*] getjswords [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/JSA/jsa.py" ] || { printf "${bred} [*] JSA [NO]${reset}\n"; allinstalled=false;}
[ -f "$tools/cloud_enum/cloud_enum.py" ] || { printf "${bred} [*] cloud_enum [NO]${reset}\n"; allinstalled=false;}
+ [ -f "$tools/nmap-parse-output/nmap-parse-output" ] || { printf "${bred} [*] nmap-parse-output [NO]${reset}\n"; allinstalled=false;}
type -P github-endpoints &>/dev/null || { printf "${bred} [*] github-endpoints [NO]${reset}\n"; allinstalled=false;}
type -P github-subdomains &>/dev/null || { printf "${bred} [*] github-subdomains [NO]${reset}\n"; allinstalled=false;}
type -P gospider &>/dev/null || { printf "${bred} [*] gospider [NO]${reset}\n"; allinstalled=false;}
@@ -264,7 +264,8 @@ function subdomains_full(){
NUMOFLINES_subs="0"
NUMOFLINES_probed="0"
printf "${bgreen}#######################################################################\n\n"
- printf "${bblue} Subdomain Enumeration $domain\n\n"
+ ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]] && printf "${bblue} Subdomain Enumeration $domain\n\n"
+ [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]] && printf "${bblue} Scanning IP $domain\n\n"
[ -s "subdomains/subdomains.txt" ] && cp subdomains/subdomains.txt .tmp/subdomains_old.txt
[ -s "webs/webs.txt" ] && cp webs/webs.txt .tmp/probed_old.txt
@@ -284,6 +285,11 @@ function subdomains_full(){
notification "IP/CIDR detected, subdomains search skipped" info
echo $domain | anew -q subdomains/subdomains.txt
fi
+
+ if [ "$BBRF_CONNECTION" = true ]; then
+ cat subdomains/subdomains.txt | bbrf domain add -
+ fi
+
webprobe_simple
if [ -s "subdomains/subdomains.txt" ]; then
deleteOutScoped $outOfScope_file subdomains/subdomains.txt
@@ -294,7 +300,7 @@ function subdomains_full(){
NUMOFLINES_probed=$(cat webs/webs.txt 2>>"$LOGFILE" | anew .tmp/probed_old.txt | wc -l)
fi
printf "${bblue}\n Total subdomains: ${reset}\n\n"
- notification "- ${NUMOFLINES_subs} new alive subdomains" good
+ notification "- ${NUMOFLINES_subs} alive" good
[ -s "subdomains/subdomains.txt" ] && cat subdomains/subdomains.txt | sort
notification "- ${NUMOFLINES_probed} new web probed" good
[ -s "webs/webs.txt" ] && cat webs/webs.txt | sort
@@ -361,7 +367,7 @@ function sub_active(){
cat .tmp/*_subs.txt | anew -q .tmp/subs_no_resolved.txt
deleteOutScoped $outOfScope_file .tmp/subs_no_resolved.txt
[ -s ".tmp/subs_no_resolved.txt" ] && axiom-scan .tmp/subs_no_resolved.txt -m puredns-resolve -r /home/op/lists/resolvers.txt -o .tmp/subdomains_tmp.txt 2>>"$LOGFILE" &>/dev/null
- echo $domain | dnsx -retry 3 -silent -r $resolvers_trusted 2>>"$LOGFILE" | anew -q .tmp/subdomains_tmp.txt
+ echo $domain | dnsx -retry 3 -silent 2>>"$LOGFILE" | anew -q .tmp/subdomains_tmp.txt
NUMOFLINES=$(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
@@ -407,12 +413,12 @@ function sub_scraping(){
start_subfunc "Running : Source code scraping subdomain search"
touch .tmp/scrap_subs.txt
if [ -s "$dir/subdomains/subdomains.txt" ]; then
- axiom-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 2>>"$LOGFILE" &>/dev/null
- [ -s ".tmp/probed_tmp_scrap1.txt" ] && cat .tmp/probed_tmp_scrap1.txt | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txt
- axiom-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 2>>"$LOGFILE" &>/dev/null
- [ -s ".tmp/probed_tmp_scrap2.txt" ] && cat .tmp/probed_tmp_scrap2.txt | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
- axiom-scan .tmp/probed_tmp_scrap.txt -m httpx -tls-probe -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color -o .tmp/probed_tmp_scrap3.txt 2>>"$LOGFILE" &>/dev/null
- [ -s ".tmp/probed_tmp_scrap3.txt" ] && cat .tmp/probed_tmp_scrap3.txt | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
+ axiom-scan subdomains/subdomains.txt -m httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -no-color -o .tmp/probed_tmp_scrap1.txt 2>>"$LOGFILE" &>/dev/null
+ [ -s ".tmp/probed_tmp_scrap1.txt" ] && cat .tmp/probed_tmp_scrap1.txt | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txt
+ axiom-scan .tmp/probed_tmp_scrap.txt -m httpx -csp-probe -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -no-color -o .tmp/probed_tmp_scrap2.txt 2>>"$LOGFILE" &>/dev/null
+ [ -s ".tmp/probed_tmp_scrap2.txt" ] && cat .tmp/probed_tmp_scrap2.txt | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
+ axiom-scan .tmp/probed_tmp_scrap.txt -m httpx -tls-probe -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -no-color -o .tmp/probed_tmp_scrap3.txt 2>>"$LOGFILE" &>/dev/null
+ [ -s ".tmp/probed_tmp_scrap3.txt" ] && cat .tmp/probed_tmp_scrap3.txt | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | grep ".$domain$" | anew .tmp/probed_tmp_scrap.txt | unfurl -u domains 2>>"$LOGFILE" | anew -q .tmp/scrap_subs.txt
if [ "$DEEP" = true ]; then
[ -s ".tmp/probed_tmp_scrap.txt" ] && axiom-scan .tmp/probed_tmp_scrap.txt -m gospider --js -d 3 --sitemap --robots -w -r -o .tmp/gospider 2>>"$LOGFILE" &>/dev/null
else
@@ -425,8 +431,8 @@ function sub_scraping(){
grep -Eo 'https?://[^ ]+' .tmp/gospider.txt | 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 -o .tmp/scrap_subs_resolved.txt 2>>"$LOGFILE" &>/dev/null
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 2>>"$LOGFILE" &>/dev/null
- [ -s ".tmp/probed_tmp_scrap4.txt" ] && cat .tmp/probed_tmp_scrap4.txt | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txt
+ axiom-scan .tmp/diff_scrap.txt -m httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -no-color -o .tmp/probed_tmp_scrap4.txt 2>>"$LOGFILE" &>/dev/null
+ [ -s ".tmp/probed_tmp_scrap4.txt" ] && cat .tmp/probed_tmp_scrap4.txt | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp_scrap.txt
end_subfunc "${NUMOFLINES} new subs (code scraping)" ${FUNCNAME[0]}
else
end_subfunc "No subdomains to search (code scraping)" ${FUNCNAME[0]}
@@ -477,6 +483,7 @@ function sub_permut(){
[ -s ".tmp/gotator2.txt" ] && axiom-scan .tmp/gotator2.txt -m puredns-resolve -r /home/op/lists/resolvers.txt -o .tmp/permute2_tmp.txt 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/permute2_tmp.txt" ] && cat .tmp/permute2_tmp.txt | anew -q .tmp/permute2.txt
eval rm -rf .tmp/gotator*.txt 2>>"$LOGFILE"
+ eval rm -rf .tmp/permute*.txt 2>>"$LOGFILE"
cat .tmp/permute1.txt .tmp/permute2.txt 2>>"$LOGFILE" | anew -q .tmp/permute_subs.txt
if [ -s ".tmp/permute_subs.txt" ]; then
@@ -529,6 +536,7 @@ function sub_recursive(){
cat .tmp/permute1_recursive.txt .tmp/permute2_recursive_tmp.txt 2>>"$LOGFILE" | anew -q .tmp/permute_recursive.txt
eval rm -rf .tmp/gotator*.txt 2>>"$LOGFILE"
eval rm -rf .tmp/brute_recursive_wordlist.txt.txt 2>>"$LOGFILE"
+ eval rm -rf .tmp/permute*.txt 2>>"$LOGFILE"
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
@@ -552,6 +560,9 @@ function subtakeover(){
if [ "$NUMOFLINES" -gt 0 ]; then
notification "${NUMOFLINES} new possible takeovers found" info
fi
+ if [ "$BBRF_CONNECTION" = true ]; then
+ cat webs/takeover.txt | grep -Eo 'https?://[^ ]+' | bbrf url add - -t subtko:true
+ fi
end_func "Results are saved in $domain/webs/takeover.txt" ${FUNCNAME[0]}
else
if [ "$SUBTAKEOVER" = false ]; then
@@ -598,6 +609,12 @@ function s3buckets(){
if [ "$NUMOFLINES2" -gt 0 ]; then
notification "${NUMOFLINES} new S3 buckets found" info
fi
+
+ if [ "$BBRF_CONNECTION" = true ]; then
+ cat subdomains/cloud_assets.txt | grep -Eo 'https?://[^ ]+' | sed 's/[ \t]*$//' | bbrf url add - -t cloud_assets:true
+ cat subdomains/s3buckets.txt | cut -d'|' -f1 | sed 's/[ \t]*$//' | bbrf domain update - -t s3bucket:true
+ fi
+
end_func "Results are saved in subdomains/s3buckets.txt and subdomains/cloud_assets.txt" ${FUNCNAME[0]}
else
if [ "$S3BUCKETS" = false ]; then
@@ -618,10 +635,15 @@ function webprobe_simple(){
if [ -s ".tmp/probed_tmp_scrap.txt" ]; then
mv .tmp/probed_tmp_scrap.txt .tmp/probed_tmp.txt
else
- axiom-scan subdomains/subdomains.txt -m httpx -follow-host-redirects -random-agent -threads $HTTPX_THREADS -status-code -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color -o .tmp/probed_tmp_.txt 2>>"$LOGFILE" &>/dev/null
- [ -s ".tmp/probed_tmp_.txt" ] && cat .tmp/probed_tmp_.txt | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp.txt
+ axiom-scan subdomains/subdomains.txt -m httpx -follow-host-redirects -random-agent -threads $HTTPX_THREADS -status-code -timeout $HTTPX_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -no-color -o .tmp/probed_tmp_.txt 2>>"$LOGFILE" &>/dev/null
+ if [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ [ -s ".tmp/probed_tmp_.txt" ] && cat .tmp/probed_tmp_.txt | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_tmp.txt
+ else
+ [ -s ".tmp/probed_tmp_.txt" ] && cat .tmp/probed_tmp_.txt | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | anew -q .tmp/probed_tmp.txt
+ fi
fi
if [ -s ".tmp/probed_tmp.txt" ]; then
+ cat .tmp/web_full_info.txt | anew -q webs/web_full_info.txt
deleteOutScoped $outOfScope_file .tmp/probed_tmp.txt
NUMOFLINES=$(cat .tmp/probed_tmp.txt 2>>"$LOGFILE" | anew webs/webs.txt | wc -l)
end_subfunc "${NUMOFLINES} new websites resolved" ${FUNCNAME[0]}
@@ -629,6 +651,9 @@ function webprobe_simple(){
notification "Sending websites to proxy" info
ffuf -mc all -fc 404 -w webs/webs.txt -u FUZZ -replay-proxy $proxy_url 2>>"$LOGFILE" &>/dev/null
fi
+ if [ "$BBRF_CONNECTION" = true ]; then
+ cat webs/webs.txt | bbrf url add -
+ fi
else
end_subfunc "No new websites to probe" ${FUNCNAME[0]}
fi
@@ -653,13 +678,14 @@ function webprobe_full(){
fi
fi
if [ -s ".tmp/nmap_uncommonweb.txt" ]; then
- axiom-scan .tmp/nmap_uncommonweb.txt -m httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_UNCOMMONPORTS_THREADS -timeout $HTTPX_UNCOMMONPORTS_TIMEOUT -silent -retries 2 -no-color -o .tmp/probed_uncommon_ports_tmp_.txt 2>>"$LOGFILE" &>/dev/null
+ axiom-scan .tmp/nmap_uncommonweb.txt -m httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_UNCOMMONPORTS_THREADS -timeout $HTTPX_UNCOMMONPORTS_TIMEOUT -silent -retries 2 -title -web-server -tech-detect -no-color -o .tmp/probed_uncommon_ports_tmp_.txt 2>>"$LOGFILE" &>/dev/null
if [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
- [ -s ".tmp/probed_uncommon_ports_tmp_.txt" ] && cat .tmp/probed_uncommon_ports_tmp_.txt | cut -d ' ' -f1 | anew -q .tmp/probed_uncommon_ports_tmp.txt
+ [ -s ".tmp/probed_uncommon_ports_tmp_.txt" ] && cat .tmp/probed_uncommon_ports_tmp_.txt | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | anew -q .tmp/probed_uncommon_ports_tmp.txt
else
- [ -s ".tmp/probed_uncommon_ports_tmp_.txt" ] && cat .tmp/probed_uncommon_ports_tmp_.txt | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_uncommon_ports_tmp.txt
+ [ -s ".tmp/probed_uncommon_ports_tmp_.txt" ] && cat .tmp/probed_uncommon_ports_tmp_.txt | anew .tmp/web_full_info.txt | cut -d ' ' -f1 | grep ".$domain$" | anew -q .tmp/probed_uncommon_ports_tmp.txt
fi
fi
+ cat .tmp/web_full_info_uncommon.txt | anew -q webs/web_full_info_uncommon.txt
NUMOFLINES=$(cat .tmp/probed_uncommon_ports_tmp.txt 2>>"$LOGFILE" | anew webs/webs_uncommon_ports.txt | wc -l)
notification "Uncommon web ports: ${NUMOFLINES} new websites" good
[ -s "webs/webs_uncommon_ports.txt" ] && cat webs/webs_uncommon_ports.txt
@@ -669,6 +695,9 @@ function webprobe_full(){
notification "Sending websites uncommon ports to proxy" info
ffuf -mc all -fc 404 -w webs/webs_uncommon_ports.txt -u FUZZ -replay-proxy $proxy_url 2>>"$LOGFILE" &>/dev/null
fi
+ if [ "$BBRF_CONNECTION" = true ]; then
+ cat webs/webs_uncommon_ports.txt | bbrf url add -
+ fi
else
if [ "$WEBPROBEFULL" = false ]; then
printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
@@ -746,6 +775,9 @@ function portscan(){
[ -s ".tmp/ips_nowaf.txt" ] && axiom-scan .tmp/ips_nowaf.txt -m nmapx --top-ports 200 -sV -n -Pn --open --max-retries 2 -o hosts/portscan_active.gnmap 2>>"$LOGFILE" &>/dev/null
[ -s "hosts/portscan_active.gnmap" ] && cat hosts/portscan_active.gnmap | egrep -v "^#|Status: Up" | cut -d' ' -f2,4- | sed -n -e 's/Ignored.*//p' | awk '{print "Host: " $1 " Ports: " NF-1; $1=""; for(i=2; i<=NF; i++) { a=a" "$i; }; split(a,s,","); for(e in s) { split(s[e],v,"/"); printf "%-8s %s/%-7s %s\n" , v[2], v[3], v[1], v[5]}; a="" }' > hosts/portscan_active.txt 2>>"$LOGFILE" &>/dev/null
fi
+ if [ "$BBRF_CONNECTION" = true ]; then
+ [ -s "hosts/portscan_active.xml" ] && $tools/nmap-parse-output/nmap-parse-output hosts/portscan_active.xml host-ports | bbrf service add -
+ fi
[ -s "hosts/portscan_active.xml" ] && searchsploit --nmap hosts/portscan_active.xml > hosts/searchsploit.txt
end_func "Results are saved in hosts/portscan_[passive|active].txt" ${FUNCNAME[0]}
else
@@ -786,6 +818,9 @@ function waf_checks(){
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
+ if [ "$BBRF_CONNECTION" = true ]; then
+ [ -s "webs/webs_wafs.txt" ] && cat webs/webs_wafs.txt | bbrf url add - -t waf:true
+ fi
end_func "Results are saved in $domain/webs/webs_wafs.txt" ${FUNCNAME[0]}
else
end_func "No results found" ${FUNCNAME[0]}
@@ -810,15 +845,22 @@ function nuclei_check(){
[ -s "webs/webs.txt" ] && cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q .tmp/webs_nuclei.txt
if [ -s ".tmp/webs_nuclei.txt" ]; then
printf "${yellow}\n Running : Nuclei Info${reset}\n\n"
- axiom-scan .tmp/webs_nuclei.txt -m nuclei -severity info -r /home/op/lists/resolvers_trusted.txt -o nuclei_output/info.txt 2>>"$LOGFILE" &>/dev/null
+ axiom-scan .tmp/webs_nuclei.txt -m nuclei -severity info -o nuclei_output/info.txt 2>>"$LOGFILE" &>/dev/null
printf "${yellow}\n\n Running : Nuclei Low${reset}\n\n"
- axiom-scan .tmp/webs_nuclei.txt -m nuclei -severity low -r /home/op/lists/resolvers_trusted.txt -o nuclei_output/low.txt 2>>"$LOGFILE" &>/dev/null
+ axiom-scan .tmp/webs_nuclei.txt -m nuclei -severity low -o nuclei_output/low.txt 2>>"$LOGFILE" &>/dev/null
printf "${yellow}\n\n Running : Nuclei Medium${reset}\n\n"
- axiom-scan .tmp/webs_nuclei.txt -m nuclei -severity medium -r /home/op/lists/resolvers_trusted.txt -o nuclei_output/medium.txt 2>>"$LOGFILE" &>/dev/null
+ axiom-scan .tmp/webs_nuclei.txt -m nuclei -severity medium -o nuclei_output/medium.txt 2>>"$LOGFILE" &>/dev/null
printf "${yellow}\n\n Running : Nuclei High${reset}\n\n"
- axiom-scan .tmp/webs_nuclei.txt -m nuclei -severity high -r /home/op/lists/resolvers_trusted.txt -o nuclei_output/high.txt 2>>"$LOGFILE" &>/dev/null
+ axiom-scan .tmp/webs_nuclei.txt -m nuclei -severity high -o nuclei_output/high.txt 2>>"$LOGFILE" &>/dev/null
printf "${yellow}\n\n Running : Nuclei Critical${reset}\n\n"
- axiom-scan .tmp/webs_nuclei.txt -m nuclei -severity critical -r /home/op/lists/resolvers_trusted.txt -o nuclei_output/critical.txt 2>>"$LOGFILE" &>/dev/null
+ axiom-scan .tmp/webs_nuclei.txt -m nuclei -severity critical -o nuclei_output/critical.txt 2>>"$LOGFILE" &>/dev/null
+ if [ "$BBRF_CONNECTION" = true ]; then
+ [ -s "nuclei_output/info.txt" ] && cat nuclei_output/info.txt | cut -d' ' -f6 | sort -u | bbrf url add - -t nuclei:info
+ [ -s "nuclei_output/low.txt" ] && cat nuclei_output/low.txt | cut -d' ' -f6 | sort -u | bbrf url add - -t nuclei:low
+ [ -s "nuclei_output/medium.txt" ] && cat nuclei_output/medium.txt | cut -d' ' -f6 | sort -u | bbrf url add - -t nuclei:medium
+ [ -s "nuclei_output/high.txt" ] && cat nuclei_output/high.txt | cut -d' ' -f6 | sort -u | bbrf url add - -t nuclei:high
+ [ -s "nuclei_output/critical.txt" ] && cat nuclei_output/critical.txt | cut -d' ' -f6 | sort -u | bbrf url add - -t nuclei:critical
+ fi
printf "\n\n"
fi
end_func "Results are saved in $domain/nuclei_output folder" ${FUNCNAME[0]}
@@ -1005,7 +1047,7 @@ function jschecks(){
[ -s .tmp/subjslinks.txt ] && cat .tmp/subjslinks.txt | grep -iE "\.js" | anew -q js/url_extract_js.txt
printf "${yellow} Running : Resolving JS Urls 2/5${reset}\n"
[ -s "js/url_extract_js.txt" ] && axiom-scan js/url_extract_js.txt -m httpx -follow-host-redirects -random-agent -status-code -threads $HTTPX_THREADS -timeout $HTTPX_TIMEOUT -silent -retries 2 -no-color -o .tmp/js_livelinks.txt 2>>"$LOGFILE" &>/dev/null
- [ -s ".tmp/js_livelinks.txt" ] && cat .tmp/js_livelinks.txt | grep "[200]" | cut -d ' ' -f1 | anew -q js/js_livelinks.txt
+ [ -s ".tmp/js_livelinks.txt" ] && cat .tmp/js_livelinks.txt | anew .tmp/web_full_info.txt | grep "[200]" | cut -d ' ' -f1 | anew -q js/js_livelinks.txt
printf "${yellow} Running : Gathering endpoints 3/5${reset}\n"
if [ -s "js/js_livelinks.txt" ]; then
axiom-scan js/js_livelinks.txt -m linkfinder -o .tmp/js_endpoints.txt 2>>"$LOGFILE" &>/dev/null
@@ -1332,7 +1374,7 @@ function command_injection(){
start_func "Command Injection checks"
[ -s "gf/rce.txt" ] && cat gf/rce.txt | qsreplace FUZZ | anew -q .tmp/tmp_rce.txt
if [ "$DEEP" = true ] || [[ $(cat .tmp/tmp_rce.txt | wc -l) -le $DEEP_LIMIT ]]; then
- [ -s ".tmp/tmp_rce.txt" ] && python3 $tools/commix/commix.py --batch -m .tmp/tmp_rce.txt --output-dir vulns/command_injection 2>>"$LOGFILE" &>/dev/null
+ [ -s ".tmp/tmp_rce.txt" ] && python3 $tools/commix/commix.py --batch -m .tmp/tmp_rce.txt --output-dir vulns/command_injection.txt 2>>"$LOGFILE" &>/dev/null
end_func "Results are saved in vulns/command_injection folder" ${FUNCNAME[0]}
else
end_func "Skipping Command injection: Too many URLs to test, try with --deep flag" ${FUNCNAME[0]}
@@ -1351,9 +1393,13 @@ function command_injection(){
function prototype_pollution(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$PROTO_POLLUTION" = true ] ; then
start_func "Prototype Pollution checks"
- [ -s "webs/url_extract.txt" ] && ppfuzz -l webs/url_extract.txt -c $PPFUZZ_THREADS > anew -q .tmp/prototype_pollution.txt
- [ -s ".tmp/prototype_pollution.txt" ] && cat .tmp/prototype_pollution.txt | sed -e '1,8d' | sed '/^\[ERR/d' | anew -q vulns/prototype_pollution.txt
- end_func "Results are saved in vulns/prototype_pollution.txt" ${FUNCNAME[0]}
+ if [ "$DEEP" = true ] || [[ $(cat webs/url_extract.txt | wc -l) -le $DEEP_LIMIT ]]; then
+ [ -s "webs/url_extract.txt" ] && ppfuzz -l webs/url_extract.txt -c $PPFUZZ_THREADS > anew -q .tmp/prototype_pollution.txt
+ [ -s ".tmp/prototype_pollution.txt" ] && cat .tmp/prototype_pollution.txt | sed -e '1,8d' | sed '/^\[ERR/d' | anew -q vulns/prototype_pollution.txt
+ end_func "Results are saved in vulns/prototype_pollution.txt" ${FUNCNAME[0]}
+ else
+ end_func "Skipping Prototype Pollution: Too many URLs to test, try with --deep flag" ${FUNCNAME[0]}
+ fi
else
if [ "$PROTO_POLLUTION" = false ]; then
printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
@@ -1418,7 +1464,7 @@ function isAsciiText {
function output(){
mkdir -p $dir_output
- mv $dir $dir_output
+ mv $dir/* $dir_output/*
}
function notification(){
@@ -1510,7 +1556,7 @@ function resolvers_update(){
function ipcidr_target(){
if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
- echo $1 | mapcidr -silent > target_reconftw_ipcidr.txt
+ echo $1 | mapcidr -silent | anew -q target_reconftw_ipcidr.txt
if [ -s "./target_reconftw_ipcidr.txt" ]; then
[ "$REVERSE_IP" = true ] && cat ./target_reconftw_ipcidr.txt | dnsx -ptr -resp-only -silent | unfurl -u domains 2>/dev/null | sed 's/\.$//' | anew -q ./target_reconftw_ipcidr.txt
if [[ $(cat ./target_reconftw_ipcidr.txt | wc -l) -eq 1 ]]; then
@@ -1563,7 +1609,8 @@ function axiom_lauch(){
function axiom_shutdown(){
if [ "$AXIOM_FLEET_LAUNCH" = true ] && [ "$AXIOM_FLEET_SHUTDOWN" = true ] && [ -n "$AXIOM_FLEET_NAME" ]; then
- if [ "$mode" == "subs_menu" ] || [ "$mode" == "list_recon" ] || [ "$mode" == "passive" ] || [ "$mode" == "all" ]; then
+ #if [ "$mode" == "subs_menu" ] || [ "$mode" == "list_recon" ] || [ "$mode" == "passive" ] || [ "$mode" == "all" ]; then
+ if [ "$mode" == "subs_menu" ] || [ "$mode" == "passive" ] || [ "$mode" == "all" ]; then
notification "Automatic Axiom fleet shutdown is not enabled in this mode" info
return
fi
@@ -1647,6 +1694,13 @@ function start(){
VT_API_KEY=$findomain_virustotal_token
fi
+ if [ "$BBRF_CONNECTION" = true ]; then
+ program_bbrf=${echo $domain | awk -F. '{print $1"_"$2}'}
+ bbrf new ${program_bbrf}
+ bbrf use ${program_bbrf}
+ bbrf inscope add '*.${domain}'
+ fi
+
printf "\n"
printf "${bred} Target: ${domain}\n\n"
}
@@ -1808,9 +1862,9 @@ function recon(){
axiom_selected
subdomains_full
- subtakeover
- s3buckets
webprobe_full
+ s3buckets
+ subtakeover
screenshot
portscan
waf_checks
@@ -1905,8 +1959,8 @@ function multi_recon(){
called_fn_dir=$dir/.called_fn
cd "$dir" || { echo "Failed to cd directory '$dir' in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
subdomains_full
- subtakeover
webprobe_full
+ subtakeover
screenshot
portscan
cloudprovider
@@ -2006,8 +2060,8 @@ function subs_menu(){
subdomains_full
webprobe_full
- screenshot
subtakeover
+ screenshot
zonetransfer
s3buckets
diff --git a/requirements.txt b/requirements.txt
index 0360c0b..3f8ec8d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -20,4 +20,5 @@ shodan
dnspython
webscreenshot
emailfinder
-requests_futures
\ No newline at end of file
+requests_futures
+bbrf
\ No newline at end of file