Slashdot Mirror


500 Thousand MS Web Servers Hacked

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."

332 comments

  1. ob... by Anonymous Coward · · Score: 4, Funny

    Does it run on linux.

    1. Re:ob... by ArcherB · · Score: 5, Interesting

      Does it run on linux. That is actually a good question and the first thing I thought of. While I'm not worried about my little webserver being hacked as it runs on Linux without MySQL, I am worried about my browser.

      If I run Firefox on Linux without NoScript, is there a danger?

      --
      There is no "I disagree" mod for a reason. Flamebait, Troll, and Overrated are not substitutes.
    2. Re:ob... by sm62704 · · Score: 0, Troll

      No. IIS is a Microsoft server. I've heard that IIS stands for "It Isn't Secure".

      Does half a million compromised servers comprise a beowolf cluster? No again.

      I'd quote the uncyclopedai entry on Microsoft, but the Microsoft <strike>shills</strike> fanboys would mod me "troll".

      --
      mcgrew's razor: Never attribute to stupidity that which can be explained by greedy self-interest
    3. Re:ob... by plague3106 · · Score: 2, Interesting

      Except that Sql injections can happen on any web server with a poorly coded application. So you should be marked as troll, but your comments on IIS are just here to stir up MS fanboy. To be fair, it's been a long time since there was any huge number of exploits on IIS.

    4. Re:ob... by AlecLyons · · Score: 2, Informative

      SQL Injection? Yes.

    5. Re:ob... by RobBebop · · Score: 4, Insightful

      In other words, you can't rely on the site you are visiting to be safe.. so the onus is on the end user to make sure their PC is fully patched and as secure as possible.

      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?

      --
      Support the 30 Hour Work Week!!!
    6. Re:ob... by keithjr · · Score: 4, Insightful

      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?

      It is fundamental. It's called secure input handling, or sanitizing input. Just because it's a rule doesn't mean it is followed.

    7. Re:ob... by sm62704 · · Score: 3, Insightful

      True, but the summary could have mentioned it. As it is, it's a ripe subject for humor. Only some folks here defend their choice of operating systems like others defend their wifes and children. Anyone who would get angry because someone jokes about someone else's product has some serious issues.

      "It Isn't Secure" is a tired old joke. But so is Microsoft!

      --
      mcgrew's razor: Never attribute to stupidity that which can be explained by greedy self-interest
    8. Re:ob... by mixmatch · · Score: 1

      Except the fact that IIS must be deployed on Windows, which is ripe for the picking when it comes to vulnerabilities.

    9. Re:ob... by VeNoM0619 · · Score: 0

      The bigger question is: Why did we post the address of the exploit sites?

      Wouldn't it have been better just to say "nmid*.com" or link to a list somewhere else instead of advertising the address on a front page (for free too)?

      We can't assume everyone who visits slashdot knows not to type it in their browser, but curiosity can be overwhelming.

      --
      Disclaimer: I am not god.
      We may not be created equal
      But we can be treated equal.
    10. Re:ob... by thetoadwarrior · · Score: 1

      Actually one of our sites was effected and it does filter out quotes. So I suspect it comes down to how MS did something wrong yet again. Since we did not write the software that was affected that was one of the first things we checked.

    11. Re:ob... by steelclash84 · · Score: 5, Funny

      Did you really name your kid "Robert'); DROP TABLE Students; --"?

    12. Re:ob... by Gr8Apes · · Score: 1

      Except that Sql injections can happen on any web server with a poorly coded application. ... To be fair, it's been a long time since there was any huge number of exploits on IIS. It doesn't take a huge number, it only takes one.

      The RTF only references 1 exploit - 500K servers isn't a bad haul.
      --
      The cesspool just got a check and balance.
    13. Re:ob... by Anonymous Coward · · Score: 0

      The thing is, many vendors offer tools that make the creation of quick little database applications "easy". Think in terms of Oracle's Application Express, or SQL Server's built in support for reporting tools. These tools usually use master-detail relationships and interfaces where what the user types gets stuck right into the database, with no programmer activity necessary.

      Weak coders who graduated from six week vendor training sessions love these 4GL type tools because they don't have to do as much work, and they can go back to wondering about the difference between "enter" and "return" on their keyboards, and the location of the "any" key.

      Old, crusty programmers like me with actual computer science degrees HATE these tools. People who are afraid of parameterized SQL statements are pansy bedwetters who ought to be working in the mailroom!

      Now, GET OFF MY LAWN YOU DAMN KIDS! (shakes cane)

    14. Re:ob... by mcrbids · · Score: 1

      It is fundamental. It's called secure input handling, or sanitizing input. Just because it's a rule doesn't mean it is followed.

      Rules aren't fundamental - they are accessory.

      Why does the Database API in most scripting languages even ALLOW a SQL injection vuln? Yes, my tool of choice, PHP, still has this problem. I've worked around it by using a DB abstraction layer that uses prepared statements, all but eliminating the problem.

      Stupid that it's not "fundamental" in the native API. It's an easily solved problem.

      --
      I have no problem with your religion until you decide it's reason to deprive others of the truth.
    15. Re:ob... by plague3106 · · Score: 1

      The summary did mention it was via a Sql injection attack. I wasn't mad about the comment, but for the OP to say he wasn't trolling when he clearly was is pretty stupid.

    16. Re:ob... by mhall119 · · Score: 4, Informative

      Obligatory link:
      http://xkcd.com/327/

      --
      http://www.mhall119.com
    17. Re:ob... by plague3106 · · Score: 1

      Exploits as in number of machines comprimised. When was the last exploit IN IIS that lead to a huge number of servers being comprimised? I think it must be very early 2000s.

      As it is, this particular exploit has nothing to do with either IIS or whatever sql server is being run... it has to do with the particlar IIS web application installed. The exact same exploit exist in thousands of PHP applications as well, and just as PHP can't stop crappy PHP programmers, MS can't stop crappy asp / asp.net programmers.

    18. Re:ob... by hclewk · · Score: 5, Funny

      Oh, yes. Little Bobby Tables, we call him.

    19. Re:ob... by 0xABADC0DA · · Score: 1

      It is fundamental. It's called secure input handling, or sanitizing input. Actually no, it's the output that needs to be sanitized. It's just that it's often easier to sanitize the input since formatting output is often already a complicated mishmash anyway.

      Also if HTML did not have inline scripts, if they had to be defined before body and referred to by an ID, this would eliminate even the possibility of the vast majority of xss. The rendering could get messed up, or scripts run when they weren't supposed to be, but only arbitrary code if making substitutions in the actual scripts.
    20. Re:ob... by jsebrech · · Score: 2, Informative
      It is fundamental. It's called secure input handling, or sanitizing input. Just because it's a rule doesn't mean it is followed

      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 the number 3 result for a google search for "php mysql". It gives the following code, with a short mumble in the precursor about addslashes:

      $username = $_POST['username'];
      $password = $_POST['password'];
      $query = "INSERT INTO user (host, user, password, select_priv, insert_priv, update_ priv) VALUES ('localhost', '$username', PASSWORD('$password'), 'Y', 'Y', 'Y')";
      mysql_query($query);

      If the tutorial writers can't even be bothered to write secure code, how can people who learn from tutorials be expected to? I think the tutorial sites have an obligation to correct or remove any tutorials that have basic coding mistakes like these in them.

    21. Re:ob... by Firehed · · Score: 2, Insightful

      Interestingly, you can only do so much damage with PHP's handling of SQL statements. Namely, you can only run one statement per mysql_query() so while you could bypass a login with a ' OR 1=1 ' deal, Bobby Tables couldn't completely kill your DB. Doesn't stop code injection in the slightest which would be the easiest to prevent, but it's a start. Unfortunately it would be rather tricky to write software that knows when to escape characters and when I'm using variables in the statement safely which would break things if their contents were escaped.

      --
      How are sites slashdotted when nobody reads TFAs?
    22. Re:ob... by the_greywolf · · Score: 1

      It's more complex than that. I saw the code for the exploit yesterday. Apparently, it's injected as part of an otherwise normal request as a hexadecimal string. It's probably a similar vulnerability to the Oracle vulnerability a few stories up.

      I don't know how, exactly, it's injected, however.

      --
      grey wolf
      LET FORTRAN DIE!
    23. Re:ob... by Actually,+I+do+RTFA · · Score: 1

      If I run Firefox on Linux without NoScript, is there a danger?

      If I run IE on XP without Javascript and ActiveX enabled, is there a danger? Or use any other javascriptless browser? Can a simple article be written without the gratudious fellatio of the Firefox team (and even then it took a plugin to accomplish what you would think would be easy.)

      --
      Your ad here. Ask me how!
    24. Re:ob... by History's+Coming+To · · Score: 1

      The thing is, most people don't learn code that way. You learn to do each specific job, in this case connect to a DB and execute a MySQL command. If input sanatisation was covered here it would
      a) confuse the student and
      b) might be taken as "so I just need to do that here, right?

      Far better to treat it as its own lesson, and cover the multiple ways this kind of attack can be used to give a better overview, rather than one limited (if obvious) case.

      --
      Please consider this account deleted, I just can't be bothered with the spam anymore.
    25. Re:ob... by gbjbaanb · · Score: 1

      oops

      the reason its easy to put the quote into a webpage SQL form is because its easy to slap code into a webpage and have it execute. Turns out that letting programmers have "easy to use" languages that "allow them to be so much more productive" makes for insecure applications. Who'd have thought!

      The only good way to secure your sites is not to use a webserver at all. Well ok, you *have* to use one for your websites, but use as little of it as possble. Write all your code in a server-side application/service/daemon and run commands from the webserver to it via some RPC methods. Your webserver should be used for serving up browser pages only, possibly with some xml->html translation if you want your app to be decoupled from html completely.

      Well, ok that's not a panacea, but its sure as hell a good start. It also means you can forget all the crap like application domains and the other pretend security cruft MS built into IIS.

    26. Re:ob... by Anonymous Coward · · Score: 0

      To the GP, yes, a database should not by default parse multiple statements, one should BEGIN ... END the statement to do that, or the statement should be aborted.

      To the parent, another problem which is fundamental on the dev side, is with languages like ASP and PHP which have bad tutorials or no db API that supports binding parameters, which are more secure and more efficient for the parser.

      Indeed, why in the year 2008 are we still fucking up such simple stuff? Bad teachers maybe?

    27. Re:ob... by Anonymous Coward · · Score: 0

      Does it run on linux.


      If it's a way to compromise a server, it will run on Teh Lunix.

      Lunix... Got r00t?
    28. Re:ob... by CastrTroy · · Score: 1

      That's my favourite way to sanitize inputs. Don't even worry about what the inputs are and use PDO with prepared queries. Little Bobby Tables wouldn't cause any trouble. All the mysql_real_escape_string_i_mean_it_this_time is just completely unnecessary, and too open to forgetting to use it in every single place. Expecially in PHP, where variables can change type at any point, so you have to make sure your numeric inputs are sensitized as well. Since I brought up PDO, and mysql_* functions, I have to point out another gripe I have. Having different APIs depending on which database you are connecting to. I do most of my web programming in .Net, and so, I really can't understand why there is a need for mysql_* and pgsql_* function, and not just have one API, and pass different parameters depending on which DB you want to connect to. Which is yet another reason I love PDO so much.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    29. Re:ob... by Anonymous Coward · · Score: 0
      MS vs Linux is not a factor. I think you meant to ask if sql statement below, that was injected via a form on a website and passed un-sanitized to the database would be a valid cmd in mySQL; or does it contain MS T-SQL specific syntax.
       
       

      DECLARE @T varchar(255)'@C varchar(255) DECLARE Table_Cursor CURSOR FOR select a.name'b.name from sysobjects a'syscolumns b where a.id=b.id and a.xtype='u' and (b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167) OPEN Table_Cursor FETCH NEXT FROM Table_Cursor INTO @T'@C WHILE(@@FETCH_STATUS=0) BEGIN exec('update ['+@T+'] set ['+@C+']=rtrim(convert(varchar'['+@C+']))+''''')FETCH NEXT FROM Table_Cursor INTO @T'@C END CLOSE Table_Cursor DEALLOCATE Table_Cursor


      Considering the huge amount of dynamic sql used in PHP web sites i wonder if SQL injection attacks would be more prevalent on servers that host php regardless of database or web server platform those sites were running on.

      PS: I am assuming that /. will sanitize this post before sending to the db :)
    30. Re:ob... by cshark · · Score: 1

      We got hit with this one two weeks ago on one of our older windows applications. It had it's way three times over with our client's web server and really made us look stupid. In our defense though... the app was written back in 01 by an entirely different agency. The hacker behind this attack also installed a script on the server side to rerun the attack, when it detected the database had been repaired. He also found and disabled directory security on the admin section of the app, and attempted to reconfigure IIS. Will it run on Linux? This one won't because it depends on the EXEC function in SQL server. But if you write unecapsolated SQL code and leave your errors turned on, on *any* production web server... expect to be hacked. I don't think that's the fault of linux or apache so much as it is the fault of bad coders and methods that we knew were dangerous ten years ago.

      --

      This signature has Super Cow Powers

    31. Re:ob... by jsebrech · · Score: 2, Insightful

      Well, the reality is that people who copy/paste together scripts don't take the time to learn the complete tutorial, they just copy out the parts they need, and often don't even look at the rest. In practice, by shunting security off to a separate lesson, it becomes a lesson most of the hobby coders never learn.

      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 way. There are enough PHP5 web hosts out there that it makes sense to no longer support PHP4 other than for legacy systems.

    32. Re:ob... by rootpassbird · · Score: 1

      you and i might not, but that cracker out there, if he gets too frustrated in the beginning, ione can't guarantee what he'll insert....in the string, that is...

      --
      Hackers have long memories. It works both ways.
    33. Re:ob... by jonadab · · Score: 1

      > 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?

      The database can't tell if the application is sending the quote mark (or whatever) on purpose, or because someone has subverted it. The application needs to vette any SQL it is sending to the database, to make sure that it is what it intends to send.

      I don't know very much ASP, so I'm going to use a language I do know, Perl, as the example for my explanation. There are approximately four ways to handle doing database stuff in Perl. Three of these are fairly easy to make safe, but the way that seems easiest to new programmers who have never done database stuff before is inherently bug-prone and dangerous. (Note that "safe" in this context does not mean nothing can ever go wrong. It means that data containing special characters like quote marks and stuff do not cause breakage.)

      One of the safe ways is to use an abstraction layer library that is determined to be safe (probably because behind the scenes it uses parameter binding, discussed below). ORMs (Object Relational Mappers) are the predominant type of abstraction layer for this. Class::DBI is probably the most popular one in Perl circles, but there are others. (Note: I have not personally checked that Class::DBI is safe. Assuming that it _is_ safe, then code that uses it is also safe. If I were actively using it, I would of course actually check its safeness.)

      A related way is to sort of roll your own abstraction layer, and make sure that it is safe (probably by having it use parameter binding, discussed below). This is what I generally do. (I experimented with Class::DBI and found that my code was actually less maintainable, so I've gone back to a hand-rolled abstraction layer. The one I use is functional rather than object-oriented, but I think the real reason it makes my code more maintainable is because its capabilities are a better match for my typical usage scenarios.)

      The most fundamental way to be safe is to use binding parameters. This is the part where my explanation is going to get fairly Perl-specific.

      Assuming you are using DBI and that $db is your database handle, the first thing a database-newbie generally does is along these lines:
      my $query = $db->prepare("INSERT INTO MYTABLE VALUES ($valueA, $valueB, $valueC)"); # Unsafe!
      $query->execute(); # This is highly bug-prone. Don't ever do it this way.

      The reason that's unsafe is simple: because the values are interpolated directly into the string that you send to DBI (the basic database interface in Perl), DBI has no way tell whether special characters like quote marks are there on purpose because they are part of your code, or whether they got interpolated along with the rest of a variable that came from user input.

      But the safe way is to use binding parameters, which looks something like this:
      my $query = $db->prepare('INSERT INTO MYTABLE (FIELDA, FIELDB, FIELDC) VALUES (?, ?, ?)');
      $query->execute($valueA, $valueB, $valueC);

      Note that the values are *not* directly interpolated into the SQL. They are passed to the database interface library (DBI) separately and are treated as data only, not as SQL. If they contain characters that are special to SQL, those characters are still treated as data only. (In the case of the query above, for instance, if $valueA contains a single quote mark, then a value containing a single quote mark will be inserted into FIELDA in the new record you are inserting into MYTABLE.)

      I don't happen to know what mechanism ASP provides, but if it provides something similar to this and the programmers aren't using it, then what you've got is very sloppy programmers.

      It is also *possible*, of course, to handle this issue correctly even if the language and database interface you are using don't provide such a mechanism.

      --
      Cut that out, or I will ship you to Norilsk in a box.
    34. Re:ob... by Gr8Apes · · Score: 1

      What's interesting is that an MS exploit seems to propogate through 1/2 a million servers in a few days. When's the last time you heard of 1/2 million PHP servers compromised? Or java servers (there can't be too many of them around after all;)

      Or any other? Could it be that MS software is just fundamentally inferior?

      But seriously, it seems that whenever there's a windows exploit, all windows servers are vulnerable. That doesn't seem to be the case in *nix land. Only people running a specific set of configurations appear vulnerable.

      --
      The cesspool just got a check and balance.
    35. Re:ob... by astrotek · · Score: 1

      Start using a MVC pattern the API becomes something you write into your model once.

    36. Re:ob... by Keybounce · · Score: 1

      ...
      And this is perfectly understandable if you look at the tutorial sites out there. Take for example the number 3 result for a google search for "php mysql". It gives the following code, with a short mumble in the precursor about addslashes:


      $username = $_POST['username'];
      $password = $_POST['password'];
      $query = "INSERT INTO user (host, user, password, select_priv, insert_priv, update_ priv) VALUES ('localhost', '$username', PASSWORD('$password'), 'Y', 'Y', 'Y')";
      mysql_query($query);
      Alright, I know this will sound like something that was suggested before. But why do we -- in 2008 -- have languages where all sorts of context information is thrown away, everything is flattened into a plain string, and that string is all that matters?

      Why does "mysql_query()" take a flat text string, and not a printf style control string and a list of arguments? Suddenly, even if the arguments contain special control characters, NOTHING HAPPENS -- everything is tokenized separately, and has some context.

      Don't like varargs? Don't like non-parameterizable stuff? Ok, how about some standard routine that builds up a tagged string, (I'm thinking something like RTF or XML), so that your "Bobby Tables" name is clearly tagged as a strange looking name.

      Asking every program to do umpteen thousand validations on input is like asking every network program to do umpteen thousand validations on the output of "GetHostByName()" because your underlying DNS software is subject to cache pollution, or worse, "attacker.com has IP address 192.168.2.75, which just happens to be the address of our database server". Or umpteen thousand checks on "What files are you allowed to access?".

      We solved this in unix land with things like set-gid (so that special programs could update stuff for you that you could not update yourself), or access() (so that set-uid root programs could check what was a legal operation).

      Yet it seems that everywhere else, we still have the same idea: Rather than just have a single standard subroutine call, or even better, a sane way to define what a single term/token is, everyone has to write from scratch.

      Would that tutorial really have been hard to re-write as


      $username = $_POST['username'];
      $password = $_POST['password'];

      $username = safetoken($username);
      $password = safetoken($password);

      $query = "INSERT INTO user (host, user, password, select_priv, insert_priv, update_ priv) VALUES ('localhost', '$username', PASSWORD('$password'), 'Y', 'Y', 'Y')";
      mysql_query_with_safetokens($query);

      One call to turn an arbitrary string into something that is properly escaped.

      One new call to say "Hey, de-escape the string before you operate, but don't change your tokenizing boundaries because of the de-escaping".
    37. Re:ob... by plague3106 · · Score: 1

      Your picking and choosing what you hear. But go on and believe that there aren't a half a million LAMP configurations that are vunerable due to crappy PHP coding.

      Your post is nonsense.

    38. Re:ob... by diorcc · · Score: 1

      You can run Opera WITH scripts and you're safe ^^

    39. Re:ob... by Actually,+I+do+RTFA · · Score: 1

      You can run Opera WITH scripts

      I do run Opera, which is why I get all annoyed at the Firefox fanboys. No, bad browser evangelism.

      --
      Your ad here. Ask me how!
  2. Bias? by jmpeax · · Score: 5, Informative
    SQL injection is a result of poor data validation on the part of the web application - not, as the blurb implies, an indicator of an insecure web server. LAMP installations are also susceptible to SQL injection (PDF). From TFA:

    Unless [...] data is sanitized before it gets saved you can't control what the website will show to the users. This is what SQL injection is all about, exploiting weaknesses in these controls. As for the fact that Firefox + NoScript prevents the problems, that really isn't a surprise seeing as these specific exploits rely on executing a JScript. Any browser with scripting disabled would be immune.

    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.
    1. Re:Bias? by ischorr · · Score: 3, Interesting

      Also, is it 500,000 web *sites* identified so far, or 510,000 web *pages*?

    2. Re:Bias? by Shados · · Score: 5, Insightful

      I agree, and that was my first reaction: "Wtf does IIS have to do with SQL injection". If nothing else, a LAMP stack would be more susceptible, not because of the servers, but because PHP didn't have mainstream prepared statements as part of a default standard install in its earlier versions, and now that it DOES have it, a lot of script kiddies or peanut gallery programmers aren't using them, as opposed to Java/.NET/Whatever which, while still having some issues with the same group of newbie developers, are prepared-statement centric in their development paradigms and documentation, thus reducing the amount of possible SQL injection significantly, unless the apps are made in legacy environments too.

      Its such a rediculous flamebait, I don't know what to say.

    3. Re:Bias? by plague3106 · · Score: 0, Flamebait

      Well, this is /., home of OSS FUD.

    4. Re:Bias? by Mia'cova · · Score: 4, Informative

      The blurb completely misquotes the article. The article clearly states pages as reported by google. Plus, Google is hardly a live metric for the state of the internet. It really gives us a very poor estimate of how much impact this is having.

      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?

    5. Re:Bias? by jellomizer · · Score: 1, Interesting

      '); drop table users; --Yea this is a microsoft problem. That wouldn't be the cause of poor website development.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    6. Re:Bias? by Binestar · · Score: 1

      I believe it's 520,000 web *links*.

      --
      Do you Gentoo!?
    7. Re:Bias? by MrMr · · Score: 1, Troll

      I don't know what to say.
      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?

    8. Re:Bias? by Splab · · Score: 1

      Well lamp isn't as vulnerable as MS SQL is - not because of better security mind you, but due to lack of support for multi queries in PHP.

      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.)

    9. Re:Bias? by Anonymous Coward · · Score: 4, Insightful

      Agreed. I *hate* Microsoft and am as rabid a Free Software advocate as you will find, but code injection attacks are neither the fault of nor prevented by the OS or web server.

      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.

    10. Re:Bias? by Anonymous Coward · · Score: 0

      Yes, please everyone, run mod_security on your LAMP servers because Linux is just as vulnerable in theory. (Exploit is application layer.)

      Course, secure code would be good but it's often written by crack^H^H^H^H^H PHP monkeys and the admin is not given a veto.

    11. Re:Bias? by Splab · · Score: 1

      That will only work on languages supporting multiple statements. PHP/MySQL which is the most commonly used will just throw an error at you.

    12. Re:Bias? by Shados · · Score: 4, Insightful

      No, i'm not trolling. My point is that the story itself is trolling. This isn't an IIS directed attack, it is a "bad programming" directed attack. The -same- attack, exactly, would work -regardless- of the server. You don't even need to CHECK which server is running on the machine for this attack to work, since the server is IRRELEVENT, and I was trying to demonstrate that. Nothing more.

      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.

    13. Re:Bias? by toby360 · · Score: 4, Interesting

      I have to agree that this is highly Biased.
      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.

      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).

    14. Re:Bias? by Anonymous Coward · · Score: 0

      Amen to that.

      When I saw "MS Web servers hacked" and "by SQL Injection" I was like... "This guy must be retarded."

      Not to mention Apache's buffer overflow exploit which really did incur a root-kitted server box >_>

      If you're gonna criticise MS technology, do it because it actually is an MS flaw.

    15. Re:Bias? by willyhill · · Score: 2, Insightful
      This is not an IIS attack, it is an application attack. No more IIS specific than this one is Apache's fault, correct?

      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.

      --
      The twitter monologues. Click on my homepage and be amazed.
    16. Re:Bias? by Col.+Klink+(retired) · · Score: 4, Informative
      > "Wtf does IIS have to do with SQL injection". RTFA:

      the attackers looked for ASP or ASPX pages containing any type of querystring
      This specific attack, of which google has found over half a million affected pages, is targeted at IIS.
      --

      -- Don't Tase me, bro!

    17. Re:Bias? by Anonymous Coward · · Score: 0

      He's not trolling, you idiot. Just stating the fact that IIS is in no way related to SQL injection, bad programming is.

    18. Re:Bias? by Anonymous Coward · · Score: 1, Funny

      HA!, I'm immune from your puny attack. My users table is named Users_Obfuscated

    19. Re:Bias? by Shados · · Score: 4, Interesting

      Doesn't change that IIS doesn't have anything to do with it. If you take aside that both ASP and ASP.NET (more ASP though) aren't IIS specific by a long shot, the attack is targeting specific technologies, then targetting specific software development flaws within the boundaries of those technologies. If I'm running PERL/PHP on my server, it won't see it. If I'm running an ASP page on Apache, it will, and even if my server hasn't been patched for the last 5 years, I'm no more or less vulnerable to that attack.

      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.

    20. Re:Bias? by RiotingPacifist · · Score: 1

      This is a terrible title, IANAWebDeveloper, hell i dont even know how to code, but as soon as i read the summary it was clear that this had nothing to do with MS.

      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 unaffected?

      --
      IranAir Flight 655 never forget!
    21. Re:Bias? by Anonymous Coward · · Score: 0

      Yea means "yes" when voting and is pronounced like "yay".

      Maybe you meant "yeah"?

    22. Re:Bias? by ZenDragon · · Score: 1

      This why you dont run SQL queries on public facing sites, with accounts that have administrative rights. This is like web/database programming rule #1. A little common sense goes a long way.

    23. Re:Bias? by samantha · · Score: 1

      I though tha javascript was rather limited in what it could do on a client. But I guess all it needs for some types of SQL injection is the ability to rewrite URLs and html data pages which it pretty much has to have. Or is it more specific than that?

      NoScript is a pain.

    24. Re:Bias? by bishiraver · · Score: 1

      "Well, we've lost this year's student records. I hope you're happy."

    25. Re:Bias? by CodeBuster · · Score: 1

      Its such a rediculous flamebait, I don't know what to say. Controversy, real or imagined, is what promotes news and blogs which sell ads. They have a saying in the news business, "if it bleeds then it leads", which says a lot about what passes as "news" these days. By the time that people figure out that a story is exaggerated or factually incorrect the world has moved on to the next daily amusement and the journalists who are responsible are rarely if ever punished so why should they check their facts before going to press? If it is sensational then they will make money and even if they have jumped the gun there is no downside (at least for them).
    26. Re:Bias? by Facetious · · Score: 4, Informative

      The admins on the ground seem to disagree with you. From that page, "Our initial investigations are pointing at an attack through IIS using ASP in an overload."

      --
      Let us not become the evil that we deplore.
    27. Re:Bias? by Stellian · · Score: 5, Funny

      In fact, the attack enumerates all ASP variables and tries to force a SQL payload in them, that in turn if executed adds the link to the malicious script to every textfield in the database. A very simple vulnerability scanner, if you like, targeting only ASP applications - thus the ISS spin.
      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.

    28. Re:Bias? by CrazedWalrus · · Score: 1

      Except for the fact that the injected SQL looks to be Transact-SQL, so this particular attack would only affect sites backed by Sybase or MS SQL Server. Of the two, ASP backed by SQL Server would by far be the most common. Sybase doesn't back many web sites. In my experience, I've only seen it in finance, and usually only for internal processing.

      SQL injection, as you state, is a common problem, no matter the database backing.

    29. Re:Bias? by CrazedWalrus · · Score: 1

      The way I wrote this comment was a bit overreaching w.r.t. the scarcity of Sybase-backed web sites. Please read with an inferred "by comparison to ASP + SQL Server".

    30. Re:Bias? by TheSkyIsPurple · · Score: 1

      There is really an IIS component to it though... The MS article shows a privilege escalation on the server, so if the injected code is running in the context of a relatively safe "Network User" account, it can be escalated to "Local System", and your server is owned.

      SQL injection to run code to get a privilege escalation to run code locally to do whatever.

      My guess is servers that aren't publicly visible will be a bit safer, as they're at least not indexed by Google and thus not as easily discoverable. (Doesn't stop bot networks from scanning networks though)

    31. Re:Bias? by CrazedWalrus · · Score: 1

      As I stated in another comment above, it's not really IIS that matters in this specific case -- it's the database backing. The injected code is written in Transact-SQL -- an SQL dialect specific to Sybase and MS SQL Server.

      You're right -- the tone of the article is scoffing and trollish, but this particular attack is aimed specifically at Microsoft. I don't know if the T-SQL would work on Sybase or not, as the language features of T-SQL vary between the two databases.

      The code looks fairly simple, though, so I'd assume that it would run on Sybase. Anyone who backs their web sites with sybase should have a good hard look at their databases.

    32. Re:Bias? by Shados · · Score: 1

      Yeah, because SQL Server is always used behind IIS...? (Also, Transact-SQL and compatible syntaxes are used in many other RDBMS, such as PervasiveSQL... now if they used SQL Server specific features, thats very possible and even likely, but again: doesn't have anything to do with IIS).

    33. Re:Bias? by DMUTPeregrine · · Score: 1

      - thus the ISS spin.
      They added artificial gravity to the International Space Station?! Cool!
      --
      Not a sentence!
    34. Re:Bias? by Shados · · Score: 1

      Indeed. As I replied already however to another post, Transact-SQL is actually not just Sybase or MS SQL server specific, a couple of other (albeit more obscure) DBMS and compatibility layers that are semi-common allow for it too. Now, if it uses MS SQL specific features, such as the default system SPs, is something else.

      Also, this ends up being an applicative attack. This is no more an SQL Server hack than a buffer overflow attack is a C/C++ one, which was my secondary point. What was hacked was the particular web applications which had severe programming/design flaws in them. The attack isn't aimed at Microsoft: its aimed at stupid MS centric developers (and even that is debatable, reading more into it the attack had many more vectors than just the sql one). Microsoft's server design (or lack of, depending on which side you are) had nothing to do with the attack.

      Its a bit like if someone was going around using unsecured Linksys router based wifi to trade kiddy porn, and in the news you'd see "Linksys routers hacked!!!", or that there was a worm in the wild that would own Linux distros that don't have root passwords and you saw "Linux has been hacked!". Its simply not the server software that has been hacked, its the applications that ran on them.

    35. Re:Bias? by MrMr · · Score: 1

      From the FA: ...So essentially what happened was that the attackers looked for ASP or ASPX pages containing any type of querystring ...

      That is NOT IIS directed but it jut happens to only point to IIS servers.

      Also from the FA: ...So far we've only seen websites using Microsoft IIS webserver and Microsoft SQL Server being hit...

      So by your reasoning the loose correlation now appears to be 'incompetent programmers' and 'IIS+Microsft SQL server'.

    36. Re:Bias? by Shados · · Score: 1

      Definately. I'm mostly going against the tone of the article and the comments below it. Its just all an awfully worded mess. The article didn't mention any of that, just the SQL injection. _NOW_ its been updated, and at the bottom of the article you see something along the line of "There's nothing about this attack that has to do with the technology, just poorly written asp and asp.net apps", which makes the article far closer to reality. But originaly, it wasn't quite so.

    37. Re:Bias? by shutdown+-p+now · · Score: 1

      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
      If you don't see it, it doesn't mean it's not out there. It just means the attack was used for something less obvious than this exploit.
    38. Re:Bias? by CrazedWalrus · · Score: 1

      I didn't say "always", I said "most common", specifically in comparison to Sybase-backed ASP. Don't read into it more than what I said.

      Remember that, not only does the language need to parse and run on the database server, the system tables used need to be the same too. Does PervasiveSQL have sysobjects and syscolumns tables? If not, the injected code won't work. I've never used PervasiveSQL, so I don't know that.

      All I'm trying to say is that this particular attack is undoubtedly targeted at MS software, with Sybase possibly caught in the cross-fire, not that an extremely similar attack couldn't be done against Postgres, MySQL, or Oracle. Obviously they have the same vulnerability: bad application programmers. It's hard for the database makers to protect against stupid.

    39. Re:Bias? by Shados · · Score: 1

      I understand where you're coming from, and you are right. My point was mostly that the article says "MS Web Servers hacked". When really its "bad web applications with SQL Server as the backend hacked", which is quite a far cry from what the article talk about. If the summary said "MS Databases hacked!", while it would still be totally stupid, it would already be a lil closer...

    40. Re:Bias? by shutdown+-p+now · · Score: 2, Interesting
      The admins on the ground are so clueless it hurts to even read the posts. They actually think they can close the hole by searching for strings such as "EXEC", "SELECT" or "NVARCHAR" in all query parameters and rejecting the request if anything similar is found. The words "escaping" and "parametrized queries" are not found once in the whole thread.

      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 LIKE '" + Request("User") + "%'". As far as I'm concerned, anyone who writes code like that in 2008, when SQL injection is explained even in books like "PHP in 7 days for total idiots", deserves what they get, be it Perl/CGI, IIS+ASP, LAMP, or whatever else.

    41. Re:Bias? by CrazedWalrus · · Score: 1

      Point taken.

      Mod Article -1 Flamebait.

    42. Re:Bias? by billius · · Score: 1
      From the F-Secure site:

      We've been receiving some questions on the platform and operating systems affected by this attack. So far we've only seen websites using Microsoft IIS webserver and Microsoft SQL Server being hit. Do note that this attack doesn't use any vulnerabilities in any of those two applications. What makes this attack possible is poorly written ASP and ASPX (.net) code.
      From the sounds of that, I'm guessing that it is an MS only problem...unless F-Secure are being *very* dishonest and not pointing out that it somehow effects LAMP as well.
    43. Re:Bias? by Shados · · Score: 1

      +1 "Full of win" for you :)

      Whats sad however, is that I keep catching mainstream, "trusted" (I use the term loosely) sources for programing using string concatenation, be it in .NET, PHP, PERL, you name it. (Ruby and Java seems to be rarer, because of the prevalance of ORM, through things such as Hibernate and Rails, which, while available and extremely popular across the board, aren't as pervasive in the other ecosystems, mostly because of legacy mentalities).

      Pick up a PHP or ASP.NET book at random at the library. One chance out of two that the first database tutorials use string concats like in your example. Look at random blogs from star developers from both the MS dev and OSS community. Again, v ery likely you'll find these same examples. Its really a sad sad world.

    44. Re:Bias? by Shados · · Score: 1

      They are being pretty dishonest, but not quite in the way one would think. The attack is targeted at ASP and ASPX pages, because they look -for the extension-. That is, if I have a web site that uses poorly written PHP with URL remapping to have my PHP scripts show up as ".aspx", I'll get attacked (and owned!) too. The SQL being injected is mostly SQL Server specific, but it doesn't attack a SQL Server -flaw-, it just uses Transact SQL syntax.

      The actual flaw being exploited is SQL injection, which will be present in a LAMP too, if the code is written the same way (by using string concatenation from user inputs/cookies/query strings without validation/escaping/prepared statements). But in this particular case, the attack was targeting specifically ASP/ASP.NET pages (by looking at the extensions) with an SQL Server (or compatible) backend (by using Transact SQL).

      So the "exploit" WOULD work on a LAMP, or on any other database driven web site that poorly written. But the attackers didn't -try-. Thats the only thing that makes it "Microsoft-only": the attackers didn't try to attack other platforms. The exploit however, is purely technology independant, and is pervasive on LAMP web sites too.

    45. Re:Bias? by Shados · · Score: 1

      PHP/MySQL get hit all the time. Multi-query works just fine. Its multiple resultset that has to be treated differently (and thats true for ASP.NET/MS SQL too).

    46. Re:Bias? by Anonymous Coward · · Score: 0

      It also misquotes those people who reboot those servers....IIS Admins lol, is that what they're calling the help now a days.

    47. Re:Bias? by Ash+Vince · · Score: 1

      Interesting point about it being platform independent, but not strictly true.

      I admin a load of web and database servers. Most are Linux boxes but 2 are IIS servers. One of our partners sent us a link regarding this attack becuase it had just effected them and I was immediately tasked with assessing our exposure.

      Thankfully we use MySQL (v4.0) as an underlying database so our exposure was zero. We are unable to use prepared statements, but we also have no declare, no exec, and ODBC drivers that refuse to execute multiple statements in one (no semicolons). So we are completely immune to this attack.

      We were recently audited by a specialist security company who spent 3 weeks attacking our web based application looking for exploits. They found some, we fixed them. The money paid for them was worth every penny. Here is a blatant plug for their site: http://www.dns.co.uk/

      --
      I dont read /. to RTFA, I read /. to offend people in ignorance.
    48. Re:Bias? by Shados · · Score: 1

      MySQL 4 does have prepared statements (maybe you're thinking stored procedures?). The ODBC driver is a good point, but that becomes more of a configuration thing: if I use SQL Server through ODBC with multi statements at off, I'm not vulnerable either...in the same way as MySQL through native drivers will allow it. So its really not the platform. If you had a textbox where users can type a full sql query and executed it as is, you'd be vulnerable too (to variations of it anyway).

    49. Re:Bias? by segedunum · · Score: 1

      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 LIKE '" + Request("User") + "%'".
      Owww. However, to be fair to them ;-), it doesn't help when your database server of choice will actively execute multiple commands in SQL statements.
    50. Re:Bias? by the_greywolf · · Score: 1

      SQL injection is a result of poor data validation on the part of the web application - not, as the blurb implies, an indicator of an insecure web server. LAMP installations are also susceptible to SQL injection (PDF).

      I saw the injected string yesterday. It seems to be a database server vulnerability, and the code is injected as a hexadecimal string. (I wasn't told whether it was URL-encoded or what, so I'm not sure about the precise vector.)

      In any case, this particular vulnerability doesn't seem to be the fault of the web application, but rather the server software.

      --
      grey wolf
      LET FORTRAN DIE!
    51. Re:Bias? by radio4fan · · Score: 1

      because PHP didn't have mainstream prepared statements as part of a default standard install in its earlier versions, and now that it DOES have it, a lot of script kiddies or peanut gallery programmers aren't using them Indeed, but thankfully the PHP database drivers doesn't allow multiple statements to be passed in one query string: only the first statement is passed to the database.

      Attacks of the nature "1; DROP TABLE users" just won't work.

      So this particular attack wouldn't work on PHP.

      And whatever 'real programmers' might think about 'gpc_magic_quotes', it *does* protect virtually all the 'peanut gallery programmers' from SQL injection attacks.
    52. Re:Bias? by Kalriath · · Score: 1

      I'm sorry, does it offend you that someone could possibly make a webserver you don't need to hand hold? One could say the same about Apache as well, since you rarely ever need to actually do anything with it.

      You're an idiot.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    53. Re:Bias? by Kalriath · · Score: 1

      Where'd you get that bit about priviledge escalation? Because the vulnerability in IIS/ASP parsing linked has no such payload. The only thing it can do is "arbitrary code in the context of the Worker Process account" (which should never be Network Service anyway - bloody hell!)

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    54. Re:Bias? by Kalriath · · Score: 1

      Uh, all of them will. It's the connection driver that decides whether to allow it (ODBC can be configured to not allow multiple statements to MSSQL too! And Mysql only doesn't support it because the client lib doesn't!)

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    55. Re:Bias? by Shados · · Score: 1

      PHP does support multiple statements, and did all the way back in 2002 (probably before, but thats as far as my memory and references go). What it doesn't (and actually, thats limited to a few drivers such as MySQL and SQLite, even in the latest versions with PDO, as far as I can tell, though I do not use PHP anymore, so I'm going from a quick browse to know the current situation) support is multiple recordset.

      So if you have multiple queries, it will execute them all. You just won't be able to move the cursor to the next result set. That was true of even mysql_query 6 years ago. It will work. (And even without them, you can just do a UNION to execute certain limited types of less destructive queries, though I feel you know that, since you specifically said multi-statements attack wouldn't work).

      In any case: yes, multi statement attacks would work, but if you want to return data in an attack, you cannot do it in a second statement, you have to UNION it and hope the query is being returned in a grid-type fashion.

    56. Re:Bias? by Kalriath · · Score: 1

      Actually, MySQL supports multi-statement just fine. The CLIENT LIBRARY for it does not. Just like ODBC can be configured to forbid multi-statements for MSSQL.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    57. Re:Bias? by Kalriath · · Score: 1

      Do all articles about adverts contain a disclaimer saying that people using adblock are unaffected? Not when Slashdot's primary revenue source is advertising they don't.
      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    58. Re:Bias? by radio4fan · · Score: 1

      PHP does support multiple statements... In any case: yes, multi statement attacks would work Multiple statements are not supported, at least for the mysql driver:

      mysql_query() sends an unique query (multiple queries are not supported) See PHP documentation.

      Try setting up a database with two tables: multitest and multitest2. Put some rows in them.

      Now try this:

      $q = "select * from mutlitest; drop table multitest2";
      $result = mysql_query($q);

      You will see that multitest2 was not dropped.

    59. Re:Bias? by Shados · · Score: 1

      Ok, it definately used to work (but it was pointless except for sql injection) so I'm guessing they removed it later in PHP4's life (it however is possible with mysqli extension)

      It does work with PDO however, with the quirk that for mysql and sqlite (I think), you cannot move to the next rowset. That, I just tried.

    60. Re:Bias? by Shados · · Score: 1

      Oh, also to add to my reply: This was also limited to mysql_query (thus, mysql) when your original post stated "Database drivers", without refering to mysql specifically... Many other drivers are not as limited (so it was more of a mysql "feature" than PHP, and only of that PARTICULAR flavor, and only later in its PHP4 life). I'm sure mysql wasn't alone however, but it wasn't generalised.

    61. Re:Bias? by gbjbaanb · · Score: 1

      not so. If the attack targeted .php pages, you'd be safe. Partly because every PHP programmer is told to use 'gpg magic quotes', but also because the PHP mysql driver doesn't support multiple queries.

    62. Re:Bias? by whitehatlurker · · Score: 1

      Google now replies "about 7,120,000" when the same query is sent. Oh, and that would be URLs, as a single page may have more than one URL that addresses it. (I.e more than one path by which Google can reach it.)

      --
      .. paranoid crackpot leftover from the days of Amiga.
    63. Re:Bias? by TheSkyIsPurple · · Score: 1

      I was reading an article on another issue, and confused the two (as did the article I was reading.

      Yeah... that's right I broke tradition. I not only RTFA, but read a different one too =-/

    64. Re:Bias? by Shados · · Score: 1

      mysqli and PDO support multiple queries (the later having issue with multiple resultset, but can still execute em). As I've been shown earlier, only the basic mysql driver through mysql_query is lacking that support.

      Also, a lot of PHP devs will also use Postgres, which do support it, and keep in mind that magic quotes only help with special characters based injection, which (while being the majority of them) isn't the only way to use sql injection attacks.

    65. Re:Bias? by Anonymous Coward · · Score: 0

      And you are adding what to my statement?

      Notice how I said PHP/MySQL? And writing in caps just makes you look stupid.

    66. Re:Bias? by Splab · · Score: 1

      Does it now?

      What version of PHP are you using?

      And what is it with people and answering a statement totally out of context and thus proving a point towards themselves that wasn't even raised to begin with?

      Yes MySQL and PHP get hit all the time, but not by multiple statements in one query since its impossible to do in PHP with MySQL (just to be pedantic since people obvisously cant read between the lines)

    67. Re:Bias? by shutdown+-p+now · · Score: 1

      I didn't see it much in the books, to be honest, but I do occasionally see it on MSDN blogs, which is a real pity. Now that ADO.NET is moving towards (strongly-typed) LINQ with LINQ to SQL, and eventually to full-featured ORM with Entity Framework, as the default and proper way to work with databases, there will hopefully be no explicitly dynamically-generated SQL strings at all - and thus, no SQL injections.

    68. Re:Bias? by jonadab · · Score: 1

      Actually, this particular attack is targetted toward sites that make heavy use of ASP -- which is VERY strongly associated with IIS.

      That doesn't mean that SQL injection attacks in general are only ever a problem on ASP or IIS. They're not, of course. You can (absolutely SHOULD NOT EVER, but can) interpolate or concatenate user-supplied data directly into SQL, without validation or metacharacter escaping or parameter binding, in any language, on any platform, and you can target the payload SQL for any RDBMS, or with some care possibly even for multiple different ones.

      But this particular attack does specifically target sites implemented in ASP, and it makes use of TSQL for its payload.

      --
      Cut that out, or I will ship you to Norilsk in a box.
    69. Re:Bias? by ralphdaugherty · · Score: 1

      I though tha javascript was rather limited in what it could do on a client. But I guess all it needs for some types of SQL injection is the ability to rewrite URLs and html data pages which it pretty much has to have. Or is it more specific than that?

      The problem with a jumble of news links and comments is that no coherent explanation is ever given for what is going on. The javascript only takes effect later, and only affects the users PC, downloading malware to it from the mentioned sites.

      The first step is bad guys in China (because one, these are Chinese sites the javascript downloads malware from, and two, because the only thing coming across the net from China is bad) scanning Google search results for web pages ending in .asp or .aspx.

      They then retrieve the pages and fill in forms with an SQL statement containing javascript code as a string and submit the page. What do they do this with? Not javascript. Simple programming using HTTP commands. All of this is automated.

      This is where the bad programming of the people who programmed processing the web pages comes in. For those pages that don't thoroughly screen web form input for SQL commands (like "enter name, ok, here's my name plus an SQL command to insert javascript into fields in your database, how do you like them apples?" type form entry), then they will get javascript inserted into their database fields.

      Sounds too bizarre to be true? Everytime a programmer just sucks whatever is entered into a web page form field and strings it together to execute it as a command to update the database, they run the risk of the part that came from the web page containing an SQL command from someone evil that does other things to the database, in other words, SQL "injected" (or more easily envisioned, appended as a second or more additional SQL commands) to the original trivial SQL statement to take name and stick it in the name field in the database.

      So far javascript isn't involved. It's send down page to a program that has found it by searching Google for .asp or .aspx pages. Of course the web site doesn't know this. As far as it knows it's a person running a browser and interested in their site content.

      Then the program fills in the form fields with an SQL command and submits the page. At this point just good old web server programming in whatever language (MS type, given .asp) to process the page like it's someone that wants to register or whatever the page with form fields is. So still no javascript.

      But when the programming strings together with an SQL command the contents of the form field, and doesn't check that it doesn't have more SQL in it, the execution of the SQL which was intended only to insert or update a database field now does a whole lot more, whatever SQL the attacker put in that and all other form fields on the page. All it takes is one of them not to be checked properly.

      And what was that SQL put in? In this case, it's MS SQL specific SQL that retrieves database layouts, then inserts the attacker's javascript string (ahh! we now see javascript but it still isn't executing yet) into *every* database field in the entire database. Holy cow. Basically what we saw from the linked IIS admin's security blog posts was that only a portion of the database would contain the javascript because SQL is typically configured to time out after a certain amount of time, so it crammed as much as it could until the plug was pulled on it.

      So the javascript is in the database, in fields like name and city or whatever, but it still isn't executing and has no effect on the server whatsoever. The injected SQL, which is just SQL, not javascript, did all this because it wasn't checked for and stripped out of the web page form field.

      Then what happens? Any page whatsoever that retrieves any data from the database and displa

  3. The Trojan is hosted in China by Malevolent+Tester · · Score: 1, Informative

    Anyone surprised?

    --
    If you haven't made a developer cry, you've wasted a day.
    1. Re:The Trojan is hosted in China by Concerned+Onlooker · · Score: 1

      A little. I would have thought it would have been Greece.

      --
      http://www.rootstrikers.org/
    2. Re:The Trojan is hosted in China by SatanicPuppy · · Score: 1

      I'm sure you mean Persia.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    3. Re:The Trojan is hosted in China by FurtiveGlancer · · Score: 1
      Ancient Greece maybe, but now most likely Turkey.

      Close but no Gyro.

      --
      Invenio via vel creo
    4. Re:The Trojan is hosted in China by abigor · · Score: 1

      And I'm sure you meant Turkey.

    5. Re:The Trojan is hosted in China by Kong+the+Medium · · Score: 4, Funny

      I'm sure you mean Persia.

      And I'm sure you meant Turkey.(http://en.wikipedia.org/wiki/Troy).

      --
      ... whenever a text is transmitted, variation occurs. This is because human beings are careless, fallible, and occasiona
    6. Re:The Trojan is hosted in China by Concerned+Onlooker · · Score: 1

      Yes, but that wouldn't have made for such a good joke. Apparently this one didn't either.

      --
      http://www.rootstrikers.org/
    7. Re:The Trojan is hosted in China by FurtiveGlancer · · Score: 1
      You could always try the Friend Of Taiwan, ROC vs PRC approach, but I don't see that succeeding either.

      Better to say "Tough Crowd" and look for the next Score 5, Funny.

      --
      Invenio via vel creo
  4. LOL by ThePhilips · · Score: 2, 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.

    --
    All hope abandon ye who enter here.
    1. Re:LOL by sakdoctor · · Score: 1

      To which he replied: "Don't use mysql_escape_string(), it's a deprecated function. Use mysql_real_escape_string() instead."

    2. Re:LOL by Shados · · Score: 2, Informative

      I'd personally laugh at you. Escaping sql strings, what the hell? the 1980/90s called and they want their obsolete methodologies back.

      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 string escaping is inexistant in environments where prepared statements are first class citizens of the language/framework, because they're inferior methods of handling it. (and again: even in PHP its not what you're supposed to do).

    3. Re:LOL by Anonymous Coward · · Score: 0

      The mere existence of mysql_real_escape_string() proves that PHP is a horrible mess. What's next mysql_escape_string_for_real_this_time()?

    4. Re:LOL by Kalriath · · Score: 1

      You don't always have a MySQL connection at the time you escape the string, and mysql_real_escape_string requires one.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    5. Re:LOL by Anonymous Coward · · Score: 0

      So big deal, you open the connection before you build the query. Any decent wrapper class to the mysql_* functions will keep track of open connection(s). You open the connection the first time a query is set to run. Problem solved.

  5. So this isn't an IIS attack at all. by Chas · · Score: 1

    This is a SQL injection attack. IIS just happens to be the front-end of a poorly written web app.

    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?

    --


    Chas - The one, the only.
    THANK GOD!!!
    1. Re:So this isn't an IIS attack at all. by Shados · · Score: 1

      Yup. Heck, even if you are using SQL on every last thing... if you're using prepared statements (or stored procedures), which MUST be done for performance reasons and code maintainability ANYWAY (sql strings concat is such a rediculous anti-pattern...), you're immune.

      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 to develop, harder to read and maintain, etc, before you can be vulnerable... You have to -try- (or be a totally clueless developer).

      There is no excuse for it.

    2. Re:So this isn't an IIS attack at all. by kisrael · · Score: 2, Informative

      I agree there's no excuse for it, but in your second paragraph I don't agree with your logic 'til the final parenthetical remark.

      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 you have placeholder ?s in your string and a list of variables at the end.

      Mind you, I'm not defending this; it's still a D,U,M thing to do, but also it is a lazier route, it doesn't really "take more time to develop, harder to read and maintain" like you said.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    3. Re:So this isn't an IIS attack at all. by SatanicPuppy · · Score: 4, Informative

      There are several smart things that need to be done to protect yourself.

      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.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    4. Re:So this isn't an IIS attack at all. by Shados · · Score: 1

      I don't know, personally. You need all those concat symbols, the parameters aren't obvious...

      "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 you need to modify the query, you need to start goofing around, moving the quotes, if it was a string that became a number, you have to change it (so you have to be "type aware"). It definately is far more time consuming in anything beyond a one shot web site made by a single developer that you won't maintain.

      Though if you use a database driver that force you to use "?" as placeholders, its not quite as great as I make it (such as OLE DB), but modern ones that have named place holders ("@parameterName"), definately.

    5. Re:So this isn't an IIS attack at all. by Wyzardking · · Score: 1

      make sure it only has access to the tables you're going to be using Better yet, create stored procedures and attach permissions to them only; users should never have access to the underlying tables unless it is absolutely necessary.

    6. Re:So this isn't an IIS attack at all. by TheSkyIsPurple · · Score: 1

      >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).

      Excellent practice, but doing this actually leads you into the vulnerability described in MS Alert 951306. That can allow users to punch out of the context you gave them and take whatever context your service is running in, possibly even "Local System", which would really suck.

    7. Re:So this isn't an IIS attack at all. by shutdown+-p+now · · Score: 1

      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.
      Forget about escaping. Even PHP supports parametrized ("prepared") queries these days - use them!
    8. Re:So this isn't an IIS attack at all. by Jaime2 · · Score: 1

      Unescaped stored procedure calls are just as vulnerable to SQL injection as raw SQL. It's the call that gets hacked, not the procedure itself, and the call is just SQL.

      Also, most people who use nothing but stored procedures usually settle on a convention for CRUDing a table. Usually something like having four or more procedures named something like Customer_ins, Customer_del, Customer_upd, and a maybe bunch of variants of Customer_get. These are as easy to hack via SQL injection as not using stored procedures at all.

      Now, if you have a very well thought out and planned business layer of stored procedures with well-designed permissions, then you are ahead of the game and you expose nothing more than your app's functionality to SQL injection. But the cost is that you have to write every line of business code in Transact-SQL, which is one of the worst programming languages on earth. You might as well write it in COBOL.

      The simpler solution is to have a data access layer that does parameter escaping for you. Then you are safe from SQL injection and can use any language you want on top of it. You can even use stored procedures as much or as little as you like. Personally I prefer to use multi-statement table-valued functions any time I can instead of stored procedures because you can join them and slap where clauses on them, you they are written exactly as stored procedures are. They also have a few extra performance optimization benefits due to the restriction of only allowing deterministic operations in UDFs while stored procedures are allowed to be non-deterministic. The server has to run each unique call to a stored procedure because stored procedures are no guaranteed to return the same results call after call even if the same parameters are passed in. User defined function calls can be short-circuited after the first call with the same set of parameters since they are guaranteed to always return the same results.

      For data modifications I like to use triggers to enforce advanced security rules where possible. Sure they incur a performance cost in cases where a transaction is rolled back, but that should be very rare. The biggest advantage to me is that I am left with a design that is very compatible with every tool out there. Many tools are not stored procedure friendly, but they all are table friendly.

    9. Re:So this isn't an IIS attack at all. by dbIII · · Score: 1

      But what do you do when the people working on the backend are the sort that use the machine's root password for the database admin password, store it in plain text and have the file that holds the passwords accessable from the public net by simply changing the URL? There are a lot of developers out there that need to be protected from the world because they do the unthinkable to save a bit of time.

    10. Re:So this isn't an IIS attack at all. by Wyzardking · · Score: 1

      Yes, T-SQL kinda blows. But it gets the job done. :)

      When I mentioned using stored procedures above, I was inferring the use of a Parameters collection (probably should have explicitly stated that :) The stored procedure's input parameters would then be treated as literal values and not SQL code.

      http://msdn2.microsoft.com/en-us/library/ms998271(printer).aspx
      http://msdn2.microsoft.com/en-us/library/bb355989(printer).aspx

      At least, that's my understanding.

    11. Re:So this isn't an IIS attack at all. by Jaime2 · · Score: 1
      That's the misconception 99% of programmers have. When they say "stored procedures prevent SQL injection", they really mean "stored procedures called with parameterized commands prevent SQL injection." The stored procedure part of the process is actually irrelevant. That's like coming to the conclusion that white cars hold more cargo becuase your new white car holds more cargo that your previous black car. Color plays no part in cargo space and stored procedures play no role in SQL injection prevention.

      I only stress this because a lot of people who know what they are doing say it wrong, but do it right. The junior programmers that listen to them hear what they say and run around the world thinking that stored procedures prevent SQL injection and then write applications that call stored procedured by concatenating strings.

      Yes, T-SQL kinda blows. But it gets the job done. :) The same goes for COBOL. Heck, you could use that argument to convert all of your code to Whitespace ( http://en.wikipedia.org/wiki/Whitespace_(programming_language) ).
    12. Re:So this isn't an IIS attack at all. by kisrael · · Score: 1

      Just noticed your reply.
      We can probably agree to disagree on some of this, especially since I don't want to be seen as recommending this bad practice!
      but to answer "How can you guys even read that? easy -- SQL is very verbose. My eyes are pretty good at throwing out all the puncuation, and the words that are left tell the whole story

      But yes, you're right, the medium and long term maintenance are where you pay the cost for this, but for the first pass, it probably is the "cheapest" way to go, or in those cases where you get lucky and you don't have to change it. And I still say
      ("select * from blah where stuff = " + var1 + " and lol = '" + var2 + "';");
      is more readable than
      ("select * from blah where stuff = ? and lol = ?;", var1, var2);
      because of the ordering of it, and the need to put things back

      I've been getting out of "direct SQL", usually working with toolkits, so I haven't seen much with the "@parameterName". Who uses that? Do you still need to put arguments in a pile at the end?

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
  6. It's gotta be M$'s fault somehow! by Anonymous Coward · · Score: 0

    Extra! Extra! Third-party software with a vulnerability is somehow M$'s fault!

    SQL injection attacks can affect any platform and any database. It is the result of trusted unsanitized user input implicitly and either using it to construct a query statement or using it as data. In the first case the query can be modified to perform malicious activities, such as bypassing database-driven security in a website or modifying the database objects. In the latter case the unsanitized input could contain fragments of HTML or script that is sent back to the browser and rendered.

    All of the platforms have mechanisms to prevent these issues, but the developers have to actually be intelligent enough to use them.

  7. Re:epic lol by James+Kilton · · Score: 5, Informative
    Wow. The responses on the forum http://forums.iis.net/t/1148917.aspx?PageIndex=1 are sad indeed. Windows Security patches DON'T protect against shittily built websites. My favorite:

    I also have been hit by this attack on Saturday 4/12/08. It compromised our database and overwritten that script into all of your products. Luckily a database restore fixed the problem. Two days later the same thing happened, I have changed all the database and login passwords and did another db restore. Now today 4/18/08 we got hit again by the same thing but this time as the pages are loaded ActivX is activated and wants to run but of course I did not allow it. Anybody has successfully solved this situation? It truely sickens me how many web developers STILL don't know about SQL Injection.
  8. Seems to be effecting older versions of IIS... by mckinnsb · · Score: 1

    Solution: Upgrade to Windows Vista!

    I kid! I kid!

    Honestly though, this is a little humiliating. I understand that things get out of control in large projects, but I thought most people nowadays should know that database input sanitizing now fell among those universal truths, including but not limited to: brushing your teeth, wearing a condom, et al.

    Its unforgiving, but you really do have to sacrifice speed for security sometimes. That being said, I feel pretty bad for all those sys-admins/developers who are probably going to have a late nights tonight...and maybe for the next week or two.

    1. Re:Seems to be effecting older versions of IIS... by Shados · · Score: 2, Insightful

      You don't even need to sanitize database input. Just use freagin prepared statements. There's no cleanup or validation necessary (for this particular vulnerability I mean, that is, sql injection).

    2. Re:Seems to be effecting older versions of IIS... by geminidomino · · Score: 3, Funny
    3. Re:Seems to be effecting older versions of IIS... by sm62704 · · Score: 1

      Solution: Upgrade to Windows Vista!

      link link link link

      --
      mcgrew's razor: Never attribute to stupidity that which can be explained by greedy self-interest
    4. Re:Seems to be effecting older versions of IIS... by Thundersnatch · · Score: 1

      There is still validation necessary. An attacker could insert Javascript into strings in your database, which could then be used for attack if not escaped when read out and displayed in the web page.

      Since you can't rely on remebering to HTML encode all sttrings coming out of the DB into the web app (even if a framework does it automatically, somebody might end-run around the framework in the future), you really should cehck for and sanitize Javascript etc on the way into the database as well as on the way out.

      And of course there are lots of other application-specific reasons to validate input; giving the user good error messages comes to mind. Parameterized SQL helps prevent SQL injection, but it does not remove the need to validate and sanitize input.

    5. Re:Seems to be effecting older versions of IIS... by Shados · · Score: 1

      Sorry, no offence, but did you read my post fully? It wasn't that long :) I specifically said that my comment only talked about SQL Injection.

    6. Re:Seems to be effecting older versions of IIS... by Thundersnatch · · Score: 1

      Yes, I did. I wasn't implying you were "wrong", but that input validation is ALWAYS necessary, no matter what. Even if you ignore security concerns, input validation very important for catching bugs and providing useful error messages.

    7. Re:Seems to be effecting older versions of IIS... by jsebrech · · Score: 1

      Sanitizing just for javascript isn't enough. For example, with clever use of links and styles, you can mess up the behavior of a site pretty thoroughly (there have been myspace hacks that used this). You need a full html sanitizer to run across any html content before you store it in the database.

  9. 500 Thousand?! by Anonymous Coward · · Score: 0

    I'm 1 hundred % shocked.

    1. Re:500 Thousand?! by Anonymous Coward · · Score: 0

      I'm only 90 eight per $.01 shocked.

    2. Re:500 Thousand?! by pclminion · · Score: 1

      I'm 1 hundred % shocked.

      I don't see why you think it's weird. People write numbers like this all the time, especially when talking about monetary amounts. For instance, "Microsoft made $100 billion last year."

    3. Re:500 Thousand?! by Anonymous Coward · · Score: 0

      For one thing, nine zeroes is longer than the word "billion" and quicker to read and understand as meaning billion. Neither of these things are true when comparing three zeroes with "thousand". Plus the whole summary was a troll so I'm not exactly inclined to be nice about their mistakes.

  10. wait a second by the+brown+guy · · Score: 1

    If I do not have noscript for ffx, then I am vulnerable, and I am also unsure of what happens when you are infected with one of these trojans or w/e. Is it really that bad if my computer is a POS that I use for nothing important? Is there a threat of keyloggers? I have zonealarm running and AVG antivirus,,,,,,

    --
    Orbis terrarum est non altus satis
  11. Article is misleading by Geak · · Score: 1

    The article states a google search found over 500,000 modified pages. The post states over 500,000 servers. This is seriously misleading. If a site is hacked you could have several hundred modified pages on the site. This brings the number of servers down considerably.

    1. Re:Article is misleading by ralphdaugherty · · Score: 1

      The article states a google search found over 500,000 modified pages. The post states over 500,000 servers.

            from my experience Google only shows one to a few pages from a website, and you have to click more results on a site result set to see all that would match on that site.

            I did a test with data I know to be on many pages on my site and the count was 35, the top 5 from my site. I counted down the results and there were 35, with see more results as a generic show everything on all sites.

            I clicked on repeat search with omitted results included and the count went to 485, and the first few hundred are from my site.

            I would say if the people reporting the 500,000 pages or sites did a preliminary Google search the result count would be closer to site count, and if they clicked on repeat search with omitted results included the results count would be pages.

        rd

  12. Not really by Scareduck · · Score: 3, Informative

    PHP has pretty much fixed SQL injection hacks, at least for MySQL, something TFA you quote mentions on page 74. Given that this is the majority combination on web-facing machines, shouldn't that blunt the "LAMP installations are also susceptible to SQL injection" if only by quantity? I mean, I agree with your counter-FUD reasoning, but it seems to me that this blunts your whole sentence, MySQL+PHP being two pillars (and the last half) of LAMP.

    --

    Dog is my co-pilot.

    1. Re:Not really by SatanicPuppy · · Score: 1

      That's still pretty new; I've been using php for a while, and it's only been recently that I stopped feeling the need to use my home-rolled anti-injection methods over the new code methods.

      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.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    2. Re:Not really by jmpeax · · Score: 1
      The features they discuss were only introduced in the most recent version of PHP, and many, many servers are still running older releases.

      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.
    3. Re:Not really by weicco · · Score: 4, 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.

      --
      You don't know what you don't know.
    4. Re:Not really by Sancho · · Score: 1

      Pear with prepared statements has been around for a while. What method are you guys talking about that prevents SQL injection without that?

    5. Re:Not really by geekoid · · Score: 2, Insightful

      Build an exploit for it and use it in front of your PHBs boss.

      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.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    6. Re:Not really by Anonymous Coward · · Score: 0

      By that logic, almost all IIS servers should also be safe since .Net and even old-school asp could easily protect against this... if the developer did it correctly. But a bad developer will cause problems no matter what language they use.

    7. Re:Not really by wolrahnaes · · Score: 1

      Even as a fan of PHP, I have to agree that it's a language problem in some way.

      Many PHP security issues come from how terrible the default settings were on old versions, and unfortunately for compatibility with old code those settings are still often set to the shitty mode, even occasionally by default.

      If you configure PHP 5 as recommended it's pretty decent, but unfortunately most are still not set up that way. I hope that PHP 6 finally drops the crap like register_globals.

      --
      I used to get high on life, but I developed a tolerance. Now I need something stronger.
    8. Re:Not really by MightyYar · · Score: 1

      I still use a whole bunch of:

      if( function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
          $dangerous_input_form_data = stripslashes($raw_input_form_data);
      } else {
          $dangerous_input_form_data = $raw_input_form_data;
      }
      and
      $safe_name = mysql_real_escape_string($dangerous_input_form_data);

      Still the only way I've found to consistently be safe no matter how PHP is set up (while also not getting crazy escape characters in your data).

      P.S.: Someone please shout if I've made a security error here! :)

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    9. Re:Not really by Anonymous Coward · · Score: 0

      If you are going to use some noxious camel case MBA jargon to refer to Sarbanes-Oxley, at least try to spell it "SarbOx" instead of the obviously disgusting and wrong "SarBox".

    10. Re:Not really by Anonymous Coward · · Score: 1, Insightful

      PHP has pretty much fixed SQL injection hacks, at least for MySQL, something TFA you quote mentions on page 74.

      Please don't make me laugh. Try Googling this exact search phrase:

      inurl:select inurl:where inurl:%20

      PHP can give you all the protection in the world, but when you're designing your application with SQL query strings in the fucking URL, you're just hosed no matter what language you're using.

    11. Re:Not really by witherstaff · · Score: 1

      You could use only stored procedures and not allow anything but calls.

    12. Re:Not really by Anonymous Coward · · Score: 0

      > 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.

      Introduce him to the user Mr. Goatse?

    13. Re:Not really by Shados · · Score: 1

      The "we trust our users" thing seriously drives me wacko... Statistically, most attacks (as in distinct attacks, not amount of systems affected) come from pissed off internal employes. While its not possible to protect against everyone (a bit tough to stop the lead DBA from running SQL against the database), at least doing the minimum...

      I recently had to go to hell to get a vulnerability fixed in a software I was working on. The software had an expression evaluator that would read code from a user, compile it on the fly, and execute it, without validating it. I had to show my boss that I could wipe out everything the web server had write permission on (which was a lot, the app had to generate a lot of files) from the UI to have em beleive me (on a staging server, of course!).

      Finally it got fixed, but originally the excuse was always "Well, our servers are not web facing, so who cares?!?!". But people don't seem to realise how quickly a computer-clueless user will learn basic programming if you fire them on a bad note...

    14. Re:Not really by MightyYar · · Score: 1

      Not every host has MySQL 5 (or even 4). I wouldn't have to use that code if they would get PHP 5.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    15. Re:Not really by Firehed · · Score: 1

      It sounds like code injection is also at fault here, not just SQL injection. Which is to say that while the above method protects attacks directly on the database (and I use a very similar method), it doesn't stop someone from sticking a malicious script tag in an input field. You need to make sure that you run htmlentities() on the output or else I can screw with your page formatting (Name: "" type things) just as easily as linking to a heinous javascript file.

      --
      How are sites slashdotted when nobody reads TFAs?
    16. Re:Not really by Anonymous Coward · · Score: 0

      LOL. So does your PHB trust that your users won't get infected by a worm that performs this type of attack? Trust is not an excuse for insecure programming.

      In the last couple of companies that I worked for, I would often find odd requests in my dev server's Apache logs designed to exploit IIS vulnerabilities. Considering the fact that the servers were internal, odds are that someone brought the worm in house on a laptop. I reported it to network security in the 1st company and the got back to me a month later. I'm amazed how companies can emphasize physical security but not understand network security.

    17. Re:Not really by CastrTroy · · Score: 1

      Wow, just wow. I mean, I've seen some dumb programming examples, but that takes the cake.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    18. Re:Not really by Nwallins · · Score: 1

      If you are under SarBox Huh? Oh, SarbOx?
    19. Re:Not really by jonadab · · Score: 1

      > MySQL+PHP being two pillars (and the last half) of LAMP

      Not exclusively. So PHP is only one of several possibilities for the language pillar of LAMP. If anything the P was originally Perl. Later it got extended to be Perl/Python/PHP.

      Personally, I rather like expanding LAMP to Linux + Apache + mod_perl + Postgres. YMMV.

      But honestly Apache is really the key piece. I'm willing to work with a different RDBMS, and maybe even a different language (though I do really _like_ Perl, and am not sure what I'd do without the CPAN), and I have no problem working with a different kernel (such as an OpenBSD kernel perhaps), but I really don't want jack diddly squat to do with IIS. Apache is just so good, why would anyone ever work with anything else in its place? You really have to be drinking the Redmond Kool-Aid by the quart to want to work with IIS.

      --
      Cut that out, or I will ship you to Norilsk in a box.
    20. Re:Not really by jonadab · · Score: 1

      > We trust our users.

      Fine, you trust your users, but do you trust every website your users ever visit, and every email message they receive, not to contain malicious links? Is port 80 closed at the firewall so that your ASP site cannot be accessed from the outside world? Trusting your users is one thing. Trusting anything that ever sends a request to your web server is something else altogether.

      --
      Cut that out, or I will ship you to Norilsk in a box.
  13. Re:really hust 500,000 by CHRONOSS2008 · · Score: 1

    Just 500,000? i know one exploit thats worth a cool few million ROFL isn't the www fun, bet your all glad i don't go round giving knowledge like that out let alone leave it ANYWHERE near a pc attached to the net

  14. That sucks by evil-osm · · Score: 1

    Canadian National Security's site is on the list. Sigh.

    --


    E.

    Never rub another man's rhubarb - The Joker
    1. Re:That sucks by sm62704 · · Score: 1

      "Its in the corner of North America, and mostly empty, except, of course, for all the fail." ~ Oscar Wilde on Where Canada is, and what its filled with.

      Canadian map of the world, eh?

      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.

      --
      mcgrew's razor: Never attribute to stupidity that which can be explained by greedy self-interest
  15. serious by the+brown+guy · · Score: 1

    www.safecanada.ca [Canadian National Security] www.n-somerset.gov.uk [UK Local Government] events.un.org [United Nations] www.unicef.org.uk [UNICEF]
    These are a list of infected sites, don't click unless you know what you're doing. But I am worried when they affecting reasonably high traffic sites, whos visitors are not too likely to be running noscript.

    --
    Orbis terrarum est non altus satis
  16. This site makes me sick by RzUpAnmsCwrds · · Score: 4, Insightful

    This site makes me sick sometimes. If this were a problem with PHP (which, mind you, it IS), we wouldn't be calling it a "vulnerability".

    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.

    1. Re:This site makes me sick by MrMunkey · · Score: 5, Insightful

      Anyone still getting hit with this in 2008 needs to be whacked on the head. This is true of any language, not just ASP. You can easily prevent SQL injection with Perl, Python, PHP, etc.
    2. Re:This site makes me sick by javilon · · Score: 0, Flamebait

      Maybe it has to do with the average quality of windows sysadmins and programmers. You can do us all a favor and whack their heads.

      But, with 500,000 websites hacked, you have a lot of whacking to do...

      --


      When his defense asked, "Which computer has Jon Johansen trespassed upon?" the answer was: "His own."
    3. Re:This site makes me sick by evolutionary · · Score: 0

      Uh, sorry to correct you, but indicate PHP has a problem because it doesn't automatically do idiot checking for a developer is misrepresenting the problem. For example: mysql_string_escape() could easily be called (when using mysql) on a central routine to handle all SQL code execution. In additional, making functions to find escape characters isn't that hard. I greatly respect you taking the time to comment, and commend you for pointing out premade functions do exist, but when it comes to PHP vs. ASP.net you have to be careful when you say one platform has a problem because it doesn't do everything for you that you can do yourself isn't accurate.

      --
      "Imagination is more important than knowledge" - Einstein
    4. Re:This site makes me sick by Anonymous Coward · · Score: 0

      The real problem is that the people running ISS are too stupid to write correct web applications.

    5. Re:This site makes me sick by RzUpAnmsCwrds · · Score: 1
      Fair enough - my comment wasn't intended as a criticism of PHP or any other web framework. I just wanted to point out that SQL injection attacks are a stupid novice mistake, one that's far too common in "professionally-done" code.

      Note, though, that PHP has a number of issues that make SQL injection more likely:
      • "mysql_escape_string" vs "mysql_real_escape_string"
      • Documentation that encourages building SQL queries by concatenation
      • "Magic quotes" which may or may not actually work, and shouldn't be used anyway
      • No bind parameters in the non-improved MySQL extension

      Most of these are legacy issues. Magic quotes is now off by default and the mysqli extension is much, much better than the old stuff. But there are still a LOT of hosts running crappy PHP configurations (magic quotes on, no mysqli, PHP version 4, etc.).
    6. Re:This site makes me sick by stubear · · Score: 2, Funny

      Why would astronauts be writing web applications? Don't they have more important experiments to be conducting to waste time playing on the internet?

    7. Re:This site makes me sick by MrMunkey · · Score: 1

      I should have reviewed my comment one more time, as it wasn't exactly what I meant to say. I agree with you that SQL injection is so easy to avoid these days, and I just wanted to enforce that it can be done in every language on the web. PHP has had its issues, as you pointed out, but they're also getting better and hosts are finally starting to catch up. My personal host finally upgraded to 5.x a few months ago. BTW, PDO is great :)

    8. Re:This site makes me sick by dedazo · · Score: 1
      Understand it's Microsoft that pays the bills around here. Without stories like these, there is no ad revenue, and therefore CmdrTaco can't bring home the bacon.

      In the Microsoft bashing universe, Slashdot is the brightest star.

      --
      Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
  17. I'm seriously not affiliated with them, but .. by Anonymous Coward · · Score: 0

    I would like to remind people to donate to our saviours such as the NoScript people (if you use it)
    After reading this article, I'm sending in $5 right now...

  18. Re:really hust 500,000 by Anonymous Coward · · Score: 0

    ...Right

  19. IIS bashing by gzipped_tar · · Score: 2, Insightful

    I've read a similar article on theregister.com: Web infection attacks more than 100,000 pages. 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.

    --
    Colorless green Cthulhu waits dreaming furiously.
    1. Re:IIS bashing by bob.appleyard · · Score: 1

      I think the point is that this particular attack only targeted IIS, and appears to be a bit of a biggie. So it's news. There is still a slight bias of course, and there will be plenty of bashing here and elsewhere, but it's noteworthy nonetheless.

      --
      How dare you be so modest!! You conceited bastard!!
  20. People need to wake up both businesses and users by evolutionary · · Score: 0

    Okay, this is sad on two levels: First SQL inject attack vulnerability is due to sloppiness by the web developers. I've seen this potential problem on code reviewed on many web servers, both Apache as well as IIS. Its well known that if you don't use proper functions to remove escape characters before processing submitted data getting hacked this is inevitable.

    This has nothing to do with Apache being more secure than IIS (which is true) but truth be told neither web server is responsible for the root of this problem: Lazy web development combined with no security review. The other sad part of this is everyone wants to make websites that are "web 2.0" enabled, requiring lots of Javascript to make cool but often unnecessary functions. Many top websites (Slashdot.org is an exception thank god) are UNUSABLE without javascript enabled and this is just poor design. Combined with IE 6/7 inability to use plugins like NoScript make infections like this inevitable to people using IE. I'll grant that disabling ActiveX by default in IE 7 was an improvement but on many sites which foolishly depended on ActiveX, it caused other issues. Again, web developers need to be more dilligent in developing LONG term according to universal usability (W3C compliant) and security.

    I constantly tell people to use FireFox, NOT IE in part because I know javascript is currently the big gaping hole in Internet security these days (which this article illustrates). No one, myself included has time to read every piece of javascript code going through their browser and regular users don't have the book learning to do this themselves so NoScript is truly a god send. (and I donate to them). But still its up to users to be aware, demand that websites be functional without javascript, and only use browsers that can check javascript for trojan/spyware code. Its also up to developers to take web security a LOT more seriously than they have. For any web developer, SQL inject attack vulnerabilities like this are EMBARASSING. It shows rushed work that wasn't properly reviewed or audited.

    --
    "Imagination is more important than knowledge" - Einstein
  21. Re:epic lol by caluml · · Score: 4, Insightful

    Why do you think he's a developer? He sounds more like a sysadmin to me.
    Sure, he should know about SQL injection stuff - but even if he did, would he be able to fix it?

  22. Re:epic lol by D+Ninja · · Score: 3, Informative

    Parent -1 Flamebait. (Actually...it's more Article -1 Flamebait.)

    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.

  23. Linux admins running in circles by Anonymous Coward · · Score: 0

    SQL injection is a result of poor data validation on the part of the web application - not, as the blurb implies, an indicator of an insecure web server. LAMP installations are also susceptible to SQL injection (PDF) I'm sure we'll soon have an article about all the Linux admins running around in circles at one of the many forums.
    1. Re:Linux admins running in circles by ray-auch · · Score: 1

      I'm sure we'll soon have an article about all the Linux admins running around in circles at one of the many forums.


      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

    2. Re:Linux admins running in circles by Abalamahalamatandra · · Score: 1

      So the best you can do is an article about login credentials getting hacked?

      FTA: "Jackson stressed that while the site hacks were done sans a true vulnerability"...

      Yeah, that definitely points to the inherent insecurity of Linux. Not.

    3. Re:Linux admins running in circles by ray-auch · · Score: 1


      I didn't mention inherent insecurity of any OS - precisely becuase it isn't relevant.

      This month we have a mass Windows server compromise, last month Mac OS X was hacked first in pwn2own, and a month or so before that we have a mass Linux server compromise.

      In at least the Windows and Linux cases (not sure about the Mac, but I'd bet on browser or email hole) the vulnerability was NOT in the OS.

      If you believe that you are inherently secure because you run Linux, then you are sadly deluded, and almost certainly not paying enough attention to the security of the rest of your application stack and environment as a result.

  24. Re:epic lol by SatanicPuppy · · Score: 1

    That one made me laugh. Wasn't that Einstein's definition of insanity? Doing the same thing over and over and expecting different results?

    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.

    --
    ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
  25. Re:really hust 500,000 by Anonymous Coward · · Score: 0

    Sure, kid. Hey, I think your mom just called you up for lunch.

  26. Re:epic lol by jellomizer · · Score: 1

    Well Computer Science Programs rairly if ever cover SQL. Or place it in the same class as web development. So you have kids just out of college with 0 SQL experience and get into business which is heavy SQL based. As well many of them are not secuirty minded. They think what does it take to get it to work and not as much as what does it take to break it. Then there is an issue of funding, pressure to get it done fast can leave such issues wide open.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  27. what does the trojan do? by circletimessquare · · Score: 4, Insightful

    ok, story 1 is a sql injection

    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 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: 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

    --
    intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
    1. Re:what does the trojan do? by bjourne · · Score: 2, 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.
    2. Re:what does the trojan do? by Deanalator · · Score: 4, Insightful

      Please do not perpetuate hysteria.

      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/

      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.

    3. Re:what does the trojan do? by Anonymous Coward · · Score: 0

      i got hacked shortly after the hainan island incident 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 It was a spy plane, not satellite and to say that the plane hit the chinese fighter is a stretch. The spy plane is prop based and slow moving (relative) the fighter is a jet and probably cruises at twice the speed of the spy plane. Saying the spy plane hit the fighter is like saying I hit your car with my bike, it's possible, but chances are since your going twice as fast as I am that it was you who hit me.
    4. Re:what does the trojan do? by dbIII · · Score: 1

      The Estonian thing was reported later as a single bored teenager seeing what he could do.

  28. Re:epic lol by Shados · · Score: 2, Insightful

    How can you blame them however? Look at what THIS site (as in Slashdot) is doing. The headline implies that its an IIS hack. If you read the posts attached to this -very- article, a significant amount of people are replying acting like it IS a server issue, related to MS or some such.

    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 think stored procedures are faster by design than dynamic SQL.

  29. Re:Okay this is an honest question by D+Ninja · · Score: 1

    Again, this has nothing to do with IIS. I'm being redundant, and MS has done some crappy things in the past, but this is due to poor web site development (specifically SQL injections) and nothing to do with IIS.

  30. PLEASE LEARN TO READ!!! by Anonymous Coward · · Score: 0

    English is not my native languagem but obviosuly I can read it better than some people...

    THE F-SECURE WEBSITE IS TALKING ABOUT 510,000 MODIFIED PAGES.
    THAT DOESN'T MEAN 510,000 WEBSERVERS!!!

  31. Re:epic lol by TooMuchToDo · · Score: 0, Redundant
    EPIC FAIL.

    OS Security != Application Securty

  32. 500,000? Where'd that number come from? by Robotron2084 · · Score: 5, Informative

    Before you post such a headline, perhaps it would be a good idea to check your facts. I RTFA'ed and checked those links and there is no mention of how many servers were attacked. There were 510,000 pages mentioned, but pages do not equal servers. This a sensationalistic headline based on a sensationalistic interpretation of a Google web search.

    1. Re:500,000? Where'd that number come from? by Unnngh! · · Score: 2, Insightful

      Yep...too bad there's not a firehose or some other way to vote to pull existing posts. This is wrong through and through and is just confusing and misleading.

    2. Re:500,000? Where'd that number come from? by FurtiveGlancer · · Score: 1
      Remember, this is /. not CNN. Nothing but characters here....

      Maintain your sense of humor: come Friday, it may be all you have left!

      --
      Invenio via vel creo
    3. Re:500,000? Where'd that number come from? by Anonymous Coward · · Score: 0

      AND, it's relatively "old news", as this man reported on it far earlier:

      http://ddanchev.blogspot.com/

  33. Re:epic lol by Goaway · · Score: 2, Funny

    Doing the same thing over and over and expecting different results? Like flipping a coin?
  34. Re:Okay this is an honest question by Shados · · Score: 1

    First, as someone already stated, the vulnerabilty is in poor software development practice, and is pervasive in all environments, be in MS, Linux, Apache, IIS, PHP, ASP.NET, JAVA, whatever.

    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 that, well, just by having a windows-based network, IIS is already "pre-configured". That is, aside for web server specific stuff, its already on your server, can be admin-ed the same way, etc. Adding a box with a different OS, a non-integrated web server, etc, is just overhead.

    Same way as regardless of anything, if you were all java based, NOT using a java app server for your web apps would just be overhead, unless you have a damn good reasons.

  35. Problem exists between keyboard and chair by Anonymous Coward · · Score: 0

    This has nothing to do with IIS, nor does it have anything to do with Windows security flaws, nor does it have anything to do with ASP or ASP.net. It has to do with retarded programmers who don't know how to prevent SQL injection even after it's been heavily publicized.

    But this comment isn't going to stop people from posting more of these "lol MS" comments, are they?

  36. I am not sure by hesaigo999ca · · Score: 1

    I googled this ("script srcscript" | "scriscript" | "scriptscript" )
    and found 1,990,000 pages with this same script attack...as for how many servers this represents,
    I don't know.

    1. Re:I am not sure by hesaigo999ca · · Score: 1

      Actually slashdot removed the open html tag bracket so right before each 's'
        put an open tag and it will work

  37. Still? by xSacha · · Score: 1

    Gee, its 2008 already. Yet you can still search: inurl:.php form and attempt a pathetic SQL injection successfully on about 5% of your results. How pathetic. People should need a licence to write PHP/SQL.

  38. Re:The dangers of using Windows and IIS... by Anonymous Coward · · Score: 0

    This just goes to show you how much cheap (and clueless) web developers actually cost. This is a problem of laziness.

  39. Re:The dangers of using Windows and IIS... by evolutionary · · Score: 0

    Actually LAMP solutions are just as vulnerable to SQL inject attacks in the hands of the wrong web developer. I love LAMP (and Ruby on Rails) and I will take it over ASP.net any day. But in all fairness (and for the record in the majority of cases I think Linux/Apache is better than IIS), neither Microsoft nor the Apache Team is responsible for this. Its careless developers who take submitted html data and send it to the database without proper checking and remove of external sql code. You can hack either web solutions without this basic security check. Just so people are clear and to be fair to MS (even though they are not the brightest bulbs in security)

    --
    "Imagination is more important than knowledge" - Einstein
  40. Javascript by _bug_ · · Score: 0

    FTFA: Currently, there is no such protection for IE users, and disallowing Javascript entirely isn't really an option on today's World Wide Web.

    Why isn't it really an option? It sure as hell should be. Anyone interested in creating a good, accessible, usable web site would do well to make sure their site works fine without javascript or flash or java or any other embedded tech that could be used to exploit users.

    As these sorts of attacks increase in popularity the awareness and education of end-users will increase as well. Eventually browsers will come stock with features similar to noscript and web pages will be loaded, by default, without javascript or any other embedded tech enabled.

  41. Re:epic lol by peragrin · · Score: 1

    More like flipping a coin and expecting it to land on it's edge.

    --
    i thought once I was found, but it was only a dream.
  42. FUD is as FUD does by Foofoobar · · Score: 1

    FUD proliferation. One must spread FUD before Microsoft spreads FUD. Just the other day, Bill Gates himself stated that you cannot make money with GPL'd products (while Redhat and SUSE and IBM and MYSQL and others continually make millions). So while we do ourselves a disservice, the only way to fight FUD is with FUD.

    --
    This is my sig. There are many like it but this one is mine.
    1. Re:FUD is as FUD does by Applekid · · Score: 1

      FUD proliferation. . . . the only way to fight FUD is with FUD. FUDdy arms! You can't hug your kids with FUDdy arms!
      --
      More Twoson than Cupertino
    2. Re:FUD is as FUD does by Foofoobar · · Score: 1

      No but you can throw chairs at them apparently for using iPods. :)

      --
      This is my sig. There are many like it but this one is mine.
  43. Re:epic lol by mckinnsb · · Score: 1

    Anyway, as it has already been noted, this problem has nothing specifically to do with the IIS servers.
    Yes, but interestingly enough, the targets were seem to be IIS servers. The vulnerability is not IIS specific, as SQL injection can happen anywhere, on any platform, if the developer isn't paying attention.

    So this prompts the following question: Why were only IIS servers targeted, if this wasn't simply an IIS vulnerability? Was this a political statement, an intentional "mudball hack" (tarnishing IIS's reputation), or simply a coincidence-that a lot of poorly trained developers maintain and develop IIS systems, even if there are many talented IIS/.ASP net developers out there?

    Thoughts?
  44. Any meaning to the site names? by Guppy · · Score: 3, Interesting

    Hmmm.... nihaorr1.com? "Ni Hao" is a greating, like "Hello" in Chinese. Anyone figure out any meaning behind the other names?

    (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.)

    1. Re:Any meaning to the site names? by Intron · · Score: 1

      Don't know about meaning, but its easy enough to track where its coming from:

      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

      --
      Intron: the portion of DNA which expresses nothing useful.
  45. Re:epic lol by D+Ninja · · Score: 1

    From a cursory reading of the forum thread, it seems like IIS was attacked because, once the SQL Injection was made, the attackers relied on ActiveX vulnerabilities (which, I will absolutely agree - ActiveX is crap) and specific Windows applications (Real Player, Yahoo Messenger) to continue the attack.

    That, IMO, is why IIS was the focus. Not specifically because of IIS, but an IIS machine is guaranteed to be running on a Windows box.

  46. SQL injection is not platform dependent by twistah · · Score: 2, Informative

    OK, so SQL Server prior to 2005 wasn't secured well by default, and xp_cmdshell() is like inviting a system-level compromise. But, as others have pointed out, ASP.NET/IIS isn't the only platform affected. In fact, this platform makes it easy to secure your scripts against most attacks, ans SQL Server 2k5 and IIS 6 and ASP.Net have added protections as well. On top of that, this platform has never been vulnerable to attacks due to superglobals, of file open functions which allow you to import remote files, even if disabled in the config (thanks PHP!) or a host of other things. And if you look at milw0rm.com and other such sites, you will see a majority of SQL injection vulnerabilities come out for open source products with a mySQL back-end these days. So somehow pointing out that this is an IIS problem, and that Firefox will protect you from evil IIS sites, just shows ignorance and bias. I love UNIX, I preffer it over Windows, but I am also grounded in reality. Yes, you will have a lot of compromised IIS servers, because you have a lot of clueless admins who write ASP scripts on their Windows boxes without paying any attention to security. But in those hands, LAMP is just as dangerous, if not even more so.

  47. Re:Okay this is an honest question by wilsone8 · · Score: 1

    Side node: (Why was the above poster modded up?)

    Admitted newbie question here, but why do people even RUN MS IIS?

    Typically, people install MS IIS for a host of mostly good reasons.

    1) They are a MS shop. That means they already have a big investment in MS IT training and their developers understand Windows.

    2) They're using Microsoft development tools to create other parts of the application and they want the seemless integration that VS.Net and IIS give you. Good luck trying to debug PHP or other applications on Apache. It can be done, but its not nearly as easy as on Windows.

    Windows XP makes a great desktop environment for the office, but where does Microsoft have any business making server software other than Domain Controllers for telling their desktop machines what to do?

    By that logic, companies should never be allowed to work on anything other than their cash cow. Good job; you just destroyed capitalism with single sentence!

    --
    The real problem is not whether machines think but whether men do. - B.F. Skinner
  48. Oblig. XKCD by eggnoglatte · · Score: 1, Redundant
  49. Impressive fighter plane they have there by hellfire · · Score: 2, Funny

    I got hacked shortly after the hainan island incident in 2001. that is when the us spy satellite was bumped a chinese fighter, and was forced to land on hainan island (china).

    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 :)

    --

    "All great wisdom is contained in .signature files"

  50. Re:really hust 500,000 by thePowerOfGrayskull · · Score: 1

    Umm, right then. I sure am glad. Rofful.

  51. Re:epic lol by Goaway · · Score: 1

    That's not "doing the same thing over and over and expecting different results".

  52. The dangers of Apache and PHP by willyhill · · Score: 2, Insightful
    Yeah sure.

    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.

    --
    The twitter monologues. Click on my homepage and be amazed.
  53. I weep for the future... by Qzukk · · Score: 1

    So much "superstition" in such a small thread... (is there a better word for doing something that you're sure will make things better but doesn't actually do anything at all?)

    Blocking urls containing ;--? (what about ;%20-- or ;+-- or ;%20%20%20%20%20%20--?)
    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.

    --
    If I have been able to see further than others, it is because I bought a pair of binoculars.
  54. Only 24 hours in a day by Anonymous Coward · · Score: 0

    Not that it's really excusable, but developers, like everyone else, only have 24 hours in a day.

    You can only know so much, and when you consider how vast web development is, from security through to marketing, are you really surprized that not every end is covered properly?

    Add skimpy budgets to the mix and what do you expect?

  55. It's even on the UN's website by probityrules · · Score: 2, Interesting

    A Google search for "nihaorr1.com" brings up events.un.org as an affected site.

    1. Re:It's even on the UN's website by probityrules · · Score: 1

      Oh, brilliant. I suppose I should summary before posting.

  56. doh! by circletimessquare · · Score: 1

    actually, you should be impressed with us spy satellite technology: it can swoop down into the atmosphere for closer looks ;-)

    --
    intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
    1. Re:doh! by isorox · · Score: 1

      actually, you should be impressed with us spy satellite technology: it can swoop down into the atmosphere for closer looks ;-) Or perhaps Chinese fighters that can reach low orbit?
    2. Re:doh! by dbIII · · Score: 1

      Careful - I got flamed a great deal here before when I mentioned the satellites in Molniya orbits that went a long way into the atmosphere to get good photos. It certainly happened in the 1980s. By atmosphere I mean still quite some way up - if they actually got low enough to be likely to hit planes they would hit ground a few seconds later :)

  57. " As per usual?" by operagost · · Score: 1

    Could someone please tell me what "as per usual" means? Does it mean, "as usual," or "per Usual"? Who is this "Usual" guy?

    --

    Gamingmuseum.com: Give your 3D accelerator a rest.
    1. Re:" As per usual?" by FurtiveGlancer · · Score: 1

      Unlike Aspercream and Aspergum, Asperusual appears to be a "suppository preposition."

      --
      Invenio via vel creo
  58. Interesting to note Windows admin responses by caseih · · Score: 1

    The iis.net forum is full of very interesting posts by windows admins. One guy was hacked no less than 3 times! Each time he just restored his database and thought all was well, and wondered how those dang hackers kept getting in. He even changed his passwords!

    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 contrast.

    I've always maintained that a good unix guy can do anything on windows with a bit of training, but a windows guy will generally be completely out of his element in unix. Not sure why, exactly, as best practices are best practices.

    1. Re:Interesting to note Windows admin responses by JSG · · Score: 1
      I don't believe that there is any such thing as "best practice" in IT. There is good practice and there is bad practice but using a phrase like "best practice" is asking for trouble.

      It really gets on my nerves having to read some of the drivel that some vendors put out with best practice scrawled all over it. It comes across as arrogant at the very least. What annoys me even more is reading web sites that have very obviously ripped off content from another larger site (eg one with lots of blue in it) and then have the nerve to whitter on about best practice.

      I've always maintained that a good unix guy can do anything on windows with a bit of training, but a windows guy will generally be completely out of his element in unix. Not sure why, exactly, as best practices are best practices. I think you are probably correct but please don't use an MSCS's favorite phrase 8)
    2. Re:Interesting to note Windows admin responses by Jaime2 · · Score: 1

      I've always maintained that a good unix guy can do anything on windows with a bit of training, but a windows guy will generally be completely out of his element in unix. So, a good unix admin will make a good Windows admin and a poor Windows admin will make a poor unix admin. A good Windows admin will also be able to do anything on unix with a bit of training (or googleing if we're talking Linux).

      good admin = good admin
      bad admin = bad admin

      What an earth-shattering revelation... but if this isn't what you are saying then it actually bodes even better for Windows. If I was supposed to read in an implicit "good Windows admin" that was completely out of his element in unix, then all the statement boils down to is -- "Windows is easy, unix is hard". Just in case it actually needs to be said, easy is good and hard is bad.
    3. Re:Interesting to note Windows admin responses by 16K+Ram+Pack · · Score: 1
      This is definitely not how most unix admins would react.

      Yes, and guess what? This is definitely not how most windows admins would react, either.

      I've always maintained that a good unix guy can do anything on windows with a bit of training, but a windows guy will generally be completely out of his element in unix.

      Why? What do you think that UNIX has got that Windows doesn't? Because to suggest that someone would be out of their depth suggests that Windows lacks features that UNIX has. The only other possibility is that you're saying that it has the same features, yet is much harder to maintain.

  59. Re:epic lol by pdq332 · · Score: 1

    20 years ago it might have been said "It truly sickens me how many developers STILL don't know how to use free()." And now we have garbage collection. Web developers are like anyone else - security awareness falls along a bell curve. You can rail against the bottom half of the curve; or a few people can endeavor to improve the system, and thereby move the whole curve up. Why not just take away text SQL queries from web development environments? But I'm sure someone brighter than I could come up with a better one.

  60. following the breadcrumbs by v1 · · Score: 0, Troll

    The vulnerability being exploited is documented here and shows it was "last updated" April 23. (two days ago)

    My favorite amusement is:

    Currently, Microsoft is not aware of any attacks attempting to exploit the potential vulnerability. Upon completion of this investigation, Microsoft will take the appropriate action to protect our customers, which may include providing a solution through a service pack, our monthly security update release process, or an out-of-cycle security update, depending on customer needs.

    Thanks for that. Now that 500k servers got owned maybe you want to move on this sort of thing a little more seriously.

    At the bottom they ask, How would you rate the usefulness of this content ? But there's no option for "a little late, eh?"

    Though it DOES make me wonder if the publishing of this notice gave the idea to the makers of the malware. Makes a good case for not publishing a known vulnerability until either (1) its' in the wild already, or (2) you have a fix for it. Clearly neither of these were the case on Wednesday.

    --
    I work for the Department of Redundancy Department.
    1. Re:following the breadcrumbs by RightSaidFred99 · · Score: 1

      Bullshit. The "exploit" in question here is badly written code allowing SQL injection. Your inane point is like saying that it's an "exploit" that if I get root on your Linux machine I can access almost any resource on your local machine or on any NFS server attached to the linux machine.

  61. True story... by gaspyy · · Score: 1

    Just a few months ago we had to build a small custom CMS for a client, that had to be PHP/MySQL. The specs were very specific so it had to be custom-built. Since it was a relatively small work and we were involved in some bigger projects, we hired a contractor. Good references, a few years of experience, knew javascript, so we handled the project to him.

    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 use of POST for things were GET was better suited or the crap variable naming, or the generally inefficient way of doing things - but what really got me was the complete absence of ANY input checking.

    Simply put, the whole thing was completely vulnerable to SQL injection of the worst kind. I even checked his other works - all sites he'd ever done were vulnerable.

    In the end, I had to spend a few more days myself just to clean the mess.

    So, dear reader, if you don't know what SQL injections are - stop coding in whatever language you're using, right now. It doesn't matter if it's Ruby on Rails or ASP.NET. Please, please learn to do things properly. Security is not something you can learn later.

    1. Re:True story... by geekoid · · Score: 1

      Then how am I supposed to get revenge after I leave?

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    2. Re:True story... by Anonymous Coward · · Score: 0

      I don't check for SQL injections, yet I cannot be hacked.

      Who am I?

      A website without mySQL.

  62. Re:The dangers of using Windows and IIS... by Anonymous Coward · · Score: 0

    "Just goes to show you how much better Linux, Apache, MySQL, and PHP are than the thousand dollar Windows Server, thousand dollar Microsoft SQL Server, thousand dollar Microsoft ASP.Net development tools!"

    Your an idiot.. this kind of attack happens on Linux Apache PHP all the time.

    Several times a year I have had to update my PHP based aps because of this kind poor programming in an open source application. I have even had my linus sever hijacked to serve pirate media for a day before I spotted it in my logs.

    Those of us that undestand this just laugh at fools like you who see software as a religion and not a tool. In the last few years I have run on open internet, and Windows server and a Linux server. The Windows server has never been hacked..The linux one all the time. But the Linux server has many WEB applications on it and that is what happens. The Windows server is only Microsoft applications running in it. Web and email servers.

    Its not the OS its the applications and poor programming.

    If you need a religion go to church or temple.. I am tired of religious technology zelots distorting the discussion.

  63. Re:epic lol by SatanicPuppy · · Score: 1

    Like expecting the coin to stay up in the air.

    --
    ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
  64. Re:Okay this is an honest question by ZenDragon · · Score: 1

    Clever troll... or do you just not think before you post?

    IIS has its merits, just as apache does. ASP.net and other related technologies are a mainstay in the corporate environment whether you agree with it or not. They lend themselves well to rapid application development, and are well supported. Thus, it is cheap and easy to find talent within the field.

    Regardless, your hosting platform will do nothing to fix bad code. The platform in this case, is irrelevent. Dont try to turn this into a soapbox to promote your own biased opinions.

    FYI, I run several linux/apache servers as well as IIS/ASP servers. I am not impartial to either, as they each have their place in our environment.

  65. All MS servers!!! by Anonymous Coward · · Score: 0

    500000 servers! That means all MS servers around the world are compromised! Well... hu... it's sensible, 100% of MS servers are expected to be compromised.

  66. New AVG 8 free edition, the linkchecker catches it by Fallen+Andy · · Score: 1
    ... so update from 7.5 if you're using the free version. 8.0 has been available here since yesterday.

    Interestingly (and I've been looking at this attack all day) it seems to overwrite itself in the middle.

    Andy

  67. Not so fast, cowboy by Anonymous Coward · · Score: 0
    Although I never thought that SQL injection is a web server vulnerability, we don't know the entire story just yet.

    From the Washington Post story referenced in TFA:

    On Thursday, Spanish anti-virus vendor Panda Security said that it had alerted Microsoft that a flaw IIS was the cause of all the break-ins. When I asked Microsoft whether they'd heard from Panda or if the hundreds of thousands of sites were hacked from a patched or unpatched flaw in IIS, a spokesman for the company didn't offer much more information.

    "Microsoft is currently aware of and is receiving reports regarding public claims of attacks on IIS Web servers," said Bill Sisk, a security response manager at Microsoft, in a statement e-mailed to Security Fix. "While we have not be [sic] contacted directly regarding these reports, we will continue to monitor all reports either publically [sic] shared or responsibly disclosed and investigate once sufficient details are provided. We have not yet determined whether or not these reports are related to Microsoft Security Advisory (951306) released last week."



    Maybe there really IS some application that introduces the vulnerability and IIS nothing more than the required server platform. SQL injection has always been thought of as something enabled by poor programming. If this is the case, what might that application be? Whatever it is, it sure is popular because it runs on hundreds of thousands of sites.

    Underneath it all, we are talking about either an MS product, or someone else's product that requires IIS. If the infected page count reaches into the millions, I think the finger points back to MS.

    1. Re:Not so fast, cowboy by Macthorpe · · Score: 2, Interesting

      From an ex-user of Panda Antivirus, take what they say with a pinch of salt.

      --
      "It does not do to leave a live dragon out of your calculations, if you live near him." - Tolkien
  68. The real clue... by Aellus · · Score: 1

    Aside from the obvious bias and ignorance on the subject, the real clue that the OP has no idea what he's talking about is that he writes "...an SQL..."

  69. Re:epic lol by Anonymous Coward · · Score: 0

    They are because they have execution plan and do not need to be parsed, syntax cheched etc...

  70. Re:epic lol by QuoteMstr · · Score: 1

    I feel the same way. We ran rant all we want, but in the end, programming is going to get done by the cheapest, least-skilled people available. So we need to make the path of least resistance the correct path.

    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 string type with a regular string produces a query string type, but with the regular string quoted. String substitutions into a query string (using PHP's $ operator) would quote the strings first.

  71. Just as dumb by pembo13 · · Score: 1

    When people laugh at Linux for being an OS with a webserver which hosts compromised web pages.

    --
    "Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
  72. according to the weblogs of the defaced sites by Anonymous Coward · · Score: 0

    the sql injection attacks come from 219.153.46.28

    which geolocates to china

    there is nothing unsubstantiated or rumor about it. western sites are being attacked from china while han antiwestern ultranationalism rages

    there is a difference between being impartial and being blind. these attacks are most definitely related to the torch protest and the tibet riots

    1. Re:according to the weblogs of the defaced sites by Anonymous Coward · · Score: 0

      Do you actually think that people launch attacks like this on their own computers? Anybody with a clue uses compromised hosts in other countries to do anything even remotely questionable. Most people will actually go through a network of compromised hosts. Merely having an IP address means absolutely nothing. It gives you a place to start looking for the perpetrators and nothing more.

  73. Re:epic lol by digitalsolo · · Score: 2, Funny

    It's about reality, not probability. If you throw a coin up, it will come down. Throwing it over and over, and expecting to suddenly not come down, is a good example. Yet, for some reason, I read comments every day, and still expect that everyone will "get it". Insanity indeed.

    --
    Just another ignorant American.
  74. Idiots running webservers by onesullivan · · Score: 1

    This is exactly what happens when you have a bunch of idiots running webservers. Come on people, it is not that hard to keep up with your updates...morons. For example, my site has been reviewed for security flaws by many, and has never had any problems, even with the php and MySql. Simply because I keep up with the patches. See for yourself: www.onesullivan.com

    1. Re:Idiots running webservers by Shados · · Score: 1

      Well, web server updates wouldn't have helped much in this case. Patches don't help too much against SQL Injection, in the same way that no amount of patches will help you with buffer overflows or cross site scripting, if you don't check inputs and don't validate buffer sizes. This particular case may have been partly prevented because my understanding is that it partly used an actual server flaw, but if that many sites were SQL Injection vulnerable, nothing could have stopped an eventual exploit beyond simply coding the apps/web sites better.

      Patches don't protect you against stupid programmers.

    2. Re:Idiots running webservers by pandrijeczko · · Score: 1
      This is exactly what happens when you have a bunch of idiots running webservers. Come on people, it is not that hard to keep up with your updates...morons. For example, my site has been reviewed for security flaws by many, and has never had any problems, even with the php and MySql. Simply because I keep up with the patches. See for yourself: www.onesullivan.com

      To be honest, I'm not sure I'd give you much credit in the intelligence stakes either, my friend.

      I mean, bragging on Slashdot that you're web site has never been hacked and then posting it's URL???

      --
      Gentoo Linux - another day, another USE flag.
  75. Looking at the IIS forum... by jd · · Score: 3, Informative
    ...the first person to google for attacked pages only turned up ASP pages as cracked. Later on, they say that the javascript attempts to use an ActiveX control. If I am exceedingly generous, I'll allow for the possibility that the story was written by someone who saw just these two comments and assumed that since both of these are generally run on Microsft OS', that this was an IIS problem. (Actually, more than a few people using Microsoft OS' run other web servers. There's quite a selection to choose from. Also, both ASP and ActiveX are usable under Linux, well, ish.)

    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.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
    1. Re:Looking at the IIS forum... by ralphdaugherty · · Score: 1

      However, it is now abundantly clear that the attack is NOT ASP-specific...

        I guess it's .asp specific because .asp web pages with form fields were targeted and SQL Server specific metadata was SELECTed to get fields to update with javascript, which in itself is not .asp specific but SQL Server specific.

        But it is not abundantly clear to me why your post is modded informative. Did you find sites that were not IIS to be infected with this?

        rd

  76. May relate to attack c.a. 11 april... by Fallen+Andy · · Score: 1
    Some more digging and here in mangled form is what i've dug up... The IIS thread in the submitters post mentions that the site nihaorr1.com was registered 11 april. Interestingly, doing some spelunking with google for mangled script injection turned up refs to 414151.com and a script "fjp.js". That led me to a thread here from 11th April which mentions aspder.com . Hmm. There's a pattern here I think.

    The real puzzle for me is *why* they haven't fixed the overwrite (unless it's a deliberate way of slowing growth).

    Andy

  77. Maybe Barack Obama's site was one of those 500,000 by Anonymous Coward · · Score: 0

    Though it was a cross-site scripting and caused his web page to be redirected to Hillary Clinton's... http://www.usatoday.com/tech/news/computersecurity/hacking/2008-04-24-obama-website-hack_N.htm

  78. Re:epic lol by Shados · · Score: 1

    They are because they have execution plan and do not need to be parsed, syntax cheched etc...
    See? Exactly what I was talking about. The execution plan is done on the fly as needed (not when the stored procedure is created), the syntax checking is only partly done at creation time (and is totally redone at runtime), and inline prepared statements all benefit from the exact same process. There is no difference. Most mainstream RDBMSs work like that (I do not know about the like of MySQL however). The only difference really, is the amount of data moving on the network, if the SQL query is extremely large.

    Even DBAs seem to miss that, but it is well documented, and easy to benchmark. There is no difference between how compilation/execution plan/caching/parsing/checking/blahblahblah is done between an SP and a prepared statement. It is done the first time the query or the SP is -executed-, and its cached for all later executions as long as the only difference between queries is the filters (where clause, etc) and some other minor differences.
  79. Re:More data needed by Technician · · Score: 1

    the summary didn't say if this was a MS SQL or My SQL attack. Picking on the MS server is the sub story. The attack was a SQL exploit. The data in the headline was pretty thin. It almost looks like a MS IIS server bash attempt instead of a story about an SQL exploit. How about better reporting?

    Reading to the bottom of the article is the important stuff that should have been at the top.

    "UPDATE: We've been receiving some questions on the platform and operating systems affected by this attack. So far we've only seen websites using Microsoft IIS webserver and Microsoft SQL Server being hit. "

    It is MS SQL on IIS server that is the attack.

    so to answer your question "does it run on Linux?"; the answer is it runs on Microsoft IIS server and Microsoft SQL Server.

    --
    The truth shall set you free!
  80. Could Be Worse.... by FurtiveGlancer · · Score: 1
    The idiots could go into politics and then where would we be?

    Oh, here. Nevermind.

    --
    Invenio via vel creo
  81. Google? by Filter · · Score: 1

    >> Plus, Google is hardly a live metric for the state of the internet.

    You lost me there, can we go back a bit?

    --

    "better ways of doing things eventually just replace the inferior things" - Linus Torvalds 09-08-07

  82. In other words.... by Anonymous Coward · · Score: 1, Insightful

    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.


    In other words, it's a story perfectly suited for Slashdot and Slashdot's primary audience.
  83. Re:More data needed by RupW · · Score: 1

    so to answer your question "does it run on Linux?"; the answer is it runs on Microsoft IIS server and Microsoft SQL Server. Rubbish - IIS doesn't have anything to do with this. It's not even SQL Server's fault either - it's just the exploit SQL is crafted to work on SQL Server, it'll use schema reflection stuff that won't be portable to other databases. There's no reason you couldn't write equivalent code for MySQL or Oracle. There's no reason you couldn't exploit this through an app hosted on Apache running against SQL Server. This all boils down to shoddy applications and database setup. There's nothing really here to blame MS for.

    IIS has no part in resisting SQL injection attacks - it passes data to the application underneath and that app is responsible for properly escaping it before talking to the database *if* you're going to graft user data into SQL commands. And you shouldn't be - you should really be coding against stored procedures on any platform, particulary MS platforms which have supported them forever and because you get better performance that way, and you can invoke the stored procedures passing parameters directly without having to escape them at all - there's good APIs for all of that. And you should probably revoke the application user's permission to the reflection tables anyway if you can.

  84. SQL Injection = MS problem now?? by cmay · · Score: 1

    So now you are blaming SQL Injection on Microsoft? Get a life.

  85. From the forum by Anonymous Coward · · Score: 0
    Quote from the forum:

    I also have been hit by this attack on Saturday 4/12/08. It compromised our database and overwritten that script into all of your products. Luckily a database restore fixed the problem. Two days later the same thing happened, I have changed all the database and login passwords and did another db restore. Now today 4/18/08 we got hit again by the same thing but this time as the pages are loaded ActivX is activated and wants to run but of course I did not allow it. Anybody has successfully solved this situation? At what point does a MS IIS admin decide that he/she is not fit for the job as restoring the corrupted data from backups DOES NOT SOLVE THE PROBLEM ....
    Fucking idiot.
  86. Re:More data needed by jedidiah · · Score: 1

    Well, the real question is what top layer language and application
    server were they using? Since this is Lemming-land where people like
    to "get everything from only one vendor" there is a significant chance
    that some bit of Microsoft technology is to blame.

    --
    A Pirate and a Puritan look the same on a balance sheet.
  87. Take that PHP haters by Skylinux · · Score: 1

    Ha, take that PHP haters .... this one is not caused by a n00b using PHP, it is caused by n00b using ASP.

    Wait a minute.... could that possibly mean that PHP/ASP is not at fault when this stuff happens but the programmer(s)... where is this world coming to when the language can not be blamed anymore?

    --
    Everyone who buys Wild Hunt will receive 16 specially prepared DLCs absolutely for free, regardless of platform.
    1. Re:Take that PHP haters by Shados · · Score: 1

      Nope, sorry :) One is caused by a noob using ASP/ASP.NET, the other is caused by a noob using PHP -or- someone who used mysql_escape_string instead of mysql_real_escape_string, which they were using because they learned PHP when prepared statements were not available or they didn't have access to PEAR before PDO came in or...

      If the escape string methods (especially the "real" flavor) didn't exist, and prepared statements like in PDO had been built in (and not database specific) from the get go, you'd have a point.

    2. Re:Take that PHP haters by Skylinux · · Score: 1

      I thought my knowledge of English was good enough to decipher most statements, apparently not.

      Doing input validation is not the languages responsibility, it is the coders.

      --
      Everyone who buys Wild Hunt will receive 16 specially prepared DLCs absolutely for free, regardless of platform.
  88. Re:epic lol by Rovastar · · Score: 1

    I am a member of that forum (micrsoft's official IIS portal not merely "one of the many IIS forums on the 'net.") and have posted in that thread a few times. Initially it was very confusing as to what was happening - hence why I suggested it may be a asp vulnerability as it only seems to effect asp pages. It has not happened to any of my servers. Now it has become clearer that it is an SQL injection attack but I think in conjunction with asp pages probably via forms. Many of the posters in that thread are first timers that have little idea what is happening and not experienced hosting admin. True it is funny to see them suffer from you slashdotters. Speaking as an IIS admin there is little we can do directly. SQL injection is something that I blame slack devs for and will continue to. That and companies having little to no budget for decent IIS admin/devs.

  89. does it work now? by Anonymous Coward · · Score: 0

    I came across this on an orphaned web server at one of our customers a little over two
    weeks ago.

    interrestingly, the js downloader didn't actually work, due to some malformed URL's.

  90. Re:really hust 500,000 by CHRONOSS2008 · · Score: 1

    funny part is its not mine but it just started working again about 6 months ago nice to have such a wonderful selection to try and see if they do or don't work haha CHRoNoSS

  91. make sure you cover your back by Anonymous Coward · · Score: 0

    It is not always the individual developers fault. Clients and managers rarely want to pay for overhaul of their legacy code that a developer inherits even if it is explained to them how insecure it is. Often they would rather add another pointless widget than make the small investment to fix vulnerabilities. Best make sure your back is covered when the s hits the f.

  92. obnoxious headline by Examancer2 · · Score: 1

    "500 Thousand"

    What an obnoxious headline. Either go with the numeric representation of the number (500,000) or spell it out properly (five hundred thousand). Didn't your English teacher tell you not to mix and match?

    1. Re:obnoxious headline by ralphdaugherty · · Score: 1

      What an obnoxious headline.

            500 Thousand is more readable. Your post is what is obnoxious.

        rd

  93. Re:More data needed by Skrynesaver · · Score: 1
    Bingo, according to the linked page of circling IIS admins it's ASP, but this isn't MS's fault. It's badly written code by the web-developers the "Bobby Tables" problem.

    For it to have hit 500K sites I'd assume their all using the same toolkit/framework for their apps.

    In conclusion much as I enjoy abusing MS this hasn't been proven to be their fault yet, and I'd assume it's a poorly coded toolkit from some company that's about to lose a lot of custom.

    --
    "Linux is for noobs"-The new MS fud strategy
  94. And if we know who wrote this? by Anonymous Coward · · Score: 0

    What do you do then?

  95. PHP Magic Quotes by Richard_J_N · · Score: 1

    With the Magic Quotes feature (on by default), PHP is unconditionally safe against SQL injection. All input data (GET,POST,COOKIES) are automatically parsed to backslash-escape single-quote, double-quote, and backslash. So, you can just use the input data, and never worry about compromise. (In my view, this is a very good idea, and the fail-safe nature is well worth the slight-inconvenience of having to occasionally remember to call stripslashes() if your data is not going to end up a database.)

    What I cannot understand is why magic-quotes has been deprecated for PHP-6. Can anyone explain?

    BTW, I'm not convinced by the advantages of stored procedures. Yes, they save you from SQL-injection risk (similar to magic-quotes), but the complexity of the resulting code is higher, and the readability is lower. Debugging cpomplex queries is hard enough already!

    1. Re:PHP Magic Quotes by Shados · · Score: 1

      There are a lot of things about stored procedures, especially in large teams (like allowing a DBA to modify stored procedures without having to change the code written by other devs, and analysing their performance on a day by day scenario, sorting SPs in order of efficiency, getting SP reports, etc), and others involving auditing (in very large, critical scenarios, you'll have auditors that will look over your SPs with their related permissions to evaluated who can do what to your data, and thats simply not possible if your SQL is in your code). Debugging an SP using professional tools is also easier than debugging a mess of concatenated strings.

      However, magic quotes being deprecated is probably for prepared statements (PDO). That has a lot of the advantages of SPs (not the ones I pointed above, but it protects against SQL Injection in the same way, and has the same performance benefits) without actually needing SPs. Escaping strings and whatsnot is simply not a good safety net. Thats why you have mysql_real_escape_string vs mysql_escape_string. And even that doesn't do it: there are attack vectors in certain situations involving encoding switching (it has been fixed, but it just shows what kind of issues can arise). There's also certain attack vectors that do not rely on special characters (such as a union attacks in a non-string query), though thats still hard.

      Just used prepared statements, and you'll get the best of both worlds anyway. That said, saying that an SP increases code complexity implies that SQL is more complex than a typical programming language... which is really not the case. Its just that you're probably not as well trained in a set-based almost functional (not quite) programming paradigm as you are in "normal" programming. We all go through that =P

    2. Re:PHP Magic Quotes by Richard_J_N · · Score: 1

      Thank you for a very good answer. I do see your points. That said, I still can't see any good reason why magic-quotes is considered harmful to the point of being completely ripped out, only that there might be some people who prefer to turn it off. magic-quotes seems to be getting the same treatment as the (genuinely harmful) register-globals. Also, Postgres doesn't seem to have the issue of escape_string() vs real_escape_string().

      I have written quite a lot of detailed SQL, and it's much easier to write in string form. It's certainly easier to understand it when debugging, and it's useful to be able to easily copy-paste between the php-code and the psql terminal, as well as being more helpful when grep-ing. Saving multiple lines of code per query is good too - I find that the increased clarity makes it far easier to "see the wood for the trees."

    3. Re:PHP Magic Quotes by Shados · · Score: 1

      I'm guessing your issues come from the way you work. If you do stored procedures the way I've done it everywhere I needed em (btw, I hate stored procedures, but not for any of the reasons you dislike them, so I'm not trying to defend a religious opinion!), you wouldn't have any issues.

      Usually, you'll develop the SP in some kind of query builder tool. So you don't need to copy paste it anywhere, its already there. You just hit F5 (or whatever) to run it. It doesn't get much easier than that, all cute with syntax coloring, etc. The stored procedures are in text files on the disk, so you can grep them fine (and its easier too, since its not split by quotes and concat operators). For complex queries (several hundred lines), its also a boon, as doing that in the middle of PHP code would simply not be realistic, especially with the above mentionned quotes and +s and other irrelevent characters.

      I guess you do save lines of code per queries...like... 2 (which aren't even visible if you use the appropriate methodologies).

      And for your question about the magic quotes: its simple. The best way of doing things is by far and above (and not just for security reasons!) prepared statements. If you use preparated statements, all what things like magic quotes do is slow down your server. There's no reason to use it. The technical term for a feature that has -zero- use is "deprecated" :)

      Its simply redundant. (And again: preparated statements have many more advantages that magic quotes won't give you, such as performance, so you MUST use them, stored proc or not).

    4. Re:PHP Magic Quotes by Richard_J_N · · Score: 1

      Can you give me a reference on the performance improvement from a prepared statement? As for query-builders, I tend to just use kwrite which does pretty much everything I can ask of it. (My dev suite is kwrite, konsole, bash, psql, apache, and firefox). Seriously though - what kind of query takes several *hundred* lines?

    5. Re:PHP Magic Quotes by Shados · · Score: 1

      A night batch process across 7 servers in a replications set around the world (and not even of the same technology, as in, not all the same database engine, using views with an ODBC front end) to finally launch an ETL package and query the result from an OLAP cube.

      Now i'm making this up, I never did anything that complicated, but... I had to do stuff like querying several servers to generate a end of month statement. Doing it in a single query was a lot faster than having multiple roundtrips and aggregating the data in the procedural code, but it required the declaration of several temporary tables, aggregating their data, you need exception handling (try/catch), variables, custom error messages, a lot of code to do all of the computations (calculating taxes across various states/provinces/countries... thats a LOT of code right there), and more. Personally, anything under 80 lines of code for an SQL query is considered "simple". (If you have a database schema in the 3rd normal form in an average business application, you'll have 10+ way JOINs quite frequently, and if you indent your code and make it readable, it will easily span 50-100+ lines in the best of cases... if you add string concatenation for all of the parameters, it quickly gets out of hand, but thats not an issue with either SPs or prepared statements).

      And yeah, with your dev setup, I'd probably dread doing stored procedures. I'm a .NET dev myself, so I have Visual Studio, with a widescreen monitor, having a small part on the right displaying my project structure, and a small section on the left having a live connection to the database on which I can view/modify stored procedures straight on the server, using plugins to have stuff like auto-complete, etc. VS also allows you to set breakpoints and trace into stored procedures for debugging, and to write/run automated unit tests on them. Its sweet.

      As for the performance improvement of prepared statements, it comes from the query plan cache (which cannot be done without prepared statements), though that depends on the database engine. Oracle and SQL Server do it, I beleive Postgres does, I don't know about MySQL.

      here is a reference, though I did not verify it (though I'd be guessing dev.mysql.com would be a semi-reliable source! This one is from the 4.0 days though)
      http://dev.mysql.com/tech-resources/articles/4.1/prepared-statements.html

    6. Re:PHP Magic Quotes by Richard_J_N · · Score: 1

      I see what you mean. I decided quite early on that I could put the "intelligence" either in the database, or in the PHP, but I didn't want half of each. Given that the PHP has to handle errors, wherever they come from, I decided to do everything in PHP, and treat the database as dumb. By this, I mean that all database queries are guaranteed to succeed without error because the query is known in advance to be valid. (If the database query does return an error, this is allowed to terminate the script with a fatal error).

      Also, Postgres doesn't usually require explicit joins - in fact, I've just checked: out of 320 sql queries, I have not a single instance of the join keyword! You can just write much more naturally:
            SELECT alpha, beta FROM table_one, table_2 WHERE table_one.gamma = table_two.gamma
      (in this example, table_one has columns alpha, gamma, and table_two has columns beta, gamma)

    7. Re:PHP Magic Quotes by Shados · · Score: 1

      Indeed, thats the "old" way of doing JOINs. Actually, the JOIN keyword is to clean up the WHERE clause, which can get quite complicated, by separating join related operations from the WHERE clause (back in the days, we didn't have the JOIN keyword, hehehe).

      Most database developers feel using JOIN is easier to maintain and more natural :)

      And I agree, I hate having intelligence in the SQL part, but in certain cases its required for performance reason, unfortunately (common in complex multi-thousand table ERP systems)... It really depends on the kind of work you do. Personally though, for anything that doesn't require business logic (such as CRUD operations), I just use an ORM framework. Then I don't even have any SQL at all, in or out of the database! Problem solved :)

    8. Re:PHP Magic Quotes by codepunk · · Score: 1

      Ah but stored procedures have one very bad drawback that you failed to mention. If all stored
      procedures used the same syntax and dialect all would be good but this is not the case every single
      database server is different. You put the majority of the logic in stored procedures and from that point forward you are eternally locked to that platform. Call Microsoft or Oracle and ask their opinion, they will tell you that you should always use stored procedures.

      --


      Got Code?
  96. but how can it happen ? by Anonymous Coward · · Score: 0

    Isn't Bill Gates one of the richest person in the world and isn't Microsoft a global Fortune 100 company ?

    I mean, where's the argumentum ad crumenam logical phallacy for all the MS fanbois when they need it?

  97. Re:epic lol by Kalriath · · Score: 1

    Wow. Just wow.

    The ActiveX vulnerabilities exploited are on the CLIENT. An IIS machine is not guaranteed to only be visited by Windows users. The server software has nothing to do with it (other than the prevalence of moronic ASP developers who don't validate anything).

    --
    For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
  98. Re:epic lol by Goaway · · Score: 1
    That's not what the quote says. It says:

    Doing the same thing over and over and expecting different results Not "doing specific insane things over and over". Just "doing the same thing".
  99. Get back in your hole, fanboy. by willeyhill · · Score: 0

    In the meantime, it's been 5+ years and no one has found an exploitable vulnerability in IIS.

    What fantasy world do you live on? The rest of us see something different.

  100. uh-oh, sockpuppets by willyhill · · Score: 0, Troll
    hi twitter. You have something that's not from 2004? I was referring to IIS6, of course. IIS5 (which is what that article talks about) had at least three vulns in four years, if I recall. IIS6 has been out for 5+ years so far. Can you find me an exploitable vulnerability for it?

    You can answer when you're done trolling with a user name that looks suspiciously like mine. And isn't that amusing.

    --
    The twitter monologues. Click on my homepage and be amazed.
  101. Re:epic lol by digitalsolo · · Score: 1

    Ah, but it assumes you can comprehend the intended meaning. Of course, we do realize you're not Einstein.

    --
    Just another ignorant American.
  102. Re:epic lol by Goaway · · Score: 1

    I can "comprehend the intended meaning" just fine. I am just pointing out it's a really bad saying, because a good saying will say what it means, without any need to second-guess it.

  103. Boring by codepunk · · Score: 1

    It could have been more entertaining it had done a fetch from any tables where
    it finds a field named user, pass, ssn etc ,combined the results and wrote it
    to all text fields in all tables.

    --


    Got Code?
  104. Re:More data needed by CastrTroy · · Score: 3, Informative

    You can have SQL injection problems just as easy in stored procedures as you can in plain old code. Look at this example (pardon the probably incorrect syntax):

    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.

    --

    Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  105. Patch your windows and use a web application fw by Yoshimetso · · Score: 1

    You can't depend on developers any more, they are just doing the shit the easy way, no code checking, no code assessment, the business needs are more important than spending hours and hours trying to figure out where are the bugs!??? 80% of web developers are just careless. My advise is keep your windows servers up-to-date. And deploy a web app firewall from vendors like F5 or Citrix. Blocking these kinds of attacks at the gateway is faster and will cover all of the vulnerable applications. check out my blog here: http://extremesecurity.blogspot.com/2008/04/un-site-took-injection.html

  106. I'm confused by Anonymous Coward · · Score: 0

    In PHP for example, is mysql_real_escape_string() b0rken, or does it still do the job it's supposed to do? You can't be telling me there are actually people literally doing this:

    mysql_query("SELECT * FROM tbl WHERE user = {$_GET['username']}");

    Unless there is a problem with the escaping functions, I do not understand how "sql injection" can possibly be an issue in any application... anyone coding scripts that are vulnerable to sql injection should not be programming, period. Unless there are internal issues with escaping functions, the idea of sql injection is absurd.

  107. Glad to see Slashdot slinging FUD by Anonymous Coward · · Score: 0
  108. wikibooks is probably better by rootpassbird · · Score: 1

    http://en.wikibooks.org/wiki/Programming:PHP:SQL_Injection

    it also says this important thing:
    "Note that MySQL does not allow stacking of queries so the ;DELETE FROM table attack would not work anyway"

    --
    Hackers have long memories. It works both ways.
  109. Re:More data needed by jonadab · · Score: 1

    > IIS has no part in resisting SQL injection attacks - it passes data to the application
    > underneath and that app is responsible for properly escaping it before talking to the database

    Almost. The app is responsible, but the actual app code itself shouldn't have to manually do the escaping, because the database interface library it's using should be doing that automatically whenever parameters are bound. (The app does have to be responsible to pass user-supplied data as bound arguments, though, rather than interpolating it directly into the SQL.)

    > *if* you're going to graft user data into SQL commands. And you shouldn't be

    No, you shouldn't be. User data should be passed to the database interface as bound variables.

    > And you shouldn't be - you should really be coding against stored procedures

    No, you should be using an abstraction layer library. You shouldn't need to have any SQL, *including* stored procedure calls, embedded directly in the main code of the application itself. All of that should be in the abstraction layer library. (The abstraction layer may be prefab, like an ORM, or it may be a specifically crafted custom abstraction layer designed to meet the particular needs of the application. But it should be isolated from the rest of the application code so that the database guys can review it and maintain it without having to troll through all the application code, and also so that non-database programmers maintaining the bulk of the application codebase don't have to mess with it in detail.)

    As for stored procedures, they are overused. The most common thing I've seen them used for is to embed application logic in the database, which is an inherently bad idea and harms maintainability severely. I'm not saying they can't ever have a valid use, but they *certainly* should not be used as a panacea for all database access. That's just wrong in so many ways I don't know where to start.

    --
    Cut that out, or I will ship you to Norilsk in a box.
  110. Re:More data needed by MacWiz · · Score: 2, Funny

    the answer is it runs on Microsoft IIS server and Microsoft SQL Server.

    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.

  111. SQL Server is ridiculously vulnerable by butlerm · · Score: 1

    SQL Server is far more vulnerable to this kind of attack because of the way it allows multiple statements to be parsed and executed together. In Oracle for example, this attack could never have occured because multiple statement execution requires creating a PL/SQL block that starts with a "begin" and terminates with an "end". Whereas in SQL Server any unvalidated semicolon is sufficient to start a new statement.

    That doesn't mean that Oracle and most other databases are invulnerable to SQL injection, but rather that insecure web applications that use them are much less likely to be exploited than those that use SQL Server are. With most databases and a typical insecure web application, a thoughtful attacker can usually only compromise the database piecemeal. With SQL Server and an insecure web app its game over without a second thought.

  112. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  113. Re:epic lol by ralphdaugherty · · Score: 1

    Why not just take away text SQL queries from web development environments?

          it's all they have.