【问题标题】:bash curl/wget with linksys guest network带有 linksys 访客网络的 bash curl/wget
【发布时间】:2014-11-30 04:10:34
【问题描述】:

我正在尝试使用 wget/curl 编写从 Internet 下载信息的脚本。我连接到 Cisco/Linksys wifi 路由器上的“访客”网络,该路由器要求我提供密码才能访问互联网。

我尝试将用于管理员帐户的用户/密码传递给路由器,但当我执行类似...

$ wget -O- --user=admin --password=qwerty librivox.org
--2014-11-29 20:05:04--  http://librivox.org/
Resolving librivox.org... 208.70.31.70
Connecting to librivox.org|208.70.31.70|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `STDOUT'

    [<=>                                                                                                                              ] 0           --.-K/s              
<html><head><noscript><meta http-equiv=Refresh Content="0; 
URL=http://192.168.3.1:10080/ui/dynamic/guest-login.html"></noscript><script language='javascript' type='text/javascript'>function init(_frm) { if (_frm.sent.value == 0) { _frm.sent.value=1; _frm.submit(); } }</script></head>
<body onload=init(auth)>
<form name=auth action='http://192.168.3.1:10080/ui/dynamic/guest-login.html' METHOD=GET>
<input type=hidden name='mac_addr' value='00:xx:xx:xx:xx:xx'>
<input type=hidden name='url' value='http://librivox.org/'>
<input type=hidden name='ip_addr' value='192.168.3.136'>
    [ <=>                                                                                                                             ] 634         --.-K/s   in 0s

2014-11-29 20:05:05 (24.3 MB/s) - written to stdout [634]

...我应该如何从 bash 脚本中提供该密码?

谢谢

【问题讨论】:

    标签: bash curl wget


    【解决方案1】:

    看起来您首先必须将 mac_addr、url 和 ip_addr 传递给 http://192.168.3.1:10080/ui/dynamic/guest-login.html,然后系统会提示您提供类似的用户名/密码

    wget -O- http://192.168.3.1:10080/ui/dynamic/guest-login.html&mac_addr=xxx&url=http://librivox.org&ip_addr=192.168.3.136
    

    根据返回的内容,您还可以在上一步或下一步中传递用户名/密码

    【讨论】:

      猜你喜欢
      • 2015-10-25
      • 2019-11-17
      • 2018-11-14
      • 1970-01-01
      • 2011-05-06
      • 2016-08-23
      • 2017-07-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多