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

fix ip geo-location

six2dez5046c91c4493
diff --git a/reconftw.sh b/reconftw.sh
index 75a76c5..cd4aa6a 100755
--- a/reconftw.sh
+++ b/reconftw.sh
@@ -1402,7 +1402,13 @@ function geo_info() {
start_func ${FUNCNAME[0]} "Running: ipinfo and geoinfo"
ips_file="${dir}/hosts/ips.txt"
if [ ! -f $ips_file ]; then
- echo "File ${dir}/hosts/ips.txt does not exist."
+ if ! [[ $domain =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9] ]]; then
+ [ -s "subdomains/subdomains_dnsregs.json" ] && cat subdomains/subdomains_dnsregs.json | jq -r 'try . | "\(.host) \(.a[0])"' | 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 -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
else
for ip in $(cat "$ips_file"); do
json_output=$(curl -s https://ipapi.co/$ip/json)