V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kindjeff
V2EX  ›  V2EX

一种有趣的安全隐患——界面劫持

  •  1
     
  •   kindjeff · 2017-02-28 21:28:25 +08:00 · 7216 次点击
    这是一个创建于 2613 天前的主题,其中的信息可能已经有所发展或是发生改变。
    这是一个演示链接: https://www.kindjeff.com/static/for_fun/v2ex_0.html

    在这个链接里点击按钮之后,再来看我的 V2EX 主页: https://www.v2ex.com/member/kindjeff

    会发现特别关注了我。思路很简单但是很有效。
    第 1 条附言  ·  2017-03-01 15:10:30 +08:00
    如果 V2EX 网页响应出现了 X-Frame-Options 头,说明站长已经修复啦!
    58 条回复    2017-03-09 19:59:57 +08:00
    eastpiger
        1
    eastpiger  
       2017-02-28 21:30:18 +08:00
    看起来很厉害的样子。

    除了我并没有发现特别关注了你呢
    isCyan
        2
    isCyan  
       2017-02-28 21:34:13 +08:00 via Android
    劫持失败?
    shiny
        3
    shiny  
       2017-02-28 21:34:41 +08:00
    报错了:[Error] Blocked a frame with origin "https://www.v2ex.com" from accessing a frame with origin "https://www.kindjeff.com". Protocols, domains, and ports must match.
    mythabc
        4
    mythabc  
       2017-02-28 21:38:10 +08:00
    iframe 233
    binux
        5
    binux  
       2017-02-28 21:39:06 +08:00
    kankana
        6
    kankana  
       2017-02-28 21:40:52 +08:00
    clickjacking?
    acmetal
        7
    acmetal  
       2017-02-28 21:47:53 +08:00
    V2 应该本来就有防止被 iframe 的 js ,只不过。。。。

    kindjeff
        8
    kindjeff  
    OP
       2017-02-28 21:48:13 +08:00
    @binux 不是的, V2EX 的特别关注链接后面的 t 参数需要是点击者的注册日期~界面劫持其实比这个更简单。
    kindjeff
        9
    kindjeff  
    OP
       2017-02-28 21:49:02 +08:00
    @acmetal 浏览器不错, 23333 。我的 chrome 和同学的 edge 都是一片白。
    wjm2038
        10
    wjm2038  
       2017-02-28 22:07:10 +08:00 via Android
    失败了
    Mutoo
        11
    Mutoo  
       2017-02-28 22:10:51 +08:00
    Anything with <frame> and <iframe>. A site can use the X-Frame-Options header to prevent this form of cross-origin interaction.
    https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy
    also24
        12
    also24  
       2017-02-28 22:13:24 +08:00


    hhhhh 这很机智
    kindjeff
        13
    kindjeff  
    OP
       2017-02-28 22:18:31 +08:00
    之后失败的各位可以回复一下浏览器版本号。以及分辨率……
    成功的也可以回一下。
    nanpuyue
        14
    nanpuyue  
       2017-02-28 22:19:30 +08:00
    有意思。
    imlonghao673
        15
    imlonghao673  
       2017-02-28 22:29:07 +08:00 via Android
    clickhijacking
    几年前看过用来做吸粉的
    whoops
        16
    whoops  
       2017-02-28 22:31:25 +08:00
    @kindjeff chrome 版本 58.0.3018.3 (正式版本) unknown ( 64 位)
    3653x2400
    xxxoooooxx
        17
    xxxoooooxx  
       2017-02-28 22:32:14 +08:00 via Android
    chrome 阻止了第三方 cookie ,没反应
    oott123
        18
    oott123  
       2017-02-28 22:33:35 +08:00   ❤️ 1
    Coxxs
        19
    Coxxs  
       2017-02-28 22:38:17 +08:00
    Clickjacking
    terence4444
        20
    terence4444  
       2017-02-28 22:40:18 +08:00
    Firefox 无效,本来以为是我用了防跨站的 RequestPolicy ,后来把这个插件关了也是一样的。
    terence4444
        21
    terence4444  
       2017-02-28 22:50:51 +08:00
    发现我还禁止了第三方 cookie ,不过这个攻击对于普通浏览器来说,可能是有效的。

    ic2y
        22
    ic2y  
       2017-02-28 23:01:08 +08:00
    无效。 chrome 进行了拦截

    Uncaught DOMException: Blocked a frame with origin "https://www.v2ex.com" from accessing a cross-origin frame.
    x86
        23
    x86  
       2017-02-28 23:03:25 +08:00 via iPhone
    某书上看过例子
    changwei
        24
    changwei  
       2017-02-28 23:06:15 +08:00 via Android
    余弦的书上讲过这种攻击方式
    kxxoling
        25
    kxxoling  
       2017-02-28 23:21:27 +08:00
    osX + Chrome 56 劫持成功。
    billlee
        26
    billlee  
       2017-02-28 23:43:08 +08:00
    r#20 @terence4444 我的 Firefox 并没有拦截啊
    terence4444
        27
    terence4444  
       2017-02-28 23:56:42 +08:00
    @billlee 看上面回复,大概是我装的那两个扩展,我一向对跨站请求和跨站 cookies 很小心。
    billlee
        28
    billlee  
       2017-03-01 00:00:06 +08:00
    r#21 @terence4444 你这个 firefox 扩展是什么?
    terence4444
        29
    terence4444  
       2017-03-01 00:01:22 +08:00 via iPhone   ❤️ 1
    @billlee Cookie Monster + RequestPolicy Continued
    Layne
        30
    Layne  
       2017-03-01 03:11:18 +08:00
    reeder 的内置浏览器,成功关注
    20015jjw
        31
    20015jjw  
       2017-03-01 03:11:32 +08:00 via Android
    android chrome 成功 记得要选 desktop site
    xzpjerry731
        32
    xzpjerry731  
       2017-03-01 05:50:15 +08:00
    缩放 175%后没有效果 (滑稽
    zscself
        33
    zscself  
       2017-03-01 09:05:13 +08:00
    @changwei 我前三章都没看完都知道他书上写过,你猜是为什么。。。
    tabris17
        34
    tabris17  
       2017-03-01 09:09:13 +08:00
    chrome

    Uncaught DOMException: Blocked a frame with origin "https://www.v2ex.com" from accessing a cross-origin frame.
    changwei
        35
    changwei  
       2017-03-01 09:15:42 +08:00 via Android
    @zscself 为什么呀?
    zscself
        36
    zscself  
       2017-03-01 09:23:06 +08:00
    @changwei 因为他写在了第一张(笑)
    ScotGu
        37
    ScotGu  
       2017-03-01 09:28:10 +08:00
    centbrowser 版本 2.3.7.50 (Chromium 55.0.2883.103) 成功。

    Chrome 版本 56.0.2924.87 关闭 uBlock Origin 后 成功。

    测试系统 Win 10
    v2ex.com 必须是登陆状态才有效。
    ieliwb
        38
    ieliwb  
       2017-03-01 09:46:32 +08:00
    osX + Chrome 56 劫持成功 +1
    journey
        39
    journey  
       2017-03-01 10:29:00 +08:00

    win10 1607 + Chrome 56 劫持成功 +1
    有趣
    crossoverJie
        40
    crossoverJie  
       2017-03-01 13:20:56 +08:00
    macos chrome 56 +1
    Livid
        41
    Livid  
    MOD
       2017-03-01 13:31:28 +08:00
    谢谢楼主的提醒 :)
    Izual_Yang
        42
    Izual_Yang  
       2017-03-01 13:38:52 +08:00
    对于 uBlockOrigin 或 uMatrix (或者类似的 noscript 类扩展)用户而言并无卵用
    http://ww1.sinaimg.cn/large/53c2ce22gy1fd7a8c2wm2j20wc07dmzz
    Izual_Yang
        43
    Izual_Yang  
       2017-03-01 13:43:34 +08:00
    更何况就算 uMatrix 放行了,仍然只看到一个空白网页上的按钮,浏览器 console 提示:
    Refused to display 'https://www.v2ex.com/member/kindjeff' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN, SAMEORIGIN'.
    lyragosa
        44
    lyragosa  
       2017-03-01 13:45:32 +08:00
    按钮无法点击

    控制台提示

    Refused to display 'https://www.v2ex.com/member/kindjeff' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN, SAMEORIGIN'.

    Chrome 56.0.2924.87 (64-bit)
    aristotll
        45
    aristotll  
       2017-03-01 13:48:26 +08:00
    chrome 拦截了汗
    paradoxs
        46
    paradoxs  
       2017-03-01 13:52:24 +08:00
    OSX + 56.0.2924.87 (64-bit) 劫持失败
    zhouyg
        47
    zhouyg  
       2017-03-01 14:03:52 +08:00
    确实很有意思
    zpf124
        48
    zpf124  
       2017-03-01 14:10:01 +08:00
    Refused to display 'https://www.v2ex.com/member/kindjeff' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

    Chrome 浏览器识别了 X-Frame-Options 请求头,拒绝载入对应的页面。
    用新版的 edge 和 ie 也是如此。

    我想这个请求头 现代浏览器应该都能识别。
    kindjeff
        49
    kindjeff  
    OP
       2017-03-01 14:42:12 +08:00 via iPhone
    @zpf124 可能站长改过了~~昨天是没有的。
    moonkiller
        50
    moonkiller  
       2017-03-01 14:52:19 +08:00
    你的 button 没法点击啊。。。
    nodeath
        51
    nodeath  
       2017-03-01 15:03:06 +08:00
    这是点击劫持啊,好老的东西了,一般浏览器都会做拦截
    luanluan
        52
    luanluan  
       2017-03-01 15:03:33 +08:00
    这个怎么实现的呢?
    Arrowing
        53
    Arrowing  
       2017-03-01 15:19:48 +08:00
    我弄了之后,被 V2 403 了。。。好久进不来。
    menc
        54
    menc  
       2017-03-01 15:44:33 +08:00
    这不叫界面劫持,叫 click jacking ,很老的东西了
    Felldeadbird
        55
    Felldeadbird  
       2017-03-01 16:12:22 +08:00
    失效了。 a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
    看来是 V2 更新了设置啊
    leots
        56
    leots  
       2017-03-01 18:55:11 +08:00
    完全无法点击.....
    anthozoan77
        57
    anthozoan77  
       2017-03-01 20:46:37 +08:00
    Refused to display 'https://www.v2ex.com/member/kindjeff' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

    虽然无法关注,有意思哈哈。
    tammy
        58
    tammy  
       2017-03-09 19:59:57 +08:00
    没人用 FF 吗,根本没反应啊
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2828 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 11:45 · PVG 19:45 · LAX 04:45 · JFK 07:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.