在UrlScan.ini中使用分号指定字符串

编程入门 行业动态 更新时间:2024-10-26 06:29:36
本文介绍了在UrlScan.ini中使用分号指定字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在IIS 6上使用UrlScan阻止用户代理.但是,我无法在字符串中指定带有分号的用户代理.我认为这是一个非常常见的情况,但是我无法在UrlScan.ini(其中使用分号进行注释)中找到任何有关如何转义分号的答案. 这是规则:

I want to block user-agents with UrlScan on IIS 6. However I am not able to specify a user-agent with a semicolon in the string. I think this is a very common scenario, but I can't find any answer on how to escape a semicolon in UrlScan.ini (where semicolon are used for commenting). This is the rule:

RuleList=DenyUserAgent [DenyUserAgent] DenyDataSection=AgentStrings ScanHeaders=User-Agent [AgentStrings] Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20100101 Firefox/10.0.2

我对其进行了测试,它阻止了所有以"Mozilla/5.0(Windows NT 5.1)"开头的用户代理,因为它会将字符串的其余部分视为注释.

I tested it and it blocks all the user-agents that start with "Mozilla/5.0 (Windows NT 5.1" because it considers the rest of the string as a comment.

推荐答案

似乎您需要对URL进行转义,即%3B

It seems like you would need to URL escape it, i.e. %3B

请参见 learn.iis/page.例如:aspx/476/common-urlscan-scenarios/;他们有一个这样的例子,就是在查询字符串中使用分号来阻止SQL注入攻击

See learn.iis/page.aspx/476/common-urlscan-scenarios/ for examples; one such example they have is blocking semicolon in the querystring to block a SQL injection attack

更多推荐

在UrlScan.ini中使用分号指定字符串

本文发布于:2023-10-27 02:50:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1532084.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分号   字符串   UrlScan   ini

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!