Dr.COM 认证脚本合集
Dr.COM 认证脚本合集,适用于 Dr.COM 的 Web 认证。目的是为了解决一些特殊设备无法使用浏览器进行认证的问题和防止设备被 Dr.COM 踢下线。
认证原理
构建 POST 请求
通过抓包分析 Dr.COM 的 Web 认证是通过 POST 提交用户信息完成认证的,我们可以通过模拟 POST 完成认证。
Request URL:http://192.168.100.1/0.htm
Request Method:POST
Status Code:200 OK
Remote Address:192.168.100.1:80
Referrer Policy:no-referrer-when-downgrade
Accept-Ranges:bytes
Cache-Control:no-cache
Connection:keep-alive
Content-length:3573
Content-type:text/html; charset=gbk
Server:DrcomServer1.0
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8
Accept-Encoding:gzip, deflate
Accept-Language:zh-CN,zh;q=0.9
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:64
Content-Type:application/x-www-form-urlencoded
Cookie:smartdot=123456; myusername=user1; username=user1
Host:192.168.100.1
Origin:http://192.168.100.1
Referer:http://192.168.100.1/0.htm
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
DDDDD:user1
upass:123456
0MKKey:%B5%C7%A1%A1%C2%BC
v6ip:
主要有这样几个地方是有用的,一是 Request URL 这个是你需要发送请求的地址,还有就是提交的内容 DDDD(用户名)、upass(密码)、0MKKey(一个 KEY)、v6ip(ipv6 地址)。可能每个设备都不太一样,不可照抄。
认证脚本
Linux 临时认证
curl -d "DDDDD=user1&upass=123456&0MKKey=%B5%C7%A1%A1%C2%BC&v6ip=" http://192.168.1.100/0.html
批处理认证保持
需要 CURL 请先下载对应版本的 CURL。
注册 CURL:
copy curl.exe C:\Windows\System32\curl.exe
脚本(保存为 bat 运行):shell set url=www.baidu.com :p ping -w 1000 -n 3 %url%|find "TTL" if %errorlevel%==0 goto p if %errorlevel%==1 goto dr :dr curl -d "DDDDD=user1&upass=123456&0MKKey=%B5%C7%A1%A1%C2%BC&v6ip=" http://192.168.1.100/0.html goto p
修改 curl -d "DDDDD=user1&upass=123456&0MKKey=%B5%C7%A1%A1%C2%BC&v6ip=" http://192.168.1.100/0.html
对应的内容即可。
Python 认证保持
需要 Python 环境,因为脚本中有注释,不做过多解释。
脚本(保存为 py 运行):
1 |
|