@@ -304,21 +304,28 @@ def upgradeFiles():
304
304
print ("Changing back to old working directory: {}" .format (old_wd ))
305
305
os .chdir (old_wd )
306
306
307
+
307
308
def writeFiles (name ):
308
309
"""Writes info of all hosts from subhosts
309
310
"""
310
311
subdomainCounter = 0
311
312
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 ]
315
322
316
323
print ("\n Opening %s File" % name )
317
324
try :
318
- with open (fileName , 'w' ) as f :
325
+ with open (fileName , "r" ) as f :
319
326
SubHosts = f .read ().splitlines ()
320
327
321
- with open (subdomainAllFile , 'a' ) as f :
328
+ with open (subdomainAllFile , "a" ) as f :
322
329
f .writelines ("\n \n " + name )
323
330
for hosts in SubHosts :
324
331
hosts = "" .join (hosts )
@@ -333,7 +340,7 @@ def writeFiles(name):
333
340
334
341
def subdomainfile ():
335
342
subdomainAllFile = "{}-all.txt" .format (output_base )
336
- names = ['Sublist3r' , ' knock' , ' enumall' , ' massdns' , ' amass' , 'SubFinder' ]
343
+ names = ["sublist3r" , " knock" , " enumall" , " massdns" , " amass" , "subfinder" ]
337
344
338
345
for name in names :
339
346
writeFiles (name )
0 commit comments