News for hackers. Stuff that matters.
Re:JSFuck (2012) by zemnmez on Saturday September 25, 2021 @10:37PM (#28657970)
makes me sad to hear that :( I will say, as a reverse engineer, that javascript minifiers like closure compiler will optimize almost all obfuscation out, and the rest you can usually translate to a form which it can understand and then it will do the rest.

The effect of obfuscation is not what you expect. It seems like it moves the whole difficulty up, but it only moves up the floor. By doing so it tends to remove all the signals that would warn non-experts of security issues. Remove the obfuscation and then you have all the catastrophic security issues that have accumulated in there like treasures in an egyptian king's tomb https://zemnmez.medium.com/how-to-hack-the-uk-tax-system-i-g...

Re:JSFuck (2012) by MrQuincle on Sunday September 26, 2021 @05:01AM (#28659430)
Makes me think of what might deter a reverse engineer and then this most awesome youtube talk on psychological warfare by Chris Domas

https://youtu.be/HlUe0TUHOIc

It's so good.

Re:JSFuck (2012) by slig on Saturday September 25, 2021 @11:13PM (#28658114)
I'm curious: can you can undo the obfuscation of JScrambler and Obfuscator.io easily? Some time ago I tried to run both through Closure Compiler, but it was way harder than I thought would be.
Re:JSFuck (2012) by zemnmez on Sunday September 26, 2021 @03:16AM (#28659034)
JScrambler I actually did de-obfuscate to bypass some very significant bot detection a few years ago, but it took a bit more doing -- it uses ES6 features IIRC so I had to transpile it down to ES5 via babel first, but it worked OK after that.

has a pretty good crack at obfuscator.io, too: https://closure-compiler.appspot.com/home#code%3D%252F%252F%...

That's the example from the site. "console.log('Hello world')" gets deobfuscated to "console[a(482)]("Hello World!");"

Re:JSFuck (2012) by stavros on Sunday September 26, 2021 @09:24AM (#28660690)
> That's the example from the site. "console.log('Hello world')" gets deobfuscated to "console[a(482)]("Hello World!");"

That does not look deobfuscated to me.

Re:JSFuck (2012) by ByteJockey on Sunday September 26, 2021 @11:16AM (#28661512)
Anyone familiar with JS is going to have some really good guesses at what a(482) is in this case.

And, even if you don't, you can always call a(482)

Re:JSFuck (2012) by stavros on Sunday September 26, 2021 @11:19AM (#28661535)
Yes, but "obfuscated" means "To make so confused or opaque as to be difficult to perceive or understand". That's obfuscated, not deobfuscated.
Re:JSFuck (2012) by AlexAndScripts on Monday September 27, 2021 @08:26AM (#28669788)
Is that difficult? Harder, but still quite easy.
Re:JSFuck (2012) by stavros on Monday September 27, 2021 @08:33AM (#28669862)
My point was that the GP seems to have mixed the words "obfuscate" and "deobfuscate".
Re:JSFuck (2012) by zemnmez on Monday September 27, 2021 @05:58PM (#28676544)
To clarify, that's what happens once you pass it through the obfuscation and THEN closure compiler. If you click the link you will see the obfuscation is much more complex
Re:JSFuck (2012) by stavros on Monday September 27, 2021 @05:59PM (#28676549)
Oh, then I misunderstood and everyone should ignore this whole thread :P
Re:JSFuck (2012) by createunderrate on Sunday September 26, 2021 @09:50AM (#28660882)
Obfuscation is like locking your front door. It won't stop anyone who is dedicated, but it might stop someone who isn't.
Re:JSFuck (2012) by woojoo666 on Sunday September 26, 2021 @05:56AM (#28659617)
While I think itcs bad to use obfuscation to hide security holes, I do think obfuscation has it's uses. If there's reasons to make data private, then there's reasons to make execution private as well. Not to mention, it was recently proved that indistinguishable obfuscation is possible, so I'm not sure how useful de-obfuscation tools will be in the future
Re:JSFuck (2012) by jstanley on Sunday September 26, 2021 @07:29AM (#28660013)
But you don't make data private by obfuscating it and then passing it to people you don't trust.

You make data private by not giving it to people you don't trust, or by encrypting it and not giving the key to people you don't trust.

Re:JSFuck (2012) by woojoo666 on Sunday September 26, 2021 @06:23PM (#28665208)
By "making data private" I meant encryption
Re:JSFuck (2012) by 0xFF0123 on Sunday September 26, 2021 @07:57AM (#28660160)
Really enjoyed that blog post, thanks for linking it! How long would you say actually finding those two issues took? The attack surface must've been fairly large, but I guess intuition helps.
Re:JSFuck (2012) by zemnmez on Monday September 27, 2021 @12:15AM (#28667030)
If I recall, the whole thing took about 6 hours
Re:JSFuck (2012) by raspasov on Sunday September 26, 2021 @01:13AM (#28658576)
Do you consider Google Closure sufficiently good obfuscation?
Re:JSFuck (2012) by zemnmez on Sunday September 26, 2021 @03:16AM (#28659035)
I think closure compiler's 'obfuscation' is an incidental part of its minification passes.
Re:JSFuck (2012) by raspasov on Sunday September 26, 2021 @05:50AM (#28659608)
Got it. Thank you.

I've been using the Google Closure compiler for many years with advanced and every time I look at the code output I'm like "there's no way in a 100 years I would be able to de-obfuscate back to my own code to a great extent". But I don't specialize in reverse engineering, so I might be missing something big.

Re:JSFuck (2012) by stjohnswarts on Sunday September 26, 2021 @08:26AM (#28660335)
Expecting obfuscation to increase security is a fool's errand. However expecting it to cut down on re-use of your code then it will no doubt work.
Re:JSFuck (2012) by zemnmez on Monday September 27, 2021 @12:15AM (#28667028)
personally, I find the code it outputs to be easier to understand often than the source because it simplifies a lot of stuff into the most abstract logic. I think it takes some getting used to for your brain to connect those pieces, though
Re:JSFuck (2012) by raspasov on Monday September 27, 2021 @06:42AM (#28669134)
Fair enough, thank you.

I guess ultra-shortening the names into a,b,c,d,e, etc makes it superficially hard to understand what's going on but I agree on your point about abstract logic.

Re:JSFuck (2012) by veb on Sunday September 26, 2021 @05:09AM (#28659466)
Thanks for the link to that blog post, really interesting!