Oct.19
October 17th, 10pm. Someone on IRC told me they were partaking in a CTF, which I apparently didn’t know was on. The Leetmore (Hackyou) CTF had been running from October 8th, so I had one day to finish it. I decided to see what challenges were avaiable and just have fun. The challenges I did were very easy, RE100 and RE200.
I decided to do a writeup to make up for the lack of content, and while I fix up all my other drafts. Also note, I am trying to find the mirrored files for RE300 so I can finish all of the reverse eningeering challenges, but for now, I only have these two (RE100 and RE200) to write about. Enjoy
RE100 – Open Source
This challenge took a minute or so. Knowledge of C is required. You are given the source code of a program which when given the correct arguements, will compute the keyword for you to submit as the flag. Lets take a look at it:
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
// we need to provide 3 argv's. the first one (argv[0]) is actually the program name, so we start at argv[1]
if (argc != 4) {
printf("what?\n");
exit(1);
}
// argv[1] gets taken as an int using atoi, and it has to match 0xcafe
unsigned int first = atoi(argv[1]);
if (first != 0xcafe) {
printf("you are wrong, sorry.\n");
exit(2);
}
// MATHS
unsigned int second = atoi(argv[2]);
if (second % 5 == 3 || second % 17 != 8) {
printf("ha, you won't get it!\n");
exit(3);
}
// compare argv[3] with h4cky0u
if (strcmp("h4cky0u", argv[3])) {
printf("so close, dude!\n");
exit(4);
}
printf("Brr wrrr grr\n");
// compute our "hash"!
unsigned int hash = first * 31337 + (second % 17) * 11 + strlen(argv[3]) - 1615810207;
// win?
printf("Get your key: ");
printf("%x\n", hash);
return 0;
}


