User Access Verification Username: Kerberos: No default realm defined for Kerberos!
import getpass import telnetlib HOST = "192.168.0.123" user = input("Enter your Username: ") password = getpass.getpass() enablepassword = getpass.getpass() tn = telnetlib.Telnet(HOST) tn.read_until(b"Username: ") tn.write(user.encode('ascii') + b"\n") tn.write(b"\n") #if password: tn.read_until(b"Password: ") tn.write(password.encode('ascii') + b"\n") tn.read_until(b"sw1>") tn.write(b"sh ip int brie\n") tn.write(b"exit\n") print(tn.read_all().decode('ascii'))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)