LMGsec / Magic-Unicorn-Tool

http://lmgsecurity.com/
BSD 2-Clause "Simplified" License
261 stars 37 forks source link

Encoding Error #2

Closed matchstickboy closed 6 years ago

matchstickboy commented 6 years ago

Hello,

Am attempting to run the Crowdstrike retriever.py script to obtain activites of a test account in our O365 org. Receiving the following error:

Traceback (most recent call last): File "retriever.py", line 96, in csv_file = open(args.output, 'w+', encoding='utf-8') TypeError: 'encoding' is an invalid keyword argument for this function

Encountering the issue on both Windows 10 and Kali using Python 2.7, and on Windows 10 using Python 3.7. I'm guessing I'm missing a library in Python?? Any help would be appreciated. Let me know if additional information would help.

Thank you in advance,

Chris

nogweii commented 6 years ago

The encoding= argument to open() is only valid for Python 3, so make sure you're running with the correct version. If you are executing the file directly, the shebang in retriever.py uses python. You can check what version that binary is symlinked to by running python --version.

Vico311 commented 6 years ago

Make sure you do the following as I would think its required: sudo apt-get upgrade python3 sudo apt-get install python3-pip pip3 install requests

MattDurrin commented 6 years ago

You could try sticking the encoding declaration in the header if you're using python 2.7. I'm working on a version that's compatible with 2.7 currently but it's not quite finished yet.

matchstickboy commented 6 years ago

Thank you everybody for your responses. I tried Vico311's recommendation first, and it did the trick :-)

Also, thank you Matt for your work in putting this all together.

Cheers all,

Chris

On Fri, Jun 29, 2018 at 12:29 AM MattDurrin notifications@github.com wrote:

You could try sticking

!/usr/bin/env python

-- coding: utf-8 --

In the header of you're using python 2.7. I'm working on a version that's compatible with 2.7 currently but it's not quite finished yet.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/LMGsec/Magic-Unicorn-Tool/issues/2#issuecomment-401244268, or mute the thread https://github.com/notifications/unsubscribe-auth/AdCSNG0yTf5YZQcnJRi8oorZjQaYonVpks5uBa0TgaJpZM4U7-Qk .

MattDurrin commented 6 years ago

My pleasure, Chris. I hope you find it useful. We will be updating and uploading as we go so stay tuned!