Created
December 24, 2015 06:56
-
-
Save atelenga/8902f84d207a1479ef4e to your computer and use it in GitHub Desktop.
Simple script for bulk IP whois lookup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Install DMitry pacakge before use | |
### sudo apt-get install dmitry | |
### | |
import sys, subprocess | |
if __name__ == "__main__": | |
if len(sys.argv) != 2: | |
print "usage: %s <file with IP list>" % sys.argv[0] | |
sys.exit(1) | |
source_file = open(sys.argv[1], "r") | |
ip_list = list(source_file) | |
total_ip = len(ip_list) | |
for line in ip_list: | |
ip = line.strip('\r\n') | |
subprocess.call(["dmitry","-io",ip]) | |
source_file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment