Announcement

Collapse
No announcement yet.

C - Common source code for testing shellcode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • C - Common source code for testing shellcode

    This is one of many examples of a C code skeleton for shellcode testing.

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