声明:本文只做学习研究,禁止用于非法用途,不然后果自负,若有侵权,请告知删除,谢谢!python
某某健康APP逆向
项目场景:
接上一篇https://blog.csdn.net/qq_26079939/article/details/109285783json
1.上一篇讲到了模拟登入,这一篇要实现的是上传本身设定的步数到WX和ZFB。
2.准备阶段
- 登入帐号
- 点击个人
- 点击数据共享
- 而后第三方同步到WX和ZFB
解决方案:
1.而后咱们开始抓同步部署数据的包,因为如今博主用的是模拟器,没法增长步数,因此抓不到上传步数的包,你们能够在手机端抓到。
2.这是我以前用手机抓到的上传数据的请求。
url = 'https://sports.lifesense.com/sport_service/sport/sport/uploadMobileStepV2?systemType=2&version=4.6.7' data = { 'list': [ { 'DataSource': 2, 'active': 1, 'calories': int(step / 4), 'dataSource': 2, 'deviceId': 'M_NULL', 'distance': int(step / 3), 'exerciseTime': 0, 'isUpload': 0, 'measurementTime': time.strftime('%Y-%m-%d %H:%M:%S'), 'priority': 0, 'step': step, 'type': 2, 'updated': int(round(time.time() * 1000)), 'userId': login_result[0] } ] }
3.接下来咱们实现修改步数的代码。
# 修改步数 def change_step(): # 登陆结果 login_result = login() if login_result == '登陆失败': return '登陆失败' else: url = 'https://sports.lifesense.com/sport_service/sport/sport/uploadMobileStepV2?systemType=2&version=4.6.7' data = { 'list': [ { 'DataSource': 2, 'active': 1, 'calories': int(step / 4), 'dataSource': 2, 'deviceId': 'M_NULL', 'distance': int(step / 3), 'exerciseTime': 0, 'isUpload': 0, 'measurementTime': time.strftime('%Y-%m-%d %H:%M:%S'), 'priority': 0, 'step': step, 'type': 2, 'updated': int(round(time.time() * 1000)), 'userId': login_result[0] } ] } headers = { 'Content-Type': 'application/json; charset=utf-8', 'Cookie': 'accessToken=%s' % login_result[1] } response_result = requests.post(url, data=json.dumps(data), headers=headers,verify=False) status_code = response_result.status_code print('修改步数返回的数据:',response_result.text) if status_code == 200: print('修改步数为【%s】成功' % step) else: print('修改步数失败')
4.而后咱们执行一下,再去看看微信运动里的数据,哈哈哈,修改为功了66666,立刻登顶封面了!