点击此处获得更好的阅读体验
WriteUp来源
https://dunsp4rce.github.io/csictf-2020/miscellaneous/2020/07/22/Escape-Plan.html
by vishalananth
题目描述
I found a script that solves ciphers, they say it's pretty secure!
题目考点
解题思路
We try out a few commands and we find out that whatever we give as input is getting evaluated in python
using the eval() command. This quite easy to exploit and we try spawning a shell with
1 | __builtins__.__dict__['__import__']('os').__dict__['system']('/bin/sh') |
We get a shell without root privileges, this is quite handy but when we try to read the contents of .git folder, it asks us for root privleges. So I tried some common privilege escalation technqiues but nothing worked. So randomly I tried to print everything in the .git
folder.
1 | cat * |
We get a github url: https://github.com/alias-rahil/crypto-cli, visiting the url and viewing the commit history gives us the flag.
Flag
1 | csictf{2077m4y32_h45_35c4p3d} |