Skip to content

Commit

Permalink
WHois_textfile
Browse files Browse the repository at this point in the history
Does whois for IPs in textfile
  • Loading branch information
anchalraheja authored Sep 25, 2021
1 parent c5c8f91 commit f0c9874
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions whois_textfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import time
import subprocess

f = open("whois_ip_list.txt","r")

for ips in f.readlines():
time.sleep(1)
test = subprocess.Popen(["whois", ips.rstrip()], stdout=subprocess.PIPE)
output = test.communicate()[0]
list_output = (output.splitlines())
for x in list_output:
if ("OrgName") in x:
print ips.rstrip() + " "+ x

0 comments on commit f0c9874

Please sign in to comment.