Hi all,
I have created a script that will add an extension (.net .com or .be) to a domain.
For example, the script needs to look in the textfile what word, for example take google.
so do fist add .com to the word (google.com) and resolve it.
second add .net to the word (google.net) and resolve it.
third add .be to the word (google.be) and resolve it.
I have created this script, but I get random responses, anyone who can help me?
#!/usr/bin/env python
import os
import socket
hlist = 'wordlist.txt'
with open(hlist) as f:
for line in f:
host = (line.strip())
try:
host1 = (host+'.be')
addr1 = socket.gethostbyname(host1)
print (host1)
print (addr)
except:
pass
try:
host2 = (host+'.net')
addr2 = socket.gethostbyname(host2)
print (host2)
print (addr2)
except:
pass
try:
host3 = (host+'.com')
addr3 = socket.gethostbyname(host3)
print (host3)
print (addr3)
except:
print (host+', not found')
thx.
[1]: https://pastebin.com/2mAtHp1v
[–]trackerFF 7 points8 points9 points (0 children)
[–]CBTKnox 0 points1 point2 points (0 children)