Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions misp_modules/modules/expansion/virustotal_public.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import logging
import asyncio
from urllib.parse import urlparse

import vt
Expand Down Expand Up @@ -284,6 +285,11 @@ def parse_error(status_code: int) -> str:
def handler(q=False):
if q is False:
return False
try:
asyncio.get_running_loop()
except RuntimeError:
asyncio.set_event_loop(asyncio.new_event_loop())

request = json.loads(q)
if not request.get("config") or not request["config"].get("apikey"):
misperrors["error"] = "A VirusTotal api key is required for this module."
Expand Down