Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (1)

Powered by Vanilla. Made with Bootstrap.
SQL InJecTion Problem
  • I was testing a website and by adding a little ' at the end of

    asp?id=23'

    I found the following error:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14' 

    [Microsoft][ODBC Microsoft Access Driver] Syntax error in query expression 'id like '%23'%''. 

    /fa/articlev.asp, line 20 


    then I tried this one:

    asp?id=23 or 1=1--

    now no error but no text is being displayed but web theme is being displayed.

    I want to know it is exploitable? how can I do it? I've never test Microsoft Access Drive.
  • m0rph
    Posts: 332
    Yes it is exploitable, but not with MySQL syntax. You have to use MSSQL syntax. Also, no one is going to stop you from doing whatever you want to, but we do not condone unlawful activities on this website. So if you're going to break the law leave iexploit's name out of it.
    while( !(succeed = try() ) );
  • Tx m0rph. I 'm a newbie and and I'm not going to do unlawful activities now and maybe never :D.
  • Sh3llc0d3
    Posts: 1,910
    Yeah deffo check out MSSQL, unfortunately a lot of tutorials on sql injection are based on MySQL and not MS or Oracle.
  • Yer MSSQL is bad for tutorials but my friend wrote these

    Part One: http://www.mediafire.com/view/?wl87fi4ccybqta0

    Part Two: http://www.mediafire.com/view/?00olvjcjspxk5gb

    Shame he got arrested, he was one of the best web-hackers i knew.
    Skype: mrpt3o
    Twitter: MrPteo


    image
  • a_tek7 said:

    [quote="a_tec7"]
    I was testing a website and by adding a little ' at the end of

    asp?id=23'

    I found the following error:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14' 

    [Microsoft][ODBC Microsoft Access Driver] Syntax error in query expression 'id like '%23'%''. 

    /fa/articlev.asp, line 20 


    ... [/quote]

    Look at the error. It's saying: " 'id like '%23'%' ". The single quotes at both ends of that statement mean nothing. It's the '%23'%' in the middle you should be concerned about. The highlighted part is your input. Look at it closely. What caused the syntax error? This is where your vulnerability lies. First, figure out what % means so you have an idea what's going on here. Looking at this error, I can already think of several ways to exploit this.

  • I 've been very busy these days to see my post again

    @ Mr.P-teo: thank you for links. I looked over those docs now and sounds great bro, thanks. I will peruse them soon. If you have the 3rd part please upload it. When author gets arrested? It seems the document is written recently :D 

    "Also, most common versions of Microsoft SQL Server are 2005 & 2008. The 2012 one has just been released 1 month ago, so it's not really used at the moment." :D


    @Null Set: thanks for comment.As I already mentioned I' m newbie and what I know, obviously a little, about sql injection is based on MySQL database and I've never had an experience on MSSQL. I used google and I found out that % specifies special characters. but I did not understand what you mean about several ways of exploiting this data base. can u clarify it please?





  • @a_tek7 I personally don't have the link to the 3rd part, you will have to check his twitter to see if i missed something. http://twitter.com/#bzyklon - he got arrested a few months ago, he went offline and i haven't heard from him again, hence be sure to use protection and clear the sever logs.
    Skype: mrpt3o
    Twitter: MrPteo


    image
  • Tx Again Mr. P-teo

    I was testing this site again and I found sth that is interesting for me. First I tried this one:
    asp?id=171+and+1=0#
    then I tried
    .asp?id=171+and+1=1#

    but there was no obvious change to see it in my web browser. Must we see any changes by applying two different conditions?

    Another problem is that how we count column in MS-SQL? I tried order by method 
    (tender.asp?id=171+and+1=1+order+by+12#)
    and the error is :

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14' 

    [Microsoft][ODBC Microsoft Access Driver] Syntax error in query expression '1%''. 

    /fa/tender.asp, line 20 

    of course, I tried to 12. Am I wrong in counting columns or there are some kind of filter or I should keep on?


  • No Comment?Nobody is interested to look at target web?
  • m0rph
    Posts: 332
    @a_tek7, I already warned you about discussing attacks on sites with which you are not the owner, and I have clearly stated to you iexploit's position on such manners. I've deleted one of your comments regarding this. If this is so hard for you to understand, and you don't want to follow this one simple rule then iexploit isn't the place for you and I'm going to have to ask you to leave.

    This is strike 2, and if you do it again I will ban you.

    Also, we're not extremely picky on double-posting but if you can refrain from doing it often we would really appreciate it.

    -5
    while( !(succeed = try() ) );
  • Sh3llc0d3
    Posts: 1,910
    @a_tek7 I think your issue is your trying to use a skill without practicing it or understanding it properly. The process of sqli is different for MS-SQL to MySQL it seems your trying to port mysqli to ms-sqli.

    So many good tutorials on ms-sqli:

    http://lmgtfy.com/?q=ms+sql+injection+tutorial

    As m0rph has laid down the rules I'm going to assume I'm right in the following... we can correct you in your technique in a hypothetical situation or in learning a skill, not in the practical application of you hacking a specific target (in this case a website). Maybe something to keep in mind for further questions.
  • You're right, so how can I explain that I'm just experiencing not I'm not going to damage? OK.
    What ms-sql injection tutorial kit would you recommend for trying and learning MS-SQL injection? I want to have it on my hard disk and try them and discuss about my probable problems.
    tx
  • m0rph
    Posts: 332
    Just do what you were in the beginning of your topic with things like: index.asp?id=69

    If you want to get a good grasp on mssql injections, you first have to understand that mssql is not generally used with php, it is used with asp. So you have to get a good understanding of inherent asp vulnerabilities: http://lmgtfy.com/?q=asp.net+vulnerabilities

    You also have to have a good understanding of general mssql syntax: http://lmgtfy.com/?q=mssql+tutorials

    Finally, you have to understand how they work together: http://lmgtfy.com/?q=asp.net+mssql+tutorials

    Finally, once you understand how asp is different from php, and how myssql is different from mysql, and how asp is used with mssql, THAT'S when you start getting into attacks: http://xd-blog.com.ar/descargas/manuales/bugs/full-mssql-injection-pwnage.html

    We don't want to discourage you from learning, but if you have questions about things you don't understand, or information that is not easily found from searching on your own, that's the time to turn to users in the forum. We can't just give you links to gee-whiz knowledge that you easily could have found on your own. Hacking communities don't revolve around simple give-me's and hand-outs, they revolve on curiousity, innovation, and helping others when you have an answer to something you thought was extremely difficult to solve.
    while( !(succeed = try() ) );
  • Mr. P-teo said:

    Yer MSSQL is bad for tutorials but my friend wrote these

    Part One: http://www.mediafire.com/view/?wl87fi4ccybqta0

    Part Two: http://www.mediafire.com/view/?00olvjcjspxk5gb

    Shame he got arrested, he was one of the best web-hackers i knew.

    Mr. P-teo said:


    Mr. P-teo said:

    I guess he is back now man...


  • Maybe the query like : select xx from yy where id ='%"& id &"%';
    So U can use ?id=23%' and 1=1 and '%'='
    Now : select xx from yy where id ='%23%' and 1=1 and '%'='%';