Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import getpass
- import sys
- import telnetlib
- HOST = "192.168.0.1"
- user = "sk"
- password = "sk"
- tn = telnetlib.Telnet(HOST)
- tn.read_until("login: ")
- tn.write(user + "\n")
- if password:
- tn.read_until("Password: ")
- tn.write(password + "\n")
- tn.write("uname -r")
- tn.write(b"exit\n")
- print tn.read_all()
Add Comment
Please, Sign In to add comment