From 536278649d0f2db04a18b081bf1e310601c40705 Mon Sep 17 00:00:00 2001 From: AetherBreeze Date: Thu, 20 Jan 2022 20:49:24 -0500 Subject: [PATCH] Modernize Virustotal API scraping - Replace old Virustotal URL with new one - Add required Virustotal headers required for successful request --- sublist3r.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sublist3r.py b/sublist3r.py index 760e5ce..b3cce1c 100755 --- a/sublist3r.py +++ b/sublist3r.py @@ -676,11 +676,17 @@ def extract_domains(self, resp): class Virustotal(enumratorBaseThreaded): def __init__(self, domain, subdomains=None, q=None, silent=False, verbose=True): subdomains = subdomains or [] - base_url = 'https://www.virustotal.com/ui/domains/{domain}/subdomains' + base_url = 'https://www.virustotal.com/ui/domains/{domain}/subdomains?relationships=resolutions' self.engine_name = "Virustotal" self.q = q super(Virustotal, self).__init__(base_url, self.engine_name, domain, subdomains, q=q, silent=silent, verbose=verbose) self.url = self.base_url.format(domain=self.domain) + + # Virustotal requires specific headers to bypass the bot detection: + self.headers["X-Tool"] = "vt-ui-main" + self.headers["X-VT-Anti-Abuse-Header"] = "hm" # as of 1/20/2022, the content of this header doesn't matter, just its presence + self.headers["Accept-Ianguage"] = self.headers["Accept-Language"] # this header being present is required to prevent a captcha + return # the main send_req need to be rewritten