开发者

Decoding an encrypted HTML file using Javascript

I am trying to decrypt the encrypted page source of an HTML file. I am serching for a decoding trick to decrypt a page containing facebook interface UI. It is in the following post decrypted facebook Ui page. 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. Go to JSFiddle. In the JavaScript area, type alert(, paste, and then type );. Press run.

The "encrypted" (not) source will be alerted. 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)? JS Beautifier is one good one.

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. In Chrome:

  1. Visit the page that has the script you are trying to view
  2. Press F12 to bring up the developer tools
  3. Go to the Scripts tab
  4. Choose the JavaScript file to view from the drop-down list in the top left
  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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