数位站点 AES 加密方式

地址链接

站点分析

发现响应的内容为加密的

  • 全局搜索 decrypt, 再通过检索 Interceptors 关键字可以看出响应的加密部分, DEBUG 调试

分析:从getList进入 调用p(t)函数 调用r(a)函数 进入4144行函数(”1d2b”),发现有t,e两个参数 分析t,e两个参数 t是构造请求体的函数 e对象有interceptors属性 ( Interceptors 用来统一处理 HTTP 请求和响应),推测此处为解密逻辑 逐个查看 Interceptors,发现fulfilled函数 跳转到 32246行 发现有AES加密逻辑(ECB模式,Pkcs7),推测使用原生的AES加密,没有魔改,打断点,获取加密的key,复现解密逻辑,测试发现可以解密数据,确定目标站点使用原生AES加密数据

加密方法
  • 数据加密方法:AES加密
  • 加密模式:ECB
  • 填充: pkcs7

加密解密复现

# -*- coding:utf-8 -*-
import base64
import json
from Crypto.Cipher import AES
class Encryptor:
    def __init__(self, key):
        self.key = key  # 初始化密钥
        self.length = AES.block_size  # 初始化数据块大小
        self.aes = AES.new(self.key, AES.MODE_ECB)  # 初始化AES,ECB模式的实例
        # 截断函数,去除填充的字符
        self.unpad = lambda date: date[0:-ord(date[-1])]
    def pad(self, text):
        """
        #填充函数,使被加密数据的字节码长度是block_size的整数倍
        """
        count = len(text.encode('utf-8'))
        add = self.length - (count % self.length)
        entext = text + (chr(add) * add)
        return entext
    def encrypt(self, encrData):  # 加密函数
        res = self.aes.encrypt(self.pad(encrData).encode("utf8"))
        msg = str(base64.b64encode(res), encoding="utf8")
        return msg
    def decrypt(self, decrData):  # 解密函数
        res = base64.decodebytes(decrData.encode("utf8"))
        msg = self.aes.decrypt(res).decode("utf8")
        return self.unpad(msg)
eg = Encryptor(key=b"QV1f3nHn2qm7i3xrj3Y9K9imDdGTjTu9")
# text 为列表页接口返回数据
text = "UiY3CaV4ZQrQR9/LFH5qq8fm4S9X0opMLScyeoRNl9mH7sP/yMZrTJgei/MPvHFP6Ktgrc3wc7fSqdr+35 qv+UT5ns1gY2KcbhB7ja6i3xNzt+pzFFCYTQizfNkLIR+rxtW717cy5/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mg0fRB63Rw/SQk4sfrBHuEE1In99aBgvSXzeUh9n0LMl3ETketL2UBcHP/br7ClHDjoXQCTM2ilzMl8g4V3EagkR+QZOWTrO1DH4LCBav+gcz2eqA1eTyZgrPK0n9Z6WHkjp9cM6r06/9U3RlwUjt94kXbZ2bfxTcL4s5S+PlqdPvNs9K9mO1h5Xye5wxFfTh+LUVorRvCejEkspeZCIexKqd05Kn5bPlXXX6IxYp0VdM90UHAJ59kDdqE9UQ2e/E2T9AWVvcKD+ru6xqk9gb2fnq0Yj2Kz5+VbLPHwczsdSI08zuU4CMhG8+6yxsKt3ePt952zkpHbARQtYfQzKL1Dwoeg+R8NRnhcnDfOTzeMGQHRh1+V1YhKwS+0p4GF3+wyYW3NPnaoXa7MVbInYCLnZlIQS0tgoqZfZSAFOV/zhVizFL4YymnGWEWnURk2VjvIpm25BIkEsqVaUfLgj1d7FVtba0FkcgcSQlRGC9Zg++30rbXvDwmnjTbCeBCTsMGEP2LgoCH8F0yC7qtQFfflaQUypbGoEtX78Ml4aYrkCnpDx2Jk5Zx5AgoGLutSgMnJ2Z/E9RXhCuKfhQcCJsFqjmmw35NqwNwPqCRFsLhaxwKzNdDV43IVXdqzHn93fVmK3dPSXT8k7tgdn/z4IC4dNoRnpdGfNb0fTIAfS6r5P9fdhXWYJB3RLe8TbzkuJsf/zYjtnJJRMgV0zI0zuD+vrFjr7shy8mQPq0p4EuH7SWDgq0CzLtT4aFAqku6dz1bHh3ut+qJTnMxWLAdnF0BwdimIq1fJN586veTYNq36dYTYwOfqJlpZiD6v9PN7G68lQzY2TWBPyNfMwpeptEDxcNJT6vZ+r67dIJihNBvNY2ck6DY+A6Wezg04/XkO4YlwwkeuI+NS5US2XpToEf4k9vmkITOKe6ORS18hBzaj1yAltfur6ogTAAztpiDhdlzyQ"
data_json = eg.decrypt(text)
print(json.loads(data_json))
posted @ 2022-09-02 10:08  愺様  阅读(837)  评论(0编辑  收藏  举报