Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char *argv[]) {
- pid_t pid = fork();
- if(pid == 0) {
- setuid(123);
- seteuid(123);
- ptrace(PT_TRACE_ME, 0, NULL, 0);
- execl("/bin/ls", "/bin/ls", NULL);
- } else if(pid > 0) {
- int status;
- wait(&status);
- printf("Process %d started. Attach now, and click enter.n", pid);
- getchar();
- ptrace(PT_CONTINUE, pid, (caddr_t) 1, 0);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment