邪恶八进制信息安全团队技术讨论组's Archiver

冰血封情 2005-1-7 22:35

[转载]Socket unreacheable in Amp II engine

信息来源:[url]www.securityfocus.com[/url]

Luigi Auriemma

Application: Amp II 3D engine
[url]http://www.4drulers.com/amp.html[/url]
Versions: any version since there is no patch available
Games: Gore: Ultimate Soldier <= 1.50
... possibly others ...
Platforms: Windows
Bug: socket unreacheable
Exploitation: remote, versus server
Date: 06 Jan 2005
Author: Luigi Auriemma
e-mail: aluigi autistici org
web: [url]http://aluigi.altervista.org[/url]


#######################################################################


1) Introduction
2) Bug
3) The Code
4) Fix


#######################################################################

===============
1) Introduction
===============


The Amp II engine is a game engine developed by 4d Rules
([url]http://www.4drulers.com[/url]) and Slam Software
([url]http://www.slamsoftware.com[/url]).
The only game released using this engine seems to be Gore
([url]http://www.4drulers.com/gore/[/url]) dated June 2002.


#######################################################################

======
2) Bug
======


The code used by the engine to handle UDP packets is similar to the
following:

if(select(sock, &read_set, NULL, NULL, &timeout_zero)
< 0) socket_error();
...
if(ioctlsocket(sock, FIONREAD, &packet_length)
< 0) socket_error();
if(packet_length) {
// read socket data
}

The problem is just in the if(packet_length) check (meaning "if
packet_length is different than zero") because FIONREAD is used to
retrieve the size of the first packet in the socket&#39;s queue so if an
attacker sends an UDP packet of zero bytes to the server, packet_length
will continue to be equal to zero and the if(packet_length) check will
be messed entering in an infinite loop that will handle ever the same
empty UDP packet but without reading its content and freeing the
socket&#39;s queue.

In short, an UDP packet of zero bytes is able to silently interrupt the
match on the server.


#######################################################################

===========
3) The Code
===========


[url]http://aluigi.altervista.org/poc/amp2zero.zip[/url]


#######################################################################

======
4) Fix
======


The Amp II engine is no longer supported and probably will be released
a patch for Gore in future.


#######################################################################


---
Luigi Auriemma
[url]http://aluigi.altervista.org[/url]

页: [1]
© 1999-2008 EvilOctal Security Team