大师邦-欢迎您,有难题随时联系在线客服!
通行证 注册 | 登录
关注公众号
访问手机版
IIS 下利用 URL 重写编写****防御规则
[ 编辑:大师邦 | 时间:2021-12-22 20:17:29 | 浏览:1249次 ]
分享到:
  1. <rewrite>

  2.  <rules>

  3.    <clear />

  4.    <!--

  5.        屏蔽低版本IE浏览器

  6.        返回信息:

  7.            终止访问

  8.    -->

  9.    <rule name="Blank bot" enabled="true" stopProcessing="true">

  10.      <match url="(.*)" ignoreCase="true" negate="false" />

  11.      <conditions logicalGrouping="MatchAny" trackAllCaptures="false">

  12.        <add input="{HTTP_USER_AGENT}" pattern="Mozilla/4\.0 \(compatible; MSIE \d.0; Windows NT \d.1(; SV1)?\)" />

  13.      </conditions>

  14.      <action type="AbortRequest" />

  15.    </rule>

  16.    <!--

  17.        屏蔽多蜘蛛标识拼接

  18.        返回信息:

  19.            终止访问

  20.    -->

  21.    <rule name="Blank_Bot_M" stopProcessing="true">

  22.      <match url=".*" />

  23.      <conditions logicalGrouping="MatchAll" trackAllCaptures="false">

  24.        <add input="{HTTP_USER_AGENT}" pattern="Baiduspider" />

  25.        <add input="{HTTP_USER_AGENT}" pattern="Googlebot" />

  26.      </conditions>

  27.      <action type="AbortRequest" />

  28.    </rule>

  29.    <!--

  30.        判断带百度蜘蛛标示的请求(完整UserAgent)是否与官网匹配

  31.        返回信息:

  32.            终止访问

  33.    -->

  34.    <rule name="BaiduSpider" stopProcessing="true">

  35.      <match url=".*" />

  36.      <conditions logicalGrouping="MatchAll" trackAllCaptures="false">

  37.        <add input="{HTTP_USER_AGENT}" pattern="Baiduspider" />

  38.        <add input="{HTTP_USER_AGENT}" pattern="Mozilla/5\.0 \(compatible; Baiduspider(-render)?/2\.0; \+http://www\.baidu\.com/search/spider\.html\)" negate="true" />

  39.      </conditions>

  40.      <action type="AbortRequest" />

  41.    </rule>

  42.    <!--

  43.        match: 判断访问user.php文件的请求

  44.        conditions_1: 来访者UserAgent不为空

  45.        conditions_2: 来访者UserAgent 必须满足正确的Url格式

  46.        返回信息:

  47.            statusDescription: 一串二进制字符,翻译成中文是: 你是傻逼

  48.    -->

  49.    <rule name="No Referer" stopProcessing="true">

  50.        <match url="user.php" />

  51.        <conditions>

  52.            <add input="{HTTP_REFERER}" pattern="^$" negate="true" />

  53.            <add input="{HTTP_REFERER}" pattern="^http(s)?://[0-9a-z-\.]+(/.*)?$" negate="true" />

  54.        </conditions>

  55.        <action type="CustomResponse" statusCode="404" subStatusCode="666" statusReason="may not" statusDescription="111001001011110110100000 111001101001100010101111 111001111000010110011110 111001111010110010010100" />

  56.    </rule>

  57.  </rules>

  58. </rewrite>


上一篇:批量获取网站挂马后的百度收录并提交死链
下一篇:没有了
发布评论
称呼:
验证码:
内容:
用户评价
技术知识更多>>
  • 网站需要收录,搜索引擎提交入口网址分享

    百度:https://ziyuan.baidu.com/  (需登录提交)360:http://info.so.360.cn/site_submit.html (可直接提交)搜狗:http://zhanzhang.sogou.com/index.php/sitelink/index (需登录提交)谷歌:http://www.google.cn/intl/zh-CN/add_url.html (google中国已关闭)移动搜索:头条:https://zhanzhang.toutiao.com/page/inner/site/add (需登录提交)神马:https://zhanzhang.sm..

    浏览量:504次发布时间:2023-03-22
  • ·"URL适配规则"-百度移动适配-url校验不通过的解决..
  • ·购买完美WordPress主题的15+条提示
  • ·为您的WordPress网站使用CDN的5个主要好处
  • ·为什么使用WordPress外贸建站是首要的选择
  • ·8款在WordPress外贸建站时使用的营销工具
  • ·我们接触的搜索引擎工作原理是什么?
  • ·搜索引擎优化SEO这是一种调整网站的方法
  • ·什么是过度SEO?过度优化对网站有什么影响
  • 相关栏目