Shellcode validation via C pointer

Categories: Uncategorized

C snippet to test the shellcode

replace your shellcode with your custom payload

 

char shellcode[] = "\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc";

int main(int argc, char **argv){
        int (*target)();
        target = (int(*)())shellcode;
        (int)(*target)();
}

compile options

gcc shellcode.c -o shellcode  -fno-stack-protector -z execstack
gdb ./shellcode

 

«
»

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.