Bugku-CTF-WEB5

$num=$_GET['num'];
if(!is_numeric($num))
{
echo $num;
if($num==1)
echo 'flag{**********}';
}

分析代码,

get传参,?num=

用到了PHP的is_numeric()的函数,    如果指定的变量是数字和数字字符串则返回 TRUE,否则返回 FALSE,注意浮点型返回空值,即 FALSE。

也就是不能传入数字和数字字符串,

在php中判断数字相等时,会把字符串转换为数字来必较

?num=1a,即可拿到flag

另一种办法 ,逻辑矛盾

?num=1 and 1=1

并不是很理解这种办法

原文地址:https://www.cnblogs.com/yunhai666/p/14759379.html