首页
社区
课程
招聘
[分享]实战分析人X的HTTP协议
发表于: 2020-12-21 17:35 5282

[分享]实战分析人X的HTTP协议

2020-12-21 17:35
5282

第一次抓包:

POST http://api.m.renren.com/api/client/login HTTP/1.1
Accept-Encoding: identity
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: /
Connection: keep-alive
User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.1.1; oppo R11 Plus Build/LMY47I)
Host: api.m.renren.com
Content-Length: 793
isverify=1&password=18beaa1df89d0f434fd33918da2d62b310f3579675e09e1ca726fb7532bd4b41&client_info=%7B%22uniqid%22%3A%22865166020506633%22%2C%22screen%22%3A%22720*1280%22%2C%22imei%22%3A%22865166020506633%22%2C%22other%22%3A%2246000%2C%22%2C%22mac%22%3A%2200%3A81%3Af0%3A3a%3A81%3Ae1%22%2C%22version%22%3A%229.3.8%22%2C%22os_type%22%3A11%2C%22terminal_type%22%3A2%2C%22from%22%3A9101041%2C%22os%22%3A%2222_5.1.1%22%2C%22imsi%22%3A%22460006017714263%22%2C%22model%22%3A%22oppo+R11+Plus%22%7D&gz=compression&api_key=9e1874c67e0b42d79cc16f787b644339&uniq_id=865166020506633&user=qianyu&format=JSON&v=1.0&call_id=1557232347378&rkey=be9f4755aa7fd0fc3ca8d3f46599b2b8&ext_info=%7Bstation_id%3D32305%7D&tab_sequence=1&sig=2d44d388b351ef50f9e392f025d4821d&verifycode=&sig=b6aa02b00934154cde248aa477500d4b

第二次抓包:

POST http://api.m.renren.com/api/client/login HTTP/1.1
Accept-Encoding: identity
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Accept: /
Connection: keep-alive
User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.1.1; oppo R11 Plus Build/LMY47I)
Host: api.m.renren.com
Content-Length: 793

isverify=1&password=91d8deb94c54262e2bd7f5402ca9c8af9ef05b7233159e8a0b4774bac6f1397f&client_info=%7B%22uniqid%22%3A%22865166020506633%22%2C%22screen%22%3A%22720*1280%22%2C%22imei%22%3A%22865166020506633%22%2C%22other%22%3A%2246000%2C%22%2C%22mac%22%3A%2200%3A81%3Af0%3A3a%3A81%3Ae1%22%2C%22version%22%3A%229.3.8%22%2C%22os_type%22%3A11%2C%22terminal_type%22%3A2%2C%22from%22%3A9101041%2C%22os%22%3A%2222_5.1.1%22%2C%22imsi%22%3A%22460006017714263%22%2C%22model%22%3A%22oppo+R11+Plus%22%7D&gz=compression&api_key=9e1874c67e0b42d79cc16f787b644339&uniq_id=865166020506633&user=qianyu&format=JSON&v=1.0&call_id=1557232479138&rkey=81601be5a731b71c2ee0ced57ce842a6&ext_info=%7Bstation_id%3D32305%7D&tab_sequence=1&sig=e16707ab08aba677a85025ebd73f3e3f&verifycode=&sig=e518e3f9e8037ddeeaefa0b6a40e69f5


2、搜索关键字段"verifycode"找到协议构造类

协议字段构造方法如下图,在a方法中的第一行代码(JsonObject v4 = ServiceProvider.A(false, true);)是关键点,完成了"client_info"字段的拼接。


3、分析关键字段"sig",需要搞清楚两个"sig"字段

动态调试smali代码无法查看相应寄存器的值,可以通过HOOK对应的方法打印参数信息。

4、Android Studio+smalidea插件动态调试smali代码

调试模式启动
adb shell am start -D -n com.renren.mobile.android/.ui.WelcomeScreen

进行端口转发
adb forward tcp:8700 jdwp:957
出现这个错误说明8700端口被占用
error: cannot bind listener: cannot bind to 127.0.0.1:8700: 通常每个套接字地址(协议/网络地址/端口)只允许使用一次。 (10048)

解决办法
netstat -nao | findstr "8700"
根据PID找到该进程,结束进程
打开任务管理器—>查看—>选项列(S)—>勾选 PID,确定—>进程按钮栏配置好调试环境后就开始调试了,先在ServiceProvider.smali文件里面的a(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Landroid/content/Context;Lcom/renren/mobile/android/loginfree/LoginStatusListener;)V方法函数头下段,shift+F8往上回溯,就来到图下所在位置。

在LoginFromQuickRegisterFragment.smali文件里面找到onClick(Landroid/view/View;)V方法,找到登录逻辑核心实现如下图。


[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

收藏
免费 1
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//