Live data from Hacker News

How does Facebook disable Developer Tools?

stackoverflow.com

41–50 of 90 posts

Re: How does Facebook disable Developer Tools?

#41
post #17

The accepted answer teases that this is not enough: Object.defineProperty(console, '_commandLineAPI', { get : function() { throw 'Nooo!' } }) But why isn't it enough?

Because it is possible to get around with just code: http://escape.alf.nu/20 (which I have done, under another username)

So how do you get around it? Or, I suppose more importantly, what else do you have to do to prevent people from getting around it?

Re: How does Facebook disable Developer Tools?

#42
post #3

I'm sort of surprised that the developer tools have only recently become an attack vector (via social engineering). I'm not sure what can even really be done about it without seriously inconveniencing developers. Maybe making them disabled by default with an extra option to enable them would be enough to deter all but the most gullible of users?

Why not a separate package altogether? That way the Chrome team can focus on Chrome, and the Developer Tools team can focus on producing a high-quality website debugger.

We can put bareers here forever that will deter more and more developers and curious yet-to-be hackers from playing with the web, while scammers will just use simple social tricks to make gullible people jump through any obstacle we put.

Here, to be honest, I vote for natural selection. Fight the scammers, and let the gullible be scammed until the society develops an immune response. It happens all the times, and I think that at least a part of the solution for Internet scam is to accelerate immune response development as much as possible.

Re: How does Facebook disable Developer Tools?

#43
post #32

This is a pretty good reason to never trust Chrome again.

I wouldn't trust any computer, then. It's the same as taking a bunch of code you have no idea how works, and paste it into CMD, then wondering why you just deleted C:/

Exactly, how many developers can honestly say they've never copy pasted commands into the terminal without being 100% sure what they were doing?

Re: How does Facebook disable Developer Tools?

#44
post #41

Earlier quoted context omitted.

Because it is possible to get around with just code: http://escape.alf.nu/20 (which I have done, under another username)

So how do you get around it? Or, I suppose more importantly, what else do you have to do to prevent people from getting around it?

It seems he's routing calls to print the code into console.log and eval-ing that string, which is quite interesting.

Re: How does Facebook disable Developer Tools?

#45
post #20

Earlier quoted context omitted.

So downloading a 100KB extension for a browser which you use for downloading stuff all the time is a "huge barrier"? Wow, talk about a 1st world problem. And "when I teach ruby", "well ok, now download xcode"... ok, Xcode is a 2.5GB download, but it is a one click download and install via App Store. And really? Xcode for Ruby? Are you really doing that?

Xcode is necessary because Apple distributes an operating system without a C compiler, and standard Ruby development requires a C compiler. Why Apple distributes an incomplete operating system by default, and why they distribute their development environment as one monolithic chunk as opposed to a set of packages, is anyone's guess.

OS X is an Open Brand UNIX 03 Registered Product since Leopard and given this it can be considered "complete." It isn't shipped with a compiler but your can install the cmdline tools (without all the XCode bundle) typing:

   xcode-select --install
on (Mavericks) Terminal.

Re: How does Facebook disable Developer Tools?

#46
post #44
post #41

Earlier quoted context omitted.

So how do you get around it? Or, I suppose more importantly, what else do you have to do to prevent people from getting around it?

It seems he's routing calls to print the code into console.log and eval-ing that string, which is quite interesting.

Eh? Who is "he"? What do you mean routing calls?

Re: How does Facebook disable Developer Tools?

#47
post #46
post #44

Earlier quoted context omitted.

It seems he's routing calls to print the code into console.log and eval-ing that string, which is quite interesting.

Eh? Who is "he"? What do you mean routing calls?

In the snippet posted by tshadwell. The code outputs a string into the console via console.log(), then executes the snippet from the console via eval(). Presumably to avoid to avoid Facebook's protections against console copy\paste execution.

Edit: I'm wrong. Need some sleep.

Re: How does Facebook disable Developer Tools?

#48

This is an analysis of the code that facebook is trying to prevent from being pasted into the console http://pastebin.com/0JXCVxXg

I thought it was obfuscated variable names, but it's a turkish word https://en.wiktionary.org/wiki/arkada%C5%9Flar (follower)

It means "friends". There are some functions named "get messages", "get friends", "get a random friend" and "post comment" too. Weird.

Re: How does Facebook disable Developer Tools?

#50
post #46

Earlier quoted context omitted.

Eh? Who is "he"? What do you mean routing calls?

In the snippet posted by tshadwell. The code outputs a string into the console via console.log(), then executes the snippet from the console via eval(). Presumably to avoid to avoid Facebook's protections against console copy\paste execution. Edit: I'm wrong. Need some sleep.

tshadwell did not post a code snippet he wrote. He posted a link to a site that demonstrates the sandbox that Facebook uses (I believe the Facebook engineer that wrote the Facebook implementation also owns escape.alf.nu). This code does not break out of the sandbox, it creates it.
Post reply on HN