This is one of many examples of a C code skeleton for shellcode testing.
It should be compiled with something like this if you need an executable stack:
Note that I did not make it. The author is unknown.
Code:
#include<stdio.h> #include<string.h> unsigned char code[] = \ "<shellcode goes here>"; void main() { int (*ret)() = (int(*)())code; ret(); }
gcc -fno-stack-protector -z execstack shellcode.c -o shellcode