13 ms·
According to this[1] post GitHub (or someone else in between) started changing the responses to alert("Malicious Script Detected")[2]. That's an awesome counter
by orf 12y ago
According to this[1] post GitHub (or someone else in between) started changing the responses to alert("Malicious Script Detected")[2]. That's an awesome counterattack - this stops the script from looping indefinitely and annoys the users.
1. http://insight-labs.org/?p=1682 http://insight-labs.org/?p=1682
2. https://github.com/greatfire/ https://github.com/greatfire/
- dengnan 12y agoFor github, this is a smart move. But, really, you can hardly negotiate with Chinese government. I'm pretty sure that they will deny this attack and re-emphasize their so-called Internet policy. If I were github, instead of a warning message, I would redirect the workload to some Chinese government's website and let them suffer what they've created. Let's face it, they are waging a war on the Internet first. Edit: Disclaimer: I know that my post is quite biased, especially this one. I'm not suggesting that people should wage a war to Chinese government. Please take my words just as a (biased?) sample from an ordinary Chinese citizen who is really tired of the government's censorship.
- j4sonstath 12y agoI think you are wrong here. Everyone is innocent until proven guilty! Also I don't think its hard to negotiate with the Chinese government unless you are an ambassador and had previous experience with them before? And any government would deny an attack under any circumstances... if not that leaves them exposed!
- hobs 12y agoCould you be more of a sock puppet in this discussion?
- pbuckley 12y agoThat's an insult to sock puppets everywhere.
- kardos 12y agoThe Chinese government is for sure a plausible culprit here, but consider that the American government (NSA, or another TLA) is also a plausible culprit. If this ends up successfully blamed on the Chinese, it builds support for "cyberwar" defence funding in the US.
- hobs 12y agokardos, that is fair. I do not know which government entity paid for this poster, just that as usual someone is trying to sway online opinion with their workforce.
- verroq 12y agoThe wu-mao is real.
- dagw 12y agoLet's face it, they are waging a war on the Internet first. The two most important aspects in war are casus belli and plausible deniability. China has the latter and github lacks the former. Thus github would lose by default in any 'war' against the Chinese government.
- tedunangst 12y agoHow would github redirect the load?
- ninjaoxygen 12y agohttp://en.wikipedia.org/wiki/HTTP_301 http://en.wikipedia.org/wiki/HTTP_301
- eli 12y agoI think you are underestimating the volume of traffic. Simple generating that many 301s would be an issue. And... where would you redirect to?
- kevinchen 12y agoGenerating a 301 is certainly less work than rendering the entire user's profile page.
- spartas 12y agoGenerating a 301 is likely more work. Profile pages are simple database hits, and they may be dynamically or even statically cached (for popular pages). You're probably severely underestimating how much traffic China can produce [1]. 1. http://furbo.org/2015/01/22/fear-china/ http://furbo.org/2015/01/22/fear-china/
- true_religion 12y agoA 301 avoids a database hit, and avoids having to go through the cache framework all together. It just says given this URL, we return an header that tells the browser to redirect. The only thing faster would be just dropping the connection as soon as its given to you.
- rookieljw 12y agoExcuse me, Why no 403 or 404?
- deleted 12y ago[deleted]
- NoCowLevel 12y agoVery interesting defense. It seems that it works because the attacking AJAX call is done with content dataType 'script'. I don't think it'll be too hard for the attacker to fix that.
- teknologist 12y agoIt's either that or call a jsonp endpoint, which could still throw up the alert. CORS protects standard AJAX from requesting anything outside the current domain.
- jfroma 12y agoWhy the attacker will run the content loaded as an script instead of just dumping what they get? Edit: I think is the dataType: "script" part. From jquery docs: > "script": Evaluates the response as JavaScript and returns it as plain text.
- mckoss 12y agoThe JavaScript used is very amateurish with many outmoded features, poorly optimized. I couldn't believe they were loading jquery, for example. This looks to be the work of a script kiddie rather then a superpower's cyber warriors.
- slang800 12y agoOr a script kiddie working for a superpower.
- zagnut8088 12y agoI agree - but it might just be deflection. The Chinese could use the same argument to assert they bore no responsibility. Besides - everybody has jquery cached. Why create an ajax from scratch and add to the weight of the crap they are injecting into the script? For quick and dirty I like it. Its not exactly long term or really destructive - but its kind of a cute and clever attack. Github's response to pop an alert was priceless. Sure it probably annoyed the hell out of millions of Chinese people - and their government will probably claim Github attacked them --- but the truth will out... maybe. Totalitarian regimes are shady as hell.
- dandelany 12y agoThey have no choice. If they used an AJAX call it could be blocked by (lack of) ACAO headers. The only way to hit a remote URL that cannot be blocked is by adding a <script href="//github..." /> tag to the URL, which means the client has no choice but to run the contents.
- IshKebab 12y agoWhat about an img tag?
- imaginenore 12y agoInstead of that "script detected" they should convert the whole page to something the Chinese government really hates, like Tiananmen Square massacre.
- minot 12y agoI hope they do. I hope they regret it happened. It should never have happened.
- amalantony06 12y agoAnd DDoS the end sites?
- JasuM 12y agoIf the message had some information about the Tiananmen Square massacre or some other censored information, the attack would probably stop. At least temporarily.
- afarrell 12y agoI wonder what percentage of Baidu users read English rather than just Chinese.
- kej 12y agoWikipedia suggests the English-reading Chinese population is in the hundreds of millions (much higher than the English-speaking Chinese population), and I would guess that group overlaps quite a bit with Baidu users.
- dheera 12y agoSo Baidu is using eval() instead of JSON.parse()? What kind of engineers did they hire?!
- talnet 12y agoEven I use JSON.parse() without knowing its benefit :3
- Havvy 12y agoJSON.parse takes a string of "JSON" and turns it into a JS object. It doesn't evaluate the string in a JS context at all, which is what eval() does. Some people have used eval() to do JSON parsing because JSON is a subset of JS, but if the user has any control into making malformed JSON, they could do so to create JS that can do anything the page can from the context of another user, otherwise known as Cross-Site-Scripting (XSS).
- deleted 12y ago[deleted]
- dandelany 12y agoThey're using neither. It's a cross-domain call so Github could block a regular AJAX GET by just not including ACAO headers. So they are using $.get with dataType 'script'. This is basically like JSONP without the callback - it adds a script tag with the remote URL to the page which means the client has no choice but to run the contents.
- jle 12y agoi feel like this alert should be in chinese for greatest effect