pdd-recruitment-anticontent-reverse
Want to obtain Pinduoduo social recruitment positions in batches and do technical research such as industry salary analysis and talent portrait construction? First pass the dynamic level in front of you - the core anti-crawling parameters under Ruisu Dynamic Security Protection:anti-content。
This article will use the real-life scenario of Pinduoduo’s social recruitment as an anchor to take you through the complete reverse process from environment detection to the core function Hook, and finally provide a reusablePython + Node.js(execjs)implementation plan.
Preparation: Be familiar with the basic operations of Chrome DevTools, understand the common methods of JavaScript reverse engineering, and know
execjsHow to call JavaScript code in Python.
1. Overview
1.1 Scenario and core parameters
The interface data of Pinduoduo social recruitment platform (<URL0>) must be carriedanti-contentto return normally. This parameter is dynamically generated by obfuscated JavaScript. Each refresh of the front-end code may produce subtle obfuscation changes, but the core encryption framework is stable.
1.2 The “hard nut” to be gnawed this time
Compared with static encryption (such as MD5+salt, AES), Ruisu's dynamic security protection product has several headaches:
- Dynamic confusion, static analysis is prone to missing dependencies: The extracted JS code is often "missing something" because it relies on the Webpack module or some global variables automatically injected by Ruisu. If it is not completed, an error will be reported directly.
- Strict environmental fingerprint detection: will be carefully checked
navigator.webdriver、window.chrome, browser plug-in list, etc., to determine whether you are using automated tools to fake the environment. - Anti-replay and link binding: The Cookie, Referer, and User-Agent carried in the request must be consistent, and a timestamp will be embedded in the parameters to prevent old requests from being reused.
- Dynamic Constructor Call: The encryption function is not static exposed at the top level
md5(), but generated by obfuscation similar towindow.hhh(4)Such a dynamic constructor.
2. Web page reverse analysis ideas
2.1 Locate the target interface
according toF12Open DevTools, switch to the Network panel, refresh the page or click the "Next Page" filter. Soon you will see the interface that returns the job list:
Click this request, view Payload, and you will findanti-contentThis is the core parameter we want to reverse this time.
2.2 Positioning parameter generation location
Ruishu parameters are generally not written directly in a static JS file, but are usually hidden in dynamically injected code. Two common positioning methods:
Method 1: Global search keywords
In the Sources panel of DevTools, pressCtrl+Shift+F(Windows) orCmd+Option+F(Mac) Open global search and enter one of the following keywords:
anti-contentantiContentgetAntihhh(You will find out later that this is the name of the core constructor)
Generally, you can quickly locate the place where the constructor is called.
Method 2: XHR/Fetch breakpoint
In the Network panel, right-click the target interface, select "XHR/fetch Breakpoints" to add breakpoints, and then refresh the page. When the request is sent, it will automatically break at the place where the code is sent - trace back along the call stack to find the generatedanti-contentfunction.
3. Simplified analysis of core encryption logic
Through debugging and Hook, we split the core logic into three steps:
3.1 Step 1: Complete the legal browser environment
Ruisu will detect a large number of environment variables before encryption. If these features are not completed, even if the generatedanti-contentIf the format is correct, the backend verification will fail. The following are key variables that must be filled in:
3.2 Step 2: Call the dynamic constructor
Ruisu will pass a piece of self-executing obfuscated code towindowInjection is similar tohhh's constructor. The name of this constructor may change, but the calling method and parameter meanings are fixed. such as numbers4It stands for "anti-content encryption of the job list interface".
3.3 Step 3: Serialized output
messagePack()The method will encode the encrypted binary data into a string similar to Base64 (not standard Base64, with a custom character mapping). This string is what we ultimately want.anti-content。
4. Reusable Python implementation solution
We can use Python'sexecjslibrary to execute the JavaScript files that complete the environment and generateanti-content, then userequestsSend a request.
4.1 Complete the JS file of the environment (demo.js)
⚠️ Note: The following code only gives the framework of environment completion. real
window.hhhYou need to completely extract and complete all the modules it depends on from Ruisu's obfuscated code. You cannot just copy and paste this framework.
4.2 Python calling code
5. Notes and Summary
5.1 Notes
- Control request frequency: Pinduoduo’s risk control will detect the frequency of requests. Too high a frequency can easily lead to IP or cookies being blocked.
- Cookie needs to be updated regularly: in Cookie
_nano_fp、api_uidThe field will expire and you need to get a new copy from the browser after expiration. - Ruishu code will be dynamically updated: Obfuscated variable names (such as
window.hhh) and the internal logic may change from time to time, so you have to debug and follow up regularly. - For technical learning purposes only: Batch scraping may violate Pinduoduo’s terms of service, so please be sure to use it legally and compliantly.
5.2 Review of core knowledge points
I hope this article can help you successfully pass the threshold of Ruisu dynamic protection. If you encounter problems during the reproduction process, please feel free to discuss them in the comment area.

