当前位置:网站首页>机场云商sign解析
机场云商sign解析
2022-07-27 13:00:00 【体面:】
这里直接进入算法查找主题,至于如何逆向小程序可以在GitHub上搜索wxunpack得知。
这里我就不重复展示抓包过程,抓包里面我们看到header里有nonceStr、sign
通过关键字直接搜索小程序源码得到关键部分:
if ("POST" === t) y.sign = r(d, m.url.replace(a.default.HOST, ""), p, v, S), m.data = d; else {
for (var h = m.url + "?", b = 0, w = Object.keys(d); b < w.length; b++) {
var P = w[b];
h += P + "=" + d[P] + "&";
}
h = h.substring(0, h.length - 1), m.url = h, y.sign = r({}, m.url.replace(a.default.HOST, ""), p, v, S);
}
我们看一下这2行代码的区别:
r(d, m.url.replace(a.default.HOST, ""), p, v, S)
r({}, m.url.replace(a.default.HOST, ""), p, v, S)
通过此处分析可以看到,如果t应该是存放的接口访问类型 POST/GET,如果是POST它调用的r函数的第一个参数是d,如果是GET则直接是{},由此得知d是一个post数据,连动态调试都没必要。
而r函数的实现过程则是一个拼接以及md5加密,如下方所示
function r(o, n, r, s, i) {
for (var u = "", c = 0, l = Object.keys(o).sort(); c < l.length; c++) {
var d = l[c], f = o[d];
if ("object" === e(f) && null !== f) {
var g = JSON.stringify(o[d]);
u += d + "=" + (g = g.split("").sort().join("")) + "&";
} else 0 === f || f ? u += d + "=" + o[d] + "&" : (o[d] = "", u += d + "=&");
}
return u += "url=" + n + "&", u += r ? "accessToken=" + r + "&" : "", u += "timestamp=" + s + "&",
u += "nonceStr=" + i + "&", u += "key=" + a.default.PLAM_KEY, t.md5Encrypt(u);
}
可以通过它的拼接猜出了这5个参数
1、post数据,如果是get则提交{}
2、url,但是是把host部分替换成空
3、r参数是accessToken,如果未登录状态应该是空的
4、v参数也很明显是一个timestamp时间戳,head里面也会包含
5、这个就是nonceStr,我们也需要知道这个参数是如何生成的。
nonceStr参数的由来 最后得出成品列子
边栏推荐
- Chapter3 data analysis of the U.S. general election gold offering project
- How to make computers have public IP
- Unity2d -- camera follow
- UTNet 用于医学图像分割的混合Transformer
- Leetcode · daily question · 592. fraction addition and subtraction · simulation
- Thinkphp+ pagoda operation environment realizes scheduled tasks
- LeetCode·每日一题·592.分数加减运算·模拟
- 基于企业知识图谱的企业关联关系挖掘
- Structural thinking
- 建议收藏,PMP应战篇(2)之易混淆知识点
猜你喜欢

小程序毕设作品之微信校园洗衣小程序毕业设计成品(7)中期检查报告
![[related contents of multithreading]](/img/2d/c8bde21f13a5305ba54e9b52bd1e89.png)
[related contents of multithreading]

How to view revenue and expenditure by bookkeeping software

C#测量工具示意图

A Keypoint-based Global Association Network for Lane Detection
![[training day3] reconstruction of roads [SPFA]](/img/eb/4729954bf5c6c0dc85daed9ca127f7.png)
[training day3] reconstruction of roads [SPFA]

Realize the basic operations such as the establishment, insertion, deletion and search of linear tables based on C language

Charles tutorial

灵活易用所见即所得的可视化报表
![[luogu_p5431] [template] multiplicative inverse 2 [number theory]](/img/e0/a710e22e28cc1ffa23666658f9ba13.png)
[luogu_p5431] [template] multiplicative inverse 2 [number theory]
随机推荐
Excellent basic methods of URL parsing using C language
Lighting 5g in the lighthouse factory, Ningde era is the first to explore the way made in China
知识关联视角下金融证券知识图谱构建与相关股票发现
Matlab digital image processing experiment 2: single pixel spatial image enhancement
Chapter 3 business function development (view clue details)
Design of LR1 compiler based on C language
Redis implements the browsing history module
Leetcode · daily question · 592. fraction addition and subtraction · simulation
Recursive method to realize the greatest common divisor
小程序毕设作品之微信校园洗衣小程序毕业设计成品(4)开题报告
Summary of scaling and coding methods in Feature Engineering
阻塞队列BlockingQueue
基于C语言实现线性表的建立、插入、删除、查找等基本操作
纯c手写线程池
The salary level of programmers in various countries is a little miserable
Positive mask, negative mask, wildcard
小程序毕设作品之微信校园洗衣小程序毕业设计成品(1)开发概要
West test Shenzhen Stock Exchange listing: annual revenue of 240million, fund-raising of 900million, market value of 4.7 billion
Schematic diagram of C measuring tool
How to make computers have public IP