漏洞挖掘之URL重定向

漏洞挖掘之URL重定向

URL跳转漏洞

业务逻辑:通过以GET或者POST的⽅式接收将要跳转的URL,然后跳转到⽬标URL。
威胁产生:没有对允许跳转的URL做限制。

跳转方式

  • js跳转
  • html的meta标签
  • php的header头跳转
  • Java
  • Django
    ....

漏洞利用

钓鱼网站,可能存在恶意跳转路径

GET请求
在url存在参数链接跳转

POST请求
在提交的参数存在链接,并跳转

漏洞挖掘

哪些业务可能存在跳转

  • 登⼊,登出
  • 404页面
  • 站内广告
  • 跨站点认证、授权
  • 分享内容

可能与跳转相关的URL参数

url
next
redirect
out
view
login
url_redirect
goto
go
backurl
service
backto
redirectsaaspath
path
forwardUrl
forward
redirect
redirect_to
redirect_url
jump
jump_to
target
to
link
linkto
domain

URL限制绕过

利⽤某些⽹站验证不严谨

和CSRF中绕过referer限制类似。

  • 匹配 a.com

http://www.yusy.com/a.com
http://yusya.com

http://a.com.yusy.com

加上xip.io

提供一个DNS解析服务
127.0.0.1.xip.io -> 127.0.0.1
www.aa.com.127.0.0.10.xip.io -> 127.0.0.1
钓鱼攻击,如www.baidu.com.123.123.123.132(你的服务器).xip.io 可能别人认为baidu.com是可信任的,但是却被跳转到你的服务器ip地址



畸形地址绕过

Fuzz

“10”种bypass的⽅式 https://landgrey.me/

  1. 单斜线"/"绕过
    https://www.landgrey.me/redirect.php?url=/www.evil.com
  2. 缺少协议绕过
    https://www.landgrey.me/redirect.php?url=//www.evil.com
  3. 多斜线"/"前缀绕过
    https://www.landgrey.me/redirect.php?url=///www.evil.com
    https://www.landgrey.me/redirect.php?url=////www.evil.com
  4. 利⽤"@"符号绕过
    https://www.landgrey.me/redirect.php?url=https://www.landgrey.me@www.evil.com
  5. 利⽤反斜线""绕过
    https://www.landgrey.me/redirect.php?url=https://www.evil.com\www.landgrey.me
  6. 利⽤"#"符号绕过
    https://www.landgrey.me/redirect.php?url=https://www.evil.com#www.landgrey.me
  7. 利⽤"?"号绕过
    https://www.landgrey.me/redirect.php?url=https://www.evil.com?www.landgrey.me
  8. 利⽤"\"绕过
    https://www.landgrey.me/redirect.php?url=https://www.evil.com\www.landgrey.me
  9. 利⽤"."绕过
    https://www.landgrey.me/redirect.php?url=.evil (可能会跳转到www.landgrey.me.evil域名)
    https://www.landgrey.me/redirect.php?url=.evil.com (可能会跳转到evil.com域名)
  10. 重复特殊字符绕过
    https://www.landgrey.me/redirect.php?url=///www.evil.com//..
    https://www.landgrey.me/redirect.php?url=////www.evil.com//..




SSRF 通过curl发起请求,获取响应内容,载入过程,针对server端
URL 重定向是在页面跳转到其他链接 ,跳出过程,针对客户端client 攻击

posted @ 2020-12-16 19:59  Black-Sweater  阅读(524)  评论(0)    收藏  举报