JS逆向之Webpack 处理2

本文参考链接:webpack逆向-中远海运-油猴中文网

这个难点在于入口函数调用库是从两个文件中调用的。

首先把入口函数扣出来

JS逆向之Webpack 处理2_第1张图片

其中o.a,o=n("MuMZ"),全局搜索"MuMZ",如下:

JS逆向之Webpack 处理2_第2张图片

 其中包含一个 var r = n("XBrZ");全局搜索"XBrZ",再另一个js文件中,并且用r这个扣调用函数,并且调用的比较多,搜索发现都在这个js文件中,将整个这个js文件拷贝下来。

JS逆向之Webpack 处理2_第3张图片

接下来扣入口函数:

JS逆向之Webpack 处理2_第4张图片

 先复制入口函数:

!function(c) {
                function n(n) {
                    for (var h, e, f = n[0], d = n[1], b = n[2], t = 0, o = []; t < f.length; t++)
                        e = f[t],
                        Object.prototype.hasOwnProperty.call(k, e) && k[e] && o.push(k[e][0]),
                        k[e] = 0;
                    for (h in d)
                        Object.prototype.hasOwnProperty.call(d, h) && (c[h] = d[h]);
                    for (r && r(n); o.length; )
                        o.shift()();
                    return a.push.apply(a, b || []),
                    u()
                }
                function u() {
                    for (var c, n = 0; n < a.length; n++) {
                        for (var u = a[n], h = !0, e = 1; e < u.length; e++) {
                            var d = u[e];
                            0 !== k[d] && (h = !1)
                        }
                        h && (a.splice(n--, 1),
                        c = f(f.s = u[0]))
                    }
                    return c
                }
                var h = {}
                  , e = {
                    runtime: 0
                }
                  , k = {
                    runtime: 0
                }
                  , a = [];
                function f(n) {
                    if (h[n])
                        return h[n].exports;
                    var u = h[n] = {
                        i: n,
                        l: !1,
                        exports: {}
                    };
                    return c[n].call(u.exports, u, u.exports, f),
                    u.l = !0,
                    u.exports
                }
                f.e = function(c) {
                    var n = [];
                    e[c] ? n.push(e[c]) : 0 !== e[c] && {
                        "chunk-0f66": 1,
                        "chunk-4f40": 1,
                        "chunk-2eb7": 1,
                        "chunk-fc38": 1,
                        "chunk-c659": 1,
                        "chunk-57a9": 1,
                        "chunk-7f7a": 1,
                        "chunk-97f7": 1,
                        "chunk-c1f6": 1,
                        "chunk-16f7": 1,
                        "chunk-1a42": 1,
                        "chunk-1b94": 1,
                        "chunk-4f5c": 1,
                        "chunk-b1ff": 1,
                        "chunk-3eb9": 1,
                        "chunk-45a6": 1,
                        "chunk-4975": 1,
                        "chunk-c89e": 1,
                        "chunk-52bc": 1,
                        "chunk-587a": 1,
                        "chunk-63d7": 1,
                        "chunk-6b48": 1,
                        "chunk-72e0": 1,
                        "chunk-7dda": 1,
                        "chunk-7ebe": 1,
                        "chunk-7f00": 1,
                        "chunk-f6c7": 1,
                        "chunk-50d0": 1,
                        "chunk-006f": 1,
                        "chunk-e083": 1,
                        "chunk-6d04": 1,
                        "chunk-8f40": 1,
                        "chunk-4bb0": 1,
                        "chunk-7050": 1,
                        "chunk-92f6": 1,
                        "chunk-9823": 1,
                        "chunk-b739": 1,
                        "chunk-commons": 1,
                        "chunk-92d5": 1,
                        "chunk-7384": 1,
                        "chunk-5df2": 1,
                        "chunk-5121": 1,
                        "chunk-5428": 1,
                        "chunk-1e77": 1,
                        "chunk-18c7": 1,
                        "chunk-6982": 1,
                        "chunk-6e49": 1,
                        "chunk-7586": 1,
                        "chunk-2619": 1,
                        "chunk-6948": 1,
                        "chunk-c63e": 1,
                        "chunk-08ac": 1,
                        "chunk-08be": 1,
                        "chunk-0e0a": 1,
                        "chunk-0e65": 1,
                        "chunk-58f5": 1,
                        "chunk-3d1c": 1,
                        "chunk-48c9": 1,
                        "chunk-745c": 1,
                        "chunk-0fb0": 1,
                        "chunk-1568": 1,
                        "chunk-15b1": 1,
                        "chunk-1ce6": 1,
                        "chunk-80f0": 1,
                        "chunk-2ff0": 1,
                        "chunk-8339": 1,
                        "chunk-1817": 1,
                        "chunk-5305": 1,
                        "chunk-579c": 1,
                        "chunk-19a9": 1,
                        "chunk-0bf9": 1,
                        "chunk-153c": 1,
                        "chunk-4744": 1,
                        "chunk-1d1c": 1,
                        "chunk-28a2": 1,
                        "chunk-4da8": 1,
                        "chunk-2d79": 1,
                        "chunk-31fd": 1,
                        "chunk-413b": 1,
                        "chunk-fae1": 1,
                        "chunk-adde": 1,
                        "chunk-542b": 1,
                        "chunk-5770": 1,
                        "chunk-5aec": 1,
                        "chunk-5bc4": 1,
                        "chunk-3513": 1,
                        "chunk-58f6": 1,
                        "chunk-6bf2": 1,
                        "chunk-5cee": 1,
                        "chunk-5797": 1,
                        "chunk-7d0b": 1,
                        "chunk-83fe": 1,
                        "chunk-8481": 1,
                        "chunk-8b0e": 1,
                        "chunk-569b": 1,
                        "chunk-6040": 1,
                        "chunk-1ca5": 1,
                        "chunk-296d": 1,
                        "chunk-902d": 1,
                        "chunk-2456": 1,
                        "chunk-c48d": 1,
                        "chunk-cdbb": 1,
                        "chunk-cdbc": 1,
                        "chunk-d9b1": 1,
                        "chunk-e06b": 1,
                        "chunk-ece0": 1,
                        "chunk-ed0b": 1,
                        "chunk-17b4": 1,
                        "chunk-2d86": 1,
                        "chunk-c327": 1,
                        "chunk-11cb": 1,
                        "chunk-025d": 1,
                        "chunk-3902": 1,
                        "chunk-8c4d": 1,
                        "chunk-5a49": 1
                    }[c] && n.push(e[c] = new Promise(function(n, u) {
                        for (var h = "static/css/" + ({
                            "chunk-commons": "chunk-commons"
                        }[c] || c) + "." + {
                            "chunk-0f66": "e954caa6",
                            "chunk-4f40": "2b2cb533",
                            "chunk-2eb7": "5508c501",
                            "chunk-fc38": "94e3f1e8",
                            "chunk-c659": "7155570f",
                            "chunk-57a9": "91adf565",
                            "chunk-7f7a": "2f807e16",
                            "chunk-97f7": "d6282dc7",
                            "chunk-c1f6": "8e9b1669",
                            "chunk-16f7": "4110d1ac",
                            "chunk-1a42": "f35e4a68",
                            "chunk-1b94": "f1a44089",
                            "chunk-4f5c": "ea915f28",
                            "chunk-b1ff": "66d5c5b6",
                            "chunk-3eb9": "6df95454",
                            "chunk-45a6": "d957706c",
                            "chunk-4975": "a8c6f368",
                            "chunk-c89e": "612bf37a",
                            "chunk-52bc": "68649870",
                            "chunk-587a": "c27615dc",
                            "chunk-63d7": "697a95b7",
                            "chunk-6b48": "78294542",
                            "chunk-72e0": "5a9cc863",
                            "chunk-7dda": "989bf49c",
                            "chunk-7ebe": "40ab5023",
                            "chunk-7f00": "f242e75a",
                            "chunk-8839": "31d6cfe0",
                            "chunk-f6c7": "d7a854b6",
                            "chunk-560b": "31d6cfe0",
                            "chunk-50d0": "dbd16658",
                            "chunk-006f": "3da1a830",
                            "chunk-e083": "3fb1e2ef",
                            "chunk-6d04": "da7a1798",
                            "chunk-8f40": "d81bb75e",
                            "chunk-4bb0": "6d9d0bde",
                            "chunk-7050": "8065e659",
                            "chunk-92f6": "77cd14eb",
                            "chunk-9823": "6c0bf642",
                            "chunk-b739": "968db88b",
                            "chunk-commons": "bd70fdc0",
                            MT78: "31d6cfe0",
                            "chunk-0641": "31d6cfe0",
                            "chunk-92d5": "ee4960ac",
                            "chunk-7384": "97d4e954",
                            "chunk-5df2": "b0405c86",
                            "chunk-5121": "20afbb83",
                            "chunk-5428": "aeb7d98f",
                            "chunk-861b": "31d6cfe0",
                            "chunk-1e77": "bb8134df",
                            "chunk-18c7": "4a621282",
                            "chunk-6982": "228114d2",
                            "chunk-6e49": "f49b1307",
                            "chunk-7586": "deb3a412",
                            "chunk-2619": "db668ac0",
                            "chunk-6948": "eb273883",
                            "chunk-c63e": "5983eaf6",
                            "chunk-08ac": "3068b189",
                            "chunk-08be": "34df066c",
                            "chunk-0e0a": "e5eed3c1",
                            "chunk-0e65": "c1532e50",
                            "chunk-58f5": "25408aa4",
                            "chunk-3d1c": "94d59c18",
                            "chunk-48c9": "a3ec212c",
                            "chunk-745c": "f10cd066",
                            "chunk-0fb0": "884f4862",
                            "chunk-1568": "1dfd4165",
                            "chunk-15b1": "b21bca18",
                            "chunk-1ce6": "97ead06e",
                            "chunk-80f0": "b632396f",
                            "chunk-2ff0": "9aa7023b",
                            "chunk-8339": "34677d43",
                            "chunk-1817": "264793bd",
                            "chunk-5305": "284acb94",
                            "chunk-579c": "83ab4f31",
                            "chunk-19a9": "cd437a6f",
                            "chunk-0bf9": "fade69fe",
                            "chunk-153c": "6b975944",
                            "chunk-1a6e": "31d6cfe0",
                            "chunk-4744": "160cc936",
                            "chunk-1d1c": "6b905d5a",
                            "chunk-28a2": "ad27f222",
                            "chunk-4da8": "8b18d9c6",
                            "chunk-2d79": "56e6ca57",
                            "chunk-31fd": "cb39625f",
                            "chunk-413b": "4f8daa87",
                            "chunk-fae1": "8bebf64f",
                            "chunk-adde": "7f94786e",
                            "chunk-542b": "15a70a63",
                            "chunk-5770": "4426f028",
                            "chunk-5aec": "cbe32f74",
                            "chunk-5bc4": "2ba18e21",
                            "chunk-3513": "e0b5307a",
                            "chunk-58f6": "692f3179",
                            "chunk-6bf2": "20aef904",
                            "chunk-5cee": "bfe412ba",
                            "chunk-5797": "f5650053",
                            "chunk-7d0b": "15084518",
                            "chunk-83fe": "b8a5961a",
                            "chunk-8481": "5cdfdd37",
                            "chunk-885f": "31d6cfe0",
                            "chunk-8b0e": "d136a2c4",
                            "chunk-569b": "d6fc0dfe",
                            "chunk-6040": "0d685b17",
                            "chunk-1ca5": "d1b2fd18",
                            "chunk-296d": "73ccd257",
                            "chunk-902d": "44974626",
                            "chunk-2456": "4b396e0a",
                            "chunk-c48d": "6b83a6b0",
                            "chunk-cdbb": "4eceadc6",
                            "chunk-cdbc": "4a298a35",
                            "chunk-d9b1": "59fcda17",
                            "chunk-e06b": "ccab19f6",
                            "chunk-ece0": "a2082868",
                            "chunk-ed0b": "e764ddf1",
                            "chunk-17b4": "a6540115",
                            "chunk-2d86": "0c16ed15",
                            "chunk-c327": "9da0b028",
                            "chunk-11cb": "4490bf14",
                            "chunk-025d": "bfe376cf",
                            "chunk-3902": "0080cb90",
                            "chunk-8c4d": "11901382",
                            "chunk-5a49": "8d1e79c8"
                        }[c] + ".css", e = f.p + h, k = document.getElementsByTagName("link"), a = 0; a < k.length; a++) {
                            var d = (t = k[a]).getAttribute("data-href") || t.getAttribute("href");
                            if ("stylesheet" === t.rel && (d === h || d === e))
                                return n()
                        }
                        var b = document.getElementsByTagName("style");
                        for (a = 0; a < b.length; a++) {
                            var t;
                            if ((d = (t = b[a]).getAttribute("data-href")) === h || d === e)
                                return n()
                        }
                        var r = document.createElement("link");
                        r.rel = "stylesheet",
                        r.type = "text/css",
                        r.onload = n,
                        r.onerror = function(n) {
                            var h = n && n.target && n.target.src || e
                              , k = new Error("Loading CSS chunk " + c + " failed.\n(" + h + ")");
                            k.request = h,
                            u(k)
                        }
                        ,
                        r.href = e,
                        document.getElementsByTagName("head")[0].appendChild(r)
                    }
                    ).then(function() {
                        e[c] = 0
                    }));
                    var u = k[c];
                    if (0 !== u)
                        if (u)
                            n.push(u[2]);
                        else {
                            var h = new Promise(function(n, h) {
                                u = k[c] = [n, h]
                            }
                            );
                            n.push(u[2] = h);
                            var a, d = document.createElement("script");
                            d.charset = "utf-8",
                            d.timeout = 120,
                            f.nc && d.setAttribute("nonce", f.nc),
                            d.src = function(c) {
                                return f.p + "static/js/" + ({
                                    "chunk-commons": "chunk-commons"
                                }[c] || c) + "." + {
                                    "chunk-0f66": "c824988b",
                                    "chunk-4f40": "9799dc9d",
                                    "chunk-2eb7": "8524cc11",
                                    "chunk-fc38": "ae20f1c1",
                                    "chunk-c659": "73d213dc",
                                    "chunk-57a9": "c6862b5e",
                                    "chunk-7f7a": "66017353",
                                    "chunk-97f7": "9ced2608",
                                    "chunk-c1f6": "284dd9fd",
                                    "chunk-16f7": "0e754493",
                                    "chunk-1a42": "3e56e1a6",
                                    "chunk-1b94": "0b35c651",
                                    "chunk-4f5c": "382802f1",
                                    "chunk-b1ff": "ba126c23",
                                    "chunk-3eb9": "dccfc918",
                                    "chunk-45a6": "176cc7ef",
                                    "chunk-4975": "3946d486",
                                    "chunk-c89e": "fa62bd5e",
                                    "chunk-52bc": "7aa40f38",
                                    "chunk-587a": "dce90d1b",
                                    "chunk-63d7": "c8ff5bda",
                                    "chunk-6b48": "568e52b5",
                                    "chunk-72e0": "01af4cfa",
                                    "chunk-7dda": "e21b91d3",
                                    "chunk-7ebe": "959b525b",
                                    "chunk-7f00": "5d20a7ed",
                                    "chunk-8839": "2bb965a5",
                                    "chunk-f6c7": "ce510bf5",
                                    "chunk-560b": "cb030c2d",
                                    "chunk-50d0": "bae45b69",
                                    "chunk-006f": "85c84dfb",
                                    "chunk-e083": "c7b6ba94",
                                    "chunk-6d04": "5843fd88",
                                    "chunk-8f40": "d60a6b26",
                                    "chunk-4bb0": "99d8ff8a",
                                    "chunk-7050": "b92a1ba6",
                                    "chunk-92f6": "2f40efb8",
                                    "chunk-9823": "474445d0",
                                    "chunk-b739": "254132c3",
                                    "chunk-commons": "e8763ce5",
                                    MT78: "c636f2f7",
                                    "chunk-0641": "b0a0f597",
                                    "chunk-92d5": "9ad7f904",
                                    "chunk-7384": "bd13389a",
                                    "chunk-5df2": "740493af",
                                    "chunk-5121": "bca42d9c",
                                    "chunk-5428": "37e35e80",
                                    "chunk-861b": "81626570",
                                    "chunk-1e77": "a9571e84",
                                    "chunk-18c7": "91ae4147",
                                    "chunk-6982": "a1bad432",
                                    "chunk-6e49": "70e2e498",
                                    "chunk-7586": "0ae09c58",
                                    "chunk-2619": "da7dda1f",
                                    "chunk-6948": "f305d891",
                                    "chunk-c63e": "6925b629",
                                    "chunk-08ac": "b08b85ad",
                                    "chunk-08be": "429da399",
                                    "chunk-0e0a": "02c503dc",
                                    "chunk-0e65": "d0a091c9",
                                    "chunk-58f5": "f839cbfa",
                                    "chunk-3d1c": "a0f17e99",
                                    "chunk-48c9": "6d169b4a",
                                    "chunk-745c": "23bf718c",
                                    "chunk-0fb0": "96f68093",
                                    "chunk-1568": "a4715074",
                                    "chunk-15b1": "3cd11c36",
                                    "chunk-1ce6": "ad3b4728",
                                    "chunk-80f0": "8380dffe",
                                    "chunk-2ff0": "1421bce3",
                                    "chunk-8339": "3eb82563",
                                    "chunk-1817": "dba38c20",
                                    "chunk-5305": "a24f0d7f",
                                    "chunk-579c": "e3bc9b91",
                                    "chunk-19a9": "0e238b33",
                                    "chunk-0bf9": "4effef74",
                                    "chunk-153c": "1296c609",
                                    "chunk-1a6e": "cd23cb18",
                                    "chunk-4744": "f9288f16",
                                    "chunk-1d1c": "4adb2598",
                                    "chunk-28a2": "92c001df",
                                    "chunk-4da8": "7ed62d4e",
                                    "chunk-2d79": "7627f6bb",
                                    "chunk-31fd": "b3ba59d2",
                                    "chunk-413b": "ad0d8a43",
                                    "chunk-fae1": "c7b6d8ee",
                                    "chunk-adde": "8a78908b",
                                    "chunk-542b": "919a4130",
                                    "chunk-5770": "73084df9",
                                    "chunk-5aec": "f632fa18",
                                    "chunk-5bc4": "e56e7297",
                                    "chunk-3513": "c11a8625",
                                    "chunk-58f6": "cea30ae9",
                                    "chunk-6bf2": "1eae040b",
                                    "chunk-5cee": "28832e3e",
                                    "chunk-5797": "49b9eb41",
                                    "chunk-7d0b": "9ce9e24d",
                                    "chunk-83fe": "f2909e4c",
                                    "chunk-8481": "c9843d76",
                                    "chunk-885f": "51abdf7f",
                                    "chunk-8b0e": "0d2cd8ea",
                                    "chunk-569b": "43fe1978",
                                    "chunk-6040": "5e2a614f",
                                    "chunk-1ca5": "84563ce2",
                                    "chunk-296d": "8e909171",
                                    "chunk-902d": "d8d5633e",
                                    "chunk-2456": "c2a03de5",
                                    "chunk-c48d": "e066f3fa",
                                    "chunk-cdbb": "2d3e6f15",
                                    "chunk-cdbc": "dbd1b6d0",
                                    "chunk-d9b1": "975e6156",
                                    "chunk-e06b": "c5062b78",
                                    "chunk-ece0": "576aa291",
                                    "chunk-ed0b": "99a9ce07",
                                    "chunk-17b4": "1ca55644",
                                    "chunk-2d86": "2ce3b5cf",
                                    "chunk-c327": "b9f56ad2",
                                    "chunk-11cb": "b9b9af4f",
                                    "chunk-025d": "46a3536a",
                                    "chunk-3902": "2a28ecf6",
                                    "chunk-8c4d": "1a13eb76",
                                    "chunk-5a49": "b9207178"
                                }[c] + ".js"
                            }(c);
                            var b = new Error;
                            a = function(n) {
                                d.onerror = d.onload = null,
                                clearTimeout(t);
                                var u = k[c];
                                if (0 !== u) {
                                    if (u) {
                                        var h = n && ("load" === n.type ? "missing" : n.type)
                                          , e = n && n.target && n.target.src;
                                        b.message = "Loading chunk " + c + " failed.\n(" + h + ": " + e + ")",
                                        b.name = "ChunkLoadError",
                                        b.type = h,
                                        b.request = e,
                                        u[1](b)
                                    }
                                    k[c] = void 0
                                }
                            }
                            ;
                            var t = setTimeout(function() {
                                a({
                                    type: "timeout",
                                    target: d
                                })
                            }, 12e4);
                            d.onerror = d.onload = a,
                            document.head.appendChild(d)
                        }
                    return Promise.all(n)
                }
                ,
                f.m = c,
                f.c = h,
                f.d = function(c, n, u) {
                    f.o(c, n) || Object.defineProperty(c, n, {
                        enumerable: !0,
                        get: u
                    })
                }
                ,
                f.r = function(c) {
                    "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(c, Symbol.toStringTag, {
                        value: "Module"
                    }),
                    Object.defineProperty(c, "__esModule", {
                        value: !0
                    })
                }
                ,
                f.t = function(c, n) {
                    if (1 & n && (c = f(c)),
                    8 & n)
                        return c;
                    if (4 & n && "object" == typeof c && c && c.__esModule)
                        return c;
                    var u = Object.create(null);
                    if (f.r(u),
                    Object.defineProperty(u, "default", {
                        enumerable: !0,
                        value: c
                    }),
                    2 & n && "string" != typeof c)
                        for (var h in c)
                            f.d(u, h, function(n) {
                                return c[n]
                            }
                            .bind(null, h));
                    return u
                }
                ,
                f.n = function(c) {
                    var n = c && c.__esModule ? function() {
                        return c.default
                    }
                    : function() {
                        return c
                    }
                    ;
                    return f.d(n, "a", n),
                    n
                }
                ,
                f.o = function(c, n) {
                    return Object.prototype.hasOwnProperty.call(c, n)
                }
                ,
                f.p = "/",
                f.oe = function(c) {
                    throw c
                }
                ;
                var d = window.webpackJsonp = window.webpackJsonp || []
                  , b = d.push.bind(d);
                d.push = n,
                d = d.slice();
                for (var t = 0; t < d.length; t++)
                    n(d[t]);
                var r = b;
                get_sign=f;
}({


})

这里要 在函数外var get_sign;在函数内get_sign=f;

在尾部的括号中把两个函数MuMZ和XBrZ列进去,如下:

JS逆向之Webpack 处理2_第5张图片

,然后把 r所导入的整个函数给加载了

JS逆向之Webpack 处理2_第6张图片

 再把入口函数给加载进去,并修改。

JS逆向之Webpack 处理2_第7张图片

 在浏览器中运行如下:

 

你可能感兴趣的:(python,webpack,javascript,前端)