Fixed checking for submission_names in VT JSON

pull/87/head
Hannah Ward 2017-01-05 10:46:07 +00:00
parent 1c5c14b6b8
commit 16311a9405
No known key found for this signature in database
GPG Key ID: 6F3BAD60DE190290
1 changed files with 4 additions and 14 deletions

View File

@ -101,12 +101,6 @@ def findAll(data, keys):
return a
def isset(d, key):
if key in d:
if d[key] not in [None, '', ' ']:
return True
return False
def getMoreInfo(req, key):
global limit
r = []
@ -136,20 +130,16 @@ def getMoreInfo(req, key):
params = {"hash":hsh, "apikey":key})
malsample = sample.content
if isset(data, "submission_names"):
# It is possible for VT to not give us any submission names
if "submission_names" in data:
r.append({"types":["malware-sample"],
"categories":["Payload delivery"],
"values":data["submission_names"],
"data": str(base64.b64encode(malsample), 'utf-8')
}
)
else:
r.append({"types":["malware-sample"],
"categories":["Payload delivery"],
"values":data["submission_names"],
"data": str(base64.b64encode(malsample), 'utf-8')
}
)
return r
def introspection():