Advertisement
l31ank

Test_TelnetConnection

Apr 24th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import telnetlib
  2.  
  3. Host = raw_input("Telnet to Host : ")
  4. user = raw_input("Username : ")
  5. pwd = raw_input("Password : ")
  6.  
  7. try:
  8.     tel = telnetlib.Telnet(Host)
  9.     tel.read_until('sername:')
  10.     tel.write(user + '\n')
  11.     tel.read_until('assword:')
  12.     tel.write(pwd + '\n')
  13.     print "[+]Login Success..!!"
  14.     tel.close()
  15.     raw_input("Press any Key to quit: ")
  16.  
  17. except Exception as e:
  18.     print "[-]Connection Error..!!!"
  19.     raise e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement