Last active
April 30, 2019 01:37
-
-
Save mritunjay-k/7b127b511a321b2e7e0dc9fd86f7c2bf to your computer and use it in GitHub Desktop.
Takes a file containing list of domains as an input and gives their ipv4 address as an output in another file. I developed it basically for using masscan. It can also be used for educational purposes too.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import socket | |
try: | |
read_file = open(input("Enter path of the file containing subdomains: "),'r') | |
for host in read_file: | |
try: | |
ip=socket.gethostbyname(host.rstrip("\n")) | |
print(ip) | |
file = open("found_ip.txt","a") | |
file.write(ip+"\n") | |
file.close() | |
except: | |
print("Not Found") | |
read_file.close() | |
except: | |
print("File doesn't exist") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment