Skip to content

AttributeError: 'module' object has no attribute 'Message' #90

@AndyLeeRobinson

Description

@AndyLeeRobinson

Came across an msg file as a malicious attachment. There is no end to the methods that scammers are using to try to bypass the filters, and this is a new one to me.
So, none of my usual tools work, oletools etc.. so eventually found this repo.
However, it has been frustrating.
So, I ran:
pip install git+https://github.com/mattgwwalker/msg-extractor
and it appeared to install, but no executable extract-msg in /usr/local/bin as expected.

OK, it's a library, so did some more research and pieced together this code to try to do what I want, just to unpack the payload and identify any malicious urls.

import extract_msg
msg = extract_msg.Message("./docq0017-3512c.doc.msg")
for attachment in msg.attachments: attachment.save()

I get this error:

Traceback (most recent call last):
  File "extract_msg.py", line 1, in <module>
    import extract_msg
  File "/var/spool/MailScanner/quarantine/20190612/spam/x5CDM7as3550383/extract_msg.py", line 3, in <module>
    msg = extract_msg.Message("./docq0017-3512c.doc.msg")
AttributeError: 'module' object has no attribute 'Message'

Test on fully updated Fedora 28 and Fedora 29 machines.
It does not work for me from a fresh install.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions