routersploit icon indicating copy to clipboard operation
routersploit copied to clipboard

No module named 'telnetlib'

Open NotSBad opened this issue 11 months ago • 7 comments

File "/home/user/routersploit/rsf.py", line 10, in from routersploit.interpreter import RoutersploitInterpreter File "/home/user/routersploit/routersploit/interpreter.py", line 14, in from routersploit.core.exploit.exceptions import RoutersploitException File "/home/user/routersploit/routersploit/core/exploit/init.py", line 28, in from routersploit.core.exploit.shell import shell File "/home/user/routersploit/routersploit/core/exploit/shell.py", line 2, in import telnetlib ModuleNotFoundError: No module named 'telnetlib'

NotSBad avatar Dec 28 '24 06:12 NotSBad

Why they are not working on this tool? It's good tool though!! :-( It's 2025 and the version release still stuck on 2017 that's just sad.

aunonno2024 avatar Jan 02 '25 09:01 aunonno2024

telnetlib was deprecated with Python 3.11 and removed with Python 3.13.

Requires standard-telnetlib.

fabaff avatar Jan 09 '25 12:01 fabaff

telnetlib was deprecated with Python 3.11 and removed with Python 3.13.

Requires standard-telnetlib.

Should I do this? Or the developer of this application? If I do, then I can put this miracle in the archive.

NotSBad avatar Jan 09 '25 20:01 NotSBad

It could help for now locally but in the long run this issue should be addressed by upstream.

You could also be affected by https://github.com/threat9/routersploit/pull/858

fabaff avatar Jan 10 '25 07:01 fabaff

This issue occurs because telnetlib was removed in Python 3.12 and later, but Routersploit still relies on it. To fix this, install the alternative library telnetlib3 using pip install telnetlib3 and then modify routersploit/core/telnet/telnet_client.py by replacing import telnetlib with import telnetlib3 as telnetlib. This should allow Routersploit to function without requiring telnetlib from older Python versions. Let me know if you need further assistance.

6qlz avatar Mar 16 '25 13:03 6qlz

pip install telnetlib3

mohammadtayb avatar May 12 '25 07:05 mohammadtayb

This work for me:

1 git clone https://www.github.com/threat9/routersploit

2 cd routersploit

3 chmod +x *

4 apt install python3.13-venv

5 python3 -m venv lks

6 source lks/bin/activate

7 python3 -m pip install -r requirements.txt

8 apt-get install libglib2.0-dev

9 python3 -m pip install bluepy

10 pip install setuptools

11 pip install telnetlib3

12 nano /routersploit/core/exploit/shell.py !!! in import section, change telnetlib for telnetlib3 !!! 12.b hit Ctrl+O to save edit 12.c hit Ctrl+X to exit edit

13 nano /routersploit/core/telnet/telnet_client.py !!! in import section, change telnetlib for telnetlib3 !!! 13.b hit Ctrl+O to save edit 13.c hit Ctrl+X to exit edit

14 type python3 rsf.py, test a full automatization (for example use /scanner/autopwn) and should be work

14.b to exit from the virtual environment, simply type deactivate and hit enter

Inf3r avatar May 12 '25 11:05 Inf3r

Thank You so much everyone for helping me. And giving me your valuable time. :-)

But i was just wondering why the main developers aren't updating the shell.py and telnet_client.py? Maybe that way we don't need to use it through a virtual environment maybe we could run it directly just like before when this tool first came out. All you have to do is " python3 -m pip install -r requirements.txt" and when you give "routersploit" command in your terminal boom routersploit fired up!! Anyway thanks again!! :-)

aunonno2024 avatar Aug 14 '25 02:08 aunonno2024

see https://github.com/threat9/routersploit/issues/890

xCEVre avatar Oct 07 '25 15:10 xCEVre