本文介绍了如何最小化,丑化,简单化和清楚地使视图源最明显地降低黑客的可读性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的查看源代码如下:

虽然它就像一本打开的书,但是黑客只需喝杯咖啡就可以很舒服地阅读它,并理解他需要的一切并玩弄它.

While its like an open book - an hacker can just read it with a glass of coffee, very comfort and understand everything he needs and play with it.

尽管Facebook受限制,但源代码却使人大吃一惊!为了了解一些东西.这样可以减少90%的浏览器注入.

While Facebook, in constrain, source code makes the hacket SWAT! in order to understand something. Which reduce 90% of browser injections.

请参见下面的FB视图源图像:

See the image below of FB view source:

他们是如何做到的?就像龙卷风!

How did they do this?It's like a tornado!

推荐答案

要降低代码的可读性,可以:

To reduce the readability of the code, one can:

  • 删除所有空格
  • 将所有变量和方法名称重命名为任意的单字母标识符
  • (高级)编码字符串
  • (甚至更高级)对整个方法进行编码

facebook上的功能不是确实非常先进,google仍然丑陋得多.请注意,尽管这两种方法都不能阻止任何恶意用户尝试入侵您的网站.混淆(这就是这些概念的名称)在技术上不会提高安全性.您必须确保您的后端在收到通常无法使用HTML进行的请求时不会受到攻击.

What facebook does there is not really advanced, google is much uglier still.Be aware though that neither of this will prevent any malicious user to try to hack your site. Obfuscation (that's what these concepts are named) does not technically improve security. You have to ensure your backend is not vulnerable when it gets requests that would not normally be possible using your HTML.

这篇关于如何最小化,丑化,简单化和清楚地使视图源最明显地降低黑客的可读性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 05:53