javascript 如何解码 JSFuck 脚本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31862135/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to decode a JSfwor script?
提问by Szymon Marczak
I have this code in JavaScript:
我在 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.
我想看纯脚本。
采纳答案by Madness
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.
我见过很多解码尝试,但没有一个能可靠地工作。我发现解码非字母数字 Javascript 的最简单方法是使用 Chrome。
Open Chrome > Go to jsfwor.com > paste the code you would like to decode in the window > hit Run This.
打开 Chrome > 转到 jsfwor.com > 在窗口中粘贴您想要解码的代码 > 点击 Run This。
Then open the Console, in the case of your specific code from PasteBinthere will be an error:
然后打开控制台,如果你的特定代码来自 PasteBin会有一个错误:
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 JSfwor itself. There is no element with the id sc
on their site.
这解释了为什么您尝试使用 JSfwor 本身对其进行解码时会出现错误。sc
他们的网站上没有带有 id 的元素。
回答by Tubekeeper
You can use this website to decode jsfwor: http://codertab.com/jsunfwor
你可以使用这个网站来解码jsfwor:http://codertab.com/jsunfwor
UPDATEDI extracted the decode javascript from the URL above, this is how the decode process work: (javascript)
更新我从上面的 URL 中提取了解码 javascript,这是解码过程的工作原理:(javascript)
s = source.slice(0, source.length - 2); txtResult = eval(s);
s = source.slice(0, source.length - 2); txtResult = eval(s);
Hope it help!
希望有帮助!