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

uDork and IP/CIDR full scanning

six2dezf1d6ad1d97e6
diff --git a/install.sh b/install.sh
index bfab79b..14b3f1b 100755
--- a/install.sh
+++ b/install.sh
@@ -36,7 +36,7 @@ gotools["gotator"]="go get -u -v github.com/Josue87/gotator"
gotools["mapcidr"]="GO111MODULE=on go get -v github.com/projectdiscovery/mapcidr/cmd/mapcidr"
declare -A repos
-repos["degoogle_hunter"]="six2dez/degoogle_hunter"
+repos["udork"]="m3n0sd0n4ld/uDork"
repos["pwndb"]="davidtavarez/pwndb"
repos["dnsvalidator"]="vortexau/dnsvalidator"
repos["dnsrecon"]="darkoperator/dnsrecon"
@@ -259,6 +259,7 @@ fi
eval $SUDO chmod 755 /usr/bin/findomain
eval $SUDO chmod 755 /usr/bin/gowitness
eval $SUDO chmod 755 /usr/bin/unimap
+eval $SUDO chmod +x $tools/uDork/uDork.sh
eval subfinder $DEBUG_STD
eval subfinder $DEBUG_STD
@@ -276,6 +277,7 @@ eval wget -nc -O fuzz_wordlist.txt https://raw.githubusercontent.com/six2dez/One
eval wget -O lfi_wordlist.txt https://gist.githubusercontent.com/six2dez/a89a0c7861d49bb61a09822d272d5395/raw $DEBUG_STD
eval wget -O ssti_wordlist.txt https://gist.githubusercontent.com/six2dez/ab5277b11da7369bf4e9db72b49ad3c1/raw $DEBUG_STD
eval wget -O headers_inject.txt https://gist.github.com/six2dez/d62ab8f8ffd28e1c206d401081d977ae/raw $DEBUG_STD
+eval wget -O custom_udork.txt https://gist.githubusercontent.com/six2dez/7245cad74f2da5824080e0cb6bdaac22/raw $DEBUG_STD
## Last check
if [ "$double_check" = "true" ]; then
@@ -320,6 +322,6 @@ eval strip -s $HOME/go/bin/* $DEBUG_STD
eval $SUDO cp $HOME/go/bin/* /usr/bin/ $DEBUG_STD
-printf "${yellow} Remember set your api keys:\n - amass (~/.config/amass/config.ini)\n - subfinder (~/.config/subfinder/config.yaml)\n - GitHub (~/Tools/.github_tokens)\n - SHODAN (SHODAN_API_KEY in reconftw.cfg)\n - SSRF Server (COLLAB_SERVER in reconftw.cfg) \n - Blind XSS Server (XSS_SERVER in reconftw.cfg) \n - notify (~/.config/notify/notify.conf) \n - theHarvester (~/Tools/theHarvester/api-keys.yml)\n - H8mail (~/Tools/h8mail_config.ini)\n\n${reset}"
+printf "${yellow} Remember set your api keys:\n - amass (~/.config/amass/config.ini)\n - subfinder (~/.config/subfinder/config.yaml)\n - GitHub (~/Tools/.github_tokens)\n - SHODAN (SHODAN_API_KEY in reconftw.cfg)\n - SSRF Server (COLLAB_SERVER in reconftw.cfg) \n - Blind XSS Server (XSS_SERVER in reconftw.cfg) \n - notify (~/.config/notify/notify.conf) \n - theHarvester (~/Tools/theHarvester/api-keys.yml)\n - H8mail (~/Tools/h8mail_config.ini)\n - uDork FB cookie (UDORK_COOKIE in reconftw.cfg)\n\n${reset}"
printf "${bgreen} Finished!${reset}\n\n"
printf "\n\n${bgreen}#######################################################################${reset}\n"
diff --git a/reconftw.cfg b/reconftw.cfg
index 6cd343c..cca2be6 100644
--- a/reconftw.cfg
+++ b/reconftw.cfg
@@ -23,6 +23,7 @@ AMASS_CONFIG=~/.config/amass/config.ini
GITHUB_TOKENS=${tools}/.github_tokens
# APIs/TOKENS - Uncomment the lines you set removing the '#' at the beginning of the line
+#UDORK_COOKIE="c_user=XXXXXXXXXX; xs=XXXXXXXXXXXXXX"
#SHODAN_API_KEY="XXXXXXXXXXXXX"
#XSS_SERVER="XXXXXXXXXXXXXXXXX"
#COLLAB_SERVER="XXXXXXXXXXXXXXXXX"
@@ -57,6 +58,7 @@ SUBRECURSIVE=true
SUB_RECURSIVE_PASSIVE=false # Uses a lot of API keys queries
ZONETRANSFER=true
S3BUCKETS=true
+REVERSE_IP=false
# Web detection
WEBPROBESIMPLE=true
@@ -80,7 +82,6 @@ URL_CHECK=true
URL_GF=true
URL_EXT=true
JSCHECKS=true
-PARAMS=true
FUZZ=true
CMS_SCANNER=true
WORDLIST=true
@@ -152,11 +153,11 @@ resolvers_trusted=${tools}/resolvers_trusted.txt
# Will not start a new fleet if one exist w/ same name and size (or larger)
AXIOM_FLEET_LAUNCH=false
AXIOM_FLEET_NAME="reconFTW"
-AXIOM_FLEET_COUNT=5
-AXIOM_FLEET_REGIONS=""
+AXIOM_FLEET_COUNT=10
+AXIOM_FLEET_REGIONS="eu-central"
AXIOM_FLEET_SHUTDOWN=true
# This is a script on your reconftw host that might prep things your way...
-#AXIOM_POST_START="$HOME/bin/yourScript"
+#AXIOM_POST_START="~/Tools/axiom_config.sh"
# TERM COLORS
bred='\033[1;31m'
diff --git a/reconftw.sh b/reconftw.sh
index 597c82d..02a3082 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/degoogle_hunter/degoogle.py" ] || { printf "${bred} [*] degoogle [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;}
@@ -123,8 +123,11 @@ function tools_installed(){
function google_dorks(){
if [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] && [ "$GOOGLE_DORKS" = true ] && [ "$OSINT" = true ]; then
start_func "Google Dorks in process"
- $tools/degoogle_hunter/degoogle_hunter.sh $domain | tee osint/dorks.txt
- sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" osint/dorks.txt
+ eval sed -i "s/^cookies=\"c_user=HEREYOUCOOKIE; xs=HEREYOUCOOKIE;\"/cookies=\"${UDORK_COOKIE}\"/" $tools/uDork/uDork.sh 2>>"$LOGFILE" &>/dev/null
+ cd "$tools/uDork" || { echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
+ ./uDork.sh $domain -f $tools/custom_udork.txt -o $dir/osint/dorks.txt &> /dev/null
+ [ -s "$dir/osint/dorks.txt" ] && sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" $dir/osint/dorks.txt 2>>"$LOGFILE" &>/dev/null
+ cd "$dir" || { echo "Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
end_func "Results are saved in $domain/osint/dorks.txt" ${FUNCNAME[0]}
else
if [ "$GOOGLE_DORKS" = false ] || [ "$OSINT" = false ]; then
@@ -251,7 +254,6 @@ function domain_info(){
fi
}
-
###############################################################################################################
############################################### SUBDOMAINS ####################################################
###############################################################################################################
@@ -276,7 +278,9 @@ function subdomains_full(){
sub_dns
sub_scraping
sub_analytics
- else echo $domain | anew -q subdomains/subdomains.txt
+ else
+ notification "IP/CIDR detected, subdomains search skipped" info
+ echo $domain | anew -q subdomains/subdomains.txt
fi
webprobe_simple
if [ -s "subdomains/subdomains.txt" ]; then
@@ -625,8 +629,14 @@ function webprobe_simple(){
function webprobe_full(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$WEBPROBEFULL" = true ]; then
start_func "Http probing non standard ports"
-
- [ -s "subdomains/subdomains.txt" ] && sudo unimap --fast-scan -f subdomains/subdomains.txt --ports $UNCOMMON_PORTS_WEB -q -k --url-output 2>>"$LOGFILE" | anew -q .tmp/nmap_uncommonweb.txt
+ if [ -s "subdomains/subdomains.txt" ]; then
+ if [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ sudo nmap -iL subdomains/subdomains.txt -p $UNCOMMON_PORTS_WEB -oG .tmp/uncommon_nmap.gnmap 2>>"$LOGFILE" &>/dev/null
+ cat .tmp/uncommon_nmap.gnmap | egrep -v "^#|Status: Up" | cut -d' ' -f2,4- | grep "open" | sed -e 's/\/.*$//g' | sed -e "s/ /:/g" | sort -u | anew -q .tmp/nmap_uncommonweb.txt
+ else
+ sudo unimap --fast-scan -f subdomains/subdomains.txt --ports $UNCOMMON_PORTS_WEB -q -k --url-output 2>>"$LOGFILE" | anew -q .tmp/nmap_uncommonweb.txt
+ fi
+ 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
@@ -702,7 +712,7 @@ function portscan(){
if ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
[ -s "subdomains/subdomains.txt" ] && resolveDomains -d subdomains/subdomains.txt -t $RESOLVE_DOMAINS_THREADS 2>>"$LOGFILE" | anew -q .tmp/subs_ips.txt
[ -s ".tmp/subs_ips.txt" ] && awk '{ print $2 " " $1}' .tmp/subs_ips.txt | sort -k2 -n | anew -q hosts/subs_ips_vhosts.txt
- [ -s "hosts/subs_ips_vhosts.txt" ] && cat hosts/subs_ips_vhosts.txt | 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
+ [ -s "hosts/subs_ips_vhosts.txt" ] && cat hosts/subs_ips_vhosts.txt | 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
else echo $domain | anew -q hosts/ips.txt
fi
[ -s "hosts/ips.txt" ] && cat hosts/ips.txt | 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.txt
@@ -1400,7 +1410,6 @@ function notification(){
}
function sendToNotify {
-
if [[ -z "$1" ]]; then
printf "\n${yellow} no file provided to send ${reset}\n"
else
@@ -1468,7 +1477,7 @@ function ipcidr_target(){
if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
echo $1 | mapcidr -silent > target_reconftw_ipcidr.txt
if [ -s "./target_reconftw_ipcidr.txt" ]; then
- cat ./target_reconftw_ipcidr.txt | dnsx -ptr -resp-only -silent | unfurl -u domains 2>/dev/null | sed 's/\.$//' | anew -q ./target_reconftw_ipcidr.txt
+ [ "$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
domain=$(cat ./target_reconftw_ipcidr.txt)
elif [[ $(cat ./target_reconftw_ipcidr.txt | wc -l) -gt 1 ]]; then
@@ -1791,7 +1800,7 @@ function multi_recon(){
POSINLIST=$(eval grep -nrE "^$domain$" "$flist" | cut -f1 -d':')
printf "\n${yellow} $domain is $POSINLIST of $LISTTOTAL${reset}\n"
fi
- printf "${reset}#######################################################################\n\n"
+ printf "${bgreen}#######################################################################${reset}\n"
done
cd "$workdir" || { echo "Failed to cd directory '$workdir' in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
@@ -1835,7 +1844,7 @@ function multi_recon(){
POSINLIST=$(eval grep -nrE "^$domain$" "$flist" | cut -f1 -d':')
printf "\n${yellow} $domain is $POSINLIST of $LISTTOTAL${reset}\n"
fi
- printf "${reset}#######################################################################\n\n"
+ printf "${bgreen}#######################################################################${reset}\n"
done
cloudprovider
for domain in $targets; do
@@ -1856,7 +1865,7 @@ function multi_recon(){
POSINLIST=$(eval grep -nrE "^$domain$" "$flist" | cut -f1 -d':')
printf "\n${yellow} $domain is $POSINLIST of $LISTTOTAL${reset}\n"
fi
- printf "${reset}#######################################################################\n\n"
+ printf "${bgreen}#######################################################################${reset}\n"
done
cd "$workdir" || { echo "Failed to cd directory '$workdir' in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
dir=$workdir
diff --git a/reconftw_axiom.sh b/reconftw_axiom.sh
index bbbb4b1..375dcd0 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/degoogle_hunter/degoogle.py" ] || { printf "${bred} [*] degoogle [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;}
@@ -100,6 +100,7 @@ function tools_installed(){
type -P emailfinder &>/dev/null || { printf "${bred} [*] emailfinder [NO]${reset}\n"; allinstalled=false;}
type -P urldedupe &>/dev/null || { printf "${bred} [*] urldedupe [NO]${reset}\n"; allinstalled=false;}
type -P analyticsrelationships &>/dev/null || { printf "${bred} [*] analyticsrelationships [NO]${reset}\n"; allinstalled=false;}
+ type -P mapcidr &>/dev/null || { printf "${bred} [*] mapcidr [NO]${reset}\n"; allinstalled=false;}
type -P interactsh-client &>/dev/null || { printf "${bred} [*] interactsh-client [NO]${reset}\n"; allinstalled=false;}
type -P axiom-ls &>/dev/null || { printf "${bred} [*] axiom [NO]${reset}\n${reset}"; allinstalled=false;}
@@ -123,8 +124,11 @@ function tools_installed(){
function google_dorks(){
if [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] && [ "$GOOGLE_DORKS" = true ] && [ "$OSINT" = true ]; then
start_func "Google Dorks in process"
- $tools/degoogle_hunter/degoogle_hunter.sh $domain | tee osint/dorks.txt
- sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" osint/dorks.txt
+ eval sed -i "s/^cookies=\"c_user=HEREYOUCOOKIE; xs=HEREYOUCOOKIE;\"/cookies=\"${UDORK_COOKIE}\"/" $tools/uDork/uDork.sh 2>>"$LOGFILE" &>/dev/null
+ cd "$tools/uDork" || { echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
+ ./uDork.sh $domain -f $tools/custom_udork.txt -o $dir/osint/dorks.txt &> /dev/null
+ [ -s "$dir/osint/dorks.txt" ] && sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" $dir/osint/dorks.txt 2>>"$LOGFILE" &>/dev/null
+ cd "$dir" || { echo "Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
end_func "Results are saved in $domain/osint/dorks.txt" ${FUNCNAME[0]}
else
if [ "$GOOGLE_DORKS" = false ] || [ "$OSINT" = false ]; then
@@ -159,7 +163,7 @@ function github_dorks(){
}
function metadata(){
- if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$METADATA" = true ] && [ "$OSINT" = true ]; then
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$METADATA" = true ] && [ "$OSINT" = true ] && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
start_func "Scanning metadata in public files"
metafinder -d "$domain" -l $METAFINDER_LIMIT -o osint -go -bi -ba 2>>"$LOGFILE" &>/dev/null
mv "osint/${domain}/"*".txt" "osint/" 2>>"$LOGFILE"
@@ -175,7 +179,7 @@ function metadata(){
}
function emails(){
- if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$EMAILS" = true ] && [ "$OSINT" = true ]; then
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$EMAILS" = true ] && [ "$OSINT" = true ] && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
start_func "Searching emails/users/passwords leaks"
emailfinder -d $domain 2>>"$LOGFILE" | anew -q .tmp/emailfinder.txt
[ -s ".tmp/emailfinder.txt" ] && cat .tmp/emailfinder.txt | awk 'matched; /^-----------------$/ { matched = 1 }' | anew -q osint/emails.txt
@@ -251,7 +255,6 @@ function domain_info(){
fi
}
-
###############################################################################################################
############################################### SUBDOMAINS ####################################################
###############################################################################################################
@@ -266,15 +269,20 @@ function subdomains_full(){
resolvers_update
- sub_passive
- sub_crt
- sub_active
- sub_brute
- sub_permut
- sub_recursive
- sub_dns
- sub_scraping
- sub_analytics
+ if ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ sub_passive
+ sub_crt
+ sub_active
+ sub_brute
+ sub_permut
+ sub_recursive
+ sub_dns
+ sub_scraping
+ sub_analytics
+ else
+ notification "IP/CIDR detected, subdomains search skipped" info
+ echo $domain | anew -q subdomains/subdomains.txt
+ fi
webprobe_simple
if [ -s "subdomains/subdomains.txt" ]; then
deleteOutScoped $outOfScope_file subdomains/subdomains.txt
@@ -554,7 +562,7 @@ function subtakeover(){
}
function zonetransfer(){
- if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$ZONETRANSFER" = true ]; then
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$ZONETRANSFER" = true ] && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
start_func "Zone transfer check"
python3 $tools/dnsrecon/dnsrecon.py -d $domain -a -j subdomains/zonetransfer.json 2>>"$LOGFILE" &>/dev/null
if [ -s "subdomains/zonetransfer.json" ]; then
@@ -571,7 +579,7 @@ function zonetransfer(){
}
function s3buckets(){
- if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$S3BUCKETS" = true ]; then
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$S3BUCKETS" = true ] && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
start_func "AWS S3 buckets search"
# S3Scanner
@@ -635,11 +643,22 @@ function webprobe_simple(){
function webprobe_full(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$WEBPROBEFULL" = true ]; then
start_func "Http probing non standard ports"
-
- axiom-scan subdomains/subdomains.txt -m unimap --fast-scan --ports $UNCOMMON_PORTS_WEB -q -k --url-output -o .tmp/nmap_uncommonweb.txt 2>>"$LOGFILE" &>/dev/null
- [ -s ".tmp/nmap_uncommonweb.txt" ] && 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
- [ -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
-
+ if [ -s "subdomains/subdomains.txt" ]; then
+ if [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ sudo nmap -iL subdomains/subdomains.txt -p $UNCOMMON_PORTS_WEB -oG .tmp/uncommon_nmap.gnmap 2>>"$LOGFILE" &>/dev/null
+ cat .tmp/uncommon_nmap.gnmap | egrep -v "^#|Status: Up" | cut -d' ' -f2,4- | grep "open" | sed -e 's/\/.*$//g' | sed -e "s/ /:/g" | sort -u | anew -q .tmp/nmap_uncommonweb.txt
+ else
+ axiom-scan subdomains/subdomains.txt -m unimap --fast-scan --ports $UNCOMMON_PORTS_WEB -q -k --url-output -o .tmp/nmap_uncommonweb.txt 2>>"$LOGFILE" &>/dev/null
+ 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
+ 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
+ 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
+ fi
+ fi
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
@@ -679,7 +698,7 @@ function screenshot(){
###############################################################################################################
function favicon(){
- if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$FAVICON" = true ]; then
+ if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$FAVICON" = true ] && ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
start_func "Favicon Ip Lookup"
cd "$tools/fav-up" || { echo "Failed to cd to $dir in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
python3 favUp.py -w "$domain" -sc -o favicontest.json 2>>"$LOGFILE" &>/dev/null
@@ -705,8 +724,12 @@ function portscan(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$PORTSCANNER" = true ]; then
start_func "Port scan"
#interlace -tL subdomains/subdomains.txt -threads 50 -c 'echo "_target_ $(dig +short a _target_ | tail -n1)" | anew -q _output_' -o .tmp/subs_ips.txt
- [ -s "subdomains/subdomains.txt" ] && resolveDomains -d subdomains/subdomains.txt -t $RESOLVE_DOMAINS_THREADS 2>>"$LOGFILE" | anew -q .tmp/subs_ips.txt
- [ -s ".tmp/subs_ips.txt" ] && awk '{ print $2 " " $1}' .tmp/subs_ips.txt | sort -k2 -n | anew -q hosts/subs_ips_vhosts.txt
+ if ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ [ -s "subdomains/subdomains.txt" ] && resolveDomains -d subdomains/subdomains.txt -t $RESOLVE_DOMAINS_THREADS 2>>"$LOGFILE" | anew -q .tmp/subs_ips.txt
+ [ -s ".tmp/subs_ips.txt" ] && awk '{ print $2 " " $1}' .tmp/subs_ips.txt | sort -k2 -n | anew -q hosts/subs_ips_vhosts.txt
+ [ -s "hosts/subs_ips_vhosts.txt" ] && cat hosts/subs_ips_vhosts.txt | 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
+ else echo $domain | anew -q hosts/ips.txt
+ fi
[ -s "hosts/subs_ips_vhosts.txt" ] && cat hosts/subs_ips_vhosts.txt | 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
[ -s "hosts/ips.txt" ] && axiom-scan hosts/ips.txt -m cf-check -o .tmp/ips_nowaf_.txt 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/ips_nowaf_.txt" ] && cat .tmp/ips_nowaf_.txt | 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.txt
@@ -877,12 +900,14 @@ function urlchecks(){
start_func "URL Extraction"
mkdir -p js
if [ -s "webs/webs.txt" ]; then
- axiom-scan webs/webs.txt -m waybackurls -o .tmp/url_extract_way_tmp.txt 2>>"$LOGFILE" &>/dev/null
- [ -s ".tmp/url_extract_way_tmp.txt" ] && cat .tmp/url_extract_way_tmp.txt | anew -q .tmp/url_extract_tmp.txt
- axiom-scan webs/webs.txt -m gau -o .tmp/url_extract_gau_tmp.txt 2>>"$LOGFILE" &>/dev/null
- [ -s ".tmp/url_extract_gau_tmp.txt" ] && cat .tmp/url_extract_gau_tmp.txt | anew -q .tmp/url_extract_tmp.txt
- #axiom-scan webs/webs.txt -m nuclei -w /home/op/recon/nuclei/headless/extract-urls.yaml -o .tmp/url_extract_nuclei_tmp.txt 2>>"$LOGFILE" &>/dev/null
- #[ -s ".tmp/url_extract_nuclei_tmp.txt" ] && cat .tmp/url_extract_nuclei_tmp.txt | grep "^http" | anew -q .tmp/url_extract_tmp.txt
+ if ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ axiom-scan webs/webs.txt -m waybackurls -o .tmp/url_extract_way_tmp.txt 2>>"$LOGFILE" &>/dev/null
+ [ -s ".tmp/url_extract_way_tmp.txt" ] && cat .tmp/url_extract_way_tmp.txt | anew -q .tmp/url_extract_tmp.txt
+ axiom-scan webs/webs.txt -m gau -o .tmp/url_extract_gau_tmp.txt 2>>"$LOGFILE" &>/dev/null
+ [ -s ".tmp/url_extract_gau_tmp.txt" ] && cat .tmp/url_extract_gau_tmp.txt | anew -q .tmp/url_extract_tmp.txt
+ #axiom-scan webs/webs.txt -m nuclei -w /home/op/recon/nuclei/headless/extract-urls.yaml -o .tmp/url_extract_nuclei_tmp.txt 2>>"$LOGFILE" &>/dev/null
+ #[ -s ".tmp/url_extract_nuclei_tmp.txt" ] && cat .tmp/url_extract_nuclei_tmp.txt | grep "^http" | anew -q .tmp/url_extract_tmp.txt
+ fi
diff_webs=$(diff <(sort -u .tmp/probed_tmp.txt) <(sort -u webs/webs.txt) | wc -l)
if [ $diff_webs != "0" ] || [ ! -s ".tmp/gospider.txt" ]; then
if [ "$DEEP" = true ]; then
@@ -945,13 +970,14 @@ function url_gf(){
function url_ext(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$URL_EXT" = true ]; then
+ start_func "Urls by extension"
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.txt
+ #echo "" > webs/url_extract.txt
for t in "${ext[@]}"; do
NUMOFLINES=$(cat .tmp/url_extract_tmp.txt | grep -Ei "\.(${t})($|\/|\?)" | sort -u | wc -l)
if [[ ${NUMOFLINES} -gt 0 ]]; then
echo -e "\n############################\n + ${t} + \n############################\n" >> webs/urls_by_ext.txt
- [ -s ".tmp/url_extract_tmp.txt" ] && cat .tmp/url_extract_tmp.txt | grep -Ei "\.(${t})($|\/|\?)" | anew -q webs/urls_by_ext.txt
+ [ -s ".tmp/url_extract_tmp.txt" ] && cat .tmp/url_extract_tmp.txt | grep -Ei "\.(${t})($|\/|\?)" >> webs/urls_by_ext.txt
fi
done
end_func "Results are saved in $domain/webs/urls_by_ext.txt" ${FUNCNAME[0]}
@@ -1405,7 +1431,6 @@ function notification(){
}
function sendToNotify {
-
if [[ -z "$1" ]]; then
printf "\n${yellow} no file provided to send ${reset}\n"
else
@@ -1469,21 +1494,21 @@ function resolvers_update(){
fi
}
-function ipcidr_detection(){
- if [[ $1 =~ /[0-9]+$ ]]; then
- prips $1 | dnsx -ptr -resp-only -silent
- else
- echo $1 | dnsx -ptr -resp-only -silent
- fi
-}
-
function ipcidr_target(){
if [[ $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
- ipcidr_detection $1 | 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
- domain=$(cat ./target_reconftw_ipcidr.txt)
- elif [[ $(cat ./target_reconftw_ipcidr.txt | wc -l) -gt 1 ]]; then
- list=${PWD}/target_reconftw_ipcidr.txt
+ echo $1 | mapcidr -silent > 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
+ domain=$(cat ./target_reconftw_ipcidr.txt)
+ elif [[ $(cat ./target_reconftw_ipcidr.txt | wc -l) -gt 1 ]]; then
+ unset domain
+ list=${PWD}/target_reconftw_ipcidr.txt
+ fi
+ fi
+ if [ -n "$2" ]; then
+ cat $list | anew -q $2
+ sed -i '/\/[0-9]*$/d' $2
fi
fi
}
@@ -1565,7 +1590,8 @@ function start(){
printf "${bgreen}#######################################################################${reset}\n"
tools_installed
- [[ -n "$domain" ]] && ipcidr_target $domain
+ #[[ -n "$domain" ]] && ipcidr_target $domain
+
if [ -z "$domain" ]; then
if [ -n "$list" ]; then
@@ -1575,7 +1601,7 @@ function start(){
called_fn_dir="$dir"/.called_fn
fi
if [[ "$list" = /* ]]; then
- install -D $list "$dir"/webs/webs.txt
+ install -D "$list" "$dir"/webs/webs.txt
else
install -D "$SCRIPTPATH"/"$list" "$dir"/webs/webs.txt
fi
@@ -1721,7 +1747,7 @@ function multi_osint(){
NOTIFY=""
fi
- [[ -n "$domain" ]] && ipcidr_target $domain
+ #[[ -n "$domain" ]] && ipcidr_target $domain
if [ -s "$list" ]; then
sed -i 's/\r$//' $list
@@ -1788,6 +1814,7 @@ function recon(){
cms_scanner
url_gf
wordlist_gen
+ url_ext
}
function multi_recon(){
@@ -1801,7 +1828,7 @@ function multi_recon(){
NOTIFY=""
fi
- [[ -n "$domain" ]] && ipcidr_target $domain
+ #[[ -n "$domain" ]] && ipcidr_target $domain
if [ -s "$list" ]; then
sed -i 's/\r$//' $list
@@ -1878,7 +1905,7 @@ function multi_recon(){
POSINLIST=$(eval grep -nrE "^$domain$" "$flist" | cut -f1 -d':')
printf "\n${yellow} $domain is $POSINLIST of $LISTTOTAL${reset}\n"
fi
- printf "${reset}#######################################################################\n\n"
+ printf "${bgreen}#######################################################################${reset}\n"
done
cd "$workdir" || { echo "Failed to cd directory '$workdir' in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
@@ -1922,7 +1949,7 @@ function multi_recon(){
POSINLIST=$(eval grep -nrE "^$domain$" "$flist" | cut -f1 -d':')
printf "\n${yellow} $domain is $POSINLIST of $LISTTOTAL${reset}\n"
fi
- printf "${reset}#######################################################################\n\n"
+ printf "${bgreen}#######################################################################${reset}\n"
done
axiom_shutdown
cloudprovider
@@ -1934,6 +1961,7 @@ function multi_recon(){
cms_scanner
url_gf
wordlist_gen
+ url_ext
currently=$(date +"%H:%M:%S")
loopend=$(date +%s)
getElapsedTime $loopstart $loopend
@@ -1943,7 +1971,7 @@ function multi_recon(){
POSINLIST=$(eval grep -nrE "^$domain$" "$flist" | cut -f1 -d':')
printf "\n${yellow} $domain is $POSINLIST of $LISTTOTAL${reset}\n"
fi
- printf "${reset}#######################################################################\n\n"
+ printf "${bgreen}#######################################################################${reset}\n"
done
cd "$workdir" || { echo "Failed to cd directory '$workdir' in ${FUNCNAME[0]} @ line ${LINENO}"; exit 1; }
dir=$workdir
@@ -1980,6 +2008,7 @@ function webs_menu(){
jschecks
url_gf
wordlist_gen
+ url_ext
vulns
end
}
@@ -2041,6 +2070,7 @@ while true; do
case "$1" in
'-d'|'--domain')
domain=$2
+ ipcidr_target $2
shift 2
continue
;;
@@ -2050,7 +2080,10 @@ while true; do
continue
;;
'-l'|'--list')
- list=$2
+ list=$2
+ for domain in $(cat $list); do
+ ipcidr_target $domain $list
+ done
shift 2
continue
;;
@@ -2108,7 +2141,7 @@ while true; do
continue
;;
'-f')
- config_file=$2
+ config_file=$2
shift 2
continue
;;