欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 锐评 > DVWA-Open HTTP Redirect

DVWA-Open HTTP Redirect

2024/10/24 22:18:19 来源:https://blog.csdn.net/weixin_45436292/article/details/139352069  浏览:    关键词:DVWA-Open HTTP Redirect

重定向漏洞

Low

点击Quote 1,burp抓包到
在这里插入图片描述
发现redirect传递参数,观察后端代码。
页面重定向到redirect传进来的参数,并且没有做任何过滤,可以通过修改redirect,将页面重定向到任何页面。
GET /vulnerabilities/open_redirect/source/low.php?redirect=https://www.baidu.com HTTP/1.1将页面重定向到https://www.baidu.com

<?phpif (array_key_exists ("redirect", $_GET) && $_GET['redirect'] != "") {header ("location: " . $_GET['redirect']);exit;
}http_response_code (500);
?>
<p>Missing redirect target.</p>
<?php
exit;
?>

Medium

观察后端代码,发现后端对redirect进行了过滤,如果以http://或者https://开头则返回500响应码,并终止运行。

<?phpif (array_key_exists ("redirect", $_GET) && $_GET['redirect'] != "") {if (preg_match ("/http:\/\/|https:\/\//i", $_GET['redirect'])) {http_response_code (500);?><p>Absolute URLs not allowed.</p><?phpexit;} else {header ("location: " . $_GET['redirect']);exit;}
}http_response_code (500);
?>
<p>Missing redirect target.</p>
<?php
exit;
?>

High

观察后端代码,检测redirect参数中是否包含info.php,包含的话才重定向。只能重定向到info.php页面。

<?phpif (array_key_exists ("redirect", $_GET) && $_GET['redirect'] != "") {if (strpos($_GET['redirect'], "info.php") !== false) {header ("location: " . $_GET['redirect']);exit;} else {http_response_code (500);?><p>You can only redirect to the info page.</p><?phpexit;}
}http_response_code (500);
?>
<p>Missing redirect target.</p>
<?php
exit;
?>

Impossible

观察后端代码,重定向到指定页面,无法修改。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com