Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import getpass
- import telnetlib
- import time
- user= "root"
- password = "admin"
- print("Router Script")
- HOST = "192.168.100.1" #the gateway of the router
- tn = telnetlib.Telnet(HOST)
- tn.set_debuglevel(7) #the master of puppets
- tn.read_until(b"Login:")
- time.sleep(1)
- tn.write(user.encode('ascii') + b"n")
- tn.read_until(b"Password:")
- tn.write(password.encode('ascii') + b"n")
- tn.read_until(b"WAP>")
- tn.write(b"display ip routen" )
- print(tn.read_all().decode('ascii'))
Add Comment
Please, Sign In to add comment