Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simply crack JSFuck, is there a better encryption? #99

Open
xiaoer3301 opened this issue Jul 26, 2020 · 3 comments
Open

Simply crack JSFuck, is there a better encryption? #99

xiaoer3301 opened this issue Jul 26, 2020 · 3 comments
Labels

Comments

@xiaoer3301
Copy link

The developer tool can directly print out the source code, and execute the following code in the developer tool.
Decryption method:

let func = [][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+[+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]])
console.log(func)

Output code

ƒ anonymous(
) {
alert(1)
}
@subzey
Copy link
Contributor

subzey commented Jul 27, 2020

Maybe @aemkei proves me wrong, but as far as I know, jsfuck is not about XSS payloads and obfuscations.

It's about recreational programming, limits, and creativity: can you write arbitrary functional JavaScript code using only 6 characters? If yes, what's the shortest way to do it? Or could it be done with 5 charaters?

Though the golfed code is often looks almost unreadable, the obfuscation in sake of obfuscation is not a goal.

@kamil-kielczewski
Copy link
Contributor

kamil-kielczewski commented Jul 27, 2020

@subzey I think JSF is mainly to show that you can write executable cody using only 6 chars (which is actually not trivial and surprising). However here #70 was my old proposition of compression such code (because I think there is a lot of places where many kinds of size-optimisation can be introduced)

@aemkei
Copy link
Owner

aemkei commented Jul 30, 2020

You are right, JSFuck is "easy" to obfuscate, once you know the basic concepts. Removing the last () from the converted sources will not execute the code but return the inner function.

As @subzey said: The goal here is not to build an obfuscation library that can be used to attack websites, but to show how far we can go by reducing the language to an absolute minimum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants