Guest User

Untitled

a guest
May 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. int main(int argc, char *argv[]) {
  2. pid_t pid = fork();
  3. if(pid == 0) {
  4. setuid(123);
  5. seteuid(123);
  6. ptrace(PT_TRACE_ME, 0, NULL, 0);
  7. execl("/bin/ls", "/bin/ls", NULL);
  8. } else if(pid > 0) {
  9. int status;
  10. wait(&status);
  11.  
  12. printf("Process %d started. Attach now, and click enter.n", pid);
  13. getchar();
  14.  
  15. ptrace(PT_CONTINUE, pid, (caddr_t) 1, 0);
  16. }
  17.  
  18. return 0;
  19. }
Add Comment
Please, Sign In to add comment