github编辑

[极客大挑战 2019]RCE ME

[极客大挑战 2019]RCE ME

考点

  • 无字母数字RCE

  • PHP7参数解析特性

  • 取反bypass代码执行

wp

<?php
error_reporting(0);
if(isset($_GET['code'])){
  $code=$_GET['code'];
  if(strlen($code)>40){
    die("This is too Long.");
  }
  if(preg_match("/[A-Za-z0-9]+/",$code)){
    die("NO.");
  }
  @eval($code);
}else{
  highlight_file(__FILE__);
}

eval的字符串不能出现字母和数字,并且长度不超过40

可以使用取反进行绕过对字符的限制

phpinfo()有disable_functions,考虑使用一句话

蚁剑连接

再绕过disable_functions

小结

最后更新于