From 3c9ece08a2b581063e33a5b6ff7909c745a2d3f6 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 14 Aug 2021 18:32:03 +0200 Subject: [PATCH 1/2] VirusTotal API Key support --- sublist3r.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sublist3r.py b/sublist3r.py index 760e5ce..b80f040 100755 --- a/sublist3r.py +++ b/sublist3r.py @@ -41,6 +41,9 @@ # Check if we are running this on windows platform is_windows = sys.platform.startswith('win') +# API Keys +vito_apikey = None + # Console Colors if is_windows: # Windows deserves coloring too :D @@ -103,6 +106,7 @@ def parse_args(): parser.add_argument('-e', '--engines', help='Specify a comma-separated list of search engines') parser.add_argument('-o', '--output', help='Save the results to text file') parser.add_argument('-n', '--no-color', help='Output without color', default=False, action='store_true') + parser.add_argument('-vito_apikey', '--virustotal_apikey', help='Virustotal API Key') return parser.parse_args() @@ -685,6 +689,10 @@ def __init__(self, domain, subdomains=None, q=None, silent=False, verbose=True): # the main send_req need to be rewritten def send_req(self, url): + global vito_apikey + + headers = dict(self.headers) + headers['x-apikey'] = vito_apikey try: resp = self.session.get(url, headers=self.headers, timeout=self.timeout) except Exception as e: @@ -987,6 +995,8 @@ def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, e def interactive(): + global vito_apikey + args = parse_args() domain = args.domain threads = args.threads @@ -995,6 +1005,7 @@ def interactive(): enable_bruteforce = args.bruteforce verbose = args.verbose engines = args.engines + vito_apikey = args.vito_apikey if verbose or verbose is None: verbose = True if args.no_color: From 31fa539047f953524a21125283867f673ee63567 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 14 Aug 2021 18:56:58 +0200 Subject: [PATCH 2/2] Fix arg name --- sublist3r.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sublist3r.py b/sublist3r.py index b80f040..b14afcb 100755 --- a/sublist3r.py +++ b/sublist3r.py @@ -1005,7 +1005,7 @@ def interactive(): enable_bruteforce = args.bruteforce verbose = args.verbose engines = args.engines - vito_apikey = args.vito_apikey + vito_apikey = args.virustotal_apikey if verbose or verbose is None: verbose = True if args.no_color: