79673546

Date: 2025-06-20 14:26:10
Score: 1.5
Natty:
Report link

Got it working! (Thanks @001 for getting me in the right direction!)
Final script:

import requests
import sys
import time
import json

url = 'https://www.virustotal.com/api/v3/files/{}'
headers = {"accept": "application/json", 
            "x-apikey": "<apikey>"}

inf = input("What hash file?")

with open(inf, "r") as f:
    with open("hashout.txt", "w") as output:
        
        for line in f:
            HASH = str(line).strip()
            url = 'https://www.virustotal.com/api/v3/files/{}'.format(HASH)
            response = requests.get(url, headers=headers)
            if response.status_code != 200:
                print("Hash Not Found")
                output.write("Not Found")
            else:
                data = response.json()
                for key in data.items():
                    if key == "md5":
                        md5 = str(value)
                        print(md5)
                        output.write(md5)
            time.sleep(16)  # VirusTotal Public API allows only 4 requests per minute, Do not change the sleep duration.
print("File Complete")
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @001
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: WaryProgram