-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from TheHive-Project/master
Pull in latest release
- Loading branch information
Showing
76 changed files
with
1,716 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python | ||
# encoding: utf-8 | ||
|
||
import requests | ||
from cortexutils.analyzer import Analyzer | ||
|
||
class CyberprotectAnalyzer(Analyzer): | ||
|
||
URI = "https://threatscore.cyberprotect.fr/api/score/" | ||
|
||
def __init__(self): | ||
Analyzer.__init__(self) | ||
self.service = self.get_param('config.service', None, 'Service parameter is missing') | ||
|
||
def summary(self, raw): | ||
taxonomies = [] | ||
namespace = "Cyberprotect" | ||
if self.service == 'ThreatScore': | ||
level = 'info' | ||
value = 'not in database' | ||
if raw.get('data') and raw.get('scores') and len(raw.get('scores')) > 0: | ||
value = 'not analyzed yet' | ||
if raw['scores'][0].get('score'): | ||
level = 'safe' | ||
value = raw['scores'][0]['score'] | ||
if value >= 0.5: | ||
level = 'malicious' | ||
elif value >= 0.25 and value < 0.5: | ||
level = 'suspicious' | ||
taxonomies.append(self.build_taxonomy(level, namespace, self.service, value)) | ||
return {"taxonomies": taxonomies} | ||
|
||
def run(self): | ||
Analyzer.run(self) | ||
if self.service == 'ThreatScore' and (self.data_type == 'domain' or self.data_type == 'ip'): | ||
try: | ||
response = requests.get("{}{}".format(self.URI, self.get_data())) | ||
result = response.json() | ||
self.report(result if len(result) > 0 else {}) | ||
except Exception as e: | ||
self.unexpectedError(e) | ||
else: | ||
self.notSupported() | ||
|
||
if __name__ == '__main__': | ||
CyberprotectAnalyzer().run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "Cyberprotect_ThreatScore", | ||
"author": "Rémi Allain, Cyberprotect", | ||
"license": "AGPL-V3", | ||
"url": "https://github.com/Cyberprotect/Cortex-Analyzers", | ||
"version": "1.0", | ||
"description": "ThreatScore is a cyber threat scoring system provided by Cyberprotect", | ||
"dataTypeList": ["domain", "ip"], | ||
"command": "Cyberprotect/CyberprotectAnalyzer.py", | ||
"baseConfig": "Cyberprotect", | ||
"config": { | ||
"service": "ThreatScore", | ||
"check_tlp": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cortexutils | ||
requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "DomainTools_HostingHistory", | ||
"version": "2.0", | ||
"author": "ANSSI", | ||
"url": "https://github.com/TheHive-Project/Cortex-Analyzers", | ||
"license": "AGPL-V3", | ||
"description": "Use DomainTools to get a list of historical registrant, name servers and IP addresses for a domain name.", | ||
"dataTypeList": ["domain"], | ||
"command": "DomainTools/domaintools_analyzer.py", | ||
"baseConfig": "DomainTools", | ||
"config": { | ||
"service": "hosting-history" | ||
}, | ||
"configurationItems": [ | ||
{ | ||
"name": "username", | ||
"description": "DomainTools API credentials", | ||
"type": "string", | ||
"multi": false, | ||
"required": true | ||
}, | ||
{ | ||
"name": "key", | ||
"description": "DomainTools API credentials", | ||
"type": "string", | ||
"multi": false, | ||
"required": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "DomainTools_ReverseIPWhois", | ||
"version": "2.0", | ||
"author": "ANSSI", | ||
"url": "https://github.com/TheHive-Project/Cortex-Analyzers", | ||
"license": "AGPL-V3", | ||
"description": "Use DomainTools to get a list of IP addresses which share the same registrant information.", | ||
"dataTypeList": ["mail", "ip", "domain", "other"], | ||
"command": "DomainTools/domaintools_analyzer.py", | ||
"baseConfig": "DomainTools", | ||
"config": { | ||
"service": "reverse-ip-whois" | ||
}, | ||
"configurationItems": [ | ||
{ | ||
"name": "username", | ||
"description": "DomainTools API credentials", | ||
"type": "string", | ||
"multi": false, | ||
"required": true | ||
}, | ||
{ | ||
"name": "key", | ||
"description": "DomainTools API credentials", | ||
"type": "string", | ||
"multi": false, | ||
"required": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...omainTools/DomainTools_WhoisLookupIP.json → ...ools/DomainTools_WhoisLookupUnparsed.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "HIBP_Query", | ||
"version": "1.0", | ||
"author": "Matt Erasmus", | ||
"url": "https://github.com/TheHive-Project/Cortex-Analyzers", | ||
"license": "AGPL-V3", | ||
"description": "Query haveibeenpwned.com for a compromised email address", | ||
"dataTypeList": ["mail"], | ||
"baseConfig": "HIBP", | ||
"config": { | ||
"service": "query", | ||
"url": "https://haveibeenpwned.com/api/v2/breachedaccount/" | ||
}, | ||
"command": "HIBP_Query/hibpquery_analyzer.py", | ||
"configurationItems": [ | ||
{ | ||
"name": "unverified", | ||
"description": "Include unverified breaches", | ||
"type": "boolean", | ||
"multi": false, | ||
"required": true, | ||
"defaultValue": true | ||
} | ||
] | ||
} |
Oops, something went wrong.