Tranquil

Writeup for Tranquil (pwn) - Angstrom CTF (2021) πŸ’œ

Video Walkthrough

VIDEO

Challenge Description

Finally, inner peace - Master Oogway

Source

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int win(){
    char flag[128];

    FILE *file = fopen("flag.txt","r");

    if (!file) {
        printf("Missing flag.txt. Contact an admin if you see this on remote.");
        exit(1);
    }

    fgets(flag, 128, file);

    puts(flag);
}

int vuln(){
    char password[64];

    puts("Enter the secret word: ");

    gets(&password);


    if(strcmp(password, "password123") == 0){
        puts("Logged in! The flag is somewhere else though...");
    } else {
        puts("Login failed!");
    }

    return 0;
}

int main(){
    setbuf(stdout, NULL);
    setbuf(stderr, NULL);

    vuln();

    // not so easy for you!
    // win();

    return 0;
}

Solution

Flag: actf{time_has_gone_so_fast_watching_the_leaves_fall_from_our_instruction_pointer_864f647975d259d7a5bee6e1}

Last updated