From 87cd07af86059c2ad9a89fd865a60d135c99bd64 Mon Sep 17 00:00:00 2001 From: hiddengearz <17349277+hiddengearz@users.noreply.github.com> Date: Mon, 29 Jun 2020 19:45:38 -0400 Subject: [PATCH 1/2] Allow secrets to be saved to a file --- SubDomainizer.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/SubDomainizer.py b/SubDomainizer.py index 1c66d92..8f35282 100644 --- a/SubDomainizer.py +++ b/SubDomainizer.py @@ -38,6 +38,8 @@ help="Cookies which needs to be sent with request. User double quotes if have more than one.") parse.add_argument('-cop', '--cloudop', help="Enter the file name in which you want to save results of cloud services finding.") +parse.add_argument('-sop', '--secretop', + help="Enter the file name in which you want to save results of cloud services finding.") parse.add_argument( '-d', '--domain', help="Enter the TLD to extract all the subdomain for that TLD.") parse.add_argument( @@ -59,6 +61,7 @@ url = args.url listfile = args.listfile cloudop = args.cloudop +secretop = args.secretop gitToken = args.gittoken isGit = args.gitscan isSSL = args.nossl @@ -682,6 +685,14 @@ def savecloudresults(): for item in cloudurlset: f.write(item + '\n') +def savesecretsresults(): + """ + This function will save secret data into the given file. + """ + with open(secretop, 'w+') as f: + for item in secretList: + f.write(item + '\n') + def printlogo(): """ @@ -894,6 +905,14 @@ def printlogo(): str(len(secretList)), color='red', attrs=['bold'])) for item in secretList: print(termcolor.colored(item, color='green', attrs=['bold'])) + if secretop: + print( + termcolor.colored("\nWriting all the secrets to given file...", color='blue', + attrs=['bold'])) + savesecretsresults() + print( + termcolor.colored("\nWritten secrets in file: ", color='blue', + attrs=['bold']) + secretop + '\n') print(termcolor.colored('\n'+'_'*23 + 'End of Results' + '_'*23 + '\n', color='white', attrs=['bold'])) From c1c9b41832bdeaf4d3bbddbe8405c6dbe117e7a6 Mon Sep 17 00:00:00 2001 From: hiddengearz <17349277+hiddengearz@users.noreply.github.com> Date: Tue, 30 Jun 2020 14:26:34 +0000 Subject: [PATCH 2/2] fixed typo --- SubDomainizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SubDomainizer.py b/SubDomainizer.py index 8f35282..34bb2ff 100644 --- a/SubDomainizer.py +++ b/SubDomainizer.py @@ -39,7 +39,7 @@ parse.add_argument('-cop', '--cloudop', help="Enter the file name in which you want to save results of cloud services finding.") parse.add_argument('-sop', '--secretop', - help="Enter the file name in which you want to save results of cloud services finding.") + help="Enter the file name in which you want to save results of secrets found.") parse.add_argument( '-d', '--domain', help="Enter the TLD to extract all the subdomain for that TLD.") parse.add_argument(