Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pycommands: error importing module ( #28

Closed
tee-lake opened this issue Aug 22, 2018 · 23 comments
Closed

pycommands: error importing module ( #28

tee-lake opened this issue Aug 22, 2018 · 23 comments

Comments

@tee-lake
Copy link

Expected behavior

Mona should spit back data when launched (!mona) from the Immunity Debugger 1.85

Actual behavior

pycommands: error importing module
....
line 87 in
import urllib ...
Error Image here
image

Steps to reproduce the problem

installed Immunity Debugger and updated from python 2.7.1 to python 2.7.14
added mona.py to the PyCommands folder
started Immunity Debugger as an admin
use !mona

Other useful information (mona version, debugger & debugger version, OS version, etc)

OS: Windows 7 x64 SP 1
immunity debugger 1.85

@tee-lake
Copy link
Author

I downgraded the python version back to 2.7.1 which was installed by Immunity Debugger and it worked!

@corelanc0d3r
Copy link
Member

would it be possible to double check that you are installing the x86 version (and not the x64 version) of python 2.7.14 (or higher), and that you are installing it in the default folder (where 2.7.1 resides)?

thanks !

@sibios
Copy link

sibios commented Aug 25, 2018

I was having this issue as well. I can confirm that this is a result of using the x64 version of Python (2.7.15 in my case). Installing the x86 version resolved the error.

@corelanc0d3r
Copy link
Member

thanks - I'm also quite sure that this is caused by installing the x64 version
I'll close the issue for now, feel free to reopen if the issue has not been resolved.
(you should not be running the python 2.7.1 version, as you won't be able to run !mona upgrade)

@dcliss
Copy link

dcliss commented Dec 7, 2018

guys i get the same error

@dcliss
Copy link

dcliss commented Dec 7, 2018

which version to run ?

@corelanc0d3r
Copy link
Member

you need to run the x86 python version, not the x64 version

@dcliss
Copy link

dcliss commented Dec 23, 2018

i installed x86 version https://www.python.org/ftp/python/2.7.14/python-2.7.14.msi

still getting the same error any help ?

@corelanc0d3r
Copy link
Member

please make sure to add the 32bit python.exe binary to your system PATH

@KweonKang
Copy link

You'd rather check mona.py file. It is 630,068 byte size, not 5MB.
You can get it from https://raw.githubusercontent.com/corelan/mona/master/mona.py

@freis
Copy link

freis commented Mar 27, 2019

Added the 32bit python.exe (version 2.7.16)binary to PATH and used this last mona.py, still getting the same error.
OS is Windows 2008 Server.

@corelanc0d3r
Copy link
Member

@freis are you using Immunity Debugger? Did you install the python version that comes with immunity, and installed it in the default path? After that, you upgraded it to 2.7.16? What was the python installer filename?

When you open mona.py, does it contain python code? How many lines does it have?

Can you run any of the other pycommands in Immunity?

@pope-es
Copy link

pope-es commented Dec 5, 2019

I am experiencing the same error on two 32-bit VMs (XP and win7). On both, I made sure I'm running 32-bit python (v 2.7.17).
In the Win7, I even:

  • removing this Python version and instead installing the 2.7.1 that Immunity installs on setup. No luck either.
  • ensured c:\Python27 is added to $PATH.

@corelanc0d3r
Copy link
Member

can you please check/confirm that mona.py contains python code?
how many lines does it have ?

@pope-es
Copy link

pope-es commented Dec 8, 2019

Yep, it's 19102 lines of pure Python code. It's the same copy of the file that I am using in a Win 10 VM. All the VMs are freshly installed 32-bits versions of windows, with 2 cores and 2 GB RAM, running on VMware Fusion.

  • Tried downgrading to a random earlier version of mona.py.

  • Tried with Python 2.7.1 and 2.7.16, apart form the latest 2.7.17. All of them 32-bits.

Is there any way I can provide further debug info?

@corelanc0d3r
Copy link
Member

can you check the properties of the file and confirm the file has been "unblocked"? Files downloaded from the internet are marked as unsafe by default

can you run other pycommands (check the pycommands folders) - that should confirm that the python setup is correct

@pope-es
Copy link

pope-es commented Dec 10, 2019

can you check the properties of the file and confirm the file has been "unblocked"? Files downloaded from the internet are marked as unsafe by default -> In the file properties I don't see anything suggesting it's blocked or not trusted. In any case I also tried re-creating the file contents to a new file created by the admin, same result.

can you run other pycommands (check the pycommands folders) - that should confirm that the python setup is correct --> Idiot me. I was copying it to the "tools" folder. Sorry man, and thanks for the troubleshooting. I confirm that copying mona.py to the right folder solves the issue, no problem. In the W10 VM where it was working, for some reason I had an older of mona.py (2.0 rev 596) in the proper folder, so THAT one was working properly (and not the one I had copied to immunity\tools).

Thanks again, and congrats on your great work!

@PSYs0s
Copy link

PSYs0s commented Feb 25, 2021

I tried so many times in vmware. But doesn't work

@corelanc0d3r
Copy link
Member

I tried so many times in vmware. But doesn't work

would it be possible to provide more detailed information?
What exactly have you tried and what doesn't work?

@rodri3d
Copy link

rodri3d commented Mar 1, 2021

If you look at the description in the download link, it says: "removed some unneeded logging". Once you have the file, you must 'clean it' of unnecessary characters (otherwise it'll not work at all)

cheers!

@corelanc0d3r
Copy link
Member

if you're not able to get mona.py to run, please open a new issue

@topaz0hisham
Copy link

topaz0hisham commented Jul 22, 2021

image

still i get error

@iprincs
Copy link

iprincs commented Feb 26, 2023

used capital M in command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests