【问题标题】:Creating a full screen iframe创建全屏 iframe
【发布时间】:2011-12-15 17:18:24
【问题描述】:

我目前正在研究 XSS 攻击,目的是在客户端演示中使用它们(我是一名渗透测试人员)。我编写了一个工具,它将托管网站登录页面的恶意版本(收集用户名和密码),然后将受害者重定向回原始网站。但是,我一直在尝试使用 iframe 来让它工作,因为它看起来更有说服力,因为 url 不会改变。

我用谷歌搜索了一下,这似乎是合适的代码:

<iframe src="http://192.168.0.1/login.php" style="border: 0; width: 100%; height: 100%">

但创建的 iframe 绝不是全屏的(在 Internet Explorer 和 Firefox 上)。这是截图

如您所见,iframe 登录页面位于“你叫什么名字?”下方。区域,因此没有接近全屏的地方。我已经尝试编辑恶意登录页面的 css 文件,以包含全屏参数,但这也没有效果。

有人有解决办法吗?谢谢!

【问题讨论】:

    标签: html iframe xss


    【解决方案1】:

    此代码有效:

    <html> 
        <head>
            <style type="text/css">
                body
                {
                    margin:   0;
                    overflow: hidden;
                }
    
                #iframe1
                {
                    height:   100%;
                    left:     0px;
                    position: absolute;
                    top:      0px;
                    width:    100%;
                }
            </style>
        </head>
    
        <body>
            <iframe id="iframe1" src="HERE PLACE YOUR URL" frameborder="0"></iframe>
        </body>
    </html>
    

    【讨论】:

    • 要清楚,对于其他来寻找的人:这里的关键区别是 iframe 上的“frameborder”属性。
    • frameBorder中的B要大写
    【解决方案2】:

    未测试,但试试这个:

    <iframe src="http://192.168.0.1/login.php" style="border: 0; position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%">
    

    或

    <iframe src="http://192.168.0.1/login.php" style="border: 0; position:fixed; top:0; left:0; right:0; bottom:0; width:100%; height:100%">
    

    【讨论】:

    • 感谢您的输入,但不幸的是,他们只是在左上角生成了一个小的 iframe =/
    • 在其中添加width:100%; 和height:100% 怎么样?
    • 啊当然 =) - 第二个使用宽度和高度 =D - 非常感谢!
    • 啊它只适用于Firefox,在Internet Explorer 上它只是在中心附近创建一个大iframe。不过我会继续玩它=)干杯
    • 在发布之前检查你上传的东西,像“未测试”这样的东西根本没有用。
    猜你喜欢
    • 2011-09-03
    • 1970-01-01
    • 2015-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-29
    • 2013-05-11
    • 2015-02-27
    相关资源
    最近更新 更多