日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

绕过iframe busting

發布時間:2023/12/16 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 绕过iframe busting 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

最近因為項目的需要,要用iframe網頁里邊嵌入第三方的網站。比如人人網。前端工程師發現這個問題后,我過去看了看,發現是因為人人做了iframe busting。


后來研究了一下,比較好的方式就是當通過http 204來處理這個問題。


通過描述,就知道它的作用是干什么。

The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation. The response MAY include new or updated metainformation in the form of entity-headers, which if present SHOULD be associated with the requested variant.

If the client is a user agent, it SHOULD NOT change its document view from that which caused the request to be sent. This response is primarily intended to allow input for actions to take place without causing a change to the user agent's active document view, although any new or updated metainformation SHOULD be applied to the document currently in the user agent's active view.


所以,在網頁的onbeforeunload加入這段代碼:

var preventBusting = 0;window.onbeforeunload = function() { preventBusting++}setInterval(function() {if (preventBusting > 0) {preventBusting -= 2;window.top.location = 'http://yourwebserver/attacker';}}, 0.5);
如果是apache, 加入下面這段代碼來處理204返回,在alias_module后,

RedirectMatch 204 attacker(.*)$
nginx的話,差不多類似的方式

location = /attacker {return 204;}
測試通過。




總結

以上是生活随笔為你收集整理的绕过iframe busting的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。