threat9 / routersploit

Exploitation Framework for Embedded Devices
Other
12.01k stars 2.31k forks source link

routersploit crushing #791

Open TaqsBlaze opened 2 years ago

TaqsBlaze commented 2 years ago

Your Environment

Current Behavior

Routersploit crushes when scanning after running the run command it gives the following error: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 109, in import_exploit module = importlib.import_module(path) File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/usr/lib/python3/dist-packages/routersploit/modules/exploits/routers/tplink/wdr842nd_wdr842n_configure_disclosure.py", line 1, in from Crypto.Cipher import DES ModuleNotFoundError: No module named 'Crypto'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/routersploit/interpreter.py", line 389, in command_run self.current_module.run() File "/usr/lib/python3/dist-packages/routersploit/modules/scanners/autopwn.py", line 77, in run for module in utils.iter_modules(directory): File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 138, in iter_modules yield import_exploit(path) File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 120, in import_exploit raise RoutersploitException( routersploit.core.exploit.exceptions.RoutersploitException: Error during loading 'routersploit/modules/exploits/routers/tplink/wdr842nd_wdr842n_configure_disclosure'

Error: No module named 'Crypto'

It should be valid path to the module. Use key multiple times for completion.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/routersploit", line 29, in routersploit(sys.argv) File "/usr/bin/routersploit", line 25, in routersploit rsf.start() File "/usr/lib/python3/dist-packages/routersploit/interpreter.py", line 125, in start command_handler(args, *kwargs) File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 177, in wrapper return fn(self, args, *kwargs) File "/usr/lib/python3/dist-packages/routersploit/interpreter.py", line 394, in command_run print_error(traceback.format_exc(sys.exc_info())) File "/usr/lib/python3.10/traceback.py", line 183, in format_exc return "".join(format_exception(sys.exc_info(), limit=limit, chain=chain)) File "/usr/lib/python3.10/traceback.py", line 135, in format_exception te = TracebackException(type(value), value, tb, limit=limit, compact=True) File "/usr/lib/python3.10/traceback.py", line 502, in init self.stack = StackSummary.extract( File "/usr/lib/python3.10/traceback.py", line 357, in extract if limit >= 0: TypeError: '>=' not supported between instances of 'tuple' and 'int

Expected Behavior

*After running the run command routersploit should then run exploit check on the given router just like the image on the readme of this repo

mrusli70 commented 2 years ago

Using Kali 2022.2 with Routersploit version 3.4.1. The scanners/autopwn is not really working at all. It just spurt out errors such as .... and return to command shell.

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 109, in import_exploit module = importlib.import_module(path) File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/usr/lib/python3/dist-packages/routersploit/modules/exploits/routers/technicolor/tc7200_password_disclosure_v2.py", line 3, in from Crypto.Cipher import AES ModuleNotFoundError: No module named 'Crypto'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/routersploit/interpreter.py", line 389, in command_run self.current_module.run() File "/usr/lib/python3/dist-packages/routersploit/modules/scanners/autopwn.py", line 77, in run for module in utils.iter_modules(directory): File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 138, in iter_modules yield import_exploit(path) File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 120, in import_exploit raise RoutersploitException( routersploit.core.exploit.exceptions.RoutersploitException: Error during loading 'routersploit/modules/exploits/routers/technicolor/tc7200_password_disclosure_v2'

Error: No module named 'Crypto'

It should be valid path to the module. Use key multiple times for completion.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/routersploit", line 29, in routersploit(sys.argv) File "/usr/bin/routersploit", line 25, in routersploit rsf.start() File "/usr/lib/python3/dist-packages/routersploit/interpreter.py", line 125, in start command_handler(args, *kwargs) File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 177, in wrapper return fn(self, args, *kwargs) File "/usr/lib/python3/dist-packages/routersploit/interpreter.py", line 394, in command_run print_error(traceback.format_exc(sys.exc_info())) File "/usr/lib/python3.10/traceback.py", line 183, in format_exc return "".join(format_exception(sys.exc_info(), limit=limit, chain=chain)) File "/usr/lib/python3.10/traceback.py", line 135, in format_exception te = TracebackException(type(value), value, tb, limit=limit, compact=True) File "/usr/lib/python3.10/traceback.py", line 502, in init self.stack = StackSummary.extract( File "/usr/lib/python3.10/traceback.py", line 357, in extract if limit >= 0: TypeError: '>=' not supported between instances of 'tuple' and 'int'

mrusli70 commented 2 years ago

I try the scanners/routers/router_scan option and that didn't work too. On kali linux 2022.2. Just like the scanners/autopwn. Traceback (most recent call last): File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 109, in import_exploit module = importlib.import_module(path) File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/usr/lib/python3/dist-packages/routersploit/modules/exploits/routers/technicolor/tc7200_password_disclosure_v2.py", line 3, in from Crypto.Cipher import AES ModuleNotFoundError: No module named 'Crypto'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/routersploit/interpreter.py", line 389, in command_run self.current_module.run() File "/usr/lib/python3/dist-packages/routersploit/modules/scanners/autopwn.py", line 77, in run for module in utils.iter_modules(directory): File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 138, in iter_modules yield import_exploit(path) File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 120, in import_exploit raise RoutersploitException( routersploit.core.exploit.exceptions.RoutersploitException: Error during loading 'routersploit/modules/exploits/routers/technicolor/tc7200_password_disclosure_v2'

Error: No module named 'Crypto'

It should be valid path to the module. Use key multiple times for completion.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/routersploit", line 29, in routersploit(sys.argv) File "/usr/bin/routersploit", line 25, in routersploit rsf.start() File "/usr/lib/python3/dist-packages/routersploit/interpreter.py", line 125, in start command_handler(args, *kwargs) File "/usr/lib/python3/dist-packages/routersploit/core/exploit/utils.py", line 177, in wrapper return fn(self, args, *kwargs) File "/usr/lib/python3/dist-packages/routersploit/interpreter.py", line 394, in command_run print_error(traceback.format_exc(sys.exc_info())) File "/usr/lib/python3.10/traceback.py", line 183, in format_exc return "".join(format_exception(sys.exc_info(), limit=limit, chain=chain)) File "/usr/lib/python3.10/traceback.py", line 135, in format_exception te = TracebackException(type(value), value, tb, limit=limit, compact=True) File "/usr/lib/python3.10/traceback.py", line 502, in init self.stack = StackSummary.extract( File "/usr/lib/python3.10/traceback.py", line 357, in extract if limit >= 0: TypeError: '>=' not supported between instances of 'tuple' and 'int'

mrusli70 commented 2 years ago

I install docker of routersploit it should work.

GH0st3rs commented 2 years ago

Try to install pycrypto or pycryptodome packages

mrusli70 commented 2 years ago

Try to install pycrypto or pycryptodome packages

It is already install by default with Kali Linux but it still does not work!

GH0st3rs commented 2 years ago

It is already install by default with Kali Linux but it still does not work!

Are you sure? Look at this wiki for pycryptodome If this packages successfully installed try to execute an official examples. Be sure that you use the same python version.

Your problem not in routersploit - the reason in your machine, packages, python or something else with your system configuration. If you got error "Error: No module named blablabla" - Then you need to install it. Try harder)

mrusli70 commented 1 year ago

It is already install by default with Kali Linux but it still does not work!

Are you sure? Look at this wiki for pycryptodome If this packages successfully installed try to execute an official examples. Be sure that you use the same python version.

Your problem not in routersploit - the reason in your machine, packages, python or something else with your system configuration. If you got error "Error: No module named blablabla" - Then you need to install it. Try harder)

I have check that the cryptodome is installed. But it is not working.

──(rusli㉿kali)-[~] └─$ sudo apt search pycryptodome Sorting... Done Full Text Search... Done python-pycryptodome-doc/kali-rolling 3.11.0+dfsg1-3 all cryptographic Python library (documentation)

python3-pycryptodome/kali-rolling,now 3.11.0+dfsg1-3 amd64 [installed,automatic] cryptographic Python library (Python 3)

But it is not working. But how do i fix it. That is why i use docker install instead.

Backtix commented 1 year ago

apt install python3-pip git clone https://www.github.com/threat9/routersploit cd routersploit python3 -m pip install -r requirements.txt python3 rsf.py

Works for me on 5.18.0-kali7-686 and -amd64

raian25 commented 5 months ago

@mrusli70 you need to install the pip requirements as sudo and run sudo python rsf.py,lets just say the root python doesnt have the same packages as the normal user