Tobias Vandenbempt
Tobias Vandenbempt

Reputation: 25

Linksys router web admin - Autmated login in .NET

I was thinking about making an application that scrapes pages of my linksys router administration website. But since this is protected using a java login dialog I'm not able to get the webpage, look for elements (username, password) and then submit the data. Is there another way to do this?

Kind regards, Tobias

Upvotes: 0

Views: 466

Answers (1)

user2006014
user2006014

Reputation: 36

The following python code allowed me to extract the status page from my Linksys model WRT320N router:

import urllib2
from base64 import encodestring

LOGIN  = 'admin'
PASSWD = '<your router password>'
URL    = 'http://<router IP address>/Status_Router.asp'

url    = urllib2.Request(URL)
b64str = encodestring('%s:%s' % (LOGIN, PASSWD))[:-1]
url.add_header("Authorization", "Basic %s" % b64str)


f = urllib2.urlopen(url)
for line in f.readlines():
    print line,

f.close()

I was also able to do it with the "wget" utility using the user and password options.

Upvotes: 2

Related Questions