本文整理汇总了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);
}
示例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)
{
//.........这里部分代码省略.........
示例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);
}