• 全家Fa米家app抓包——做自动签到领Fa米粒


    目录

    简介

    代码

    效果

    app下载

    福利


    简介

    通过小黄鸟抓包Fa米家App,发现没有什么校验,用模拟请求直接可以重发。。。

    注意:

    1、首先需要在小黄鸟里安装SSL证书,不然抓不到SSL的包。

    2、只需要找那些“fmapp.chinafamilymart.com.cn”的包,其他的包用处不大。

    • 账号验证是通过token字段;
    • 设备标识用deviceId;
    • 等等...
      基本上必须的几个参数就:

      1. {
      2. "blackbox": "tdfpeyxxxx",
      3. "device_id": "2f35xxxx",
      4. "fmversion": "3.0.2",
      5. "os": "android",
      6. "token": "eyneWxxxx",
      7. "useragent": "okhttp/4.7.2"
      8. }

    代码

    这就好办了,可以做一个自动Fa米粒签到(可以换商品),或者其他好玩的功能。
    提供几个粗糙的函数:

    1. import requests
    2. class Fmapp:
    3. def __init__(self) -> None:
    4. self.base_headers = {
    5. 'Host': 'fmapp.chinafamilymart.com.cn',
    6. 'blackBox': '',
    7. 'token': '',
    8. 'deviceId': '',
    9. 'User-Agent': 'okhttp/4.7.2',
    10. 'Content-Type': 'application/json',
    11. 'loginChannel': 'app',
    12. 'channel': '333',
    13. 'fmVersion': '3.0.2',
    14. 'os': 'android',
    15. }
    16. def check_in(self):
    17. '''
    18. 签到
    19. '''
    20. url = 'https://fmapp.chinafamilymart.com.cn/api/app/market/member/signin/sign'
    21. headers = self.base_headers.copy()
    22. res = requests.post(url=url, headers=headers).json()
    23. print(res)
    24. def verify_code(self, mobile, distinctId):
    25. '''
    26. 请求发送短信验证码
    27. '''
    28. url = 'https://fmapp.chinafamilymart.com.cn/api/app/member/verifyCode'
    29. headers = self.base_headers.copy()
    30. data = {
    31. "mobile": mobile,
    32. "firstSend": True,
    33. "distinctId": distinctId,
    34. "newVersion": True
    35. }
    36. res = requests.post(url=url, json=data, headers=headers).json()
    37. print(res)
    38. if res['code'] == '200':
    39. return res['data']
    40. return None
    41. def login(self, mobile, code, distinctId):
    42. '''
    43. 短信验证码登录
    44. '''
    45. url = 'https://fmapp.chinafamilymart.com.cn/api/app/login'
    46. headers = self.base_headers.copy()
    47. data = {
    48. "mobile": mobile,
    49. "verifyCode": code,
    50. "openId": "",
    51. "openChannelCd": "1",
    52. "grantTypeCd": "1",
    53. "distinctId": distinctId,
    54. "newVersion": True,
    55. "unionId": "",
    56. "jpushId": "120c83f760da1764565"
    57. }
    58. res = requests.post(url=url, json=data, headers=headers).json()
    59. print(res)
    60. if res['res'] == '200':
    61. return res['data']['token']
    62. return None
    63. def member_info(self):
    64. '''
    65. 获取用户详情
    66. '''
    67. url = 'https://fmapp.chinafamilymart.com.cn/api/app/member/info'
    68. headers = self.base_headers.copy()
    69. res = requests.post(url=url, headers=headers).json()
    70. print(res)
    71. if res['code'] == '200':
    72. return True
    73. return False
    74. def mili_detail(self):
    75. '''
    76. 获取Fa米粒详情
    77. '''
    78. url = 'https://fmapp.chinafamilymart.com.cn/api/app/member/v2/mili/detail'
    79. headers = self.base_headers.copy()
    80. data = {"pageNo":1, "pageSize":10}
    81. res = requests.post(url=url, json=data, headers=headers).json()
    82. print(res)
    83. total = -1
    84. if res['code'] == '200':
    85. total = res['data']['total']
    86. return total
    87. def process(self):
    88. # 需要抓包补全
    89. blackBox = 'tdfp'
    90. # 需要抓包补全
    91. deviceId = '2f356'
    92. # 需要抓包补全
    93. distinctId = "cb19df02c32d2079"
    94. # 可用手机验证码登录获取,或者手动抓包补全
    95. token = 'eyJhbG'
    96. self.base_headers['token'] = token
    97. self.base_headers['blackBox'] = blackBox
    98. self.base_headers['deviceId'] = deviceId
    99. # # 手机号
    100. # mobile = ""
    101. # # 收到的验证码
    102. # code = self.verify_code(mobile, distinctId)
    103. # if not code:
    104. # return
    105. # token = self.login(mobile, code, distinctId)
    106. # if not token:
    107. # return
    108. # self.base_headers['token'] = token
    109. self.member_info()
    110. self.check_in()
    111. self.mili_detail()
    112. Fmapp().process()

    效果

    签到:

    个人资料:

    米粒信息:

    app下载

    福利

    然后就可以在挂载服务器上每天自动运行了。
    没有服务器的可以看看这个腾讯云的轻量服务器,很便宜,一年只需65元,它不香吗?:
    详情:云产品特惠专区

  • 相关阅读:
    Sql优化总结!详细!(2021最新面试必问)
    链表题(1)
    结合CRM 与项目管理,扩大你的业务和客户群
    java计算机毕业设计学习和分享做菜web系统源码+mysql数据库+lw文档+系统+调试部署
    python 自动化操作必备函数功能
    02.初识C语言2
    爬虫中出现OSError: [WinError 193] %1 不是有效的 Win32 应用程序。
    【嵌入式——QT】QListWidget
    Linux:今天学vim编辑器,gdb调试器,makefile项目自动化构建工具
    ubuntu 软件管理
  • 原文地址:https://blog.csdn.net/sxf1061700625/article/details/126458362