mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 07:12:46 +01:00
23 lines
551 B
Python
23 lines
551 B
Python
#!/usr/bin/env python
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
subprocess.call(
|
|
[sys.executable, "-m", "pip", "install", "requests"],
|
|
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
|
|
)
|
|
|
|
import json
|
|
import requests
|
|
|
|
|
|
def run(msg):
|
|
api_key = msg['secrets']['vt_api_key'].encode('utf-8')
|
|
resource = msg['payload']['default'].encode('utf-8')
|
|
params = {'apikey': api_key, 'resource': resource}
|
|
return requests.get("https://www.virustotal.com/vtapi/v2/file/report", params=params).json()
|
|
|
|
|
|
print(json.dumps(run(json.loads(sys.argv[1]))))
|