Outline - Task 1 & 2

65 Solves

dOh look its a vulnerable flask app! There are 2 flags hidden here. Good luck!

Task 1: Retrieve the flag from its configs

nc c2.lagncrash.com 8002

We noticed that our input is being shown directly above. This might mean a possibility of SSTI as there may be a template engine rendering the template and placing our user input into the page.

From the above output, we can see that {{7*7}} results in 49 and {{7*'7'}} results in 7777777. This means the template engine running is Jinja2, where the challenge has informed us the server is running Flask.

{{ config.items() }} shows us the configuration of the web server which shows us the hidden flag in 'SECRET KEY'.

Task 2(36 solves)

Oh look its a vulnerable flask app! There are 2 flags hidden here. Good luck!

Task 2: /flag seems to have an error... Try accessing as one of the other users!

nc c2.lagncrash.com 8002

After dumping the subclasses, I found the class subprocess.Popen being available to us to launch a process for arbitrary command execution.

We copied the output and get the index of the class subprocess.Popen which is 215.

{{''.__class__.mro()[1].__subclasses__()[215]('ls',shell=True,stdout=-1).communicate()[0].split()}}

{{''.__class__.mro()[1].__subclasses__()[215]('cat app.py',shell=True,stdout=-1).communicate()[0].splitlines()}}

From the above output in app.py, we can find the flag in the application logic, where we are supposed to login as bigboiadmin to obtain the flag.

We found a SHA256 hash function in the code which implies the password is hashed with SHA256.

I first cracked the SHA256 password hash before using the credentials to login and obtained the flag.

Last updated