Add UrlHaus analyzer and helpers script

This commit is contained in:
Wes Lambert
2022-04-01 21:11:57 +00:00
parent 2dc370c8b6
commit 39101cafd1
5 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import os
import json
import inspect
def checkSupportedType(meta, artifact_type):
if artifact_type not in meta['supportedTypes']:
sys.exit("No supported type detected!")
else:
return True
def loadData(artifact):
request_data = json.loads(artifact)
artifact_value = request_data['value']
artifact_type = request_data['artifactType']
return artifact_type, artifact_value
def loadMeta(file):
dir = os.path.dirname(os.path.realpath(file))
filename = os.path.realpath(file).rsplit('/', 1)[1].split('.')[0]
with open(str(dir + "/" + filename + ".json"), "r") as metafile:
return json.load(metafile)