
07.12.2009, 05:02
|
|
Banned
Регистрация: 02.12.2008
Сообщений: 43
С нами:
9178715
Репутация:
4
|
|
http://packetstormsecurity.org/filedesc/bing-ip2hosts-0.1.tar-gz.html
PHP код:
#!/bin/bash
# bing-ip2hosts - Enumerate hostnames from Bing.com for an IP address.
# Bing.com is Microsoft's search engine which has an IP: search parameter.
#
# By Andrew Horton aka urbanadventurer, MorningStar Security
# www.morningstarsecurity.com
#
# Released at Kiwicon III (kiwicon.org), November 2009
# License: GPLv3
VERSION=0.1
ANIMATION=1
if [ -z "$1" ] || [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
echo -e "Usage: $0 [--noanimation] <IP>
bing-ip2hosts ($VERSION)- Enumerate hostnames from Bing.com for an IP address.
Bing.com is Microsoft's search engine which has an IP: search parameter.
By Andrew Horton aka urbanadventurer, MorningStarSecurity
www.morningstarsecurity.com
"
exit 1
fi
if [ "$1" == "--noanimation" ]; then
ANIMATION=0
shift
ARGV=$*
fi
animation="/-\|"
IP="$1"
num_vhosts=10
page=0
all_hosts=`mktemp -p . -t ip2hosts.tmp.XXXXXX`
while [ "$num_vhosts" == 10 ]; do
if [ $ANIMATION == 1 ]; then
echo -en "${animation: $(( $page % 4 )) :1}"
fi
url="http://m.bing.com/search/search.aspx?A=webresults&Q=ip%3a$IP&D=Web&SI=$page""0"
out=`mktemp -p . -t ip2hosts.tmp.XXXXXX`
wget -q -O "$out" "$url"
vhosts=`cat "$out"| egrep -o "(<span class=\"c2\">)[^<]+(<\/)" | sed -e 's/<span class="c2">\|<\///g'`
num_vhosts=`echo "$vhosts" | wc -l`
echo -e "$vhosts" >> "$all_hosts"
rm -f "$out"
let page=$page+1
if [ $ANIMATION == 1 ]; then
echo -ne "\b"
fi
done
cat "$all_hosts" | cut -d '/' -f 1 | tr '[:upper:]' '[:lower:]' | sort | uniq
rm -f "$all_hosts"
Последний раз редактировалось x[0]x; 07.12.2009 в 05:05..
|
|
|