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

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

相关推荐
Chengbei118 小时前
SRC报告成稿 Skill(SRC/0day 提交稿、分层验证门、Step 式 PoC、截图铁律)
网络·人工智能·安全·web安全·自动化·系统安全
一只鹿鹿鹿8 小时前
SCM流程图参考(PPT文件)
大数据·数据库·web安全·系统安全·流程图
sbjdhjd9 小时前
PHP eval 型 RCE:flag 正则过滤与通配符绕过实操 | 01
安全·web安全·网络安全·开源·系统安全·php·网络攻击模型
数据知道10 小时前
静态分析入门——PE 结构、字符串、导入表快速定性
网络·安全·web安全·网络安全
蒲公英eric12 小时前
从宽松策略到严格限制:DVWA CSP 绕过模块完整漏洞分析教程
web安全·ai·dvwa·ai安全·csp bypass·csp绕过
慧都小项1 天前
从 Burp Suite Professional 到 DAST:把 Web 安全测试接入持续 AppSec 的工程化路径
测试工具·web安全·网络安全·burp suite
三8441 天前
应急响应之账户排查 + 计划任务排查 + 进程排查
web安全·应急响应·windows账户排查·应急响应linux排查
0xBADCODE1 天前
CTF Writeup 合集
安全·web安全·网络安全·系统安全·密码学·php·ctf
数据知道1 天前
恶意软件分析实验室搭建——沙箱、快照、网络隔离
网络·安全·web安全·网络安全
奔跑的卡卡2 天前
线上Web异常发现为什么总是滞后?一套自研Web实时异常分析监控系统整体架构拆解
前端·web安全·架构