Skip to content

Commit

Permalink
cf-check and clouddetect removed, ipcdn
Browse files Browse the repository at this point in the history
  • Loading branch information
six2dez committed Apr 8, 2022
1 parent 33860b5 commit 314b3b5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 32 deletions.
3 changes: 1 addition & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ gotools["qsreplace"]="go install -v github.com/tomnomnom/qsreplace@latest"
gotools["Amass"]="go install -v github.com/OWASP/Amass/v3/...@master"
gotools["ffuf"]="go install -v github.com/ffuf/ffuf@latest"
gotools["github-subdomains"]="go install -v github.com/gwen001/github-subdomains@latest"
gotools["cf-check"]="go install -v github.com/dwisiswant0/cf-check@latest"
gotools["waybackurls"]="go install -v github.com/tomnomnom/waybackurls@latest"
gotools["nuclei"]="go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest"
gotools["anew"]="go install -v github.com/tomnomnom/anew@latest"
Expand All @@ -68,7 +67,7 @@ gotools["analyticsrelationships"]="go install -v github.com/Josue87/analyticsrel
gotools["gotator"]="go install -v github.com/Josue87/gotator@latest"
gotools["roboxtractor"]="go install -v github.com/Josue87/roboxtractor@latest"
gotools["mapcidr"]="go install -v github.com/projectdiscovery/mapcidr/cmd/mapcidr@latest"
gotools["clouddetect"]="go install -v github.com/99designs/clouddetect/cli/clouddetect@latest"
gotools["ipcdn"]="go install -v github.com/six2dez/ipcdn/@latest"
gotools["dnstake"]="go install -v github.com/pwnesia/dnstake/cmd/dnstake@latest"
gotools["gowitness"]="go install -v github.com/sensepost/gowitness@latest"
gotools["cero"]="go install -v github.com/glebarez/cero@latest"
Expand Down
2 changes: 1 addition & 1 deletion reconftw.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ FAVICON=true
PORTSCANNER=true
PORTSCAN_PASSIVE=true
PORTSCAN_ACTIVE=true
CLOUD_IP=true
CDN_IP=true

