gfwlist/lookup.sh

19 lines
356 B
Bash
Raw Normal View History

2009-08-13 02:49:42 +00:00
#!/bin/bash
if [ $# != 1 ]; then
2009-08-14 01:34:15 +00:00
echo -e "Usage:\n $./lookup.sh wordpress\n $./lookup.sh ghs.l.google\n";
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}" |
2009-08-14 01:34:15 +00:00
grep -vE "dotn$|html$|php$" );
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"