Re: Microsoft Windows 2000 WebDAV Buffer Overflow Vulnerability

From: Gerardo Richarte (core.lists.pentest@corest.com)
Date: 03/21/03

  • Next message: Gary O'leary-Steele: "Net:telnet exploit"
    Date: Fri, 21 Mar 2003 12:24:56 -0300
    From: Gerardo Richarte <core.lists.pentest@corest.com>
    To: <pen-test@securityfocus.com>
    
    

    Frank Knobbe wrote:

    > However, those same folks said that it is not the LOCK method that is
    > vulnerable, but in fact only the GET method. I heard reports from guys
    > who just couldn't make WebDAV crash with GET, but didn't have a problem
    > with SEARCH and PROPFIND. Personally, I'm wondering if ISS was just
    > spreading misinformation to confuse the potential worm-writers, but I'm
    > not making any such accusation. (Misinformation wouldn't be effective
    > anyway. But then again, neither is holding back the details for a sig,
    > but explaining how it works...:/

        In did, the problem is not in GET nor SEARCH nor LOCK nor any other
    method. AFAIK.

        While writing the exploit, and heavily basing our work on Renaud's nessus script
    (thanks Renaud)

    http://cvs.nessus.org/cgi-bin/cvsweb.cgi/~checkout~/nessus-plugins/scripts/iis_webdav_overflow.nasl

        we found out that the problem is not in the method, it's rather in the embeded SQL sentence:

                ...
                 '<g:sql>\r\n' +
                 'Select "DAV:displayname" from scope()\r\n' +
                 '</g:sql>\r\n' +
                ...

        the function scope() somehow is resolved to the Unicode string
    scope('"c:\inetpub\wwwroot\AAAAAAAAAAAA...
    (I think it's not unicode but rather just wchars, UTF-16, or however it's the official
    name) and this is what's causing the overflow actually... well... I think...
    mmm... let me try something... well... for us, it's not crashing with GET nor
    LOCK nor PROPFIND nor XXX... only with SEARCH, but, I bet the tests
    were too fast to be correct. I'll try again latter today, and if there is any
    change I'll let you know.

        So, being that the problem is present when using an SQL statement calling
    scope() I wonder how many other ways are there to call an SQL statement
    (only SEARCH, or all the other methods also... or does IIS care about the method
    at all?). Is there another vuln function like scope is? [apparently scope is calling
    "strcat()" on a wchar string]. Is there another way to force the problem in
    ntdll.dll without even having to send 64k bytes of data? (and just create an SQL
    statement that will generate 64K of data)... who knows... is the patch correct
    at all? heh, who knows... what's the patch patching?

        more $0.02 to the piggy bank
        gera

    --- for a personal reply use: gera@corest.com

    ----------------------------------------------------------------------------
    Did you know that you have VNC running on your network?
    Your hacker does. Plug your security holes now!
    Download a free 15-day trial of VAM:
    http://www2.stillsecure.com/download/sf_vuln_list.html


  • Next message: Gary O'leary-Steele: "Net:telnet exploit"

    Relevant Pages

    • Re: Functions
      ... the sql statement has access to variables that are ... :> private but within scope. ... package private function which he attempted to call from outside of the ...
      (comp.databases.oracle.misc)
    • Re: Functions
      ... :> private but within scope. ... package private function which he attempted to call from outside of the ... I noted that the sql statement he is building would have access to any ... and indeed even though pl/sql itself has at least one ...
      (comp.databases.oracle.misc)
    • Re: Functions
      ... :> I noted that the sql statement he is building would have access to any ... engine automatically creates and binds for PL/SQL variables in scope. ... :> scope is a limitation of the implementation of the pl/sql language. ...
      (comp.databases.oracle.misc)
    • Re: ID of a newly created record
      ... id of the last inserted record in the current scope... ... > @@identity in the sql statement, but I just can't seem to get it to go. ... > Dim myCommand As new SqlCommand ... > Dim myConnection As New SqlConnection ...
      (microsoft.public.dotnet.framework.adonet)