V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
chenduoduo
V2EX  ›  问与答

网站被镜像,大佬们有什么方法可以制止?

  •  
  •   chenduoduo · 2018-12-26 12:10:40 +08:00 · 1597 次点击
    这是一个创建于 1946 天前的主题,其中的信息可能已经有所发展或是发生改变。

    有个网站 a.com(php 程序)被镜像了,镜像网站 b.com 实时同步更新我站内容。

    试过很多方法都没有解决问题:

    1、服务器屏蔽 IP、iptables 屏蔽、htaccess 屏蔽都不行,也没有使用泛解析这些的。

    2、使用 js 判断进行跳转,无用。

    3、使用$_SERVER['HTTP_HOST']判断,无用。

    猜测应该是 curl 抓取的,然后把相关的内容给替换了。

    这个镜像站是个菠菜站,一些敏感文字都是用“澳门真人赌场网”字符替换了的。

    所有与我域名相关的,都替换成它的。

    比如 a.com/1.html

    换成 b.com/1.html

    但是却不把这些内容显示出来,而是将加载的 iframe 显示出来。

    镜像站使用了如下 js 代码

    <script> var ss = '<center id="showcloneshengxiaon"><ifr'+'ame scrolling="no" marginheight=0 marginwidth=0 frameborder="0" width="100%" width="14'+'00" height="80'+'50" src="https://www.bf33111.com/1/"></iframe></center>'; eval("do"+"cu"+"ment.wr"+"ite('"+ss+"');"); try{ setInterval(function(){ try{ document.getElementById("div"+"All").style.display="no"+"ne"; }catch(e){} for(var i=0;i<document.body.children.length;i++){ try{ var tagname = document.body.children[i].tagName; var myid = document.body.children[i].id; if(myid!="iconDiv1" && myid!="showcloneshengxiaon"){ // if(tagname!="center"){ document.body.children[i].style.display="non"+"e"; //} } }catch(e){} } },100); }catch(e){} </script>

    不得不说,能想到这些点子的人真的很有头脑。

    请问各位大佬有什么方法可以制止呢?在此谢过。

    7 条回复    2018-12-27 15:59:13 +08:00
    chenduoduo
        1
    chenduoduo  
    OP
       2018-12-26 12:28:26 +08:00
    代码显示出来有点乱,见图
    IceBay
        2
    IceBay  
       2018-12-26 13:27:56 +08:00
    关键词。如何避免被 iframe
    chenduoduo
        3
    chenduoduo  
    OP
       2018-12-26 16:36:52 +08:00
    @IceBay
    没有啊,他并不是 iframe 我的,而是镜像过去后用 js 加载 ifraem 它的,再将我的给隐藏掉。
    IceBay
        4
    IceBay  
       2018-12-26 17:55:45 +08:00
    @chenduoduo #3 55 开头的域名是你的吗。
    chenduoduo
        5
    chenduoduo  
    OP
       2018-12-27 11:35:53 +08:00
    @IceBay
    bf33111 这个是菠菜的
    jiejiss
        6
    jiejiss  
       2018-12-27 15:41:21 +08:00 via Android
    逼急了可以上 html2canvas,在客户端渲染,渲染之前加上一堆判断条件,通过了再渲染。例如鼠标滑动之类的。服务器端做 user agent 筛选,加上 referer 过滤。甚至可以每次访问都检测指定 cookie,如果没有设置就要求重定向跳转到某指定路由,由服务端设置 http-only cookie,再根据 referer 生成 inline js,延时 20ms 跳转回去。js 可以做混淆。curl 绝对吃不消。反正这种手段很多,就是对搜索引擎爬虫不友好,建议服务器端判断符合搜索引擎爬虫的 ua 的时候返回正常页面。
    nfroot
        7
    nfroot  
       2018-12-27 15:59:13 +08:00
    你知道他的 IP 是多少么
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   966 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:39 · PVG 05:39 · LAX 14:39 · JFK 17:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.