2009-08-13 02:49:42 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ $# != 1 ]; then
|
2010-03-26 03:07:38 +00:00
|
|
|
echo -e "\
|
|
|
|
Usage:
|
|
|
|
$./lookup.sh wordpress
|
|
|
|
$./lookup.sh ghs.l.google
|
|
|
|
$./lookup.sh 72.14.203.121 // ghs
|
|
|
|
$./lookup.sh 67.207.139.81 // Posterous
|
|
|
|
$./lookup.sh 72.32.231.8 // Tumblr
|
|
|
|
$./lookup.sh typepad
|
|
|
|
";
|
2009-08-13 02:49:42 +00:00
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
while read line
|
|
|
|
do
|
|
|
|
|
|
|
|
host=$( echo "$line" |
|
2009-08-13 03:56:56 +00:00
|
|
|
grep -oE "[a-z0-9]([a-z0-9_\.\-]*[a-z0-9])?\.[a-z]{2,4}" |
|
2010-01-13 06:46:36 +00:00
|
|
|
grep -vE "(aspx?|dotn|exe|fan|html?|php|zh)$"
|
|
|
|
);
|
2009-08-13 02:49:42 +00:00
|
|
|
|
2009-08-14 01:34:15 +00:00
|
|
|
[ "$host" ] && [ "$(nslookup $host | grep -i $1)" ] && echo $host;
|
2009-08-13 02:49:42 +00:00
|
|
|
|
|
|
|
done < "list.txt"
|
|
|
|
|