From b83a3c7efee2631e5c217aa3c2f6fc2c8b531907 Mon Sep 17 00:00:00 2001 From: "lovely.wcm" Date: Thu, 13 Aug 2009 02:49:42 +0000 Subject: [PATCH] New script: lookup.sh --- lookup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 lookup.sh diff --git a/lookup.sh b/lookup.sh new file mode 100755 index 0000000..4d957cd --- /dev/null +++ b/lookup.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [ $# != 1 ]; then + echo -e "Usage:\n $./lookup.sh wordpress\n $./lookup.sh ghs\n"; + exit 1; +fi + +while read line +do + + host=$( echo "$line" | + grep -oE "[a-z0-9]([a-z0-9_\.\-]*[a-z0-9])?\.[a-z]{2,3}" | + grep -vE "dot$|htm$|php$" ); + + [ "$host" ] && [ "$(nslookup $host | grep $1)" ] && echo $host; + +done < "list.txt" +