threat9 / routersploit

Exploitation Framework for Embedded Devices
Other
12.2k stars 2.32k forks source link

AttributeError: 'module' object has no attribute 'packages' when running scanners/autopwn #82

Closed maluga-net closed 8 years ago

maluga-net commented 8 years ago

rsf > use scanners/autopwn rsf (AutoPwn) > set target 192.168.0.1 [+] {'target': '192.168.0.1'} rsf (AutoPwn) > run [*] Running module... [-] exploits/technicolor/tc7200_password_disclosure is not vulnerable [-] exploits/2wire/gateway_auth_bypass is not vulnerable [-] exploits/juniper/screenos_backdoor is not vulnerable [-] exploits/netgear/multi_rce is not vulnerable [-] exploits/netgear/n300_auth_bypass is not vulnerable [-] exploits/netgear/prosafe_rce is not vulnerable [-] Traceback (most recent call last): File "/home/michal-praca/Workspaces/Playground/routersploit/routersploit/interpreter.py", line 261, in command_run self.current_module.run() File "/home/michal-praca/Workspaces/Playground/routersploit/routersploit/modules/scanners/autopwn.py", line 49, in run module = imp.load_source('module', rootpath + f + '.py') File "routersploit/modules/exploits/ubiquiti/airos_6_x.py", line 14, in class Exploit(exploits.Exploit): File "routersploit/modules/exploits/ubiquiti/airos_6_x.py", line 43, in Exploit requests.packages.urllib3.disable_warnings() AttributeError: 'module' object has no attribute 'packages'

rsf (AutoPwn) > [*] routersploit stopped

Run on Ubuntu 14.04 with Python 2.7.6

fwkz commented 8 years ago

@maluga-net Please try pip install -U requests

maluga-net commented 8 years ago

[-] exploits/zte/f660_config_disclosure is not vulnerable [-] exploits/comtrend/ct_5361t_password_disclosure is not vulnerable [-] Traceback (most recent call last): File "/home/michal-praca/Workspaces/Playground/routersploit/routersploit/interpreter.py", line 261, in command_run self.current_module.run() File "/home/michal-praca/Workspaces/Playground/routersploit/routersploit/modules/scanners/autopwn.py", line 49, in run module = imp.load_source('module', rootpath + f + '.py') File "routersploit/modules/exploits/fortinet/fortigate_os_backdoor.py", line 9, in from paramiko.py3compat import u ImportError: No module named py3compat

fwkz commented 8 years ago

Please make sure you have all the requirements installed pip install -r requirements.txt

maluga-net commented 8 years ago

michal-praca@praca:~/Workspaces/Playground/routersploit$ sudo pip install -r requirements.txt [sudo] password for michal-praca: Requirement already satisfied (use --upgrade to upgrade): gnureadline in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 1)) Requirement already satisfied (use --upgrade to upgrade): requests in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 2)) Requirement already satisfied (use --upgrade to upgrade): paramiko in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 3)) Requirement already satisfied (use --upgrade to upgrade): beautifulsoup4 in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 4)) Requirement already satisfied (use --upgrade to upgrade): pysnmp in /usr/local/lib/python2.7/dist-packages (from -r requirements.txt (line 5)) Requirement already satisfied (use --upgrade to upgrade): pycrypto>=2.1,!=2.4 in /usr/lib/python2.7/dist-packages (from paramiko->-r requirements.txt (line 3))

I have used sudo as some compiled packages could not be installed when I first run this command: (...) running install_lib

copying build/lib.linux-x86_64-2.7/gnureadline.so -> /usr/local/lib/python2.7/dist-packages

error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/gnureadline.so' (...)

fwkz commented 8 years ago

If you have installed everything beside gnureadline you are good to go, because it is required only for OSX.

Alternatively you can run pip like that: pip install requests paramiko beautifulsoup4 pysnmp

maluga-net commented 8 years ago

Looks like it's a paramiko library bug: http://stackoverflow.com/questions/34192016/importerror-no-module-named-py3compat

I have created a simple py file:

from paramiko.py3compat import u
print 'Hello Python'

Result of running:

michal-praca@praca:~/Workspaces/Playground/routersploit$ python test.py 
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from paramiko.py3compat import u
ImportError: No module named py3compat
fwkz commented 8 years ago

Please post output of pip freeze

maluga-net commented 8 years ago

http://pastebin.com/ZmduS1Kz

fwkz commented 8 years ago

Please try to upgrade paramiko pip install -u paramiko

maluga-net commented 8 years ago

Thanks, that has helped. I just needed to add following package:

sudo apt-get install libffi-dev