Advertisement
Guest User

Untitled

a guest
Nov 11th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import getpass
  2. import sys
  3. import telnetlib
  4.  
  5. HOST = "localhost"
  6. user = raw_input("Enter your remote account: ")
  7. password = getpass.getpass()
  8.  
  9. tn = telnetlib.Telnet(HOST)
  10.  
  11. tn.read_until("login: ")
  12. tn.write(user + "n")
  13. if password:
  14. tn.read_until("Password: ")
  15. tn.write(password + "n")
  16.  
  17. tn.write("lsn")
  18. tn.write("exitn")
  19.  
  20. print tn.read_all()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement