Typical SSTI challenges with filters, but what really frustrating is: We are not given any source code.
Description
Author: @congon4tor#2334
Every Capture the Flag competition has to have an obligatory to-do list application, right???
Solution
Once again, we were welcomed with a login prompt. No sign of being able to access using SSTI or SQLi, I created an account and got logged in.
All functions work great, no sign of vulnerabilities when I tried to create, delete, modify the state of the to-do event. The bug here is the success notification:
If I change the content inside the success parameter to {{g}}, I got confirmed that this site is vulnerable to SSTI.
Fuzzing with some special characters, I am given the application's keyword blacklist:
This is the bypass plan for the given blacklist:
Since config is blocked, we can access the built-in functions using other objects (like (), [], "")
eval, exec are blocked, so we need to find way to import os library to be able to execute arbitrary code.
Other keyword block can be bypassed like this:
Since "." is blocked, we can use |attr() to call other methods, classes.
We can hex-encode the file path so other character block is no difficulty for me.
This is the bypass I created following the above plan:
There is a DB folder, and a db.sqlite database inside it. I can quickly grab the flag by calling strings DB/*. (I really wonder why I can not use cat DB/db.sqlite)