Skip to content

Instantly share code, notes, and snippets.

@notelseit
Forked from atelenga/bulk_ip_whois.py
Created March 26, 2017 07:57
Show Gist options
  • Select an option

  • Save notelseit/e28b941e11c2ad1c2e6eae105a89e2b4 to your computer and use it in GitHub Desktop.

Select an option

Save notelseit/e28b941e11c2ad1c2e6eae105a89e2b4 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