Live data from Hacker News

JavaScript Obfuscation Techniques by Example

trickster.dev

51–60 of 75 posts

Re: JavaScript Obfuscation Techniques by Example

#51
post #12

Before someone asks why would you obfuscate, here's common use case: There's plenty of paid/proprietary Electron apps these days and they're not just websites, some of them do some heavy lifting under the hood and people want to protect that better than what Electron offers out of the box (read: nothing).

Isn’t that just the illusion of security?

Re: JavaScript Obfuscation Techniques by Example

#52

Earlier quoted context omitted.

I think what the parent meant was, can someone looking at it decode what is going on. Not asking whether it is possible in general.

That's why they wrote "Anyone dedicated enough can de-compile that javascript..." Meaning, effectively, it can be de-obfuscated into code with control flow that's readily understood by a human, even if it would take some patience and practice (and the right tools) to perform the de-obfuscation. Re: the FreeSlots.com program, https://deobfuscate.io shows that most of the obfuscation is related to decoding characters p…

As the other commenter said I think everyone understands it is feasible for someone here to accomplish de-obfuscating the code but the actual question was "Can anyone decode this and figure out the odds generator?". As in "can anyone take out the trash" like actually take the time to do the work of taking out the trash. Not as in explain that it is in fact possible for a dedicated person to tie up a bag, lift it out of the bin, take it outside, and put it in a dumpster. One of those quirks of speech.

I gave it a quick shot with some spare time, was selfishly hoping someone else had done the work when I checked back :p.

Re: JavaScript Obfuscation Techniques by Example

#53

Earlier quoted context omitted.

That's why they wrote "Anyone dedicated enough can de-compile that javascript..." Meaning, effectively, it can be de-obfuscated into code with control flow that's readily understood by a human, even if it would take some patience and practice (and the right tools) to perform the de-obfuscation. Re: the FreeSlots.com program, https://deobfuscate.io shows that most of the obfuscation is related to decoding characters p…

As the other commenter said I think everyone understands it is feasible for someone here to accomplish de-obfuscating the code but the actual question was "Can anyone decode this and figure out the odds generator?". As in "can anyone take out the trash" like actually take the time to do the work of taking out the trash. Not as in explain that it is in fact possible for a dedicated person to tie up a bag, lift it out…

If the economic incentive (or some other abstruse incentive) is great enough for a someone, then that someone will do it, if it's strictly possible and within the scope of their resources, i.e. because they stand to gain / be fulfilled / for the fun of it / experience fame and glory / etc.

Re: JavaScript Obfuscation Techniques by Example

#54

Earlier quoted context omitted.

As the other commenter said I think everyone understands it is feasible for someone here to accomplish de-obfuscating the code but the actual question was "Can anyone decode this and figure out the odds generator?". As in "can anyone take out the trash" like actually take the time to do the work of taking out the trash. Not as in explain that it is in fact possible for a dedicated person to tie up a bag, lift it out…

If the economic incentive (or some other abstruse incentive) is great enough for a someone, then that someone will do it, if it's strictly possible and within the scope of their resources, i.e. because they stand to gain / be fulfilled / for the fun of it / experience fame and glory / etc.

Perhaps the original ask is better explained as: a request for someone here do the actual deobfuscation.

Re: JavaScript Obfuscation Techniques by Example

#55

Earlier quoted context omitted.

If the economic incentive (or some other abstruse incentive) is great enough for a someone, then that someone will do it, if it's strictly possible and within the scope of their resources, i.e. because they stand to gain / be fulfilled / for the fun of it / experience fame and glory / etc.

Perhaps the original ask is better explained as: a request for someone here do the actual deobfuscation.

Nice way to put it. :-)

I don't feel so incentivized at present, sorry if I'm letting you down.

Re: JavaScript Obfuscation Techniques by Example

#56
OP is talking about protected legit JS but I see malware use similar techniques as well. The latest one I have seen has a legit JQuery code on top but eventually functions with english words as names that do weird string operations are seen intermixed with jquery. The script is meant to be run by the windows script host to download malware.

Re: JavaScript Obfuscation Techniques by Example

#57

Earlier quoted context omitted.

Business people demand it to protect intellectual property without realizing the ease of reversing it / wanting to say they're doing something to protect IP that their own superior will not realize doesn't help. It is making the best of an impossible situation, the paradox of sending your code to every single customer for them to run it while also wishing nobody could see it. The more aggressive they make patent law…

With how mediocre most developers today are, obfuscation is enough.

Too mediocre to type "deobsfucate" into Google? The first result is a deobsfucator.

https://deobfuscate.io/

Re: JavaScript Obfuscation Techniques by Example

#58
post #51
post #12

Before someone asks why would you obfuscate, here's common use case: There's plenty of paid/proprietary Electron apps these days and they're not just websites, some of them do some heavy lifting under the hood and people want to protect that better than what Electron offers out of the box (read: nothing).

Isn’t that just the illusion of security?

Not if it isn't used for security

Re: JavaScript Obfuscation Techniques by Example

#59
post #26

You want to see obfusication? Check out FreeSlots.com. Look at view source on one of the slot machines.[1] Can anyone decode this and figure out the odds generator? [1] view-source: https://www.freeslots.com/slot515.min.js?v=84

To answer your question, yes. Someone absolutely can decode that and figure out the odds. If they couldn't then there would be less obfuscation used. A browser ABSOLUTELY has to be able to run the javascript. Anyone dedicated enough can de-compile that javascript to a program. Is it easy? No, but people do it all the time. I have had to deal with client that thought they could keep some bit of code secret on a browse…

nothing special about code in a browser. there are regular reports from bug finders where they detail how they disassembled iOS or some native app etc and worked out how some exploit worked

Re: JavaScript Obfuscation Techniques by Example

#60
post #58
post #51

Earlier quoted context omitted.

Isn’t that just the illusion of security?

Not if it isn't used for security

Yep, no one uses obfuscation for security (I hope!) and given the Electron's modus operandi, copying your entire codebase is trivial... unless you make it not trivial.
Post reply on HN