corelan / mona

Corelan Repository for mona.py
BSD 3-Clause "New" or "Revised" License
1.71k stars 564 forks source link

pycommands: error importing module ( #28

Closed tee-lake closed 6 years ago

tee-lake commented 6 years ago

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 commented 6 years ago

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

corelanc0d3r commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

guys i get the same error

dcliss commented 5 years ago

which version to run ?

corelanc0d3r commented 5 years ago

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

dcliss commented 5 years ago

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 commented 5 years ago

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

KweonKang commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

@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 commented 4 years ago

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:

corelanc0d3r commented 4 years ago

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

pope-es commented 4 years ago

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.

Is there any way I can provide further debug info?

corelanc0d3r commented 4 years ago

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 commented 4 years ago

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!

asmtoha commented 3 years ago

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

corelanc0d3r commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

topaz0hisham commented 3 years ago

image

still i get error

iprincs commented 1 year ago

used capital M in command