eml-analyzer


Nameeml-analyzer JSON
Version 3.0.1 PyPI version JSON
download
home_pagehttps://github.com/wahlflo/eml_analyzer
SummaryA cli script to analyze an E-Mail in the eml format for viewing the header, extracting attachments, etc.
upload_time2023-08-04 20:30:43
maintainer
docs_urlNone
authorFlorian Wahl
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # emlAnalyzer
A CLI script to analyze an email in the EML format for viewing headers, extracting attachments, etc.

## Installation

Install the package with pip

    pip install eml-analyzer

## Usage
Type ```emlAnalyzer --help``` to view the help.

```
usage: emlAnalyzer [-h] [-i [INPUT]] [--header] [-x] [-a] [--text] [--html] [-s] [-u] [-ea EXTRACT] [--extract-all] [-o OUTPUT] [--format [{json}]]

A CLI script to analyze an email in the EML format for viewing headers, extracting attachments, etc.

optional arguments:
  -h, --help            show this help message and exit
  -i [INPUT], --input [INPUT]
                        Path to the EML file. Accepts standard input if omitted
  --header              Shows the headers
  -x, --tracking        Shows content which is reloaded from external resources in the HTML part
  -a, --attachments     Lists attachments
  --text                Shows plaintext
  --html                Shows HTML
  -s, --structure       Shows structure of the E-Mail
  -u, --url             Shows embedded clickable links and urls in the HTML and text part
  -ea EXTRACT, --extract EXTRACT
                        Extracts the x-th attachment. Can not be used together with the '--format' parameter.
  --extract-all         Extracts all attachments. If a output format is specified the content of the attachments will be included in the structural output as a base64 encoded blob
  -o OUTPUT, --output OUTPUT
                        Path for the extracted attachment (default is filename in working directory)
  --format [{json}]     Specifies a structured output format, the default format is not machine-readable
```

## Examples

### Example 1
```
$ emlAnalyzer -i email_1.eml
 =================
 ||  Structure  ||
 =================
|- text/html

 =========================
 ||  URLs in HTML part  ||
 =========================
 - https://suspicious.site.com/Zajnad

 ===============================================
 ||  Reloaded Content (aka. Tracking Pixels)  ||
 ===============================================
[+] No content found which will be reloaded from external resources

 ===================
 ||  Attachments  ||
 ===================
[+] E-Mail contains no attachments

```

### Example 2
```
$ emlAnalyzer -i email_2.eml
 =================
 ||  Structure  ||
 =================
|- multipart/mixed
|  |- multipart/related
|  |  |- text/html
|  |  |- image/jpeg                        [image002.jpg]
|  |  |- image/jpeg                        [image003.jpg]
|  |  |- image/png                         [image004.png]
|  |- message/rfc822
|  |  |- multipart/alternative
|  |  |  |- text/plain
|  |  |  |- text/html

 =========================
 ||  URLs in HTML part  ||
 =========================
 - https://example.company.com/random/link
 - mailto:john.doe@company.com

 ===============================================
 ||  Reloaded Content (aka. Tracking Pixels)  ||
 ===============================================
[+] No content found which will be reloaded from external resources

 ===================
 ||  Attachments  ||
 ===================
[1] image002.jpg        image/jpeg        inline
[2] image003.jpg        image/jpeg        inline
[3] image004.png        image/png         inline

```

### Example 3
```
$ emlAnalyzer -i email_1.eml --header

 ==============
 ||  Header  ||
 ==============
From..........................................John Doe <asjkasd@asdasd123.com>
To............................................"bob@company.at" <bob@company.at>
Subject.......................................RANDOM SUBJECT
Thread-Topic..................................RANDOM SUBJECT
X-MS-Exchange-MessageSentRepresentingType.....1
Date..........................................Tue, 19 May 2020 07:02:37 +0000
Accept-Language...............................de-DE, en-US
Content-Language..............................de-DE
X-MS-Exchange-Organization-AuthAs.............Anonymous
X-MS-Has-Attach...............................
X-MS-TNEF-Correlator..........................
x-fireeye.....................................Clean
x-rmx-source..................................123.123.123.123
Content-Type..................................text/html; charset="iso-8859-1"
Content-Transfer-Encoding.....................quoted-printable
MIME-Version..................................1.0
```

### Example 4
```json
$ emlAnalyzer -i email_4.eml --format json
{
    "structure": {
        "type": "multipart/mixed",
        "children": [
            {
                "type": "text/plain"
            },
            {
                "type": "application/pdf",
                "name": "attachment_123.pdf",
                "disposition": "attachment"
            }
        ]
    },
    "urls": [
        "https://www.facebook.de/abc123",
        "https://www.google.com/demo"
    ],
    "reloaded_content": [],
    "attachments": [
        {
            "type": "application/pdf",
            "name": "attachment_123.pdf",
            "disposition": "attachment"
        }
    ]
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/wahlflo/eml_analyzer",
    "name": "eml-analyzer",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Florian Wahl",
    "author_email": "florian.wahl.developer@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/13/e9/ed5216efbbbb14e95b49df5164f0bc6fce06ad69f68603891f07aa9e2c77/eml-analyzer-3.0.1.tar.gz",
    "platform": null,
    "description": "# emlAnalyzer\r\nA CLI script to analyze an email in the EML format for viewing headers, extracting attachments, etc.\r\n\r\n## Installation\r\n\r\nInstall the package with pip\r\n\r\n    pip install eml-analyzer\r\n\r\n## Usage\r\nType ```emlAnalyzer --help``` to view the help.\r\n\r\n```\r\nusage: emlAnalyzer [-h] [-i [INPUT]] [--header] [-x] [-a] [--text] [--html] [-s] [-u] [-ea EXTRACT] [--extract-all] [-o OUTPUT] [--format [{json}]]\r\n\r\nA CLI script to analyze an email in the EML format for viewing headers, extracting attachments, etc.\r\n\r\noptional arguments:\r\n  -h, --help            show this help message and exit\r\n  -i [INPUT], --input [INPUT]\r\n                        Path to the EML file. Accepts standard input if omitted\r\n  --header              Shows the headers\r\n  -x, --tracking        Shows content which is reloaded from external resources in the HTML part\r\n  -a, --attachments     Lists attachments\r\n  --text                Shows plaintext\r\n  --html                Shows HTML\r\n  -s, --structure       Shows structure of the E-Mail\r\n  -u, --url             Shows embedded clickable links and urls in the HTML and text part\r\n  -ea EXTRACT, --extract EXTRACT\r\n                        Extracts the x-th attachment. Can not be used together with the '--format' parameter.\r\n  --extract-all         Extracts all attachments. If a output format is specified the content of the attachments will be included in the structural output as a base64 encoded blob\r\n  -o OUTPUT, --output OUTPUT\r\n                        Path for the extracted attachment (default is filename in working directory)\r\n  --format [{json}]     Specifies a structured output format, the default format is not machine-readable\r\n```\r\n\r\n## Examples\r\n\r\n### Example 1\r\n```\r\n$ emlAnalyzer -i email_1.eml\r\n =================\r\n ||  Structure  ||\r\n =================\r\n|- text/html\r\n\r\n =========================\r\n ||  URLs in HTML part  ||\r\n =========================\r\n - https://suspicious.site.com/Zajnad\r\n\r\n ===============================================\r\n ||  Reloaded Content (aka. Tracking Pixels)  ||\r\n ===============================================\r\n[+] No content found which will be reloaded from external resources\r\n\r\n ===================\r\n ||  Attachments  ||\r\n ===================\r\n[+] E-Mail contains no attachments\r\n\r\n```\r\n\r\n### Example 2\r\n```\r\n$ emlAnalyzer -i email_2.eml\r\n =================\r\n ||  Structure  ||\r\n =================\r\n|- multipart/mixed\r\n|  |- multipart/related\r\n|  |  |- text/html\r\n|  |  |- image/jpeg                        [image002.jpg]\r\n|  |  |- image/jpeg                        [image003.jpg]\r\n|  |  |- image/png                         [image004.png]\r\n|  |- message/rfc822\r\n|  |  |- multipart/alternative\r\n|  |  |  |- text/plain\r\n|  |  |  |- text/html\r\n\r\n =========================\r\n ||  URLs in HTML part  ||\r\n =========================\r\n - https://example.company.com/random/link\r\n - mailto:john.doe@company.com\r\n\r\n ===============================================\r\n ||  Reloaded Content (aka. Tracking Pixels)  ||\r\n ===============================================\r\n[+] No content found which will be reloaded from external resources\r\n\r\n ===================\r\n ||  Attachments  ||\r\n ===================\r\n[1] image002.jpg        image/jpeg        inline\r\n[2] image003.jpg        image/jpeg        inline\r\n[3] image004.png        image/png         inline\r\n\r\n```\r\n\r\n### Example 3\r\n```\r\n$ emlAnalyzer -i email_1.eml --header\r\n\r\n ==============\r\n ||  Header  ||\r\n ==============\r\nFrom..........................................John Doe <asjkasd@asdasd123.com>\r\nTo............................................\"bob@company.at\" <bob@company.at>\r\nSubject.......................................RANDOM SUBJECT\r\nThread-Topic..................................RANDOM SUBJECT\r\nX-MS-Exchange-MessageSentRepresentingType.....1\r\nDate..........................................Tue, 19 May 2020 07:02:37 +0000\r\nAccept-Language...............................de-DE, en-US\r\nContent-Language..............................de-DE\r\nX-MS-Exchange-Organization-AuthAs.............Anonymous\r\nX-MS-Has-Attach...............................\r\nX-MS-TNEF-Correlator..........................\r\nx-fireeye.....................................Clean\r\nx-rmx-source..................................123.123.123.123\r\nContent-Type..................................text/html; charset=\"iso-8859-1\"\r\nContent-Transfer-Encoding.....................quoted-printable\r\nMIME-Version..................................1.0\r\n```\r\n\r\n### Example 4\r\n```json\r\n$ emlAnalyzer -i email_4.eml --format json\r\n{\r\n    \"structure\": {\r\n        \"type\": \"multipart/mixed\",\r\n        \"children\": [\r\n            {\r\n                \"type\": \"text/plain\"\r\n            },\r\n            {\r\n                \"type\": \"application/pdf\",\r\n                \"name\": \"attachment_123.pdf\",\r\n                \"disposition\": \"attachment\"\r\n            }\r\n        ]\r\n    },\r\n    \"urls\": [\r\n        \"https://www.facebook.de/abc123\",\r\n        \"https://www.google.com/demo\"\r\n    ],\r\n    \"reloaded_content\": [],\r\n    \"attachments\": [\r\n        {\r\n            \"type\": \"application/pdf\",\r\n            \"name\": \"attachment_123.pdf\",\r\n            \"disposition\": \"attachment\"\r\n        }\r\n    ]\r\n}\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A cli script to analyze an E-Mail in the eml format for viewing the header, extracting attachments, etc.",
    "version": "3.0.1",
    "project_urls": {
        "Homepage": "https://github.com/wahlflo/eml_analyzer"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b3afb1876fece30a68ab5e2e3856d5a1a09d7f97cff2d0876f7e87cea344e931",
                "md5": "60b98e7789b30f32b839aa7df5c244eb",
                "sha256": "47130c5dcc4d8851cddbca2acfaeb060b74ee0500a122f39b18f1ea709663549"
            },
            "downloads": -1,
            "filename": "eml_analyzer-3.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "60b98e7789b30f32b839aa7df5c244eb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 14973,
            "upload_time": "2023-08-04T20:30:41",
            "upload_time_iso_8601": "2023-08-04T20:30:41.907910Z",
            "url": "https://files.pythonhosted.org/packages/b3/af/b1876fece30a68ab5e2e3856d5a1a09d7f97cff2d0876f7e87cea344e931/eml_analyzer-3.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "13e9ed5216efbbbb14e95b49df5164f0bc6fce06ad69f68603891f07aa9e2c77",
                "md5": "87ceccee62e595ca1e4502dc29a1cd80",
                "sha256": "d1cc4406458769304ead92da72b7919123b3c03686f6916f352f98f19a79272f"
            },
            "downloads": -1,
            "filename": "eml-analyzer-3.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "87ceccee62e595ca1e4502dc29a1cd80",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12667,
            "upload_time": "2023-08-04T20:30:43",
            "upload_time_iso_8601": "2023-08-04T20:30:43.526588Z",
            "url": "https://files.pythonhosted.org/packages/13/e9/ed5216efbbbb14e95b49df5164f0bc6fce06ad69f68603891f07aa9e2c77/eml-analyzer-3.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-04 20:30:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "wahlflo",
    "github_project": "eml_analyzer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "eml-analyzer"
}
        
Elapsed time: 0.14793s