Skip to content

A streamlined tool for decoding and simplifying JavaScript obfuscated by Datadome's Interstitial challenge, enhancing readability and maintainability of the code.

License

Notifications You must be signed in to change notification settings

glizzykingdreko/Datadome-Interstitial-Deobfuscator

Repository files navigation

Datadome Interstitial Deobfuscator

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.

Original script location The original script can be found as one line minimized code in the HTML file of the Interstitial challenge.

Table of Contents

Features

  • 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.

Prerequisites

  • Node.js
  • Required Babel libraries: @babel/parser, @babel/traverse, @babel/generator, @babel/core, @babel/types

Usage

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 to out.js if not specified.

Structure

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.

Before and After Comparison

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)

  • Original obfuscated script: (3399 lines) Original obfuscated script
  • Deobfuscated script: (1266 slines) Deobfuscated script

Contributing

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.

License

This project is made available under the MIT License. For more information, refer to the LICENSE file.

Contact

About

A streamlined tool for decoding and simplifying JavaScript obfuscated by Datadome's Interstitial challenge, enhancing readability and maintainability of the code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published