Phoenix exploit education heap-one
Heap one Second exercice heap de la suite Phoenix exploit education. Débordement de mémoire et falsification d’adresse.
Le source /* * phoenix/heap-zero, by https://exploit.education * * Can you hijack flow control? * * Which vegetable did Noah leave off the Ark? * Leeks */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #define BANNER \ "Welcome to " LEVELNAME ", brought to you by https://exploit.education" struct heapStructure { int priority; char *name; }; int main(int argc, char **argv) { struct heapStructure *i1, *i2; i1 = malloc(sizeof(struct heapStructure)); i1->priority = 1; i1->name = malloc(8); i2 = malloc(sizeof(struct heapStructure)); i2->priority = 2; i2->name = malloc(8); strcpy(i1->name, argv[1]); strcpy(i2->name, argv[2]); printf("and that's a wrap folks!