简体   繁体   English

Linksys router web admin - 在.NET中自动登录

[英]Linksys router web admin - Autmated login in .NET

I was thinking about making an application that scrapes pages of my linksys router administration website. 我正在考虑制作一个应用程序来擦除我的linksys路由器管理网站的页面。 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. 但由于这是使用java登录对话框保护我无法获取网页,查找元素(用户名,密码),然后提交数据。 Is there another way to do this? 还有另一种方法吗?

Kind regards, Tobias 亲切的问候,托比亚斯

The following python code allowed me to extract the status page from my Linksys model WRT320N router: 以下python代码允许我从Linksys模型WRT320N路由器中提取状态页面:

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. 我还可以使用用户和密码选项使用“wget”实用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM