I made this program in python to connect with a device that support telnet using 23 port, with user:admin and password:pass:
import getpass
import telnetlib
HOST = '192.168.1.10'
user = input("Enter your remote account: ")
password = getpass.getpass()
tn = telnetlib.Telnet(HOST)
tn.read_until(b"login: ")
tn.write(user.encode('ascii') + b"\n")
if password:
tn.read_until(b"Password: ")
tn.write(password.encode('ascii') + b"\n")
tn.write(b"dir\n")
tn.write(b"exit\n")
print(tn.read_all().decode('ascii'))
But I have this ouput and the program doesn't connect: Enter your remote account: admin Warning: QtConsole does not support password mode, the text you type will be visible. pass
What I am doing wrong? help please