-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (29 loc) · 1020 Bytes
/
main.py
File metadata and controls
44 lines (29 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import sys
import socket
args = sys.argv
if len(args) == 1:
print("Usage: python main.py [domain] -w [wordlist]")
sys.exit(1)
if args[2] == '-w' or args[2] == '-wordlist':
subdmain_word_list = args[3]
founds = []
try:
filePath = open(subdmain_word_list, 'r')
except FileNotFoundError:
print('File not found')
sys.exit()
for line in filePath:
website_uri = line.strip() + "." + args[1]
try:
website_response = socket.gethostbyname(website_uri)
strfounds = "[+] " + website_uri + ": " + website_response
founds.append(strfounds)
print("[+] " + website_uri + " " + website_response)
except socket.gaierror:
print("[-] " + website_uri + " " + "No response")
filePath.close()
if len(founds) == 0:
print("No results found")
else:
print("\n[+] Found " + str(len(founds)) + " results")
print("[=] Results:" + "\n" + "\n".join(founds))