Skip to content

Instantly share code, notes, and snippets.

@hackingbutlegal
Created August 27, 2014 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hackingbutlegal/30b10aa60d9fc646d5f9 to your computer and use it in GitHub Desktop.
Save hackingbutlegal/30b10aa60d9fc646d5f9 to your computer and use it in GitHub Desktop.
Query Whois using IP's in a text file and output the important bits to a separate file.
#!/bin/bash
for a in `awk -F: '{print $1}' ip1.txt`
do
echo "$((i++)) $1:" >> whoisdb.txt
whois $a | awk '/NetName/ || /OrgName/{print}' >> whoisdb.txt
echo -e "\n" >> whoisdb.txt
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment