Giter Site home page Giter Site logo

Comments (4)

0x1Avram avatar 0x1Avram commented on July 17, 2024

Hello,
obfuscator.io adds some checks so that if the code is tampered with it crashes. Here it crashes when adding the code corresponding to the string rotate function to the execution context. Did you beautify/format the code? If so, do you have the original version?

As a side node, if you use the latest (1.0.5) version, the stringarray specific code(stringarray.txt, stringarraywrappers.txt, stringarrayrotate.txt) are recognized automatically, there is no need to manually pass them as input.

from js-deobfuscator.

Arcovegle avatar Arcovegle commented on July 17, 2024

As a side node, if you use the latest (1.0.5) version, the stringarray specific code(stringarray.txt, stringarraywrappers.txt, stringarrayrotate.txt) are recognized automatically, there is no need to manually pass them as input.

I use the latest version to deobfuscate this, it still crashes:

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received null
    at Object.writeFileSync (node:fs:2163:5)
    at Object.writeTextFile (/snapshot/js-deobfuscator/useful.js)
    at main (/snapshot/js-deobfuscator/index.js)
    at Object.<anonymous> (/snapshot/js-deobfuscator/index.js)
    at Module._compile (pkg/prelude/bootstrap.js:1930:22)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.runMain (pkg/prelude/bootstrap.js:1983:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'ERR_INVALID_ARG_TYPE'
}

I beautified the original code and the original version is here:
https://pastebin.com/3zNAaPCt

from js-deobfuscator.

0x1Avram avatar 0x1Avram commented on July 17, 2024

There was a problem while simplifying some numeric expressions that were getting evaluated as NaN.
Fixed it and created a new release - 1.0.6 The deobfuscated version looks like some sort of CTF challenge.
Another thing to note is that the deobfuscation only works on the orginal file and not the beautified one because of the anti tampering code I mentioned in the comment above.
You can run it like this:
node index.js -i obfuscated.txt -o output.txt
Please check it and let me know if you encounter other issues.

from js-deobfuscator.

Arcovegle avatar Arcovegle commented on July 17, 2024

The deobfuscated version looks like some sort of CTF challenge.

Yep, it is a simple CTF challenge and I have solved it yesterday using other techniques. I just check the new release(1.0.6), it works well and successfully recover the js file's original semantics. Anyway, your work works :)

from js-deobfuscator.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.