From d83acef428e29dfb36e5ab67138dc6f5ed9f6902 Mon Sep 17 00:00:00 2001 From: arnydo Date: Tue, 11 Dec 2018 15:13:24 -0500 Subject: [PATCH] Change headers to dict and update long template --- analyzers/EmlParser/parse.py | 2 +- thehive-templates/EmlParser_1_1/long.html | 176 ++++++++++++---------- 2 files changed, 94 insertions(+), 84 deletions(-) diff --git a/analyzers/EmlParser/parse.py b/analyzers/EmlParser/parse.py index abc5879ba..ce4f1e0c0 100755 --- a/analyzers/EmlParser/parse.py +++ b/analyzers/EmlParser/parse.py @@ -67,7 +67,7 @@ def parseEml(filepath): #cause eml_parser does not provide raw headers (as far as I know) hParser = email.parser.HeaderParser() h = hParser.parsestr(raw_eml) - result['headers'] = (str(h).split('\n\n')[0]) + result['headers'] = dict(h) parsed_eml = eml_parser.eml_parser.decode_email(filepath, include_raw_body=True, include_attachment_data=True) #parsed_eml['header'].keys() gives: diff --git a/thehive-templates/EmlParser_1_1/long.html b/thehive-templates/EmlParser_1_1/long.html index a1fe34110..afc431a20 100644 --- a/thehive-templates/EmlParser_1_1/long.html +++ b/thehive-templates/EmlParser_1_1/long.html @@ -1,86 +1,96 @@
-
- {{(artifact.data || artifact.attachment.name) | fang}} +
+ {{(artifact.data || artifact.attachment.name) | fang}} +
+
+ {{content.errorMessage}} +
-
- {{content.errorMessage}} + + +
+
+ Email message details +
+
+
Is anonymous proxy
+
Is satellite provider
+ +
+
From
+
{{content.displayFrom}} ({{content.sender}})
+
+
+
To
+
{{content.displayTo}} ({{content.receivers}})
+
+
+
Subject
+
{{content.subject || '-'}}
+
+
+
Topic
+
{{content.topic || '-'}}
+
+
+
Bcc
+
{{content.bcc || '-'}}
+
+
+
Attachments
+
+
This message file includes + +
+ + + + + + + + + + + + + + + + + + + + + + + +
FilenameFile information
{{a.filename}}[MD5]: {{a.md5}}
[SHA1]: {{a.sha1}}
[SHA256]: {{a.sha256}}
+ {{a.mime}} +
+
+
+
+
Headers
+
+ + + + + + + + + +
HeaderContent
{{k}}{{v}}
+
+
+
+
Body
+
+
{{content.body}}
+
+
+
-
- - -
-
- Email message details -
-
-
Is anonymous proxy
-
Is satellite provider
- -
-
From
-
{{content.displayFrom}} ({{content.sender}})
-
-
-
To
-
{{content.displayTo}} ({{content.receivers}})
-
-
-
Subject
-
{{content.subject || '-'}}
-
-
-
Topic
-
{{content.topic || '-'}}
-
-
-
Bcc
-
{{content.bcc || '-'}}
-
-
-
Attachments
-
-
This message file includes - -
- - - - - - - - - - - - - - - - - - - - - - - -
FilenameFile information
{{a.filename}}[MD5]: {{a.md5}}
[SHA1]: {{a.sha1}}
[SHA256]: {{a.sha256}}
- {{a.mime}} -
-
-
-
-
Headers
-
-
{{content.headers}}
-
-
-
-
Body
-
-
{{content.body}}
-
-
-
-
+