How to deobfuse javascript codes using "[] [filter] [constructor] ..."?

As we all know, obfuscated javascript with things like "wrapper" and "eval" can be easily decoded by a lot of tools provided on the internet, but lately I came across a chunk of javascript code that gets confused by things like []['filter']['constructor'].....

, which doesn't seem to have a decoding solution. An example is as follows:

[]["filter"]["constructor"]("r" + "e" + "t" + "u" + "r" + "n" + " " + "e" + "s" + "c" + "a" + 211["toString"]("!0!0!01")[+true] + "e")()("" ["italics"]()[0])[true + true] + "N" + "S" + "S" + "{" + "I" + []["filter"]["constructor"]("r" + "e" + "t" + "u" + "r" + "n" + " " + "u" + "n" + "e" + "s" + "c" + "a" + 211["toString"]("!0!0!01")[+true] + "e")()([]["filter"]["constructor"]("r" + "e" + "t" + "u" + "r" + "n" + " " + "e" + "s" + "c" + "a" + 211["toString"]("!0!0!01")[+true] + "e")()("" ["italics"]()[0])[0] +
    "5" + "f") + 101["toString"]("!0!01")[+true] + "a" + (+"false" + []["filter"]["constructor"]("r" + "e" + "t" + "u" + "r" + "n" + " " + []["filter"]["constructor"]("r" + "e" + "t" + "u" + "r" + "n" + " " + "e" + "s" + "c" + "a" + 211["toString"]("!0!0!01")[+true] + "e")()("" ["fontcolor"]()["!01"])[true + true] + "a" + "t" + "e")()())["!0!0!00"] + "e" + []["filter"]["constructor"]("r" + "e" + "t" + "u" + "r" + "n" + " " + "u" + "n" + "e" + "s" + "c" + "a" + 211["toString"]("!0!0!01")[+true] + "e")()([]["filter"]["constructor"]("r" +
    "e" + "t" + "u" + "r" + "n" + " " + "e" + "s" + "c" + "a" + 211["toString"]("!0!0!01")[+true] + "e")()("" ["italics"]()[0])[0] + "5" + "f") + []["filter"]["constructor"]("r" + "e" + "t" + "u" + "r" + "n" + " " + "u" + "n" + "e" + "s" + "c" + "a" + 211["toString"]("!0!0!01")[+true] + "e")()([]["filter"]["constructor"]("r" + "e" + "t" + "u" + "r" + "n" + " " + "e" + "s" + "c" + "a" + 211["toString"]("!0!0!01")[+true] + "e")()("" ["italics"]()[0])[0] + "59" + "") + "o" + "u" + []["filter"]["constructor"]("r" +
    "e" + "t" + "u" + "r" + "n" + " " + "u" + "n" + "e" + "s" + "c" + "a" + 211["toString"]("!0!0!01")[+true] + "e")()([]["filter"]["constructor"]("r" + "e" + "t" + "u" + "r" + "n" + " " + "e" + "s" + "c" + "a" + 211["toString"]("!0!0!01")[+true] + "e")()("" ["italics"]()[0])[0] + "7" + "d");

      

How do I decode javascript like this?

+3


source to share


1 answer


This is very similar to non-alphanumeric obfuscation, but in an intermediate form. Take a look here for an example.

The principle is the same: 1. It relies on an alternate form of code evaluation, which in your case is the filter constructor Array 2. Uses index notation (to convert object names to strings) 3. Split the strings into char strings, then convert each char in sequence no alphanumeric characters using type coercion.

Decoding is very easy, but it takes some hard work if you do it manually. I think it will take less than an hour to write the tool to automatically return it. This may seem like a good obfuscation at first, but it is not resilient and can be easily defeated.



No obfuscation is 100% bulletproof, but modern JS obfuscators like JScrambler go much deeper than basic coding techniques (be it eval or eval-less).

See this presentation for more details on non-alphanumeric obfuscation (slides 33-38). Check out the rest if you are interested in JavaScript obfuscation.

+5


source







All Articles