逆向31-webpcak-医保局

医保局

网站

接口

image

一响应解密

  1. 请求代码转化

image

  1. 入口定位方法一拦截器

interceptors.response.use

image

验证

e.data 是加密的值 Object(u.b)("SM4", e.data)是解密的值,所以u.b是关键

image

那么找一下 u.b吧 其实就是找u

image

// 文件名 06conn.js
require("./06jiazaiqi") // 加载器 copy出来,笔记略

u = window.loader('7d92');
console.log(u.b);


// ret = u.b("SM4", e);
// console.log(ret);

function test(e){
    // console.log(e);
    ret = u.b("SM4", e);
    return ret;
  }

python调用

import requests
import json
import execjs

headers = {
    "Accept": "application/json",
    "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7",
    "Cache-Control": "no-cache",
    "Connection": "keep-alive",
    "Content-Type": "application/json",
    "Origin": "https://fuwu.nhsa.gov.cn",
    "Pragma": "no-cache",
    "Referer": "https://fuwu.nhsa.gov.cn/nationalHallSt/",
    "Sec-Fetch-Dest": "empty",
    "Sec-Fetch-Mode": "cors",
    "Sec-Fetch-Site": "same-origin",
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
    "X-Tingyun": "c=B|4Nl_NnGbjwY;x=ccd878e4ea034639",
    "channel": "web",
    "contentType": "application/x-www-form-urlencoded",
    "sec-ch-ua": "\"Google Chrome\";v=\"131\", \"Chromium\";v=\"131\", \"Not_A Brand\";v=\"24\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"macOS\"",
    "x-tif-nonce": "h7IJyLR8",
    "x-tif-paasid": "undefined",
    "x-tif-signature": "883b7acb2e622329fffb80cf446e8b60ce11e6f0852b3cd634131acb5fe42bf6",
    "x-tif-timestamp": "1741070873"
}
cookies = {
    "acw_tc": "1a0c65d417410708215656972e00a8f90cf326907ecff113d5df4a86060bdd",
    "amap_local": "110000",
    "yb_header_active": "-1"
}
url = "https://fuwu.nhsa.gov.cn/ebus/fuwu/api/nthl/api/CommQuery/queryRtalPhacBInfo"
data = {
    "data": {
        "data": {
            "encData": "3DFBCA4667B978F639BB23B95DCE4CC74CE34C33DC32F1068E9E23CA546C9EA8CCD20943B4DAE96380B41164D761DE97BBBD5DB53EA5E7154071E74EF0BE481E2BADC2FDCC843E425B4CA14CEDBC102CA979CA4202C06C9F2CD837D90C6DA45E64DE712DF3683DE81C358841664CBE17561D0390069F11B0D412FE38BE15BA5C"
        },
        "appCode": "T98HPCGN5ZVVQBS8LZQNOAEXVI9GYHKQ",
        "version": "1.0.0",
        "encType": "SM4",
        "signType": "SM2",
        "timestamp": 1741070873,
        "signData": "ROHCPzibAQa/YW/miDBxYBShtgQshh4j+BhL6bzj3xaaJ7dQwQufJc53O/MFcOOZ5zDWSmKuFnAe/yWT0C1usQ=="
    }
}
data = json.dumps(data, separators=(',', ':'))
response = requests.post(url, headers=headers, cookies=cookies, data=data)

e = response.json()


# 主要代码
data_e = execjs.compile(open("./06conn.js").read()).call("test",e)
print(data_e)
posted @ 2025-03-04 15:55  流年中渲染了微笑  阅读(0)  评论(0)    收藏  举报