exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Reverse Whois Using BING

Reverse Whois Using BING
Posted Oct 26, 2009
Authored by Alejandro Ramos

This is a script for reverse whois using BING.

tags | tool
systems | unix
SHA-256 | 1e63131a8716056c04b241d984eaa2c1e4718a305bfaad963bcc6c43b6780af7

Reverse Whois Using BING

Change Mirror Download
#!/bin/bash
# Tue Dec 30 12:38:32 CET 2008 <aramosf @ unsec.net>
#
# TODO: Bucle para los alias.
# En modo cgi?

APPID="7066FAEB6435DB963AE3CD4AC79CBED8B962779C"


function usage() {
cat << EOF
$0 <-h IP> [-n] [-g NUM]
-h <host> : IP/Host address to check
-n : Don't check from vhosts with A record
-g <num> : Number of results to get (default 100)
EOF
exit 0
}

URL="http://api.search.live.net/json.aspx"
DNS=1; HITS=0; HOST=0

while getopts ":h:g:n" options; do
case $options in
h ) HOST=$OPTARG;;
g ) HITS=$OPTARG;;
n ) DNS=0;;
: ) echo "-$OPTARG requires an argument."; usage;;
\? ) usage;;
esac
done

if [ "$HOST" == "0" ]; then
echo "No IP/Host specified"
usage
fi
if [[ $HOST =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]
then
IP=$HOST
else
IP=`host $HOST|awk 'BEGIN {NF = 1} /address/{print $4}'`
if [ $( echo "$IP"|wc -l) -gt 1 ]; then
echo $HOST have an alias. Using first IP.
IP=`echo "$IP"|head -1`
fi
fi
if [ -z $IP ]; then echo "Error with IP: \"$IP\""; exit 0; fi

RSLTS=`curl -s "$URL?Appid=$APPID&sources=web&query=IP:\"$IP\""|sed -e \
's/.*Total":\([0-9]*\).*/\1/'`
echo "Number of results: $RSLTS. IP: $IP"

if [ $RSLTS -gt 1000 ] && [ $HITS == 0 ]; then
echo "Too much results, using first 100"
RSLTS=100
fi
if [ $HITS -gt 0 ]; then
echo "Forcing to get $HITS results"
RSLTS=$HITS;
fi

# Let's go.
echo "------------------------------------"
OFFSET=0
while [ $OFFSET -lt $(( $RSLTS + 50 )) ]; do
DA=$(curl -s \
"$URL?Appid=$APPID&Web.Count=50&sources=web&query=IP:\"$IP\"+$str&Web.Offset=$OFFSET" \
| sed -e 's|\\/|/|g' -e 's|,|\n|g'|grep '"Url":' \
| sed -e 's|.*//\([^/|^"]*\)"*.*|\1|')
DB="$DB\n$DA"
str=`echo -e "$DB"|sort|uniq -c|sort -gr \
|awk '$2~/[aA-zZ]/ {print "-site:"$2}'|head -15|tr '\n' '+'`
OFFSET=$(( $OFFSET + 50 ))
done

if [ $DNS == 1 ]; then
for host in `echo -e "$DB" | sort | uniq`; do
ADDR=`host $host| awk 'BEGIN {NF = 1}/address/{print $4}'`
if [ "$ADDR" == "$IP" ]; then
AA="$AA $host"
else
if [ -z "$ADDR" ]; then ADDR="No_address"; fi
BB="$BB $host:${ADDR}"
fi
done
A=`echo -e "$AA" |sort | uniq`
echo $A \
|awk '{ for (idx=1; $idx; i++) {printf "%-39s %-39s\n", $(idx++),$(idx++); }}'
echo Total: `echo "$AA"|tr ' ' '\n'|sort|uniq|sed -e 1d|wc -l`
ETOTAL=`echo -e "$BB" |tr ' ' '\n'|sort |uniq|sed -e 1d|wc -l`
if [ $ETOTAL -gt 0 ]; then
echo -e "\nWith errors"
echo "------------------------------------"
echo -e "$BB" |tr ' ' '\n'|sort|uniq|sed -e 1d \
|awk -F: '{ printf "%-39s %-39s\n", $1,$2}'
echo "Total with errors: $ETOTAL"
else
echo -e "\nNo errors found"
fi
else
A=`echo -e "$DB" |sort | uniq`
echo $A \
|awk '{ for (idx=1; $idx; i++) {printf "%-39 %-39\n", $(idx++),$(idx++); }}'
echo Total: `echo -e "$A" |sort | uniq|wc -l`
fi


Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close