Skip to content

Commit

Permalink
#56 Phishtank() and short reports + bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Jun 20, 2017
1 parent 6e00de7 commit c10ac23
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion analyzers/PhishTank/PhishTank_CheckURL.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PhishTank_CheckURL",
"version": "1.0",
"version": "2.0",
"author": "Eric Capuano",
"url": "https://github.com/CERT-BDF/Cortex-Analyzers",
"license": "AGPL-V3",
Expand Down
15 changes: 12 additions & 3 deletions analyzers/PhishTank/phishtank_checkurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,19 @@ def phishtank_checkurl(self, data):
return json.loads(r.content)

def summary(self,raw):

taxonomy = {"level": "safe", "namespace": "PhishTank", "predicate": "In_Database", "value": "False"}
taxonomies = []

if ('in_database' in raw) :
return {'in_database':raw['in_database'],
'verified':raw['verified'],
'verified_at':raw['verified_at']}
taxonomy['value'] = "\"{}\"".format(raw['in_database'])
if raw['verified']:
taxonomy['level'] = "malicious"
else:
taxonomy['level'] = "suspicious"
taxonomies.append(taxonomy)
return {"taxonomies":taxonomies}


def run(self):
if self.service == 'query':
Expand Down
14 changes: 0 additions & 14 deletions thehive-templates/PhishTank_CheckURL_1_0/short.html

This file was deleted.

3 changes: 3 additions & 0 deletions thehive-templates/PhishTank_CheckURL_2_0/short.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<span class="label" ng-repeat="t in content.taxonomies" ng-class="{'info': 'label-info', 'safe': 'label-success', 'suspicious': 'label-warning', 'malicious':'label-danger'}[t.level]">
{{t.namespace}}:{{t.predicate}}={{t.value}}
</span>&nbsp;

0 comments on commit c10ac23

Please sign in to comment.