php 跳转到指定url_URL跳转漏洞

04cf4dcedf61f2ff77afcd0a0dc51f92.png

描述

URL 跳转漏洞:攻击者通过传入的URL参数,网站未进行检查或过滤不严,导致跳转到恶意网站

e410c0a91493ff249f59cc57cab83ae9.png

挖掘
常见漏洞位置
  • 用户注册、登录、退出

  • 网站链接、点击跳转

  • 用户分享、收藏内容过后、会跳转

  • 网站报错返回跳转

  • ......

常见参数
redirectredirect_toredirect_urlurljumpjump_totargettolinklinktodomainOutDoutgoreturnreturnTologoutregisterloginreturnUrlpathredirectURIredirreturlsharewapsrcsourceudisplaysourceURlimageURLlinkurlRedirectUrlserviceredirect_uridestUrloauth_callbackoauthgoto

来源于P审的:https://www.yuque.com/pmiaowu/web_security_1/pqqgwg

URL跳转一般实现方式:

  • META 标签跳转

  • Javascript 跳转

  • Header 头跳转

  • 超链接跳转

  • ......

META 标签跳转
<meta name="test" content="<?php echo $_GET['url'];?>">
http://127.0.0.1/1.php?url=1;http://baidu.com" http-equiv="refresh&fsearch=yes

6c387241bbec8fae7bae8c6fd5322f2a.png

Javascript 跳转
<script>    window.location.href="<?php  echo $_GET['url'];?>";script>
http://127.0.0.1/1.php?url=http://baidu.com

0fa123a2eaee5c8f65cd667c5b07ad16.png

Header 头跳转
php$url = $_GET['url'];header("Location: $url");?>
http://127.0.0.1/1.php?url=http://baidu.com

fda548da5beb1d2cc1aad4bda0ce7fef.png

超链接跳转
<a href="<?php  echo $_GET['url'];?>">点击返回a>
http://127.0.0.1/1.php?url=http://baidu.com

6b8fcc2f3993edfc68d8f0b764248031.png

遇到过的奇葩跳转

1、校验目录

http://test.com/login/?url=http://baidu.com/login

在挖专属的时候碰到一个校验目录的URL跳转,只要带有 login 就可以绕过

2、需要登录

http://test.com/?url=http://baidu.com

在做项目的时候,发现在登录的情况下会跳转到百度,不登录的情况就会提示 url 参数非法

登录处小技巧

登录:http://test.com/login/?url=http://baidu.com

退出:http://test.com/logout/?url=http://baidu.com

尝试把 login 改为 logout 可能有惊喜哦

白盒一些代码
Java:response.sendRedirect(request.getParameter("url"));PHP:$redirect_url = $_GET['url'];header("Location: " . $redirect_url);.NET:string redirect_url = request.QueryString["url"];Response.Redirect(redirect_url);Django:redirect_url = request.GET.get("url")HttpResponseRedirect(redirect_url)Flask:redirect_url = request.form['url']redirect(redirect_url)Rails:redirect_to params[:url]

来源于:https://ninjia.gitbook.io/secskill/web/url

Bypass

@ 绕过

http://test.com/?url=http://test.com@baidu.com

?绕过

http://test.com/?url=http://baidu.com?test.com

. 绕过

http://test.com/?url=http://test.com.baidu.com

# 绕过

http://test.com/?url=http://baidu.com#test.com

hpp 绕过

http://test.com/?url=http://test.com&url=http://baidu.com

进制 绕过

http://test.com/?url=http://664552783

IP转换:https://ip.911cha.com/baidu.com.html

......

参考:

https://www.yuque.com/pmiaowu/web_security_1/pqqgwg

https://ninjia.gitbook.io/secskill/web/url

无奖问答

8e6ca51daf629cf5c3bcd1711daf15d7.png

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值