Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import getpass
- import telnetlib
- HOST = "192.168.1.1"
- user = "1234"
- password = "1234"
- tn = telnetlib.Telnet(HOST,"21")
- tn.read_until(b"login: ")
- tn.write(user.encode('ascii') + b"r")
- if password:
- tn.read_until(b"Password: ")
- tn.write(password.encode('ascii') + b"r")
- tn.write(b"rebootr")
- tn.write(b"exitr")
- print(tn.read_all().decode('ascii'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement