16 lines
390 B
C
16 lines
390 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
// gcc -o test_shellcode -m32 -fno-stack-protector -fno-pie -z execstack -O0 test_shellcode.c
|
|
|
|
// Your shellcode goes here
|
|
char *shellcode = "\x90\x90\x90...";
|
|
// ------------------------
|
|
|
|
int main()
|
|
{
|
|
// Print length of shellcode
|
|
fprintf(stdout,"Length: %d\n",strlen(shellcode));
|
|
// Execute shellcode
|
|
(*(void (*)()) shellcode)();
|
|
}
|