Created
May 25, 2014 12:49
-
-
Save wattnotions/f52f0f1653b980b1935c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Program written 17 April 2014 | |
# Enter default username and password | |
# waits for commands, then prints results | |
import telnetlib | |
tn = telnetlib.Telnet("192.168.1.100", "23") | |
print tn.read_until("Username>") # wait till prompted for username | |
tn.write("alien\n") | |
print tn.read_until("Password>") # wait till prompted for password | |
tn.write("password\n") | |
print tn.read_until("Alien>") | |
while True: | |
tn.write(raw_input()+ "\n") # enter commands | |
print (tn.read_until('Alien>')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment