Created
February 13, 2018 17:06
-
-
Save anonymous/b15d5f92a7d18bb07a6b3dd3e1a368af to your computer and use it in GitHub Desktop.
PYTHON TELNET SCRIPT
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
import getpass | |
import sys | |
import telnetlib | |
HOST = "YOUR ROUTER IP ADDRESS" | |
user = raw_input("Enter your telnet username: ") | |
password = getpass.getpass() | |
tn = telnetlib.Telnet(HOST) | |
tn.read_until("Username: ") | |
tn.write(user + "\n") | |
if password: | |
tn.read_until("Password: ") | |
tn.write(password + "\n") | |
tn.write("exit\n") | |
print tn.read_all() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment