JS逆向之中关村在线pwd

篇幅有限

完整内容及源码关注公众号:ReverseCode,发送

https://www.zol.com.cn/

抓包

本登录页面既然是框架,找到php页面,https://service.zol.com.cn/user/siteLogin.php?type=small&callback=userLoginCallback&backurl=https://www.zol.com.cn/

image-20210412112404348

直接访问该php网址,避免其他请求干扰分析

image-20210412112527950

登录url:

POST https://service.zol.com.cn/user/ajax/siteLogin/login.php

请求头:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
:authority: service.zol.com.cn
:method: POST
:path: /user/ajax/siteLogin/login.php
:scheme: https
accept: application/json, text/javascript, */*; q=0.01
accept-encoding: gzip, deflate, br
accept-language: zh-CN,zh;q=0.9
content-length: 138
content-type: application/x-www-form-urlencoded; charset=UTF-8
cookie: ip_ck=5cKC7/vxj7QuMjUzODE2LjE2MTgxOTc3OTM%3D; lv=1618197793; vn=1; Hm_lvt_ae5edc2bc4fc71370807f6187f0a2dd0=1618197793; questionnaire_pv=1618185602; Hm_lpvt_ae5edc2bc4fc71370807f6187f0a2dd0=1618197883
origin: https://service.zol.com.cn
referer: https://service.zol.com.cn/user/siteLogin.php?type=small&callback=userLoginCallback&backurl=https://www.zol.com.cn/
sec-fetch-mode: cors
sec-fetch-site: same-origin
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36
x-requested-with: XMLHttpRequest

参数:

1
2
3
4
5
6
7
userid: 15806204096
pwd: 74ce2ba17b2c218246e778fb5e895c95
isAuto: 1
backurl: http://www.zol.com.cn/
tmallBtn: 0
activeBtn: 0
headPicid: 0

分析

全局搜索siteLogin/login.php

image-20210412112828654

中关村非常的耿直,加密使用md5,var md5Password = CryptoJS.MD5(password+"zol") + '';输入123提交的pwd为74ce2ba17b2c218246e778fb5e895c95,通过md5比对

image-20210412113012113

爬虫实现

拷贝Form Data到请求头加引号.py中自动生成dict格式

image-20210412113757176

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import requests
from hashlib import md5

username = '15806204095'
pwd = '123'
md5_pwd = md5((pwd + 'zol').encode('utf8')).hexdigest()
print(md5_pwd)
url = 'https://service.zol.com.cn/user/ajax/siteLogin/login.php'
data = {
'userid': username,
'pwd': md5_pwd,
'isAuto': '1',
'backurl': 'http://www.zol.com.cn/',
'tmallBtn': '0',
'activeBtn': '0',
'headPicid': '0',
}
r =requests.post(url,data)
print(r.text)

完整源码请关注微信公众号:ReverseCode,回复:JS逆向

文章作者: J
文章链接: http://onejane.github.io/2021/04/12/js逆向之中关村在线pwd/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 万物皆可逆向
支付宝打赏
微信打赏