Saturday, July 20, 2013

Red V!per User Domain Extractor


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 &amp;&amp; --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="">&gt; 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=[^&gt;]+" | cut -d '=' -f2 | sed '/www./s///g' | sort | uniq &gt;&gt; whois_kenh12.txt


while [ -z "$last_page_check" ] &amp;&amp; [ -n "$how_many" ] &amp;&amp; [ -z "$single_page" ]; do


 url="http://www.bing.com/search?q=ip%3A$IP&amp;go=&amp;qs=n&amp;first=${page}0&amp;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">[^&lt;]+' bing.php |cut -d '&gt;' -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">&gt; 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 &gt;&gt; whois_bing.txt
rm alldomain_bing.txt ;


   for line_bing in `cat whois_bing.txt`
     do
       echo "$line_bing" &gt;&gt; reversed.txt
     done

   for line_neighbors in `cat whois_neighbors.txt`
    do
       echo "$line_neighbors" &gt;&gt; reversed.txt
    done
 
   for line_kenh12 in `cat whois_kenh12.txt`
    do
       echo "$line_kenh12" &gt;&gt; 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 &gt;&gt;user.txt
}

get_user_with_site()
{
for reverse in `cat user.txt`
do
site=`cat reversed.txt | grep "$reverse"`
cat reversed.txt | grep "$reverse" &gt;&gt; /dev/null;check=$?
           if [ $check -eq 0 ]
                then
                echo -e "[+] Found : User: "$reverse" \t Site: $site"
                echo -e "[+] Found : User: "$reverse" \t Site: $site" &gt;&gt;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