Systemsicherheit/Assignment 5 - Software Security - Teil 1/shellcode/test_shellcode.c

17 lines
390 B
C
Raw Normal View History

#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)();
}