【js逆向学习】某多多anti_content逆向(补环境)

打印 上一主题 下一主题

主题 1843|帖子 1843|积分 5529


声明

本文章中全部内容仅供学习交换使用,不用于其他任何目的,不提供完整代码,抓包内容、敏感网址、数据接口等均已做脱敏处置惩罚,严禁用于商业用途和非法用途,否则由此产生的一切结果均与作者无关!
本文章未经许可禁止转载,禁止任何修改后二次传播,擅自使用本文解说的技术而导致的任何不测,作者均不负责,如有侵权,请接洽作者立刻删除!

逆向目的

网址:aHR0cHM6Ly9jYXJlZXJzLnBkZGdsb2JhbGhyLm5ldC9qb2Jz
参数:anti_content

逆向分析


分析找到目的接口,然后以cURL格式复制,转 为python 哀求


可以看到接口比力简朴,只有一个 anti_content 参数

逆向过程

搜索关键字 anti_content ,可以在全部搜索结果处都打上断点,这里我就直接在目的处打上断点

我们翻页调试在断点处断住,然后一步步跟栈进去,末了跟到了下面位置,具体跟栈流程也比力简朴,CSDN 一大堆相干文章某,这里我们就不多讲了

控制台实行 Vt() 输出结果就是我们要的 anti_content ,我们翻到最上面可以看到就是 webpack

