吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1672|回复: 19
收起左侧

[求助] 求教,是如何生成signsafe,本地可以生成吗?谢谢

[复制链接]
⊙⌒⊙ 发表于 2022-3-13 20:20
网址:https://www.gaokao.cn/school/102/provinceline

1.png
数据获得的地址:https://api.eol.cn/web/api/?e_sort=zslx_rank,min&e_sorttype=desc,desc&local_province_id=32&local_type_id=2073&page=1&school_id=102&size=10&uri=apIDAta/api/gk/score/province&year=2021&signsafe=9ee248937a78c4bf871263f0f16472ea

后面的singsafe自动生成的,请问能本地生成这个参数吗?谢谢
返回的数据也加密了 2.png

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

laos 发表于 2022-3-13 20:39
这里去下断跟一下就行
[Asm] 纯文本查看 复制代码

                            g = r.a.HmacSHA1(r.a.enc.Utf8.parse(t), g),
                            g = r.a.enc.Base64.stringify(g).toString(),
                            p = c()(g),
                            u.signsafe = p,
                            s.find((function(l) {
                                return l === u.uri
                            }
                            )) || (e = f + "&signsafe=" + p)),
82813668 发表于 2022-3-13 21:05
 楼主| ⊙⌒⊙ 发表于 2022-3-14 06:59
laos 发表于 2022-3-13 20:39
这里去下断跟一下就行
[mw_shl_code=asm,true]

