level04: done
This commit is contained in:
@ -13,7 +13,7 @@ int main(void)
|
||||
|
||||
pid = fork();
|
||||
memset(s, 0, sizeof(s));
|
||||
if (pid) {
|
||||
if (pid) { // parent code
|
||||
do {
|
||||
wait(&wstatus);
|
||||
if (WIFSIGNALED(wstatus) ||
|
||||
@ -23,10 +23,10 @@ int main(void)
|
||||
}
|
||||
} while (ptrace(PTRACE_PEEKUSER, pid, 44, 0) != 11);
|
||||
puts("no exec() for you");
|
||||
kill(pid, 9);
|
||||
} else {
|
||||
prctl(1, 1);
|
||||
ptrace(PTRACE_TRACEME, 0, 0, 0);
|
||||
kill(pid, SIGKILL);
|
||||
} else { // child code
|
||||
prctl(1, PR_SET_PDEATHSIG);
|
||||
ptrace(PTRACE_TRACEME, 0, NULL, NULL);
|
||||
puts("Give me some shellcode, k");
|
||||
gets(s);
|
||||
}
|
||||
|
Reference in New Issue
Block a user