Created
January 20, 2019 15:29
-
-
Save AdityaChaudhary/e0400bd5546c78e8181c2e6bf548758c to your computer and use it in GitHub Desktop.
C program to test the Egg Hunter shellcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<string.h> | |
#define EGG "\x90\x50\x90\x50" | |
unsigned char egghunter[] = \ | |
"\x31\xc0\x89\xc7\xbf" | |
EGG | |
"\x66\x81\xca\xff\x0f\x42\x60\x8d\x5a\x04\xb0\x21\xcd\x80\x3c\xf2\x61\x74\xed\x39\x3a\x75\xee\x39\x7a\x04\x75\xe9\xff\xe2"; | |
unsigned char shellcode[] = \ | |
EGG EGG | |
"<shell_code_here>"; | |
main() | |
{ | |
printf("Egghunter Length: %d\n", strlen(egghunter)); | |
printf("Shellcode Length: %d\n", strlen(shellcode)); | |
int (*ret)() = (int(*)())egghunter; | |
ret(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment