Encode/Decode JSFuck (0.5.0) obfuscated Javascript.
Helpful resources:
- https://jsfuck.com/ - test encoding (results may differ)
- https://enkhee-osiris.github.io/Decoder-JSFuck/ - test decoding
Use latest release binary or install the tool with:
go install github.com/karust/unjsfuck
unjsfuck encode ./test/test_plain.js
unjsfuck decode ./test/test_enc.js
go test . -v
go get github.com/karust/unjsfuck
yourEncodedJS := "..."
jsFuck := New()
jsFuck.Init()
fmt.Println(jsFuck.Decode(yourEncodedJS))
yourPlainJS := "alert(123);"
jsFuck := New()
jsFuck.Init()
encoded := jsFuck.Encode(yourEncodedJS)
// Wrap in eval and parent scope execution
wrapped := jsFuck.Wrap(true, true)
fmt.Println(wrapped)