Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Oct 1, 2019
2 parents 97dcc08 + 5f7d99f commit 9d926b1
Show file tree
Hide file tree
Showing 45 changed files with 796 additions and 340 deletions.
10 changes: 9 additions & 1 deletion analyzers/CuckooSandbox/CuckooSandbox_File_Analysis.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CuckooSandbox_File_Analysis_Inet",
"version": "1.1",
"version": "1.2",
"author": "Andrea Garavaglia, LDO-CERT",
"url": "https://github.com/garanews/Cortex-Analyzers",
"license": "AGPL-V3",
Expand All @@ -15,6 +15,14 @@
"type": "string",
"multi": false,
"required": true
},
{
"name": "verifyssl",
"description": "Verify SSL certificate",
"type": "boolean",
"multi": false,
"required": true,
"defaultValue": true
}
]
}
10 changes: 9 additions & 1 deletion analyzers/CuckooSandbox/CuckooSandbox_Url_Analysis.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CuckooSandbox_Url_Analysis",
"version": "1.1",
"version": "1.2",
"author": "Andrea Garavaglia, LDO-CERT",
"url": "https://github.com/garanews/Cortex-Analyzers",
"license": "AGPL-V3",
Expand All @@ -15,6 +15,14 @@
"type": "string",
"multi": false,
"required": true
},
{
"name": "verifyssl",
"description": "Verify SSL certificate",
"type": "boolean",
"multi": false,
"required": true,
"defaultValue": true
}
]

Expand Down
15 changes: 11 additions & 4 deletions analyzers/CuckooSandbox/cuckoosandbox_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def __init__(self):
self.url = self.url + "/" if not self.url.endswith("/") else self.url
# self.analysistimeout = self.get_param('config.analysistimeout', 30*60, None)
# self.networktimeout = self.get_param('config.networktimeout', 30, None)
self.verify = self.get_param('config.verifyssl', True, None)
if not self.verify:
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

def summary(self, raw):
taxonomies = []
Expand Down Expand Up @@ -53,14 +57,15 @@ def run(self):
filename = self.get_param('filename', basename(filepath))
with open(filepath, "rb") as sample:
files = {"file": (filename, sample)}
response = requests.post(self.url + 'tasks/create/file', files=files)
response = requests.post(self.url + 'tasks/create/file', files=files, verify=self.verify)
task_id = response.json()['task_ids'][0] if 'task_ids' in response.json().keys() \
else response.json()['task_id']

# url analysis
elif self.data_type == 'url':
data = {"url": self.get_data()}
response = requests.post(self.url + 'tasks/create/url', data=data)
response = requests.post(
self.url + 'tasks/create/url', data=data, verify=self.verify)
task_id = response.json()['task_id']

else:
Expand All @@ -70,7 +75,8 @@ def run(self):
tries = 0
while not finished and tries <= 15: # wait max 15 mins
time.sleep(60)
response = requests.get(self.url + 'tasks/view/' + str(task_id))
response = requests.get(
self.url + 'tasks/view/' + str(task_id), verify=self.verify)
content = response.json()['task']['status']
if content == 'reported':
finished = True
Expand All @@ -79,7 +85,8 @@ def run(self):
self.error('CuckooSandbox analysis timed out')

# Download the report
response = requests.get(self.url + 'tasks/report/' + str(task_id) + '/json')
response = requests.get(
self.url + 'tasks/report/' + str(task_id) + '/json', verify=self.verify)
resp_json = response.json()
list_description = [x['description'] for x in resp_json['signatures']]
if 'suricata' in resp_json.keys() and 'alerts' in resp_json['suricata'].keys():
Expand Down
24 changes: 0 additions & 24 deletions analyzers/Cymon/Cymon_Check_IP.json

This file was deleted.

221 changes: 0 additions & 221 deletions analyzers/Cymon/cymon_analyzer.py

This file was deleted.

2 changes: 0 additions & 2 deletions analyzers/Cymon/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion analyzers/FileInfo/FileInfo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "FileInfo",
"version": "6.0",
"version": "7.0",
"author": "TheHive-Project",
"url": "https://github.com/TheHive-Project/Cortex-Analyzers",
"license": "AGPL-V3",
Expand Down
5 changes: 4 additions & 1 deletion analyzers/FileInfo/submodules/submodule_ioc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def iocparser(self, path):
oformat = 'json'
try:
with redirect_stdout(out):
P.Parser(output_format=oformat).parse(path)
try:
P.Parser(output_format=oformat).parse(path)
except TypeError:
pass
oo = out.getvalue().split('\n')
if oo[-1] == '':
oo.pop()
Expand Down
Loading

0 comments on commit 9d926b1

Please sign in to comment.