kindjeff
V2EX  ›  V2EX

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

  •  1
     
  •   kindjeff · Feb 28, 2017 · 8670 views
    This topic created in 3548 days ago, the information mentioned may be changed or developed.
    这是一个演示链接: https://www.kindjeff.com/static/for_fun/v2ex_0.html

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

    会发现特别关注了我。思路很简单但是很有效。
    Supplement 1  ·  Mar 1, 2017
    如果 V2EX 网页响应出现了 X-Frame-Options 头,说明站长已经修复啦!
    58 replies  •  2017-03-09 19:59:57 +08:00
    eastpiger
    eastpiger
    Feb 28, 2017
    1
    看起来很厉害的样子。

    除了我并没有发现特别关注了你呢
    isCyan
    isCyan
    Feb 28, 2017 via Android
    2
    劫持失败?
    shiny
    shiny
    Feb 28, 2017
    3
    报错了:[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
    mythabc
    Feb 28, 2017
    4
    iframe 233
    binux
    binux
    Feb 28, 2017
    5
    kankana
    kankana
    Feb 28, 2017
    6
    clickjacking?
    acmetal
    acmetal
    Feb 28, 2017
    7
    V2 应该本来就有防止被 iframe 的 js ,只不过。。。。

    kindjeff
    kindjeff
    OP
    Feb 28, 2017
    8
    @binux 不是的, V2EX 的特别关注链接后面的 t 参数需要是点击者的注册日期~界面劫持其实比这个更简单。
    kindjeff
    kindjeff
    OP
    Feb 28, 2017
    9
    @acmetal 浏览器不错, 23333 。我的 chrome 和同学的 edge 都是一片白。
    wjm2038
    wjm2038
    Feb 28, 2017 via Android
    10
    失败了
    Mutoo
    Mutoo
    Feb 28, 2017
    11
    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
    also24
    Feb 28, 2017
    12


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

    ic2y
    ic2y
    Feb 28, 2017
    22
    无效。 chrome 进行了拦截

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

    Uncaught DOMException: Blocked a frame with origin "https://www.v2ex.com" from accessing a cross-origin frame.
    changwei
    changwei
    Mar 1, 2017 via Android
    35
    @zscself 为什么呀?
    zscself
    zscself
    Mar 1, 2017
    36
    @changwei 因为他写在了第一张(笑)
    ScotGu
    ScotGu
    Mar 1, 2017
    37
    centbrowser 版本 2.3.7.50 (Chromium 55.0.2883.103) 成功。

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

    测试系统 Win 10
    v2ex.com 必须是登陆状态才有效。
    ieliwb
    ieliwb
    Mar 1, 2017
    38
    osX + Chrome 56 劫持成功 +1
    journey
    journey
    Mar 1, 2017
    39

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

    控制台提示

    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
    aristotll
    Mar 1, 2017
    45
    chrome 拦截了汗
    paradoxs
    paradoxs
    Mar 1, 2017
    46
    OSX + 56.0.2924.87 (64-bit) 劫持失败
    zhouyg
    zhouyg
    Mar 1, 2017
    47
    确实很有意思
    zpf124
    zpf124
    Mar 1, 2017
    48
    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
    kindjeff
    OP
    Mar 1, 2017 via iPhone
    49
    @zpf124 可能站长改过了~~昨天是没有的。
    moonkiller
    moonkiller
    Mar 1, 2017
    50
    你的 button 没法点击啊。。。
    nodeath
    nodeath
    Mar 1, 2017
    51
    这是点击劫持啊,好老的东西了,一般浏览器都会做拦截
    luanluan
    luanluan
    Mar 1, 2017
    52
    这个怎么实现的呢?
    Arrowing
    Arrowing
    Mar 1, 2017
    53
    我弄了之后,被 V2 403 了。。。好久进不来。
    menc
    menc
    Mar 1, 2017
    54
    这不叫界面劫持,叫 click jacking ,很老的东西了
    Felldeadbird
    Felldeadbird
    Mar 1, 2017
    55
    失效了。 a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
    看来是 V2 更新了设置啊
    leots
    leots
    Mar 1, 2017
    56
    完全无法点击.....
    anthozoan77
    anthozoan77
    Mar 1, 2017
    57
    Refused to display 'https://www.v2ex.com/member/kindjeff' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

    虽然无法关注,有意思哈哈。
    tammy
    tammy
    Mar 9, 2017
    58
    没人用 FF 吗,根本没反应啊
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2218 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 156ms · UTC 14:04 · PVG 22:04 · LAX 06:04 · JFK 09:04
    ♥ Do have faith in what you're doing.