Impossible Level

查看源码

<?php

// The page we wish to display
$file = $_GET[ 'page' ];

// Only allow include.php or file{1..3}.php
if( $file != "include.php" && $file != "file1.php" && $file != "file2.php" && $file != "file3.php" ) {
    // This isn't the page we want!
    echo "ERROR: File not found!";
    exit;
}

?>

可以看到,Impossible级别的代码使用了白名单机制进行防护,简单粗暴,page参数必须为“include.php”、“file1.php”、“file2.php”、“file3.php”之一,彻底杜绝了文件包含漏洞。

 

参考:https://www.freebuf.com/articles/web/119150.html

相关文章:

  • 2021-04-17
  • 2021-08-22
  • 2022-12-23
  • 2021-06-19
  • 2021-12-19
  • 2021-12-17
  • 2021-07-03
  • 2022-12-23
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
  • 2021-12-23
  • 2021-11-06
  • 2021-05-29
相关资源
相似解决方案