# Web analysis
WAF_DETECTION=true
Expand Down
47 changes: 18 additions & 29 deletions reconftw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ function tools_installed(){
type -P gau &>/dev/null || { printf "${bred} [*] gau [NO]${reset}\n"; allinstalled=false;}
type -P dnsx &>/dev/null || { printf "${bred} [*] dnsx [NO]${reset}\n"; allinstalled=false;}
type -P gotator &>/dev/null || { printf "${bred} [*] gotator [NO]${reset}\n"; allinstalled=false;}
type -P cf-check &>/dev/null || { printf "${bred} [*] Cf-check [NO]${reset}\n"; allinstalled=false;}
type -P nuclei &>/dev/null || { printf "${bred} [*] Nuclei [NO]${reset}\n"; allinstalled=false;}
[ -d ~/nuclei-templates ] || { printf "${bred} [*] Nuclei templates [NO]${reset}\n"; allinstalled=false;}
type -P gf &>/dev/null || { printf "${bred} [*] Gf [NO]${reset}\n"; allinstalled=false;}
Expand All @@ -96,7 +95,7 @@ function tools_installed(){
type -P mapcidr &>/dev/null || { printf "${bred} [*] mapcidr [NO]${reset}\n"; allinstalled=false;}
type -P ppfuzz &>/dev/null || { printf "${bred} [*] ppfuzz [NO]${reset}\n"; allinstalled=false;}
type -P searchsploit &>/dev/null || { printf "${bred} [*] searchsploit [NO]${reset}\n"; allinstalled=false;}
type -P clouddetect &>/dev/null || { printf "${bred} [*] clouddetect [NO]${reset}\n"; allinstalled=false;}
type -P ipcdn &>/dev/null || { printf "${bred} [*] ipcdn [NO]${reset}\n"; allinstalled=false;}
type -P interactsh-client &>/dev/null || { printf "${bred} [*] interactsh-client [NO]${reset}\n"; allinstalled=false;}
type -P uro &>/dev/null || { printf "${bred} [*] uro [NO]${reset}\n"; allinstalled=false;}
type -P cero &>/dev/null || { printf "${bred} [*] cero [NO]${reset}\n"; allinstalled=false;}
Expand Down Expand Up @@ -908,24 +907,18 @@ function portscan(){
[ -s "hosts/subs_ips_vhosts.txt" ] && cat hosts/subs_ips_vhosts.txt | cut -d ' ' -f1 | grep -aEiv "^(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 | grep -aEiv "^(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
fi
if [ ! "$AXIOM" = true ]; then
[ -s "hosts/ips.txt" ] && cat hosts/ips.txt | cf-check | grep -aEiv "^(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
else
[ -s "hosts/subs_ips_vhosts.txt" ] && cat hosts/subs_ips_vhosts.txt | cut -d ' ' -f1 | grep -aEiv "^(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 $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/ips_nowaf_.txt" ] && cat .tmp/ips_nowaf_.txt | grep -aEiv "^(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
fi
printf "${bblue}\n Resolved IP addresses (No WAF) ${reset}\n\n";
[ -s ".tmp/ips_nowaf.txt" ] && cat .tmp/ips_nowaf.txt | sort
[ -s "hosts/ips.txt" ] && cat hosts/ips.txt | ipcdn -m not | grep -aEiv "^(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_nocdn.txt
printf "${bblue}\n Resolved IP addresses (No CDN) ${reset}\n\n";
[ -s ".tmp/ips_nocdn.txt" ] && cat .tmp/ips_nocdn.txt | sort
printf "${bblue}\n Scanning ports... ${reset}\n\n";
if [ "$PORTSCAN_PASSIVE" = true ] && [ ! -f "hosts/portscan_passive.txt" ] && [ -s "hosts/ips.txt" ] ; then
nrich hosts/ips.txt > hosts/portscan_passive.txt
if [ "$PORTSCAN_PASSIVE" = true ] && [ ! -f "hosts/portscan_passive.txt" ] && [ -s ".tmp/ips_nocdn.txt" ] ; then
nrich .tmp/ips_nocdn.txt > hosts/portscan_passive.txt
fi
if [ "$PORTSCAN_ACTIVE" = true ]; then
if [ ! "$AXIOM" = 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
[ -s ".tmp/ips_nocdn.txt" ] && $SUDO nmap --top-ports 200 -sV -n --max-retries 2 -Pn --open -iL .tmp/ips_nocdn.txt -oA hosts/portscan_active 2>>"$LOGFILE" &>/dev/null
else
[ -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 $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" &>/dev/null
[ -s ".tmp/ips_nocdn.txt" ] && axiom-scan .tmp/ips_nocdn.txt -m nmapx --top-ports 200 -sV -n -Pn --open --max-retries 2 -o hosts/portscan_active.gnmap $AXIOM_EXTRA_ARGS 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
fi
Expand All @@ -946,17 +939,13 @@ function portscan(){
fi
}

function cloudprovider(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$CLOUD_IP" = true ]; then
start_func ${FUNCNAME[0]} "Cloud provider check"
if [ -s "$dir/hosts/ips.txt" ]; then
for ip in $( cat "$dir/hosts/ips.txt" ); do
echo "$( echo -n ${ip} && echo -n " " && clouddetect -ip=${ip} )" | grep -iv "Error" | anew -q $dir/hosts/cloud_providers.txt
done
fi
end_func "Results are saved in hosts/cloud_providers.txt" ${FUNCNAME[0]}
function cdnprovider(){
if { [ ! -f "$called_fn_dir/.${FUNCNAME[0]}" ] || [ "$DIFF" = true ]; } && [ "$CDN_IP" = true ]; then
start_func ${FUNCNAME[0]} "CDN provider check"
[ -s "$dir/hosts/ips.txt" ] && cat $dir/hosts/ips.txt | ipcdn -m all | anew -q $dir/hosts/cdn_providers.txt
end_func "Results are saved in hosts/cdn_providers.txt" ${FUNCNAME[0]}
else
if [ "$CLOUD_IP" = false ]; then
if [ "$CDN_IP" = false ]; then
printf "\n${yellow} ${FUNCNAME[0]} skipped in this mode or defined in reconftw.cfg ${reset}\n"
else
printf "${yellow} ${FUNCNAME[0]} is already processed, to force executing ${FUNCNAME[0]} delete\n $called_fn_dir/.${FUNCNAME[0]} ${reset}\n\n"
Expand Down Expand Up @@ -2059,14 +2048,14 @@ function passive(){
subdomains_full
remove_big_files
favicon
cdnprovider
PORTSCAN_ACTIVE=false
portscan

if [ "$AXIOM" = true ]; then
axiom_shutdown
fi

cloudprovider
end
}

Expand Down Expand Up @@ -2186,6 +2175,7 @@ function recon(){
s3buckets
screenshot
virtualhosts
cdnprovider
portscan
waf_checks
nuclei_check
Expand All @@ -2197,7 +2187,6 @@ function recon(){
axiom_shutdown
fi

cloudprovider
cms_scanner
url_gf
wordlist_gen
Expand Down Expand Up @@ -2291,8 +2280,8 @@ function multi_recon(){
remove_big_files
screenshot
virtualhosts
cdnprovider
portscan
cloudprovider
currently=$(date +"%H:%M:%S")
loopend=$(date +%s)
getElapsedTime $loopstart $loopend
Expand All @@ -2316,7 +2305,7 @@ function multi_recon(){
NUMOFLINES_webs_total=$(find . -type f -name 'webs.txt' -exec cat {} + | anew webs/webs.txt | sed '/^$/d' | wc -l)
NUMOFLINES_webs_total=$(find . -type f -name 'webs_uncommon_ports.txt' -exec cat {} + | anew webs/webs_uncommon_ports.txt | sed '/^$/d' | wc -l)
NUMOFLINES_ips_total=$(find . -type f -name 'ips.txt' -exec cat {} + | anew hosts/ips.txt | sed '/^$/d' | wc -l)
NUMOFLINES_cloudsprov_total=$(find . -type f -name 'cloud_providers.txt' -exec cat {} + | anew hosts/cloud_providers.txt | sed '/^$/d' | wc -l)
NUMOFLINES_cloudsprov_total=$(find . -type f -name 'cdn_providers.txt' -exec cat {} + | anew hosts/cdn_providers.txt | sed '/^$/d' | wc -l)
find . -type f -name 'portscan_active.txt' -exec cat {} + > hosts/portscan_active.txt 2>>"$LOGFILE" &>/dev/null
find . -type f -name 'portscan_active.gnmap' -exec cat {} + > hosts/portscan_active.gnmap 2>>"$LOGFILE" &>/dev/null
find . -type f -name 'portscan_passive.txt' -exec cat {} + > hosts/portscan_passive.txt 2>>"$LOGFILE" &>/dev/null
Expand Down

0 comments on commit 314b3b5

Please sign in to comment.