基于Proxyman的实时解密和预览方案

简介

本篇主要讲的内容是基于Proxyman的抓包 自动化解密便捷预览实践,希望能对大家有所帮助~

更多高级玩法详见官方文档Overview | Proxyman

实现

1.初识proxyman

Proxyman · Debug, intercept & mock HTTP with Proxyman

有钱用正版,没钱...o(╥﹏╥)o

2.如何连接设备

对比Charles虽然证书安装流程差不多,但Proxyman的连接说明可以说是非常的方便

3.配置SSL代理列表

SSL Proxying | Proxyman

添加域名后进行SSL代理设置即可,可设置黑白名单

4.脚本工具使用

Scripting | Proxyman

可以通过自定义脚本实现请求和响应拦截

添加脚本

脚本示例(基于DES加密方式举例)

php 复制代码
/// This func is called if the Request Checkbox is Enabled. You can modify the Request Data here before the request hits to the server
/// e.g. Add/Update/Remove: host, scheme, port, path, headers, queries, comment, color and body (json, form, plain-text, base64 encoded string)
///
/// Use global object `sharedState` to share data between Requests/Response from different scripts (e.g. sharedState.data = "My-Data")
///
const CryptoJS = require("@libs/crypto-js.min.js");

async function onRequest(context, url, request) {
  if (request.body) {
    const result = decrypt_des(request.body);
    request.customPreviewerTabs["decrypt"] = result
  }
  return request;
}

/// This func is called if the Response Checkbox is Enabled. You can modify the Response Data here before it goes to the client
/// e.g. Add/Update/Remove: headers, statusCode, comment, color and body (json, plain-text, base64 encoded string)
///
async function onResponse(context, url, request, response) {
  if (response.body) {
    const result = decrypt_des(response.body);
    response.customPreviewerTabs["decrypt"] = result
  }
  return response;
}

// 替换为你的密钥和初始向量(IV)
const key = '你自己的秘钥Key';  // 密钥
const iv = '你自己的秘钥IV';   // IV(初始向量)

// 自定义DES解密函数
function decrypt_des(crypt_text) {

  try {
    // 将16进制字符串转换为WordArray
    const data = CryptoJS.enc.Hex.parse(crypt_text);

    // 创建key和iv的WordArray对象
    const keyWordArray = CryptoJS.enc.Utf8.parse(key);
    const ivWordArray = CryptoJS.enc.Utf8.parse(iv);

    // 使用DES-CBC模式解密
    const decrypted = CryptoJS.DES.decrypt(
      { ciphertext: data },
      keyWordArray,
      {
        iv: ivWordArray,
        mode: CryptoJS.mode.CBC,
        padding: CryptoJS.pad.Pkcs7  // 等同于Python的unpad
      }
    );

    // 转换为UTF-8字符串
    const result = decrypted.toString(CryptoJS.enc.Utf8);
    return result;
  } catch (error) {
    console.error('DES解密失败:', error);
    return null;
  }
}

5.添加预览Tab

Custom Previewer Tab | Proxyman (官网搬运工)

在脚本中使用自定义预览Tab

总结

非常好使~o( ̄▽ ̄)d 👍🏻👍🏻👍🏻

相关推荐
gAlAxy...13 分钟前
IntelliJ IDEA 四种项目构建:从普通 Java 到 Maven Web 项目
前端·firefox
my一阁16 分钟前
2025-web集群-问题总结
前端·arm开发·数据库·nginx·负载均衡·web
会飞的小妖17 分钟前
个人博客系统(十一、前端-简短的配置)
前端
念念不忘 必有回响2 小时前
nginx前端部署与Vite环境变量配置指南
前端·nginx·vite
JIngJaneIL2 小时前
篮球论坛|基于SprinBoot+vue的篮球论坛系统(源码+数据库+文档)
java·前端·数据库·vue.js·论文·毕设·篮球论坛系统
程序猿阿伟4 小时前
《首屏加载优化手册:Vue3+Element Plus项目提速的技术细节》
前端·javascript·vue.js
fruge5 小时前
Vue Pinia 状态管理实战指南
前端·vue.js·ubuntu
sean6 小时前
开发一个自己的 claude code
前端·后端·ai编程
用户21411832636026 小时前
dify案例分享-用 Dify 一键生成教学动画 HTML!AI 助力,3 分钟搞定专业级课件
前端
太过平凡的小蚂蚁8 小时前
Kotlin 协程中常见的异步返回与控制方式(速览)
开发语言·前端·kotlin