Systemsicherheit/Assignment 5 - Software Security - Teil 1/shellcode/test_shellcode.c
2024-06-08 18:13:36 +02:00

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