Skip to content
This repository was archived by the owner on Apr 11, 2021. It is now read-only.

Commit 3ea7707

Browse files
committed
Fix issue #37
1 parent c3fc4dc commit 3ea7707

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

domained.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,21 +304,28 @@ def upgradeFiles():
304304
print("Changing back to old working directory: {}".format(old_wd))
305305
os.chdir(old_wd)
306306

307+
307308
def writeFiles(name):
308309
"""Writes info of all hosts from subhosts
309310
"""
310311
subdomainCounter = 0
311312
subdomainAllFile = "{}-all.txt".format(output_base)
312-
fileExt = {'Sublist3r':'.txt', 'knock':'.csv.txt', 'enumall': '.lst',
313-
'massdns': '.txt', 'amass': '.txt', 'SubFinder': '.txt'}
314-
fileName = "output/" + name + fileExt[name]
313+
fileExt = {
314+
"sublist3r": ".txt",
315+
"knock": ".csv.txt",
316+
"enumall": ".lst",
317+
"massdns": ".txt",
318+
"amass": ".txt",
319+
"subfinder": ".txt",
320+
}
321+
fileName = output_base + "_" + name + fileExt[name]
315322

316323
print("\n Opening %s File" % name)
317324
try:
318-
with open(fileName, 'w') as f:
325+
with open(fileName, "r") as f:
319326
SubHosts = f.read().splitlines()
320327

321-
with open(subdomainAllFile, 'a') as f:
328+
with open(subdomainAllFile, "a") as f:
322329
f.writelines("\n\n" + name)
323330
for hosts in SubHosts:
324331
hosts = "".join(hosts)
@@ -333,7 +340,7 @@ def writeFiles(name):
333340

334341
def subdomainfile():
335342
subdomainAllFile = "{}-all.txt".format(output_base)
336-
names = ['Sublist3r', 'knock', 'enumall', 'massdns', 'amass', 'SubFinder']
343+
names = ["sublist3r", "knock", "enumall", "massdns", "amass", "subfinder"]
337344

338345
for name in names:
339346
writeFiles(name)

0 commit comments

Comments
 (0)