This project, is designed to decode and simplify JavaScript files obfuscated by Datadome's new Interstitial challenge. The original script, typically obfuscated, can be transformed into a more readable and maintainable format.
The original script can be found as one line minimized code in the HTML file of the Interstitial challenge.
- Specifically targets the obfuscation patterns used in Datadome's Interstitial challenge.
- Efficiently decodes hexadecimal encoded strings within the JavaScript file.
- Transforms and simplifies initial function calls and variables for enhanced readability.
- Eliminates dead code, including unused functions and variables.
- Improves overall code clarity, making it easier to understand and maintain.
- Higly improved for the newest version of the challenge.
- Node.js
- Required Babel libraries:
@babel/parser
,@babel/traverse
,@babel/generator
,@babel/core
,@babel/types
Execute the deobfuscator using the following command:
node main.js <input> [output]
<input>
: Path to the input JavaScript file (obfuscated by Datadome's Interstitial challenge).[output]
: (Optional) Path for saving the deobfuscated code. Defaults toout.js
if not specified.
The project structure is as follows:
.
├── README.md
├── index.html
├── main.js
├── package-lock.json
├── package.json
└── transformers
├── cleanCode.js
├── cleanSwitchCases.js
└── evaluateStringObf.js
main.js
: The main script that orchestrates the deobfuscation process.transformers/
: Contains scripts for specific transformations.evaluateStringObf.js
: Handles the deobfuscation of the file.cleanSwitchCases.js
: Removes the usless switch cases obfuscation inside functions.cleanCode.js
: Improves the readability of the code post-deobfuscation.
A screenshot demonstrating the original obfuscated script and its deobfuscated version will be attached to visually highlight the effectiveness of this tool. (just a snippet of the code)
Contributions to enhance or extend the functionality of this tool are welcome. Please feel free to submit pull requests. For significant changes or suggestions, kindly open an issue to discuss your ideas.
This project is made available under the MIT License. For more information, refer to the LICENSE file.