
学校上网需要 web 认证,想是否可以通过 python 模拟发包 写个 py 文件放进路由器里自动认证,然后中继 wifi 让多台设备连接上网
这是我抓包的结果


1 evin OP import requests Target='http://auth.wifi.com/40/login.cgi?x=8576198279906591137598122957861719&c=33825515' Data={ "portal_subtype": "account", "user_name": "账号", "password": "密码" } r = requests.post(Target,Data) print r.text 这样写对吗? |
2 xia0chun 2016 年 3 月 11 日 via iPhone 最好加上 UA ,以防万一被封 |
3 evin OP @xia0chun ``` s = requests.session() data = {"portal_subtype": "account","user_name": "账号","password": "密码" } s.post('http://auth.wifi.com/40/pc.html?x=3180345486836446256183969493333751&c=78633491',data);//认证的网页 s.get('http://auth.wifi.com/40/login.cgi?x=8576198279906591137598122957861719&c=33825515'); ``` 为什么 终端 python 运行 告诉我 没有定义 requests |
6 wenyu1001 2016 年 3 月 11 日 pip install requests ========================= #!/usr/bin/env python # encoding: utf-8 import requests def test(): d = {'key':'value'} headers = {'user-agent': 'my-app/0.0.1'} url = 'http://httpbin.org/post' r = requests.post(url, headers=headers, data=d) if r.status_code == 200: print "ok" if __name__ == "__main__": test() |
8 Kilerd 2016 年 3 月 11 日 看你发的第一张图就知道密码是加密了的, 居然不知道加密方式就去试程序。 |
9 lhbc 2016 年 3 月 11 日 路由器跑 Python 多累啊,这事不是 curl 最合适吗? |
10 binux 2016 年 3 月 11 日 用 web 认证的 wifi, 连接不加密的。 可以搞到一大堆账号了啊 |
11 VYSE 2016 年 3 月 11 日 LZ 你这个 CHARLES 包括 CHROME 右键不是都有转成 curl 的选项么,根本不用上 PYTHON 啊 |
12 Izual 2016 年 3 月 12 日 chrome 浏览器 F12 然后 copy as curl ? |
15 mxonline 2016 年 3 月 12 日 用 open-wrt +wifidog 就行了,没必要上 Python 啊 |
18 1stlulu 2016 年 3 月 16 日 via Android 楼主我受你鼓舞给蔽校写了个 Android 端的一键连网 https://play.google.com/store/apps/details?id=xyz.jilulu.jamesji.netify |