update cuckoo module to fix duplicated check (#626)

This commit is contained in:
doomedraven
2017-11-27 09:45:06 +01:00
committed by Michel Oosterhof
parent c47613dcd9
commit fa8821cfe3

View File

@ -99,7 +99,6 @@ class Output(cowrie.core.output.Output):
"""
Check if file already was analyzed by cuckoo
"""
res = ""
try:
print("Looking for tasks for: {}".format(sha256))
res = requests.get(urljoin(self.url_base, "/files/view/sha256/{}".format(sha256)),
@ -107,11 +106,17 @@ class Output(cowrie.core.output.Output):
auth=HTTPBasicAuth(self.api_user,self.api_passwd),
timeout=60)
if res and res.ok:
if res.statuc_code == 200:
print("Sample found in Sandbox, with ID: {}".format(res.json().get("sample", {}).get("id", 0)))
return True
else:
return False
except Exception as e:
print(e)
return res
return False
def postfile(self, artifact, fileName):
"""