Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Missing line numbers are comment lines only, removed them to make it easier to read.d
- 1 import getpass
- 2 import sys
- 3 import telnetlib
- 4
- 5 HOST = "*******************"
- 7 user = raw_input("User Name: ")
- 9 # user = "*********"
- 11 password = getpass.getpass()
- 13 # password = "***********************"
- 14
- 15 tn = telnetlib.Telnet(HOST)
- 17 tn.read_until("login: ")
- 19 tn.write(user + "\n")
- 21 tn.read_until("Password: ")
- 23 tn.write(password + "\n")
- 25 tn.read_until("5308> ")
- 27 # tn.write("show net lan dhcp reserved_ip setup\n")
- 28 tn.write("security firewall ipv4 enable 20\n")
- 29 # print tn.read_all()
- 31 tn.read_until("5308> ")
- 33 tn.write(".exit\n")
- 35
- 36 print tn.read_all()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement