-
-
Save maliciousgroup/2293d0655b0dd2d4bdf056abc36417c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* phoenix/stack-one, by https://exploit.education | |
* | |
* The aim is to change the contents of the changeme variable to 0x496c5962 | |
* | |
* Did you hear about the kid napping at the local school? | |
* It's okay, they woke up. | |
* | |
*/ | |
#include <err.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#define BANNER \ | |
"Welcome to " LEVELNAME ", brought to you by https://exploit.education" | |
int main(int argc, char **argv) { | |
struct { | |
char buffer[64]; | |
volatile int changeme; | |
} locals; | |
printf("%s\n", BANNER); | |
if (argc < 2) { | |
errx(1, "specify an argument, to be copied into the \"buffer\""); | |
} | |
locals.changeme = 0; | |
strcpy(locals.buffer, argv[1]); | |
if (locals.changeme == 0x496c5962) { | |
puts("Well done, you have successfully set changeme to the correct value"); | |
} else { | |
printf("Getting closer! changeme is currently 0x%08x, we want 0x496c5962\n", | |
locals.changeme); | |
} | |
exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment