Advertisement
Guest User

Untitled

a guest
Mar 12th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #! /usr/bin/python
  2.  
  3. import getpass
  4. import sys
  5. import telnetlib
  6.  
  7. HOST = "IP DEL ROUTER"
  8. user = "USUARIO DEL ROUTER"
  9. password = "CONTRASEÑA DEL ROUTER"
  10. tn = telnetlib.Telnet(HOST)
  11.  
  12. tn.read_until("Login: ")
  13. tn.write(user + "\n")
  14. if password:
  15. tn.read_until("Password: ")
  16. tn.write(password + "\n")
  17.  
  18. tn.write("save_and_reboot\n")
  19. tn.write("exit\n")
  20.  
  21. print tn.read_all()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement