Facebook如何禁用浏览器的集成开发人员工具? [英] How does Facebook disable the browser's integrated Developer Tools?

查看:180
本文介绍了Facebook如何禁用浏览器的集成开发人员工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显然,由于最近的骗局,开发人员工具被人们利用来发布垃圾邮件,甚至用来破解帐户。 Facebook已经阻止了开发者工具,我甚至无法使用控制台。





他们是怎么做到的? ;
这是为了防止特定的社会工程攻击



如果你最终进入测试组并对此感到恼火,抱歉。
我试图尽可能简单地制作旧的退出页面(现在帮助页面)虽然仍然很可怕至少阻止一些受害者。



实际代码非常类似于@joeldixon66的链接;我们的情况有点复杂,没有充分理由。



Chrome包装所有控制台代码

  with((console&& console._commandLineAPI)|| {}){
< code goes here>
}

...所以网站重新定义 console._commandLineAPI 抛出:

  Object.defineProperty(console,'_ commandLineAPI',
{get :function(){throw'Nooo!'}})

这是还不够(试试吧!),但那是
主要技巧。






结语:Chrome团队认为从用户端JS中击败控制台是一个错误并且解决了问题,导致此技术无效。之后,保护用户免受自我xss


So apparently because of the recent scams, the developer tools is exploited by people to post spam and even used to "hack" accounts. Facebook has blocked the developer tools, and I can't even use the console.

How did they do that?? One Stack Overflow post claimed that it is not possible, but Facebook has proven them wrong.

Just go to Facebook and open up the developer tools, type one character into the console, and this warning pops up. No matter what you put in, it will not get executed.

How is this possible?

They even blocked auto-complete in the console:

解决方案

I'm a security engineer at Facebook and this is my fault. We're testing this for some users to see if it can slow down some attacks where users are tricked into pasting (malicious) JavaScript code into the browser console.

Just to be clear: trying to block hackers client-side is a bad idea in general; this is to protect against a specific social engineering attack.

If you ended up in the test group and are annoyed by this, sorry. I tried to make the old opt-out page (now help page) as simple as possible while still being scary enough to stop at least some of the victims.

The actual code is pretty similar to @joeldixon66's link; ours is a little more complicated for no good reason.

Chrome wraps all console code in

with ((console && console._commandLineAPI) || {}) {
  <code goes here>
}

... so the site redefines console._commandLineAPI to throw:

Object.defineProperty(console, '_commandLineAPI',
   { get : function() { throw 'Nooo!' } })

This is not quite enough (try it!), but that's the main trick.


Epilogue: The Chrome team decided that defeating the console from user-side JS was a bug and fixed the issue, rendering this technique invalid. Afterwards, additional protection was added to protect users from self-xss.

这篇关于Facebook如何禁用浏览器的集成开发人员工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