Loading

#Memo : Telneting into Router with Python (using telnetlib)

% python
>>>
>>> # importing telnetlib
>>> import telnetlib
>>>
>>> # telnet into 192.168.1.1
>>> t=telnetlib.Telnet("192.168.1.1")
>>>
>>> # wait until Username is appear
>>> t.read_until("Username: ")
>>>
>>> # send the username
>>> t.write("<username>\n")
>>>
>>> # wait until Password is appear
>>> t.read_until("Password: ")
>>>
>>> # send the password
>>> t.write("<password>\n")
>>>
>>> # wait until > is appear
>>> t.read_until(">")
>>>
>>> # send the enable password
>>> t.write("<enable>\n")
>>>
>>> # wait till # is appear
>>> t.read_until("#")
>>>
>>> # Now you are in Global Configuration Mode
>>>

Cheers,
Soe Min

2 comments:

Thiha Kyaw Zaw said...

why don't you change your script a little bit like create a loop, read the username and password from a file and try until the correct username and password? :P

မာ့ခ္ said...

Hahaha, I think that kind of BruteForce is out there already.

If not i will try one. :D

က်ေနာ္ဖတ္ေသာ အျခား ဘေလာ့ / ဆိုဒ္မ်ား