Domain lock not working?
See original GitHub issueFirst of all: great tool, thanks for releasing it! I’d like to use the domain-locking feature, but can’t (yet) get it to work. I have a single (rather large) JS file, and I obfuscate it like so:
javascript-obfuscator/bin/javascript-obfuscator.js 'js/game.js' --output 'js/game.js' --compact true --selfDefending true --domainLock 'domaina.com,domainb.com'
Now, when I run the resulting JS file on domainc.com, it just works. I would expect the obfuscated JS file to generate an error or halt execution some other way. Am I missing something? Do I need to enable another cli-option to make domain locking work?
FYI: running on node v8.9.0
I just made another boiled down test. My test.js file contains 1 line of code:
alert(123);
Now I run:
/usr/local/scripts/node_modules/javascript-obfuscator/bin/javascript-obfuscator.js test.js --domainLock 'google.com'
The resulting test-obfuscated.js file contains this:
alert(0x7b);
There is no extra code to check whether the code runs on a valid domain.
If I paste this example code (alert(123);
) on https://javascriptobfuscator.herokuapp.com/ and enter the ‘google.com’ domain to lock to (uncheck all other options), the resulting code is much longer, as I’d expect it to be.
Either the cli-script doesn’t handle lock domains well, or I need to call the cli-script with more arguments. Hope someone can tell me. Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Thanks for the quick fix, works great now!
similarly to above answer, the expected behaviour would be to not allow running from the filesystem