rapid7 / metasploit-framework

Metasploit Framework
https://www.metasploit.com/
Other
33.81k stars 13.91k forks source link

Importing Python modules on Linux Mint (Ubuntu) #12684

Closed ku4eto closed 3 years ago

ku4eto commented 4 years ago

Issue:

From what i saw, putting a Python script (module), into modules/exploits/.... and issuing updatedb should add the script to the database. But with use i cant seem to find it. Permissions on the script are root:root, 744 (all other Ruby scripts use 644).

I have the Metasploit installed in /opt/metasploit-framework with /usr/bin/ having symlinks to /etc/alternatives/ and from there to the /opt/metasploit-framework/bin.

I tried adding the $PYTHONPATH to use /opt/metasploit-framework/embedded/framework/lib/msf/core/modules/external/python/metasploit/, but nothing happened.

Running the script directly gives an error for missing module metasploit. Trying to install it with pip returns 404 error, likely no longer present (but this should not matter, since it should be looking in the Metasploit directories supposedly).

Tried installing the pymetasploit and renaming the imported module, but ... does not find it, with or without the $PYTHONPATH.

ku4eto@ku4eto:~/Desktop$ python3 routeros-exploit.py 
Traceback (most recent call last):
  File "routeros-exploit.py", line 7, in <module>
    from pymetasploit import module
ModuleNotFoundError: No module named 'pymetasploit'
ku4eto@ku4eto:~/Desktop$ pip3 install pymetasploit
Requirement already satisfied: pymetasploit in /usr/local/lib/python3.6/dist-packages (1.1)
Requirement already satisfied: msgpack-python>=0.1.12 in /usr/local/lib/python3.6/dist-packages (from pymetasploit) (0.5.6)

(tried under normal and root users, does not matter).

The script i want to run is this one: https://www.exploit-db.com/exploits/45170

Version and source: root@ku4eto:/home/ku4eto# apt-cache policy | grep metasploit 500 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid/main i386 Packages origin downloads.metasploit.com 500 http://downloads.metasploit.com/data/releases/metasploit-framework/apt lucid/main amd64 Packages origin downloads.metasploit.com metasploit-framework -> 5.0.64+20191207112612~1rapid7-1 with priority 1000

OS: Linux Mint 19

I would need help on getting this to work, not sure where the issue exactly is. There is almost no documentation about this.

github-actions[bot] commented 3 years ago

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

github-actions[bot] commented 3 years ago

Hi again!

It’s been 60 days since anything happened on this issue, so we are going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.