Kullanıcı + Domain Listeleyici.
Serverde kısıtlı bölgerlere erişmediğinizde yardım edici bir araçtır.Kodlar Aşağıdadır.
---------------------------------------------
#!/bin/bash
#
# ---------------------------------
# User+Domain Extractor
# Licence : Linux
# ---------------------------------
IP=
F_ARG=$1
page=0
last_page_check=
how_many=1
single_page=
Usage()
{
echo ""
echo "# ****************************************************************************************************#"
echo "# Usage : User+Domain Extractor*#"
echo "# Help : -h && --help : Show This Menu *#"
echo "# RunScript : create etc-passwd.txt file Besides User+Domain Extractor script and insert Contents *#"
echo "# RunScript : of /etc/passwd file Within etc-passwd.txt then Give Permision to script and run it !! *#"
echo "# ****************************************************************************************************#"
echo ""
}
get_reverse()
{
# check IP
if [ `echo "$F_ARG" | egrep "(([0-9]+\.){3}[0-9]+)|\[[a-f0-9:]+\]"` ]; then
IP="$F_ARG"
else
IP=`resolveip -s "$F_ARG"`
if [ "$?" != 0 ]; then
echo -e " [-] Error: cannot resolve $F_ARG to an IP "
exit
fi
fi
url_neighbors="http://www.my-ip-neighbors.com/?domain=$IP"
wget -q -O my-ip-neighbors.php "$url_neighbors"
cat my-ip-neighbors.php | egrep -o '> whois_neighbors.txt
url_kenh12="http://ip.kenh12.com/Reverse-IP-Lookup-DNS-Domain/$IP.html"
wget -q -O my-ip-kenh12.php "$url_kenh12"
cat my-ip-kenh12.php | egrep -o "gif' alt=[^>]+" | cut -d '=' -f2 | sed '/www./s///g' | sort | uniq >> whois_kenh12.txt
while [ -z "$last_page_check" ] && [ -n "$how_many" ] && [ -z "$single_page" ]; do
url="http://www.bing.com/search?q=ip%3A$IP&go=&qs=n&first=${page}0&FORM=PERE"
wget -q -O bing.php "$url"
last_page_check=`egrep -o '[0-9]+-([0-9]+) of (\1)' bing.php`
# if no results are found, how_many is empty and the loop will exit
how_many=`egrep -o '[^<]+' bing.php |cut -d '>' -f 2|cut -d ' ' -f 1-3`
# check for a single page of results
single_page=`egrep -o '[0-9] results' bing.php`
cat "bing.php"| egrep -o "> alldomain_bing.txt
let page=$page+1
rm -f bing.php
done
cat alldomain_bing.txt | cut -d '/' -f 3 | tr '[:upper:]' '[:lower:]' | sed '/www./s///g' | sort | uniq >> whois_bing.txt
rm alldomain_bing.txt ;
for line_bing in `cat whois_bing.txt`
do
echo "$line_bing" >> reversed.txt
done
for line_neighbors in `cat whois_neighbors.txt`
do
echo "$line_neighbors" >> reversed.txt
done
for line_kenh12 in `cat whois_kenh12.txt`
do
echo "$line_kenh12" >> reversed.txt
done
rm whois_bing.txt;
rm whois_neighbors.txt;
rm whois_kenh12.txt;
rm my-ip-neighbors.php;
rm my-ip-kenh12.php;
}
get_user()
{
cat etc-passwd.txt | egrep "/home" | cut -d ':' -f 1 >>user.txt
}
get_user_with_site()
{
for reverse in `cat user.txt`
do
site=`cat reversed.txt | grep "$reverse"`
cat reversed.txt | grep "$reverse" >> /dev/null;check=$?
if [ $check -eq 0 ]
then
echo -e "[+] Found : User: "$reverse" \t Site: $site"
echo -e "[+] Found : User: "$reverse" \t Site: $site" >>ListUserDomain.txt
fi
done
rm -rf user.txt
rm -rf reversed.txt
}
main()
{
# check for arguments
if [ -z "$F_ARG" ] || [ "$F_ARG" == "-h" ] || [ "$F_ARG" == "--help" ]; then
Usage;
exit
fi
get_reverse;
get_user;
get_user_with_site;
}
main;
Yorumlar
Yorum Gönder