当前位置 主页 > 本站WEB程序 > 安全 > IIS7网站监控 >

    pr劫持怎么做,一般会怎么劫持,pr劫持操作手法

    栏目:IIS7网站监控 时间:2020-12-03 10:01

      了解什么是PR劫持我们才能最有效的防止PR劫持,今天和大家分享系ASP和PHP的PR劫持方法。。。。
      首先是ASP版:x 是我要劫持的pr站
      以下内容为程序代码:
      user_agent = Request.ServerVariables("HTTP_USER_AGENT")
      if user_agent = "Googlebot" then '则判定访问google
      Response.Status = "301 Moved Permanently"
      Response.AddHeader "Location", x/
      end if
      接下来是PHP版:x 是我要劫持的pr站
      以下内容为程序代码:
      if (strstr($_SERVER["HTTP_USER_AGENT"],"Googlebot")) {
      header("HTTP/1.1 301 Moved Permanently"); header("Location: x");
      exit;
      }
      else {
      header("Content-Type: text/html; charset=ISO-8859-1");
      };
      关于PR劫持:
      通过301重定向可以让google误认为重定向的站为当前域名站,故可以将重定向站的PR劫持,使下次PR更新自己的站与指定站PR一致,不过此PR不是真实的PR,就是好看!