How to decrypt the encrypted data of the mini-program without conducting an audit

0 26
1. Mini-program decompilationEnvironment preparation1. Prepare node environmentD...

1. Mini-program decompilation

Environment preparation

1. Prepare node environment

Download link:https://nodejs.org/en/

How to decrypt the encrypted data of the mini-program without conducting an audit

The project address comes from:https://github.com/xuedingmiaojun/wxappUnpacker

Specific operations

1. Obtain the mini-program on WeChat PC

Before opening the mini-program with WeChat PC, it is best to find the path of the locally cached mini-program package, generally it is in the WeChat PC installation directory\WeChat Files\WeChat Files\Applet

For example, mine is installed in the root directory of D disk, so the path is: D:\WeChat\WeChat Files\Applet

1687580642_64966fe2d57dee4f19f51.png!small?1687580642923

In the figure above, each wx folder represents a mini-program, generally the latest opened mini-program is the first one, if uncertain, you can sort by modification date

Once we find the path, we can open the mini-program with WeChat PC, after opening it, we will find that a new folder has been added to the current directory, which contains the encrypted mini-program package

1687580655_64966fefd4fa47924a386.png!small?1687580656174

2. Decrypt the package

The package we just obtained cannot be decompiled yet, we must go throughDecryption softwareModification is required to decompile

1687580670_64966ffee8dca3aeef5e4.png!small?1687580671144

This article demonstrates the process of decompiling a main package and a分包, first modify the main package through the decryption tool

1687580684_6496700c8cf9e915e18c9.png!small?1687580684729

The decrypted main package automatically comes to the wxpack package, the same steps are used to decrypt a分包, the following image is the decrypted one I have done

1687580702_6496701e8be4e5e79bc89.png!small?1687580702627

3. Decompilation

Enter the同级目录 wxpack的同级目录 wxappUnpacker-master, type cmd in the path bar to automatically open the command window of the current directory

1687580732_6496703c8128fa492bd55.png!small?1687580732647

First decompile the main package, and put the decompiled folder intowxpackIn the same directory level

node wuWxapkg.js ..\wxpack\wx464f1fef86a25927.wxapkg
  • -sIndicates the分包

  • The first one..\Indicates the output location

  • ..\wxpack\_pages_app.wxapkgThe分包 location that needs to be decompiled

1687580745_64967049bd0a7c137ccea.png!small?1687580745933

Then import the folder we obtained into the developer tool or notepad++ to view the code, here we import the developer tool

1687580922_649670fad266664c4637a.jpg!small?1687580923535

2. Find related js vulnerabilities

The global search decryption finally locates the code block in request.js by checking the code

1687580962_64967122b6217d230b608.png!small?1687580963277

Enter the folder of request.js

1687581011_6496715322d9f56e1cb0b.png!small?1687581011248

3. Modular loading

Browserify should be installed in advance

3.1. Browserify

Browserify allows you to organize browser-side Javascript code in a way similar to node's require(). By precompiling, it allows front-end Javascript to directly use some libraries installed by Node NPM.

3.2. Installation

Admins open cmd (normal users may fail to install)

npm install -g browserify

3.3. Package the js file

browserify request.js > myboundle.js

1687581063_64967187604f86e709680.png!small?1687581063440

3.4. Modify the js code

var data="WVMNBlsFBgQKWVEPBVgABAFXUFEKVlAGBlRWXVdeWlxRAQcBWQRQUA0GUgcGWwcMAFsBVARRDVkMU1kCBgALWFlfAltQCQIDDFheBV9RB1dXUAMPB1gBAwYHXlZdUA0LVgEDCVlcAF4KCFYAX1ALB1oDBQcAUVQNV1AHUwAAXANYAgwHCABTCVELWg8LAVAFUFAPV19TCQoLWFVdVwpRBAMLDVJYUFFQCQRQXQNbWggDBlADX1UIVg1TBlcKX1AIAg0CUQMFWFcKBlwLUVEHDlBaVF0HCFQDDlULUV0ABQUCXQUNVwg="
var t = JSON.parse(u.decryptSM4(data, u.createGenkey("202300")));

console.log(t)

Place the above code in the code block we located

1687581076_64967194bb6230fda1517.png!small?1687581077051

Place it in a suitable position below, note that it should not be inserted into other functions, otherwise it will not start when accessing the page

1687581085_6496719dcbe411da36fa0.png!small?1687581086133

3.5. Write an html file and import the js file

1687581094_649671a661019c018c3a2.png!small?1687581094498

3.6. Access the page and view the console

1687581173_649671f510ca879ddac3b.jpg!small?1687581173389

4. Summary

In general, when encountering data leaks or other encrypted data that requires decryption, and when there is no time to view the code and reverse engineer it, this method can be used, which can save a lot of time and is almost an essential skill for laziness. This method is actually similar to integrating the entire js document into a single file, which avoids confusion. Even after the code is obfuscated, this method can still be referred to, because after integrating all the code, even if it is obfuscated, it is still recorded in the same file, so it can be successfully decrypted.


你可能想看:

It is possible to perform credible verification on the system boot program, system program, important configuration parameters, and application programs of computing devices based on a credible root,

Article 2 of the Cryptography Law clearly defines the term 'cryptography', which does not include commonly known terms such as 'bank card password', 'login password', as well as facial recognition, fi

Announcement regarding the addition of 7 units as technical support units for the Ministry of Industry and Information Technology's mobile Internet APP product security vulnerability database

b) It should have a login failure handling function, and should configure and enable measures such as ending the session, limiting the number of illegal login attempts, and automatically logging out w

As announced today, Glupteba is a multi-component botnet targeting Windows computers. Google has taken action to disrupt the operation of Glupteba, and we believe this action will have a significant i

2025 latest & emulator WeChat mini-program packet capture & mini-program reverse engineering

In today's rapidly developing digital economy, data has become an important engine driving social progress and enterprise development. From being initially regarded as part of intangible assets to now

Cloud Migration Security (Part Two): Understanding AWS Cloud Security Strategies from the Perspective of Buying and Decorating a House

Distributed Storage Technology (Part 2): Analysis of the architecture, principles, characteristics, and advantages and disadvantages of wide-column storage and full-text search engines

b) It should have the login failure handling function, and should configure and enable measures such as ending the session, limiting the number of illegal logins, and automatically exiting when the lo

最后修改时间:
admin
上一篇 2025年03月29日 17:18
下一篇 2025年03月29日 17:41

评论已关闭