1956 字
10 分钟
辽宁省建筑市场监管公共服务平台
接口
import requests
headers = { 'Accept': '*/*', 'Accept-Language': 'zh-CN,zh;q=0.9', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Origin': 'http://218.60.154.1:81', 'Referer': 'http://218.60.154.1:81/webserver/lnpublish/index.html', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36', 'buried': 'encrypt',}
params = { 'appKey': 'c9406731-50bc-4e23-b3f5-b7e7d3093875', 'time': '1758878803292', 'sign': 'Z7ja1HJBiPLxe+bXzOosFg==', 'current': 'SW48JVM27UroKFwiAGeMGw==', 'size': 'Z/4B6lhB7saCD5D7frKxGw==',}
data = '3yCFSxRi/s2k07XHI43mqyKIxcQSafkJtES/mtSrzGxSAAaCEq8mDhy/JJtNplbedUgXp/sdRVn3bkO44s7WV/v03+gMaBNkHUpZPPihHbI='
response = requests.post( 'http://218.60.154.1:81/dataexchangeserver/fbTbpersonbasicinfo/getPersonList', params=params, headers=headers, data=data, verify=False,)响应样例
{ "EncData": "qrRIRedxmTzOZiIpgY41....", "IsEnc": true}定位解密位置,解密算法为AES(ECB模式),密钥 consmationecasof

data参数为入参’{“specialtytypnum”:"",“personname”:“张伟”,“idcard”:"",“corpname”:""}‘经过AES加密后的值
current 与 size 为当前页数和页数大小经过相同加密算法后,经过encodeURIComponent的值
sign分析
time只在第一次进入网页时初始化获取,后续多次查询保持不变,相应的sign值也不变化,说明sign仅time一个变量,其他为定量,且可以临时固定
全局搜 sign= 只在大数组中查询到一次,尝试代理大数组,获取get该值的位置,以定位sign加密位置

发现并未直接调用大数组, 而是将大数组转为了函数调用,所以直接在函数中hook即可定位位置

加密逻辑分析, 是个MD5+base64的实现
m = "c9406731-50bc-4e23-b3f5-b7e7d3093875" + '645ffda7-fc12-4415-a237-314d87d66716' + Date.now()
sign = encodeURIComponent( v( c( p(m), m.length * 8 ) ))
function c(e, x) { e[x >> 5] |= 128 << x % 32, e[14 + (x + 64 >>> 9 << 4)] = x; for (var t = 1732584193, _ = -271733879, n = -1732584194, i = 271733878, a = 0; a < e[_0x27e6("0x12e")]; a += 16) { var r = t , s = _ , o = n , c = i; _ = h(_ = h(_ = h(_ = h(_ = l(_ = l(_ = l(_ = l(_ = d(_ = d(_ = d(_ = d(_ = u(_ = u(_ = u(_ = u(_, n = u(n, i = u(i, t = u(t, _, n, i, e[a + 0], 7, -680876936), _, n, e[a + 1], 12, -389564586), t, _, e[a + 2], 17, 606105819), i, t, e[a + 3], 22, -1044525330), n = u(n, i = u(i, t = u(t, _, n, i, e[a + 4], 7, -176418897), _, n, e[a + 5], 12, 1200080426), t, _, e[a + 6], 17, -1473231341), i, t, e[a + 7], 22, -45705983), n = u(n, i = u(i, t = u(t, _, n, i, e[a + 8], 7, 1770035416), _, n, e[a + 9], 12, -1958414417), t, _, e[a + 10], 17, -42063), i, t, e[a + 11], 22, -1990404162), n = u(n, i = u(i, t = u(t, _, n, i, e[a + 12], 7, 1804603682), _, n, e[a + 13], 12, -40341101), t, _, e[a + 14], 17, -1502002290), i, t, e[a + 15], 22, 1236535329), n = d(n, i = d(i, t = d(t, _, n, i, e[a + 1], 5, -165796510), _, n, e[a + 6], 9, -1069501632), t, _, e[a + 11], 14, 643717713), i, t, e[a + 0], 20, -373897302), n = d(n, i = d(i, t = d(t, _, n, i, e[a + 5], 5, -701558691), _, n, e[a + 10], 9, 38016083), t, _, e[a + 15], 14, -660478335), i, t, e[a + 4], 20, -405537848), n = d(n, i = d(i, t = d(t, _, n, i, e[a + 9], 5, 568446438), _, n, e[a + 14], 9, -1019803690), t, _, e[a + 3], 14, -187363961), i, t, e[a + 8], 20, 1163531501), n = d(n, i = d(i, t = d(t, _, n, i, e[a + 13], 5, -1444681467), _, n, e[a + 2], 9, -51403784), t, _, e[a + 7], 14, 1735328473), i, t, e[a + 12], 20, -1926607734), n = l(n, i = l(i, t = l(t, _, n, i, e[a + 5], 4, -378558), _, n, e[a + 8], 11, -2022574463), t, _, e[a + 11], 16, 1839030562), i, t, e[a + 14], 23, -35309556), n = l(n, i = l(i, t = l(t, _, n, i, e[a + 1], 4, -1530992060), _, n, e[a + 4], 11, 1272893353), t, _, e[a + 7], 16, -155497632), i, t, e[a + 10], 23, -1094730640), n = l(n, i = l(i, t = l(t, _, n, i, e[a + 13], 4, 681279174), _, n, e[a + 0], 11, -358537222), t, _, e[a + 3], 16, -722521979), i, t, e[a + 6], 23, 76029189), n = l(n, i = l(i, t = l(t, _, n, i, e[a + 9], 4, -640364487), _, n, e[a + 12], 11, -421815835), t, _, e[a + 15], 16, 530742520), i, t, e[a + 2], 23, -995338651), n = h(n, i = h(i, t = h(t, _, n, i, e[a + 0], 6, -198630844), _, n, e[a + 7], 10, 1126891415), t, _, e[a + 14], 15, -1416354905), i, t, e[a + 5], 21, -57434055), n = h(n, i = h(i, t = h(t, _, n, i, e[a + 12], 6, 1700485571), _, n, e[a + 3], 10, -1894986606), t, _, e[a + 10], 15, -1051523), i, t, e[a + 1], 21, -2054922799), n = h(n, i = h(i, t = h(t, _, n, i, e[a + 8], 6, 1873313359), _, n, e[a + 15], 10, -30611744), t, _, e[a + 6], 15, -1560198380), i, t, e[a + 13], 21, 1309151649), n = h(n, i = h(i, t = h(t, _, n, i, e[a + 4], 6, -145523070), _, n, e[a + 11], 10, -1120210379), t, _, e[a + 2], 15, 718787259), i, t, e[a + 9], 21, -343485551), t = b(t, r), _ = b(_, s), n = b(n, o), i = b(i, c) } return Array(t, _, n, i) } function f(e, x, t, _, n, i) { return b((a = b(b(x, e), b(_, i))) << (r = n) | a >>> 32 - r, t); var a, r } function u(e, x, t, _, n, i, a) { return f(x & t | ~x & _, e, x, n, i, a) } function d(e, x, t, _, n, i, a) { return f(x & _ | t & ~_, e, x, n, i, a) } function l(e, x, t, _, n, i, a) { return f(x ^ t ^ _, e, x, n, i, a) } function h(e, x, t, _, n, i, a) { return f(t ^ (x | ~_), e, x, n, i, a) } function b(e, x) { var t = (65535 & e) + (65535 & x); return (e >> 16) + (x >> 16) + (t >> 16) << 16 | 65535 & t } function p(e) { for (var x = Array(), t = (1 << o) - 1, _ = 0; _ < e[_0x27e6("0x12e")] * o; _ += o) x[_ >> 5] |= (e[_0x27e6("0x2b9")](_ / o) & t) << _ % 32; return x } function v(e) { for (var x = "", t = 0; t < 4 * e[_0x27e6("0x12e")]; t += 3) for (var _ = (e[t >> 2] >> t % 4 * 8 & 255) << 16 | (e[t + 1 >> 2] >> (t + 1) % 4 * 8 & 255) << 8 | e[t + 2 >> 2] >> (t + 2) % 4 * 8 & 255, n = 0; n < 4; n++) 8 * t + 6 * n > 32 * e[_0x27e6("0x12e")] ? x += s : x += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_0x27e6("0x6f1")](_ >> 6 * (3 - n) & 63); return x }详情接口
import requests
headers = { 'Accept': '*/*', 'Accept-Language': 'zh-CN,zh;q=0.9', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Origin': 'http://218.60.154.1:81', 'Pragma': 'no-cache', 'Referer': 'http://218.60.154.1:81/webserver/lnpublish/index.html', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36', 'buried': 'encrypt',}
params = { 'appKey': 'c9406731-50bc-4e23-b3f5-b7e7d3093875', 'time': '1759027737595', 'sign': 'fECVgM/vBX/uLQo7hYshWQ==',}
data = 'D8IpXyq/gkvzotR82oBFPPPuntN5tQYLQQ6WN0GMCRrmpUr8O+AIwJmJ+D1OMjgZkN7z5XObYetYbUrFCT12iA=='
response = requests.post( 'http://218.60.154.1:81/dataexchangeserver/fbTbpersonbasicinfo/getPersonDetail', params=params, headers=headers, data=data, verify=False,) 辽宁省建筑市场监管公共服务平台
https://blog.tiamix.cn/posts/辽宁省建筑市场监管公共服务平台/