RE: XPath injection doubt

From: Andy JKC (andy_at_inetconsulting.co.uk)
Date: 09/24/05

  • Next message: Sol Invictus: "RE: PT Activity duration/time"
    To: <pen-test@securityfocus.com>
    Date: Sat, 24 Sep 2005 17:28:20 +0100
    
    

    As the entire query is likely in [] with Xpath, unlike sql.

    You get e.g.;

    (//user[name/text()=' + InsertString + '])

    Where the "hi' or 1=1 or 'hey'='hello" string deals with the surrounding
    ''s, giving you room to inject 1=1 to return a positive.

    Whereas with e.g.;

    select * from [table] where username = ' + InsertString + ';

    The "hi' or 1=1--" string closes the ''s, returns a positive (1=1) and then
    comments following sql out (--).

    Hope that helps,

    Andy.

    P.S. There's a decent paper at
    http://www.watchfire.com/resources/blind-xpath-injection.pdf

    -----Original Message-----
    From: Anne Beckman [mailto:anne.beckman@gmail.com]
    Sent: 24 September 2005 04:44
    To: pen-test@securityfocus.com
    Subject: XPath injection doubt

    I am learning the XPath injection technique. To bypass authentication,
    we give a string like:

    hi' or 1=1 or 'hey'='hello

    I noticed that the equivalent string in SQL Injection would have been
    shorter:

    hi' or 1=1--

    I understand that XPath does not have comments, so we cannot use the
    -- technique to comment out the rest of the query. But how does that
    additional OR clause with 'hey'='hello solve the problem too?

    Thank-you,
    Anne

    ----------------------------------------------------------------------------

    --
    Audit your website security with Acunetix Web Vulnerability Scanner:
    Hackers are concentrating their efforts on attacking applications on your
    website. Up to 75% of cyber attacks are launched on shopping carts, forms,
    login pages, dynamic content etc. Firewalls, SSL and locked-down servers are
    futile against web application hacking. Check your website for
    vulnerabilities
    to SQL injection, Cross site scripting and other web attacks before hackers
    do!
    Download Trial at:
    http://www.securityfocus.com/sponsor/pen-test_050831
    ----------------------------------------------------------------------------
    ---
    ------------------------------------------------------------------------------
    Audit your website security with Acunetix Web Vulnerability Scanner: 
    Hackers are concentrating their efforts on attacking applications on your 
    website. Up to 75% of cyber attacks are launched on shopping carts, forms, 
    login pages, dynamic content etc. Firewalls, SSL and locked-down servers are 
    futile against web application hacking. Check your website for vulnerabilities 
    to SQL injection, Cross site scripting and other web attacks before hackers do! 
    Download Trial at:
    http://www.securityfocus.com/sponsor/pen-test_050831
    -------------------------------------------------------------------------------
    

  • Next message: Sol Invictus: "RE: PT Activity duration/time"

    Relevant Pages

    • RE: SQL Smuggling
      ... Its several methods for encoding sql queries or tricking multi layered input validation/sanitisation routines, none of which are new, all of which are implemented by every pen/app tester i have ever worked with. ... of SQL Injection that has not received attention till now. ... As for attacks against signature validation... ... SQL injection attacks against commonly broken data validation routines. ...
      (Bugtraq)
    • Re: SQL Smuggling
      ... of SQL Injection that has not received attention till now. ... "This paper will present a new class of attack, called SQL Smuggling. ... Relying on data validation alone will eventually land you in hot water. ... As for attacks against signature validation... ...
      (Bugtraq)
    • Official release of SQL Power Injector v1.0
      ... SQL Power Injector is a graphical application created in .Net 1.1 that helps the penetrating tester to inject SQL commands on a web page. ... For now it is SQL Server, Oracle and MySQL compliant, but it is possible to use it with any existing DBMS when using the inline injection. ... Up to 75% of cyber attacks are launched on shopping carts, forms, login pages, dynamic content etc. Firewalls, SSL and locked-down servers are futile against web application hacking. ...
      (Pen-Test)
    • RE: [PHP] SQL security
      ... > Doesn't MySQL automatically protect against attacks like SQL ... SQL injection attacks that attempt to terminate the current query and execute ...
      (php.general)
    • Official release of SQL Power Injector 1.2
      ... One of the major improvements is an innovative way to optimize and accelerate the dichotomy in the Blind SQL injection, saving time/number of requests up to 25%. ... Also another great time saver is a new Firefox plugin that will launch SQL Power Injector with all the information of the current webpage with its session context. ... No more time wasted to copy paste the session cookies after you logged... ...
      (Bugtraq)