aboul3la / Sublist3r

Fast subdomains enumeration tool for penetration testers
GNU General Public License v2.0
9.72k stars 2.1k forks source link

Add support for VirusTotal using APIv3 #373

Open 0x0M03II opened 4 months ago

0x0M03II commented 4 months ago

Running the master branch of Sublist3r returns the error displayed below. The Virustotal URL is no longer valid and can be replaced to use the API (version 3).

[!] Error: Virustotal probably now is blocking our requests."

These changes allow users to pass their Virustoal API key via the command-line flag. The API key will be passed to the Virustotal enumerator object. The flag is not required; rather, it defaults to None, and a value check is included in the Virustotal class, leaving the remaining objects untouched.

Alternatively, Virustotal can be completely removed from the list of supported engines, or you can mark this repo as archived to indicate that it is no longer supported. Ideally, this PR can be merged to support the continued use of Virtustotal.

Should you no longer support Virustotal, supported_engines and chosenEnums in the main() function should be modified to exclude Virustotal; it will not work without modifying the URL.

def main():
    supported_engines = { ..., 'virustotal': Virustotal, ...  } # remove VT

    if engines is None:
        chosenEnums = [ ..., Virustotal, ... ] # remove VT

I have tested changes using Python 3.11.2 (Linux). If there is interest in merging this PR, I can test other Python versions and the Windows OS.