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

php 复制代码
<?php

if (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响应码,并终止运行。

php 复制代码
<?php

if (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>
		<?php
		exit;
	} else {
		header ("location: " . $_GET['redirect']);
		exit;
	}
}

http_response_code (500);
?>
<p>Missing redirect target.</p>
<?php
exit;
?>

High

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

php 复制代码
<?php

if (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>
		<?php
		exit;
	}
}

http_response_code (500);
?>
<p>Missing redirect target.</p>
<?php
exit;
?>

Impossible

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

相关推荐
kali-Myon4 小时前
2025春秋杯网络安全联赛冬季赛-day2
python·安全·web安全·ai·php·pwn·ctf
独行soc4 小时前
2026年渗透测试面试题总结-19(题目+回答)
android·网络·安全·web安全·渗透测试·安全狮
kali-Myon5 小时前
2025春秋杯网络安全联赛冬季赛-day1
java·sql·安全·web安全·ai·php·web
kali-Myon5 小时前
2025春秋杯网络安全联赛冬季赛-day3
python·安全·web安全·ai·php·web·ctf
迎仔6 小时前
05-AI与网络安全
人工智能·安全·web安全
临水逸7 小时前
一次路径穿越漏洞引发的NAS安全危机:飞牛fnOS漏洞深度剖析与用户自救指南
网络·安全·web安全
JMchen1238 小时前
Android网络安全实战:从HTTPS到双向认证
android·经验分享·网络协议·安全·web安全·https·kotlin
hzb666668 小时前
unictf2026
开发语言·javascript·安全·web安全·php
Binary-Jeff14 小时前
一文读懂 HTTPS 协议及其工作流程
网络协议·web安全·http·https
lingggggaaaa20 小时前
安全工具篇&动态绕过&DumpLsass凭据&Certutil下载&变异替换&打乱源头特征
学习·安全·web安全·免杀对抗