简体   繁体   English

使用JavaScript解码加密的HTML文件

[英]Decoding an encrypted HTML file using Javascript

I am trying to decrypt the encrypted page source of an HTML file. 我正在尝试解密HTML文件的加密页面源。 I am serching for a decoding trick to decrypt a page containing facebook interface UI. 我正在寻找一种解码技巧来解密包含Facebook界面UI的页面。 It is in the following post decrypted facebook Ui page . 它在以下帖子解密的Facebook Ui页面中 The demo page of that post is encrypted. 该帖子的演示页面已加密。 Is there any posible way to decrypt it? 有什么可行的解密方法吗?

The code looks like this: 代码如下:

document.write(unescape("..."));

Copy the unescape("...") part. 复制unescape("...")部分。 Go to JSFiddle . 转到JSFiddle In the JavaScript area, type alert( , paste, and then type ); 在JavaScript区域中,输入alert( ,粘贴,然后键入); . Press run. 按运行。

The "encrypted" (not) source will be alert ed. “已加密”(未)源将被alert You can copy and paste that into your text editor of choice to start analyzing it. 您可以将其复制并粘贴到所选的文本编辑器中,以开始对其进行分析。

By the way, the decrypted code looks pretty bad. 顺便说一下,解密后的代码看起来很糟糕。 I wouldn't want to learn from that. 我不想从中学到东西。

You can't "decrypt" it back to the original source at this point. 您目前无法将其“解密”回原始源。 It is "obfuscated" to the point it's not really easy to read anymore. 它被“混淆”到不再真正容易阅读的地步。

You can deminify it to make it a little easier to read by using a JavaScript deminifer/deobfuscator as discussed in the SO question Is there such a thing as a javascript deminifier (deobfuscator)? 您可以使用SO的问题中所讨论的JavaScript deminifer / deobfuscator对其进行去元素化处理,以使其更易于阅读。 是否存在诸如javascript deminifier(deobfuscator)之类的东西? JS Beautifier is one good one. JS Beautifier是一个不错的选择。

You could also use a debugger like a browser plugin like Firebug (though it doesn't deobfuscate/deminify without plugins) or use the latest version of Google Chrome which provides one built-in. 您还可以使用调试器,例如Firebug之类的浏览器插件(尽管在没有插件的情况下它不会进行模糊处理/去杂化),也可以使用提供了内置功能的最新版Google Chrome。 In Chrome: 在Chrome中:

  1. Visit the page that has the script you are trying to view 访问包含您要查看的脚本的页面
  2. Press F12 to bring up the developer tools 按F12键调出开发人员工具
  3. Go to the Scripts tab 转到脚本选项卡
  4. Choose the JavaScript file to view from the drop-down list in the top left 从左上角的下拉列表中选择要查看的JavaScript文件
  5. Click the "brackets" icon in the bottom left to run the "Pretty print" tool which will make the script easier to read. 单击左下角的“括号”图标以运行“漂亮打印”工具,这将使脚本更易于阅读。

This still won't make it very easy to read since the author has obfuscated it pretty good. 由于作者对其进行了很好的模糊处理,因此它仍然很难读懂。 You're going to have to walk through it line by line and rebuild the script yourself if you want to go through all that trouble. 如果您想解决所有麻烦,则必须逐行浏览并自行重建脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM