Skip to content

Instantly share code, notes, and snippets.

@atelenga
Created December 24, 2015 06:56
Show Gist options
  • Save atelenga/8902f84d207a1479ef4e to your computer and use it in GitHub Desktop.
Save atelenga/8902f84d207a1479ef4e to your computer and use it in GitHub Desktop.
Simple script for bulk IP whois lookup
### 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