GKCTF web wp

cve版签到

hint:cve-2020-7066

名称 CVE-2020-7066
描述 在低于7.2.29的PHP版本7.2.x,低于7.3.16的7.3.x和低于7.4.4的7.4.x中,将get_headers()与用户提供的URL一起使用时,如果URL包含零(\ 0)字符,则URL将被静默地截断。这可能会导致某些软件对get_headers()的目标做出错误的假设,并可能将某些信息发送到错误的服务器。

?url=http://www.ctfhub.com

You just view *.ctfhub.com 也就是要ctfhub.com结尾。

\0好像不行,用%00截断。访问?url=http://127.0.0.1%00.ctfhub.com

[4] => Tips: Host must be end with '123'

把最后127.0.0.1改成127.0.0.123 出flag

老八小超市儿

进来先感叹一下这个做的真好。百度一下居然还有这个电商模板。

直接百度搜索shopxo漏洞,参考[http://www.nctry.com/1660.html]

过程不赘述了,上传小马,蚁剑连进去。

注意里面有个错误,马的路径是/public/static/index/default/1.php

进去以后,有个flag,是假的,说在Root里面,但是root没权限

flag.hint好像也没什么用。这时看到一个标红的auto.sh。想改一下里面的60s改少,发现改不了。是root权限才能改。说明这个是root权限文件.

#!/bin/sh
while true; do (python /var/mail/makeflaghint.py &) && sleep 60; done

跟着路径找到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()

time ctime() 函数把一个时间戳(按秒计算的浮点数)转化为time.asctime()的形式。中间无参数时,默认参数是time.time()

这里就是写一点东西到/flag.hint里面。这个是root权限控制的py文件,那么这个也有root权限。那我们用这文件read flag然后write到flag.hint里面。
在中间插入
a=io.open("/root/flag","rb+")
b=a.read()
f.write(b)

然后去flag.hint里面就有flag了

猜你喜欢

转载自www.cnblogs.com/vstar-o/p/12962055.html