How to decode a JSFuck script?

匿名 (未验证) 提交于 2019-12-03 01:49:02

问题:

I have this code in JavaScript:

[(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+ (![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+ (!![]+[])[+!+[]]] 

In the console, it will return

Array [ "filter" ] 

And how can I decode a lot of text that’s similar to the text above? E.g.:

[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+ (!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+ ([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+ (!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+ (!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+ (!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+ ([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+ (!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+ (![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+ (!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+ ([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+ (!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]] 

I want to see the plain script.

回答1:

I have seen many decoding attempts around, but none that work reliably. The easiest way I have found to decode Non Alphanumeric Javascript is with Chrome.

Open Chrome > Go to jsfuck.com > paste the code you would like to decode in the window > hit Run This.

Then open the Console, in the case of your specific code from PasteBin there will be an error:

Uncaught TypeError: Cannot read property 'innerHTML' of null   

To the right of the error, click the line number link, and the code will be revealed. The result is:

(function(){     window.false=document.getElementById('sc').innerHTML; }) 

Which explains why you get the error trying to just decode it using JSFuck itself. There is no element with the id sc on their site.



回答2:

You can use this website to decode jsfuck: http://codertab.com/jsunfuck

UPDATED I extracted the decode javascript from the URL above, this is how the decode process work: (javascript)

s = source.slice(0, source.length - 2); txtResult = eval(s);

Hope it help!



回答3:

    let elem = yourJSFuck function decode(elem) {     return (/\n(.+)/.exec(eval(elem.replace(/\s+/, "").slice(0, -2)))[1]); }  console.log(decode(elem)) 

This should work, the source is from this page



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!