mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 15:22:47 +01:00
Release catalyst
This commit is contained in:
22
database/migrations/automations/vt.hash.py
Normal file
22
database/migrations/automations/vt.hash.py
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/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]))))
|
||||
Reference in New Issue
Block a user