京东 h5st 5.1 分析

声明:
本文章中所有内容仅供学习交流使用,不用于其他任何目的,抓包内容、敏感网址、数据接口等均已做脱敏处理,严禁用于商业用途和非法用途,否则由此产生的一切后果均与作者无关!
逆向分析
学习了2天某物,frida检测有点狠,看了几篇博客,全是hook线程,遇到难的就不行。习惯性看评论发现大佬都在评论区直接给通用方案秒了95%  libmsaoaidsec.so检测。卡在vmp了,真的恶心。还是降级老老实实学习一下基础。

if vt:
    cookies.update(response.cookies)
    print(response.cookies)
    for i in range(1, 5):
        cp = execjs.compile(open('h5st.js', 'r', encoding='utf-8').read())
        result = cp.call('getH5st')
        # print(result)
        headers = {
            "accept": "application/json, text/javascript, */*; q=0.01",
            "accept-language": "zh-CN,zh;q=0.9",
            "cache-control": "no-cache",
            "pragma": "no-cache",
            "priority": "u=1, i",
            "referer": "https://item.jd.com/",
            "sec-ch-ua": "\"Not A(Brand\";v=\"8\", \"Chromium\";v=\"132\", \"Microsoft Edge\";v=\"132\"",
            "sec-ch-ua-mobile": "?0",
            "sec-ch-ua-platform": "\"Windows\"",
            "sec-fetch-dest": "empty",
            "sec-fetch-mode": "cors",
            "sec-fetch-site": "same-site",
            "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0",
      
            "x-rp-client": "h5_1.0.0"
        }

        url = ""
        params = {
            "appid": "pc-item-soa",
            "functionId": "pc_detailpage_wareBusiness",
            "client": "pc",
            "clientVersion": "1.0.0",
            "t": result['t'],
            "body": result['body'],
            "h5st": result['h5st'],
            "x-api-eid-token": token,
            "loginType": "3",
            "scval": "100145994848",
            "uuid": jda
        }
        response = session.get(url, headers=headers, params=params,cookies=cookies)
        print(result)
        print(response.text)
else:
    print("验证不通过")

结果

总结

1.出于安全考虑,本章未提供完整流程,调试环节省略较多,只提供大致思路,具体细节要你自己还原,相信你也能调试出来。

### 调用京东H5ST签名文件的方法 为了成功调用京东H5ST签名文件,需遵循特定流程并准备必要参数。此过程涉及使用指定API接口来获取所需签名。 #### 使用的API 用于请求H5ST签名的主要API路径为`/open/api/sign/h5st/generate`[^1]。该API负责生成针对具体业务场景优化后的H5ST签名字符串。 #### 参数说明 当发起API请求时,应提供如下关键参数: - `appKey`: 应用程序密钥,由开发者平台分配给每个应用实例。 - `timestamp`: 时间戳,精确到毫秒级别的时间表示形式。 - `nonceStr`: 随机数字符串,建议长度不少于8位字符。 - `bizType`: 业务类型编码,定义了当前操作所属的具体服务类别。 - `body`: 请求体内容,通常包含JSON格式的数据结构描述实际业务逻辑需求。 这些参数共同作用于构建安全可靠的通信环境,确保每次交互的安全性和唯一性[^2]。 #### 示例代码 以下是Python语言实现的一个简单示例,展示了如何通过HTTP POST方法向上述API发送请求,并处理返回的结果。 ```python import requests import json import time from hashlib import sha256 def generate_h5st_signature(app_key, biz_type, body_data): timestamp = str(int(time.time() * 1000)) nonce_str = "randomString" params = { 'appKey': app_key, 'timestamp': timestamp, 'nonceStr': nonce_str, 'bizType': biz_type, 'body': json.dumps(body_data), } response = requests.post( url='https://api.jd.com/open/api/sign/h5st/generate', headers={'Content-Type': 'application/json'}, data=json.dumps(params) ) result = response.json() if result['success']: h5st_sign = result['data'] print(f"H5ST Signature Generated Successfully: {h5st_sign}") else: error_msg = result.get('message', '') raise Exception(f"Failed to Generate H5ST Sign. Error Message: {error_msg}") if __name__ == '__main__': try: app_key_example = 'your_app_key_here' biz_type_example = 'exampleBizTypeCode' sample_body = {"key": "value"} generate_h5st_signature(app_key_example, biz_type_example, sample_body) except Exception as e: print(e) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wx a15018601872

wx a15018601872

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值