Found a WP site (not mine) with lovely obfuscated code injected into the footer so I've been trying to de-obfuscate it.
I ran it through unpacker, then converted hex to ASCII, then un-minified to bring back line breaks and wound up with something someone like me can actually kind of recognize as javascript:
var _0x1386=["$ = ~[];
$ = {
2: ++$,
$$$$: (![] + "")[$],
1 $: ++$,
$0$0: (![] + "")[$],
0 $0: ++$,
$0$$: ({} + "")[$],
$$0$: ($[$] + "")[$],
0 $$: ++$,
$$$0: (!"" + "")[$],
$1: ++$,
$0$: ++$,
$$1: ({} + "")[$],
$$0: ++$,
$$$: ++$,
$2: ++$,
$1$: ++$
};
Then followed some of the instructions of this dude who analyzed very similar javascript.
After doing so, this is where I'm at:
$ = -1;
$ = {
2: 0,
$$$$: "f",
1 $: 1,
$0$0: "a",
0 $0: 2,
$0$$: "j",
$$0$: "d",
0 $$: 3,
$$$0: "e",
$1: 4,
$0$: 5,
$$1: "t",
$$0: 6,
$$$: 7,
$2: 8,
$1$: 9
};
**I'm specifically stuck (I think) lines in the $ object that have an integer and then space in the property name. ** Also, the hex alphabet wouldn't include "j" or "t" if I'm not mistaken, so maybe I am evaluating those expressions incorrectly?
Grateful for any bones thrown my way. I know it's a rube question that shares some in common with existing questions about deobfuscation, but it's not a duplicate question - I'm just a guy trying to learn Javascript and coding a little better by way of this exercise.
Thanks in advance!