Skip to content

Instantly share code, notes, and snippets.

@vay3t
Last active September 13, 2018 13:00
Show Gist options
  • Save vay3t/2d3f1e8c815cdbaf7cb8347ef932bfbf to your computer and use it in GitHub Desktop.
Save vay3t/2d3f1e8c815cdbaf7cb8347ef932bfbf to your computer and use it in GitHub Desktop.
import socket
import sys
try:
with open(sys.argv[1],"r") as f:
lista = f.readlines()
cont = 1
for line in lista:
#print "[!] transformando " + str(cont) + "/" + str(len(xlines))
line = line.rstrip()
try:
dom2ip = socket.gethostbyname(line)
print "[+]" + line + " --> " + dom2ip
cont += 1
except socket.gaierror:
print "[-]" + line + " --> null"
cont += 1
except KeyboardInterrupt:
print "Exit!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment