这个 rand_key 是直接 post /router/get_rand_key.cgi 就可以直接获取到。
紧接着向 web_login_cgi post 数据。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
POST /router/web_login.cgi HTTP/1.1 Referer: http://guanli.luyou.360.cn token_id: 6887b2151fdc73069d8ff84c164b7ced Connection: close Content-Type: application/x-www-form-urlencoded Content-Length: 268 Host: guanli.luyou.360.cn Accept-Encoding: gzip User-Agent: okhttp/3.7.0
bindLanguage=eyJsYW5ndWFnZSI6IjEifQ%3D%3D&density=420&language=1&language_server=zh&ostype=android&osversion=27&pass=9332c90abc850ef93f9a600eff5606ba5328c9362bc131db6047cfbc481523f9&phonetype=ONEPLUS%20A5010®ion=CN&screenx=1080&screeny=2160&user=admin&version=4.2.3HTTP/1.1 200 OK Set-Cookie: Qihoo_360_login=c0bd8fc56b6bcdb5192cd56d9c437763;path=/ Connection: close content-type: text/plain; charset=UTF-8
data = 'bindLanguage=eyJsYW5ndWFnZSI6IjEifQ==&density=420&language=1&language_server=zh&ostype=android&osversion=27&pass={}&phonetype=ONEPLUS%20A5010®ion=CN&screenx=1080&screeny=2160&user=admin&version=4.2.3'.format(key['rand_key'][:32]+EnAES(aes_key))
header = '... r = requests.post('http://192.168.0.1/router/web_login.cgi',data =data) print r.text'