-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.5.0
- Loading branch information
Showing
27 changed files
with
1,822 additions
and
3 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,25 @@ | ||
{ | ||
"name": "IPVoid", | ||
"version": "1.0", | ||
"author": "Joel Snape @ Nettitude", | ||
"url": "https://github.com/TheHive-Project/Cortex-Analyzers", | ||
"license": "AGPL-v3", | ||
"description": "Determine whether an IP is present on any of the feeds consumed by IPVoid", | ||
"dataTypeList": ["ip"], | ||
"baseConfig": "IPVoid", | ||
"command": "IPVoid/ipvoid.py", | ||
"configurationItems": [ | ||
{ | ||
"name": "key", | ||
"description": "API key for IPVoid", | ||
"type": "string", | ||
"multi": false, | ||
"required": true | ||
} | ||
], | ||
"config": { | ||
"check_tlp": true, | ||
"max_tlp": 2, | ||
"auto_extract": false | ||
} | ||
} |
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,64 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import requests | ||
|
||
from cortexutils.analyzer import Analyzer | ||
|
||
class IPVoid(Analyzer): | ||
""" | ||
IPVoid API docs - https://app.apivoid.com/dashboard/api/ip-reputation/documentation/ | ||
""" | ||
|
||
def run(self): | ||
try: | ||
if self.data_type == 'ip': | ||
api_key = self.get_param('config.key',None, 'Missing API key') | ||
ip = self.get_data() | ||
|
||
url = 'https://endpoint.apivoid.com/iprep/v1/pay-as-you-go/?key={}&ip={}'.format(api_key,ip) | ||
response = requests.get(url) | ||
|
||
if not (200 <= response.status_code < 300): | ||
self.error('Unable to query IPVoid API\n{}'.format(response.text)) | ||
|
||
json_response = response.json() | ||
|
||
self.report(json_response) | ||
|
||
else: | ||
self.notSupported() | ||
except Exception as e: | ||
self.unexpectedError(e) | ||
|
||
|
||
def summary(self, raw): | ||
try: | ||
taxonomies = list() | ||
|
||
#Parse the information section of the report into a Location taxonomy. Only a subset of keys included for now | ||
|
||
info = raw['data']['report']['information'] | ||
|
||
location = info['city_name']+'/'+info['country_name'] | ||
taxonomies = taxonomies + [self.build_taxonomy('info','IPVoid','Location',location)] | ||
|
||
#Parse blacklists info | ||
detections = raw['data']['report']['blacklists']['detections'] | ||
engines = raw['data']['report']['blacklists']['engines_count'] | ||
|
||
if detections > 0: | ||
taxonomies = taxonomies + [self.build_taxonomy('suspicious','IPVoid','Blacklists',str(detections)+"/"+str(engines))] | ||
else: | ||
taxonomies = taxonomies + [self.build_taxonomy('info','IPVoid','Blacklists',str(detections)+"/"+str(engines))] | ||
|
||
return({'taxonomies':taxonomies}) | ||
|
||
except Exception as e: | ||
if 'error' in raw: | ||
self.unexpectedError(raw['error']) | ||
else: | ||
self.unexpectedError(e) | ||
|
||
if __name__ == '__main__': | ||
IPVoid().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,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,27 @@ | ||
{ | ||
"name": "ThreatGrid", | ||
"license": "MIT", | ||
"author": "Cisco Security", | ||
"url": "https://github.com/CiscoSecurity", | ||
"version": "1.0", | ||
"description": "Threat Grid Sandbox", | ||
"dataTypeList": ["file", "url", "hash"], | ||
"command": "ThreatGrid/ThreatGrid.py", | ||
"baseConfig": "ThreatGrid", | ||
"configurationItems": [ | ||
{ | ||
"name": "tg_host", | ||
"description": "Threat Grid Host", | ||
"type": "string", | ||
"multi": false, | ||
"required": true | ||
}, | ||
{ | ||
"name": "api_key", | ||
"description": "Threat Grid API Key", | ||
"type": "string", | ||
"multi": false, | ||
"required": true | ||
} | ||
] | ||
} |
Oops, something went wrong.