我们把整个 js代码 拷贝到 vscode,全部折叠代码并搜索具体的加密代码t[n(576, "lD!i")](e, t[n(558, "[k*i")](Vt)),如下
可以看到内里也是一个 webpack 的加载器,我们直接把这个模块扣出来,并导出加载器
  1. var _qin;
  2. !(function (t) {
  3.         var e = {};
  4.         function n(r) {
  5.                 if (e[r]) return e[r].exports;
  6.                 var o = (e[r] = {
  7.                         i: r,
  8.                         l: !1,
  9.                         exports: {},
  10.                 });
  11.                 return t[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports;
  12.         }
  13.         return (
  14.                 (n.m = t),
  15.                 (n.c = e),
  16.                 (n.d = function (t, e, r) {
  17.                         n.o(t, e) ||
  18.                                 Object.defineProperty(t, e, {
  19.                                         enumerable: !0,
  20.                                         get: r,
  21.                                 });
  22.                 }),
  23.                 (n.r = function (t) {
  24.                         "undefined" != typeof Symbol &&
  25.                                 Symbol.toStringTag &&
  26.                                 Object.defineProperty(t, Symbol.toStringTag, {
  27.                                         value: "Module",
  28.                                 }),
  29.                                 Object.defineProperty(t, "__esModule", {
  30.                                         value: !0,
  31.                                 });
  32.                 }),
  33.                 (n.t = function (t, e) {
  34.                         if ((1 & e && (t = n(t)), 8 & e)) return t;
  35.                         if (4 & e && "object" == typeof t && t && t.__esModule) return t;
  36.                         var r = Object.create(null);
  37.                         if (
  38.                                 (n.r(r),
  39.                                 Object.defineProperty(r, "default", {
  40.                                         enumerable: !0,
  41.                                         value: t,
  42.                                 }),
  43.                                 2 & e && "string" != typeof t)
  44.                         )
  45.                                 for (var o in t)
  46.                                         n.d(
  47.                                                 r,
  48.                                                 o,
  49.                                                 function (e) {
  50.                                                         return t[e];
  51.                                                 }.bind(null, o)
  52.                                         );
  53.                         return r;
  54.                 }),
  55.                 (n.n = function (t) {
  56.                         var e =
  57.                                 t && t.__esModule
  58.                                         ? function () {
  59.                                                         return t.default;
  60.                                           }
  61.                                         : function () {
  62.                                                         return t;
  63.                                           };
  64.                         return n.d(e, "a", e), e;
  65.                 }),
  66.                 (n.o = function (t, e) {
  67.                         return Object.prototype.hasOwnProperty.call(t, e);
  68.                 }),
  69.                 (n.p = ""),
  70.                 (_qin = n)
  71.                 // n((n.s = 4))
  72.         );
  73. })([
  74.         ...
  75.         ...
  76.         函数数组太大了,这里就不贴了
  77.         ...
  78.         ...
  79. ]);
复制代码
到这里我们的工作只完成了 50%,剩下 50% 工作量就是补环境,当然也可以直接硬扣,本篇文章用补环境来实现,下面给出一个补环境框架,各人自行实验
  1. //enviroment.js 补环境代码
  2. delete global;
  3. delete Buffer;
  4. catvm = {};
  5. catvm.memory = { log: [] };
  6. window = {};
  7. // 保护伪造函数toString
  8. (() => {
  9.         const $toString = Function.toString;
  10.         const myFunction_toString_symbol = Symbol(
  11.                 "(".concat("", ")_", Math.random() + "").toString(36)
  12.         );
  13.         const myToString = function () {
  14.                 return (
  15.                         (typeof this === "function" && this[myFunction_toString_symbol]) ||
  16.                         $toString.call(this)
  17.                 );
  18.         };
  19.         function set_native(func, key, value) {
  20.                 Object.defineProperty(func, key, {
  21.                         enumerable: false,
  22.                         configurable: true,
  23.                         writable: true,
  24.                         value: value,
  25.                 });
  26.         }
  27.         delete Function.prototype.toString;
  28.         set_native(Function.prototype, "toString", myToString);
  29.         set_native(
  30.                 Function.prototype.toString,
  31.                 myFunction_toString_symbol,
  32.                 "function toString() { [native code] }"
  33.         );
  34.         globalThis.catvm.savefunction = (func, funcname) => {
  35.                 //todo 系统函数没名字 native code
  36.                 set_native(
  37.                         func,
  38.                         myFunction_toString_symbol,
  39.                         `function ${func.name || funcname || ""}() { [native code] }`
  40.                 );
  41.         };
  42. }).call(globalThis);
  43. var Window = function Window() {};
  44. Object.setPrototypeOf(window, Window.prototype);
  45. catvm.rename(Window.prototype, "Window");
  46. catvm.savefunction(Window);
  47. window.document = new Document();
  48. Object.setPrototypeOf(window.document, Document.prototype);
  49. catvm.rename(Document.prototype, "Document");
  50. catvm.savefunction(Document);
  51. var Location = function Location() {};
  52. window.location = new Location();
  53. Object.setPrototypeOf(window.location, Location.prototype);
  54. catvm.rename(Location.prototype, "Location");
  55. catvm.savefunction(Location);
  56. var Navigator = function Navigator() {};
  57. Navigator.prototype.hasOwnProperty = function hasOwnProperty() {
  58.         console.log(arguments);
  59.         return true;
  60. };
  61. window.navigator = new Navigator();
  62. Object.setPrototypeOf(window.navigator, Navigator.prototype);
  63. catvm.rename(Navigator.prototype, "Navigator");
  64. catvm.savefunction(Navigator);
  65. var History = function History() {};
  66. window.history = new History();
  67. Object.setPrototypeOf(window.history, History.prototype);
  68. catvm.rename(History.prototype, "History");
  69. catvm.savefunction(History);
  70. var Storage = function Storage() {};
  71. window.localStorage = new Storage();
  72. Object.setPrototypeOf(window.localStorage, Storage.prototype);
  73. catvm.rename(Storage.prototype, "Storage");
  74. catvm.savefunction(Storage);
  75. var Screen = function Screen() {};
  76. Object.setPrototypeOf(window.screen, Screen.prototype);
  77. catvm.rename(Screen.prototype, "Screen");
  78. catvm.savefunction(Screen);
  79. window = catvm.proxy(window);
  80. window.document = catvm.proxy(window.document);
  81. window.location = catvm.proxy(window.location);
  82. window.navigator = catvm.proxy(window.navigator);
  83. window.history = catvm.proxy(window.history);
  84. window.localStorage = catvm.proxy(window.localStorage);
  85. window.screen = catvm.proxy(window.screen);
复制代码
用无欣赏器模式调试,缺什么补什么就行了,下面是我补完之后的结果

补了环境之后可以看到带上anti_content 可以正常拿到结果了


总结

以上就是本篇文章介绍的内容,本篇帖子简朴介绍了拼多多的补环境,完整源码请跳转下载 拼夕夕anti_content, 有疑问可以留言或私信一起探讨

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

河曲智叟

论坛元老
这个人很懒什么都没写!
快速回复 返回顶部 返回列表