【渗透测试-web安全】URL跳转

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/harry_c/article/details/102527067

基本概念

借助未验证的URL跳转,将应用程序引导到不安全的第三方区域,从而导致安全问题。

常见实现方式:

1、设置Header头跳转

~~~php
<?php
header("Content-Type: text/html; charset=utf8")
if(isset($_REQUEST["url"]))
{
	$url = $ REQUESE["url"];
	}else{
	$url = "url.html";
	}
header("HTTP/1.1 301 Moved Permanently");
header("Location: $url");
?>
~~~

2、JavaScript跳转

	// 直接跳转
	window.location.href='index.html';
	
	 // 定时跳转
	setTimeout("javascript:location.href='index.html'", 5000);

3、META标签跳转

~~~html
<head>
    <!--只是刷新不跳转到其他页面 -->
    <meta http-equiv="refresh" content="5">
    <!--定时转到其他页面 -->
    <meta http-equiv="refresh" content="5;url=index.html"> 
</head>
~~~

利用过程

黑客利用常规信任网址构造恶意链接–>用户访问–>服务器、浏览器等解析–>林荫道进入恶意网站–>用户将恶意网站当成正规网站进行相关操作

猜你喜欢

转载自blog.csdn.net/harry_c/article/details/102527067