500 Thousand MS Web Servers Hacked 332
andrewd18 writes "According to F-Secure, over 500,000 webservers across the world, including some from the United Nations and UK government, have been victims of a SQL injection. The attack uses an SQL injection to reroute clients to a malicious javascript at nmidahena.com, aspder.com or nihaorr1.com, which use another set of exploits to install a Trojan on the client's computer. As per usual, Firefox users with NoScript should be safe from the client exploit, but server admins should be alert for the server-side injection. Brian Krebs has a decent writeup on his Washington Post Security Blog, Dynamoo has a list of some of the high-profile sites that have been hacked, and for fun you can watch some of the IIS admins run around in circles at one of the many IIS forums on the 'net."
ob... (Score:4, Funny)
Re:ob... (Score:5, Interesting)
If I run Firefox on Linux without NoScript, is there a danger?
Re:ob... (Score:5, Insightful)
The above quote is from the article link which lists "important sites that have been compromised". I think the important thing is that any site running MSSQL could potentially be compromised in a way that would affect a reader of that site who (a) does not have an updated web browser, or (b) doesn't have script disabled.
In 2008... why is it really so easy to put a damned single or double quote into a SQL form and then make it possible to execute your malicious code on that server? Shouldn't disabling this be a fundamental security rule for databases?
Re:ob... (Score:5, Insightful)
It is fundamental. It's called secure input handling, or sanitizing input. Just because it's a rule doesn't mean it is followed.
Re:ob... (Score:5, Funny)
Re:ob... (Score:5, Informative)
http://xkcd.com/327/ [xkcd.com]
Re:ob... (Score:5, Funny)
Re: (Score:3, Informative)
Just because there are rules, doesn't mean people know about them. I frequent a flash forum where people often ask how to integrate flash with mysql via a php script. The vast majority of the code posted there is open to sql injection. This is not a matter of laziness, it is ignorance.
And this is perfectly understandable if you look at the tutorial sites out there. Take for example
Re: (Score:3, Insightful)
Besides, tutorials have no excuse anymore. In the PHP4 days it required extra code to be secure, but with PDO in PHP5, and bind variables, the easiest way to code things also happens to be the secure
Re: (Score:3, Insightful)
Re: (Score:2, Informative)
Re: (Score:2, Interesting)
Re:ob... (Score:4, Insightful)
"It Isn't Secure" is a tired old joke. But so is Microsoft!
Re: (Score:3, Funny)
Microsoft's technical team was taken by surprise, giving them fresh hope that they, too, can develop software which runs on Microsoft IIS server and Microsoft SQL Server.
Re:More data needed (Score:4, Informative)
Create Procedure GetUserTelePhone(@UserName varchar(50))
Begin
Declare @sql varchar(300)
Set @sql = 'SELECT TelePhone From Users where UserName=''' + @UserName + ''''
return exec(@sql)
END
See, there you go, completely open to sql injection, and it's a stored procedure. The problem isn't that people aren't using stored procedures, it's that people are creating queries which result from the concatenation of strings and variables, which invariably leaves them open to attack. A much better way to do things, is to use prepared queries, either in you stored procedures, or just using prepared queries directly in the code.
Bias? (Score:5, Informative)
The tone of the blurb is not only biased but also counter-productive to promoting open source (as this appears to be its intention): by trying to criticise closed technologies not by highlighting their actual deficiencies but instead by spreading FUD, the whole community is done a disservice.
Re:Bias? (Score:4, Interesting)
Re:Bias? (Score:5, Informative)
Also, which browsers are affected? It sounds like most of the exploits being used against the browsers have already been patched. Is there a new one there?
Re: (Score:2)
Re:Bias? (Score:5, Insightful)
Its such a rediculous flamebait, I don't know what to say.
Re: (Score:2, Troll)
That's pretty obvious.
How is the alledged fact that a LAMP stack would have been more vulnerable to this IIS directed attack relevant to this story? No claims of superiority for any server software in the blurb. Are you just trolling?
Re:Bias? (Score:5, Insightful)
It is NOT an IIS directed attack. At best, its a loose corelation statistic, and one thats pretty useless without comparing it to other references, such as other web servers.
Re:Bias? (Score:5, Funny)
Since we don't see the LAMP version spreading I think we can safely conclude that no web application written in PHP with a MySQL back-end is currently vulnerable to any type of SQL injection.
Re: (Score:3, Insightful)
I love the difference in tone between the two submissions, and especially the "haha this is all a big joke, relax" tone of the comments on the other one.
It's unfortunate that Slashdot is becoming one big FUD-spewing machine.
Re:Bias? (Score:5, Informative)
Re:Bias? (Score:5, Interesting)
If the attackers looked for servers that were advertising themselves as IIS, and/or attacked IIS vulnerabilities or bad administration practices, you'd have a point. But the fact that the servers were running IIS was little beyond a strong corelation.
Re:Bias? (Score:5, Informative)
Re: (Score:3, Interesting)
If you actually bother to read the thread, anyway, it's clear that the problem is indeed with applications that use queries like "SELECT * FROM Users WHERE Name
Looking at the IIS forum... (Score:4, Informative)
However, it is now abundantly clear that the attack is NOT ASP-specific, and just because one of the vectors it tries is based on ActiveX does NOT mean it doesn't try other methods. It only means that the people who spotted it early spotted it trying that method. Although it's unlikely to have an attack library for multiple OS', it would be surprising if it didn't have some alternative action for when ActiveX isn't available.
I'm concerned about the number of Government sites that have been shown to be vulnerable, especially (as has been commented by others on Slashdot) a Canadian site dealing with national security. This attack is unlikely to cause any particular lasting harm, but stop and think. These are the sorts of sites that actually need to be secure. Even if not directly connected to internal secure networks (and I'd be willing to bet that far more are than are supposed to be), they are high-profile and for that reason alone are likely to be much more at-risk than other sites.
Most smaller websites are just point-of-presence and information sites. It's an irritant if they vanish for a while, but it's unlikely to hurt anything. Nobody is going to die if a blog site isn't available for an hour or so, unless they're a serious addict. No small vendor is going to lose business if their PDF datasheets aren't reachable for a little while. Adult sites risk making a one or two percent loss of webcam income out of their steady stream of millions. I seriously doubt anyone from the United Methodist church will suddenly become Mormon or Catholic because their primary website was hit.
Not really (Score:4, Informative)
Re: (Score:2)
There are still plenty of examples of bad php out there; I'd hardly call it fixed when the problem has never really been a problem of the language, but instead a problem of lazy programmers.
Re: (Score:2)
Re: (Score:2)
Furthermore, note that these safeguards are only a basic defence and programmer awareness is still required to ensure SQL injection can't happen:
But, magic quotes is a generic solution that doesn't include all of the characters that require escaping, and the feature isn't always enabled (for reasons outlined in the first chapter). Ultimately, it's up to you to implement safeguards to protect against SQL injection.
Re:Not really (Score:5, Interesting)
As so has ASP.NET. I write (almost) all my database queries parametrized like this
SqlConnection conn = ... ...
SqlCommand cmd =
cmd.CommandText = "SELECT * FROM Foo WHERE Bar = @bar";
cmd.Parameters.AddWithValue("bar", barValue);
This way I'm pretty safe from SQL injection attacks. Add all the HTML encoding/decoding stuff to that and you can rest your nights peacefully.
Then enter the PHB. Now a days we stuff all the parameters straight to the DB procedure where they aren't sanitized at all. We build SQL query inside the stored proc by concatenating strings and call sp_execute to execute them. So all my earlier input validation and parameterized queries went down the drain. PHB's reasoning? - We trust our users.
Re: (Score:3, Insightful)
If you are under SarBox, remind them that this is an security audit issue.
This all can be done in a professional manner and not a 'get my stupid boss' manner.
IF you deal with any personal information, in your report you will make before the meeting, show the PR and legal nightmare that happens when data gets out.
Your boss should not be telling you how to program.
Re: (Score:2, Interesting)
Re: (Score:2)
Re: (Score:2)
When injecting in PHP/MySQL environment you are limited limited to what you can do inside the query provided by the server (or of course if some retard has put the whole query as an get/put you got free pickings.)
Re:Bias? (Score:4, Insightful)
If users of open source software want to protect our largely well-deserved right to be smug, we have to be no less vigilant against these attacks than the proprietary chumps. This particular attack may only have hit MS servers, but this category of attack in general is frighteningly equal-opportunity.
We can't take our superiority for granted; we have to earn it every day.
Re:Bias? (Score:5, Interesting)
This has nothing to do with IIS, SQL or ASP, coding against SQL injection is the responsibility of web designer. Also it should be noted that ASP was originally released way back when with NT4.0 in 1996(v1) , 2.0 in 1997 and 3.0 in 2000 http://en.wikipedia.org/wiki/Active_Server_Pages [wikipedia.org].
With the newer ASP.NET MS was kind enough to provide several layers of protection against attacks such as SQL injection with both server side and client side validation applied to controls when built in the designer (by default).
FUD is as FUD does (Score:2)
Re: (Score:2)
And ofcourse your safe using FF + NoScript, but then again your safe from anything, if people keep posting about how safe FF + noscript are, i might start talking about how secure lynx is, it would be much more useful to talk about browsers without NoScript.
Do all articles about adverts contain a disclaimer saying that people using adblock are unaf
Re: (Score:2)
NoScript is a pain.
Re: (Score:2)
Re: (Score:2)
Not right now - I think they're taking a month or so off after the last few months running around in circles, see eg. http://computerworld.co.nz/news.nsf/scrt/E902A2095FEC1A23CC2573D60072888C [computerworld.co.nz]
Re: (Score:3, Interesting)
The Trojan is hosted in China (Score:2, Informative)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re:The Trojan is hosted in China (Score:5, Funny)
And I'm sure you meant Turkey.(http://en.wikipedia.org/wiki/Troy [wikipedia.org]).
Re: (Score:2)
LOL (Score:3, Funny)
Lolicious.
I once spend an hour trying to explain IIS/MS SQL Server admin what PHP/MySQL addslashes()/mysql_escape_string() do - all to no avail. He was absolutely sure it is sufficient to like in VB surround any string with single quotes and it all will be fine.
Now seeing that it's real fun for guys, I can only laugh.
Re: (Score:2)
Re: (Score:3, Informative)
In any semi-advanced programming language or framework (including PHP, even more so since PHP5 as it doesn't require any extension or whatever), you just use prepared statements. Maybe that MS SQL Server admin was a bozo, but in VB, you'll almost always be using prepared statements (even in VB5-6, pre-.NET), or at worse, stored procedures, which act as prepared statements.
SQL
So this isn't an IIS attack at all. (Score:2)
Thus, if I'm running a web app that doesn't rely on IIS for anything more than presentation, and am not using SQL in my authentication (say something like Terminal Services or GraphOn), I should be fine.
Correct?
Re: (Score:2)
SQL Injection is by far the stupidest security vulnerability there is... Worse than buffer overflows, cross site scripting, etc... Because you have to go -out of your way- to make them possible. You have to make your code slower, take more time
Re: (Score:3, Informative)
In development, it often IS simpler to start with a single hardcoded SQL query (probably cut and paste from your DB tool, and then if your language supports + or . for string concat, it's easier to just do a "+variablename+" where the hardcoded value was -- plus, it keeps the flow of the SQL 'sentence' in correct order, rather than that kind of weird "sprintf()"ness you get when y
Re: (Score:2)
"select * from blah where stuff = " + var1 + " and lol = '" + var2 + "';";
It gets messy when you have strings, dates in special formats, xml literals, multiline queries... look at this around var2, the single quote followed by a double quote... messy messy. And depending on the language, you have to escape the quotes, etc. Crazy. How can you guys even read that? Nevermind debug it when it gets complicated.
Then when
Re:So this isn't an IIS attack at all. (Score:5, Informative)
Restrict the account that is used to access the database to the absolute minimum permissions it needs to run; using one set of credentials for insert/update/delete and another for selects is enough to foil a lot of exploits (I actually never allow deletes, just out of paranoia...I just update the record with an "inactive" flag, and purge them later with a local account).
For gods sake, don't allow a single account to access multiple databases, and even within the database make sure it only has access to the tables you're going to be using. I've seen more than a few MySQL injections that just dump the user table to the screen because some joker didn't think he needed to restrict access for "SELECT" statements.
Escape ALL data that comes from userland. This is your first line of defense, and it's where most people screw up. If you let an escape character past without it being escaped, your only protection is the privileges associated with the user account.
Abstract your data methods. If you just throw out random SQL queries all through your code, you're going to make a mistake somewhere. Make a single method that does your selects. Make a single method that does your inserts, etc. If it's only in ONE PLACE you can go over the code in extreme detail. If the queries are scattered through the code, you can't.
This is all just best practice stuff. The most important thing is to PAY ATTENTION and remember that one unsecured account can screw your entire server.
This site makes me sick (Score:5, Insightful)
ASP.net has lots of built-in features to prevent SQL injection attacks (like bind parameters) and the ASP.net DB documentation specifically warns about this type of attack.
Anyone still getting hit with this in 2008 needs to be whacked on the head.
Re:This site makes me sick (Score:5, Insightful)
Re: (Score:2)
Note, though, that PHP has a number of issues that make SQL injection more likely:
Re: (Score:3, Funny)
IIS bashing (Score:2, Insightful)
I've read a similar article on theregister.com: Web infection attacks more than 100,000 pages [theregister.co.uk]. There are also some interesting discussions over there.
This is a SQL injection, which is not specific to IIS. Any server-side program that fails to validate the input is subjected to this kind of exploit.
Re: (Score:2)
what does the trojan do? (Score:5, Insightful)
there seems to be a story 2 here: what the trojan will do in a few weeks to all of the IE users who visit these half a million sites
and, reading some of the links and finding that these trojan hosting domains are registered in china, there also seems to be a story 3: chinese hackers are pissed off
i got hacked shortly after the hainan island incident [wikipedia.org] in 2001. that is when the us spy satellite was bumped a chinese fighter, and was forced to land on hainan island (china). there was much chinese nationalist anger then, and it was taken out by hacking western sites with "f**k usa!" and the chinese flag replacing the main page
obviously, this hack is contemporaneous with the whole tibet riots/ olympic torch protests. that's the meat of this story, and that avenue seems unexplored as of yet. similar to the russian ddos of estonia due to the deprecation of a war statue in 2007 [slashdot.org]: the lesson is that, much like al qaeda and terrorism, cyber warfare is not so much a tool of any state government, but chest-thumping activity for ultranationalists and religious bigots and other organizations of cultural or national or religious chauvinism. the theme of the 21st century seems to be shaping up as partisan tribalism and extreme ideology reaching beyond the notions of sovereignty, statehood to go to war with each other in a novel ways
Impressive fighter plane they have there (Score:3, Funny)
Is that the fighter plane with warp drive and photon torpedos?
Sorry to pick on ya dude... it was a US spy plane, not a spy satellite
doh! (Score:2)
Re: (Score:3, Insightful)
obviously, this hack is contemporaneous with the whole tibet riots/ olympic torch protests. that's the meat of this story, and that avenue seems unexplored as of yet. similar to the russian ddos of estonia due to the deprecation of a war statue in 2007 [slashdot.org]:
Please don't spread this unsubstantiated rumour. The only one who ever was found guilty of the dos attacks was an Estonian Russian script kiddie. The other allegations about Russia launching a cyber attack on Estonia were just that, allegations with no evidence what so ever.
Re:what does the trojan do? (Score:5, Insightful)
The "Russian DDoS attacks of Estonia" were done by a few Estonian kids mad about some statues being moved around.
http://www.theregister.co.uk/2008/01/24/estonian_ddos_fine/ [theregister.co.uk]
There was no cyberwar, the Russian government had nothing to do with it, and every media source that mentioned it really needs to update their articles because the misinformation is causing far more harm than good.
500,000? Where'd that number come from? (Score:5, Informative)
Re: (Score:3, Insightful)
Any meaning to the site names? (Score:4, Interesting)
(Other meanings are possible as well, due to the large number of homophones in the language, but this is by far the most obvious meaning.)
Re: (Score:2)
host aspder.com
aspder.com has address 60.172.219.4
jwhois 60.172.219.4
person: Jinneng Wang
address: 17/F, Postal Building No.120 Changjiang
address: Middle Road, Hefei, Anhui, China
country: CN
phone: +86-551-2659073
fax-no: +86-551-2659287
e-mail: wang@mail.hf.ah.cninfo.net
nic-hdl: JW89-AP
SQL injection is not platform dependent (Score:2, Informative)
It's even on the UN's website (Score:2, Interesting)
" As per usual?" (Score:2)
Interesting to note Windows admin responses (Score:2)
This is definitely not how most unix admins would react. If a machine is compromised (via whatever source) then a simple data restore is never good enough, unix admins know. The original vector must be identified and stopped. It's quite the cont
True story... (Score:2)
To his credit, the site actually worked and seemed fine, until you had a peek at the PHP code, which was truly horrific. I could overlook the nonsensical us
Re: (Score:2)
New AVG 8 free edition, the linkchecker catches it (Score:2)
Interestingly (and I've been looking at this attack all day) it seems to overwrite itself in the middle.
Andy
Re:epic lol (Score:5, Informative)
Re:epic lol (Score:5, Insightful)
Sure, he should know about SQL injection stuff - but even if he did, would he be able to fix it?
Re: (Score:2)
Anyone can make a mistake; forget to taint a variable or something, but when you've obviously got an exploitable bug, you need to fix it, not just constantly rebuild the hacked database, probably losing data every time.
Re: (Score:3, Funny)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Re: (Score:3, Insightful)
When such misconceptions are so pervasive (even in -articles- on a geek web site like here!), obviously newbies are going to be confused all over the place.
Its a bit similar on how there's still so many SQL Server DBAs who thin
I weep for the future... (Score:2)
Blocking urls containing
Redirecting the user to google if they use the word "cast" or "set"? (but not "CaSt"?)
Why not wave dead chickens or throw salt at the server, it'll do just as good.
Re: (Score:2)
One quick and dirty idea I had for PHP was the following: Imagine a new string-like datatype, the query string. Syntactically, it works like a double-quoted string, but it's delimited by, let's say, [ and ]. Database query functions would only accept this new query-string type.
Concatenating a query str
Re: (Score:3, Informative)
Anyway, as it has already been noted, this problem has nothing specifically to do with the IIS servers.
Two other notes:
FOSS is good, I agree. But FOSS, by default, is not always better than closed source solutions. Making a blanket statement like that is being just as close minded as the opposite camp.
Using M$ to represent Microsoft is soooooooo 1990s.
Re: (Score:3, Insightful)
Re:Seems to be effecting older versions of IIS... (Score:4, Funny)
Re: (Score:2)
link link link link [uncyclopedia.org]
Re: (Score:2)
Second, IIS, since version 6, is amazingly secure, comparable with the likes of Apache. Its also the more straightforward platform to use as an ASP.NET server (obviously, unless you're into Mono), or to use along with a lot of fairly interesting technologies, such as TFS, Reporting Services, Sharepoints, etc.
On top of th
Re: (Score:2)
Canadian map of the world, eh? [wikia.com]
If I linked to the Uncyclopedia entry on the UK I'd be modded down. If I linked to the uncyclopedia entry on the US I'd be shot. If I linked to the uncyclopedia entry on Australia I'd be drunk.
The dangers of Apache and PHP (Score:3, Insightful)
Add a healthy dose of misrepresentation, twisting of facts and oh-so-funny exaggeration (the IIS admins are running around in circles, LOLZORZ) and people like you can feel better about yourselves, at least for a few hours.
In the meantime, it's been 5+ years and no one has found an exploitable vulnerability in IIS.
I'm sure FOSS is better off this morning, thanks to kdawson, Slashdot and this type of misguided "advocacy". Might as well have twitter control the content of the front page.