create etc-passwd.txt file Besides User+Domain Extractor script and insert Contents of
/etc/passwd file Within etc-passwd.txt then Give Permision to script and run it
#!/bin/bash
#
# ---------------------------------
# User+Domain Extractor
# Licence : Linux
# ---------------------------------
#
# Title : User+Domain Extractor
# Code : Bash
# Author : RedH4t.Viper
# Email : RedH4t.Viper@Gmail.com , RedH4t.Viper@yahoo.com
# Date : 2013 06 May
# Home : IrIsT Security Center
# Thanks : IrIsT ,TBH ,kurdhackteam , 3xp1r3
#
# Gr33tz : Am!r | C0dex | B3HZ4D | TaK.FaNaR | 0x0ptim0us | Net.W0lf |
# Gr33tz : Skote_Vahshat| Dj.TiniVini| Mr.XHat | Black King |
# Gr33tz : E2MAEN | Mr.F@RDIN | M4st3r4N0nY | ICA_r00t | m3hdi |
# Gr33tz : x3o-1337 | rEd X | No PM | Gabby | Sukhoi Su-37
# Gr33tz : ARTA | H-SK33PY | (^_^) | Turk Sever | And All Of IrIsT Memebrz
#------------------------------------------------------------------------------------------#
IP=
F_ARG=$1
page=0
last_page_check=
how_many=1
single_page=
Usage()
{
echo ""
echo "# ****************************************************************************************************#"
echo "# Usage : User+Domain Extractor <ip> *#"
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 '<a -d="" -f4="" cut="" href="http://whois.domaintools.com/%5B%5E" sort="" uniq="">> 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 '<span class="sb_count" id="count">[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 '<span class="sb_count" id="count">[^<]+' bing.php |cut -d '>' -f 2|cut -d ' ' -f 1-3`
# check for a single page of results
single_page=`egrep -o '<span class="sb_count" id="count">[0-9] results' bing.php`
cat "bing.php"| egrep -o "</span></span></span></a>
<h3>
<span class="sb_count" id="count"><span class="sb_count" id="count"><span class="sb_count" id="count"><a -d="" -f="" 2="" bing.php="" cut="" href="http://www.blogger.com/%5C">> 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;
Download: http://www.mediafire.com/download/ismd5f47n7hs7my/User_Domain_Extractor.sh
No comments:
Post a Comment