-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathBrutedSubs.py
More file actions
75 lines (45 loc) · 2.05 KB
/
BrutedSubs.py
File metadata and controls
75 lines (45 loc) · 2.05 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import os
import subprocess
import glob
from requests import post
def rec(a,dom):
global flag
while flag < 5:
print("Iteration Number: " + str(flag))
# Generating Permutations with Dnsgen
with open(fnames[a+1], 'w') as f:
subprocess.run(['timeout', '30', 'dnsgen', fnames[a], '-w', '/root/Wordlists/words.txt'], text=True, stdout=f)
# Resolving again for Dnsgen Generated Domains
subprocess.check_output(["shuffledns", "-d", dom, "-list", fnames[a+1], "-r", "/root/tools/findomain/massdns/lists/resolvers.txt", "-t", "15000", "-o", fnames[a+2]], stderr=subprocess.STDOUT)
flag += 1
rec(a+2, dom)
def Catting(slack):
p1 = subprocess.run(['cat', 'Domains-Online.txt', 'Level1-Domains.txt', 'Level2-Domains.txt', 'Level3-Domains.txt', 'Level4-Domains.txt'], text=True, capture_output=True)
with open('Subdomains.txt', 'w') as fp:
subprocess.run(['sort', '-u'], text=True, input=p1.stdout, stdout=fp)
os.remove('Domains-Online.txt')
for path in glob.glob('dnsgen*'):
os.remove(path)
for path in glob.glob('Level*'):
os.remove(path)
send = "\n\n[***] TOTAL " + str(sum(1 for line in open('Subdomains.txt'))) + " LIVE DOMAINS...! [***]"
print(send)
post(slack, data="{'text': '" + send + "'}", headers={'Content-Type': 'application/json'})
def Probing(slack):
p1 = subprocess.run(['cat', 'Subdomains.txt'], text=True, capture_output=True)
with open('Web-Domains.txt', 'w') as fps:
subprocess.run(['httprobe', '-c', '50'], text=True, input=p1.stdout, stdout=fps)
send = "[+++] Total " + str(sum(1 for line in open('Web-Domains.txt'))) + " WEB Domains...! [+++]"
print(send)
post(slack, data="{'text': '" + send + "'}", headers={'Content-Type': 'application/json'})
def main(domssss,slax):
global flag, fnames
fnames = ["Domains-Online.txt", "dnsgen.txt", "Level1-Domains.txt", "dnsgen-2.txt", "Level2-Domains.txt", "dnsgen-3.txt",
"Level3-Domains.txt", "dnsgen-4.txt", "Level4-Domains.txt"]
flag = 1
# Calling the Functions
rec(0,domssss)
Catting(slax)
Probing(slax)
if __name__ == '__main__':
main(sites,slk)