Skip to content

Commit 1eea686

Browse files
committed
Signed-off-by: Ryan B <randomrhythm@rhythmengineering.com>
1 parent e167c43 commit 1eea686

File tree

7 files changed

+9
-16
lines changed

7 files changed

+9
-16
lines changed

Cuckoo/Single_Query_Module/tia.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#Copyright (c) 2018 Ryan Boyle randomrhythm@rhythmengineering.com.
2-
#All rights reserved.
32

43
#This program is free software: you can redistribute it and/or modify
54
#it under the terms of the GNU General Public License as published by

Cuckoo/tia.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#Copyright (c) 2018 Ryan Boyle randomrhythm@rhythmengineering.com.
2-
#All rights reserved.
32

43
#This program is free software: you can redistribute it and/or modify
54
#it under the terms of the GNU General Public License as published by
@@ -27,8 +26,7 @@ def run(self):
2726
dictTIA = {'BitDefender': None, 'TrendMicro': None, 'Symantec': None, 'F-Secure': None, 'ESET-NOD32': None, 'DrWeb': None, 'Avira': None, 'AntiVir': None, 'Microsoft': None, 'Sophos': None, 'Panda': None, 'BitDefender': None, 'McAfee': None, 'ClamAV': None}
2827
key = self.options.get("key", None)
2928
if not key:
30-
raise CuckooProcessingError("TIA API key not "
31-
"configured, skip")
29+
raise CuckooProcessingError("TIA API key not configured, skip")
3230
response_data = ""
3331
queryStringPart = ""
3432
#print self.results["virustotal"]["results"]
@@ -50,7 +48,7 @@ def run(self):
5048
try:
5149
json_object = json.loads(response_data)
5250
except ValueError, e:
53-
CuckooProcessingError("TIA error processing combined JSON: " + response_data)
51+
raise CuckooProcessingError("TIA error processing combined JSON: " + response_data)
5452
#print json_object
5553
return json_object
5654

@@ -59,19 +57,18 @@ def tia_request(vendorQueryString, apikey): #performs HTTP GET against TIA API a
5957
data = {"ApiKey": apikey}
6058
timeout = 60
6159
try:
62-
r = requests.get(url, params=data, verify=True, timeout=int(timeout))
60+
r = requests.get(url, params=data, verify=True, timeout=timeout) #set verify=False to bypass certificate verification
6361

6462
except requests.exceptions.RequestException as e:
65-
raise CuckooProcessingError("Unable to complete connection "
66-
"to TIA: {0}".format(e))
63+
raise CuckooProcessingError("Unable to complete connection to TIA: {0}".format(e))
6764
return r.content
6865

6966
def combineTIAresults(queryStringPart, vendorname, detectionName):
7067
queryStringPieces = queryStringPart
7168
if queryStringPieces == "":
72-
queryStringPieces = vendorname + "=" + detectionName
69+
queryStringPieces = "%s=%s" % (vendorname, detectionName)
7370
else:
74-
queryStringPieces = queryStringPieces + "&" + vendorname + "=" + detectionName
71+
queryStringPieces = queryStringPieces + "&" + "%s=%s" % (vendorname, detectionName)
7572
return queryStringPieces
7673

7774
def is_json(myjson):

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ Result example from query:
4444
If you provide an invalid API key you will received a 401 error:
4545

4646
`HTTP/1.1 401 Unauthorized
47-
<Error><Message>Authorization has been denied for this request.</Message></Error>`
47+
{"Message":"Authorization has been denied for this request."}`
4848

4949
If you go over API threshold limit of 48 a minute you will receive a 402 error:
5050

51-
<string>Rate limit exceeded</string>
51+
`"Rate limit exceeded"`
52+
5253
All API provided dates are in UTC.

TIA_Example.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#TIA API Example
22
#Copyright (c) 2018 Ryan Boyle randomrhythm@rhythmengineering.com.
3-
#All rights reserved.
43

54
#This program is free software: you can redistribute it and/or modify
65
#it under the terms of the GNU General Public License as published by

TIA_Python_Demo/TIA_Demo.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#Copyright (c) 2018 Ryan Boyle randomrhythm@rhythmengineering.com.
2-
#All rights reserved.
32

43
#This program is free software: you can redistribute it and/or modify
54
#it under the terms of the GNU General Public License as published by

TIA_Python_Demo/TIA__Multi_Demo.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#Copyright (c) 2018 Ryan Boyle randomrhythm@rhythmengineering.com.
2-
#All rights reserved.
32

43
#This program is free software: you can redistribute it and/or modify
54
#it under the terms of the GNU General Public License as published by

VBScript Example/tia.vbs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
'Looks up vendor and detection name to return URL if one exists in TIA database
33

44
'Copyright (c) 2017 Ryan Boyle randomrhythm@rhythmengineering.com.
5-
'All rights reserved.
65

76
'This program is free software: you can redistribute it and/or modify
87
'it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)