javascript 如何解密一个javascript文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16416971/
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 decrypt a javascript file
提问by Flipsyde
I just discovered a virus in my computer that uses a .js file to attack. I opened the file in notepad to check out the code, but it is completely encrypted. I can see some data that makes sense (such as bhynivmao.length!=4
), but the majority of the file is filled with gibberish.
我刚刚在我的计算机中发现了一种使用 .js 文件进行攻击的病毒。我在记事本中打开文件查看代码,但它是完全加密的。我可以看到一些有意义的数据(例如bhynivmao.length!=4
),但文件的大部分内容都充满了胡言乱语。
There is also an autorun.inf and even though I can see some of the shell \open\command
, I am not able to figure out the rest of the gibberish that is present.
还有一个 autorun.inf,尽管我可以看到其中的一些,但shell \open\command
我无法弄清楚存在的其余胡言乱语。
Looks like both the autorun and the .js file are obfuscated the same way. Can someone please help me to get back the readable code? I am really curious to know how this thing works.
看起来 autorun 和 .js 文件都以相同的方式进行了混淆。有人可以帮我找回可读的代码吗?我真的很想知道这个东西是如何工作的。
回答by MMM
Try using something like a JS beautifier:
尝试使用类似 JS 美化器的东西:
It will still keep the old variable names, but will definitely make the code more readable.
它仍然会保留旧的变量名,但肯定会使代码更具可读性。
回答by Alexander Craggs
You might also consider using http://jsnice.org, which uses statistical analysis of code to identify variable names. It complements http://jsbeautifier.orgwell by altering variable names but not structure.
您也可以考虑使用http://jsnice.org,它使用代码的统计分析来识别变量名称。它通过改变变量名称而不是结构很好地补充了http://jsbeautifier.org。