谢谢,已经找到这儿了,下面不会操作了:(
laos 发表于 2022-3-14 19:10
本帖最后由 laos 于 2022-3-14 19:12 编辑
⊙⌒⊙ 发表于 2022-3-14 06:59
谢谢,已经找到这儿了,下面不会操作了:(

差不多是这样吧~我随便写,你凑合看~

calc_sign传的参数为signsafe前

如:
[Asm] 纯文本查看 复制代码
https://api.eol.cn/web/api/?e_sort=zslx_rank,min&e_sorttype=desc,desc&local_province_id=32&local_type_id=2073&page=1&school_id=102&size=10&uri=apidata/api/gk/score/province&year=2021

微信截图_20220314190919.png
 楼主| ⊙⌒⊙ 发表于 2022-3-14 20:12
laos 发表于 2022-3-14 19:10
差不多是这样吧~我随便写,你凑合看~

calc_sign传的参数为signsafe前

谢谢老哥,我都分析一周了,没个头绪,就这么简单的一段代码?:(太厉害了!!!
 楼主| ⊙⌒⊙ 发表于 2022-3-14 20:29
完美!!,能不能大概的传授下怎么去找的,我断点找到这儿了,后面找不下去了:( 图片.png
 楼主| ⊙⌒⊙ 发表于 2022-3-14 22:06
import base64
import hashlib
import re
import hmac
import requests

def calc_sign(s):
    s=re.sub(re.compile(r'^\/|https?:\/\/\/?',re.S),'',s)
    hmac_sha1=hmac.new('D23ABC@#56'.encode(),s.encode(),hashlib.sha1).digest()
    sign_b64=base64.b64encode(hmac_sha1)
    sign_md5=hashlib.md5(sign_b64).hexdigest()
    return sign_md5

school_id=118
url='https://api.eol.cn/web/api/?e_sort=zslx_rank,min&e_sorttype=desc,desc&local_province_id=32&local_type_id=2073&page=1&school_id='+str(school_id)+'&size=10&uri=apidata/api/gk/score/province&year=2021'

signsafe=calc_sign(url)

url=url+'&signsafe='+signsafe
print(url)

headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0'}
postdata={"e_sort":"zslx_rank,min","e_sorttype":"desc,desc","local_province_id":"32","local_type_id":2073,"page":1,"school_id":str(school_id),"signsafe":signsafe,"size":10,"uri":"apidata/api/gk/score/province","year":2021}
response=requests.post(url,data=postdata,headers=headers)
print(response.text)


已经成功获得数据,但加密的:(调到现在都找不到哪儿解密:(
 楼主| ⊙⌒⊙ 发表于 2022-3-14 23:08
[JavaScript] 纯文本查看 复制代码
return h = "D23ABC@#56",
                            p = "",
                            e.endsWith(".json") || e.endsWith(".txt") || (f = e + (0 < Object.keys(u).length ? "?" + function(l) {
                                return Object.keys(l).sort().map((function(e) {
                                    var a = l[e];
                                    return "keyword" !== e && "ranktype" !== e || (a = decodeURI(decodeURI(l[e]))),
                                    "".concat(e, "=").concat(void 0 === a ? "" : a)
                                }
                                )).join("&")
                            }(u) : ""),
                            g = void 0,
                            g = (t = {
                                SIGN: h,
                                str: f.replace(/^\/|https?:\/\/\/?/, "")
                            }).SIGN,
                            t = t.str,
                            g = r.a.HmacSHA1(r.a.enc.Utf8.parse(t), g),
                            g = r.a.enc.Base64.stringify(g).toString(),
                            p = c()(g),
                            u.signsafe = p,
                            s.find((function(l) {
                                return l === u.uri
                            }
                            )) || (e = f + "&signsafe=" + p)),
                            l.abrupt("return", i()({
                                url: e,
                                method: a,
                                timeout: n,
                                data: function(l, e) {
                                    var a, u = {};
                                    if (Object.keys(e).sort().forEach((function(l) {
                                        return u[l] = Array.isArray(e[l]) ? e[l].toString() : e[l]
                                    }
                                    )),
                                    "get" === l)
                                        return JSON.stringify(u);
                                    for (a in u)
                                        "elective" !== a && "vote" !== a || "" == u[a] || (u[a] = -1 == u[a].indexOf(",") ? u[a].split(" ") : u[a].split(","));
                                    return u
                                }(a, Object(b.a)(Object(b.a)({}, u), {}, {
                                    signsafe: p
                                }))
                            }).then((function(l) {
                                return l.data
                            }
                            )).catch((function() {
                                return window.gio("track", "info_err", {
                                    info_err_res: e
                                }),
                                {}
                            }
                            )).then((function(l) {
                                var e, a, t, b, n;
                                return null != l && null !== (a = l.data) && void 0 !== a && a.text && (l.data = (n = (e = {
                                    iv: u.uri,
                                    text: l.data.text,
                                    SIGN: h
                                }).iv,
                                a = e.text,
                                e = e.SIGN,
                                e = r.a.PBKDF2(e, "secret", {
                                    keySize: 8,
                                    iterations: 1e3,
                                    hasher: r.a.algo.SHA256
                                }).toString(),
                                n = r.a.PBKDF2(n, "secret", {
                                    keySize: 4,
                                    iterations: 1e3,
                                    hasher: r.a.algo.SHA256
                                }).toString(),
                                a = r.a.lib.CipherParams.create({
                                    ciphertext: r.a.enc.Hex.parse(a)
                                }),
                                n = r.a.AES.decrypt(a, r.a.enc.Hex.parse(e), {
                                    iv: r.a.enc.Hex.parse(n)
                                }),
                                JSON.parse(n.toString(r.a.enc.Utf8)))),
                                v && (t = o,
                                b = l,
                                null !== (n = window.apiConfig) && void 0 !== n && null !== (n = n.filterCacheList) && void 0 !== n && n.length ? window.apiConfig.filterCacheList.forEach((function(l) {
                                    new RegExp(l).test(t) || d.set(t, b)
                                }
                                )) : d.set(t, b)),
                                l
                            }
                            )));


解密好像也是这断代码,高度到这儿了
laos 发表于 2022-3-15 16:14
⊙⌒⊙ 发表于 2022-3-14 20:12
谢谢老哥,我都分析一周了,没个头绪,就这么简单的一段代码?:(太厉害了!!!

这一段不难 没混淆 加密方式都明明白白写着了
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-25 16:25

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表