当前位置: 首页>>代码示例>>C#>>正文


C# Request.ToString方法代码示例

本文整理汇总了C#中IronWASP.Request.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Request.ToString方法的具体用法?C# Request.ToString怎么用?C# Request.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IronWASP.Request的用法示例。


在下文中一共展示了Request.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InjectInRequest

 public Request InjectInRequest(Request Req, int InjectionPoint, string Payload)
 {
     string CurrentRequestHash = Tools.MD5(Req.ToString());
     string XML = "";
     if(this.RequestHash.Equals(CurrentRequestHash))
     {
         XML = this.RequestXml;
     }
     else
     {
         XML = this.ToXmlFromRequest(Req);
         this.RequestXml = XML;
         this.RequestHash = CurrentRequestHash;
     }
     string InjectedXml = InjectInXml(this.RequestXml, InjectionPoint, Payload);
     return this.ToRequestFromXml(Req.GetClone(true), InjectedXml);
 }
开发者ID:kartikeyap,项目名称:IronWASP,代码行数:17,代码来源:FormatPlugin.cs

示例2: CanInterceptBasedOnFilter

        internal static bool CanInterceptBasedOnFilter(Request Req)
        {
            //Check Hostnames
            if (InterceptCheckHostNames)
            {
                if (InterceptCheckHostNamesPlus && InterceptHostNames.Count > 0)
                {
                    bool Match = false;
                    foreach (string HostName in InterceptHostNames)
                    {
                        if (Req.Host.Equals(HostName, StringComparison.InvariantCultureIgnoreCase))
                        {
                            Match = true;
                            break;
                        }
                    }
                    if (!Match)
                    {
                        return false;
                    }
                }
                if (InterceptCheckHostNamesMinus && DontInterceptHostNames.Count > 0)
                {
                    foreach (string HostName in DontInterceptHostNames)
                    {
                        if (Req.Host.Equals(HostName, StringComparison.InvariantCultureIgnoreCase))
                        {
                            return false;
                        }
                    }
                }
            }

            //Check Methods Rule
            if (!InterceptGET)
            {
                if (Req.Method.Equals("GET", StringComparison.CurrentCultureIgnoreCase))
                {
                    return false;
                }
            }
            if (!InterceptPOST)
            {
                if (Req.Method.Equals("POST", StringComparison.CurrentCultureIgnoreCase))
                {
                    return false;
                }
            }
            if (!InterceptOtherMethods)
            {
                if (!(Req.Method.Equals("GET", StringComparison.CurrentCultureIgnoreCase) || Req.Method.Equals("POST", StringComparison.CurrentCultureIgnoreCase)))
                {
                    return false;
                }
            }

            //Check File Extensions
            Req.StoredFile = Req.File;
            if (InterceptCheckFileExtensions && Req.StoredFile.Length > 0)
            {
                if (InterceptCheckFileExtensionsPlus && InterceptFileExtensions.Count > 0)
                {
                    bool Match = false;
                    foreach (string File in InterceptFileExtensions)
                    {
                        if (Req.StoredFile.Equals(File, StringComparison.InvariantCultureIgnoreCase))
                        {
                            Match = true;
                            break;
                        }
                    }
                    if (!Match)
                    {
                        return false;
                    }
                }
                if (InterceptCheckFileExtensionsMinus && DontInterceptFileExtensions.Count > 0)
                {
                    foreach (string File in DontInterceptFileExtensions)
                    {
                        if (Req.StoredFile.Equals(File, StringComparison.InvariantCultureIgnoreCase))
                        {
                            return false;
                        }
                    }
                }
            }

            //Check Keyword
            if (InterceptCheckRequestWithKeyword)
            {
                if (InterceptCheckRequestWithKeywordPlus && InterceptRequestWithKeyword.Length > 0)
                {
                    if (!Req.ToString().Contains(InterceptRequestWithKeyword))
                    {
                        return false;
                    }
                }
                if (InterceptCheckRequestWithKeywordMinus && DontInterceptRequestWithKeyword.Length > 0)
                {
//.........这里部分代码省略.........
开发者ID:herotheo,项目名称:IronWASP,代码行数:101,代码来源:IronProxy.cs

示例3: GetXmlInjectionPointsCount

 public int GetXmlInjectionPointsCount(Request Req)
 {
     this.RequestXml  = this.ToXmlFromRequest(Req);
     this.RequestHash = Tools.MD5(Req.ToString());
     string[,] XmlInjectionArray = XmlToArray(this.RequestXml);
     return XmlInjectionArray.GetLength(0);
 }
开发者ID:kartikeyap,项目名称:IronWASP,代码行数:7,代码来源:FormatPlugin.cs


注:本文中的IronWASP.Request.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。