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


C# Request.GetHeadersAsString方法代码示例

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


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

示例1: Highlight

        public static string Highlight(Request Req, List<string> ToHighlight)
        {
            string ReqHeader = Req.GetHeadersAsString();
            string Body = Req.BodyString;

            ReqHeader = InsertHighlights(ReqHeader, ToHighlight);
            Body = InsertHighlights(Body, ToHighlight);

            StringBuilder SB = new StringBuilder();
            SB.Append(SnipHeaderSection(ReqHeader));
            SB.AppendLine(); SB.AppendLine();
            SB.Append(SnipBodySection(Body));

            return SB.ToString();
        }
开发者ID:0ks3ii,项目名称:IronWASP,代码行数:15,代码来源:Highlighter.cs

示例2: UpdateScan

 internal static void UpdateScan(int ScanID, Request Req, string Status, string InjectionPoints, string FormatPlugin, string ScanPlugins, string SessionPlugin)
 {
     using(SQLiteConnection DB = new SQLiteConnection("data source=" + IronProjectFile))
     {
     DB.Open();
         using(SQLiteCommand Cmd = DB.CreateCommand())
         {
         Cmd.CommandText = "UPDATE ScanQueue SET [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] WHERE [email protected]";
         Cmd.Parameters.AddWithValue("@ScanID", ScanID);
         Cmd.Parameters.AddWithValue("@RequestHeaders", Req.GetHeadersAsString());
         if(Req.IsBinary)
             Cmd.Parameters.AddWithValue("@RequestBody", Req.BinaryBodyString);
         else
             Cmd.Parameters.AddWithValue("@RequestBody", Req.BodyString);
         Cmd.Parameters.AddWithValue("@BinaryRequest", AsInt(Req.IsBinary));
         Cmd.Parameters.AddWithValue("@Status", Status);
         Cmd.Parameters.AddWithValue("@Method", Req.Method);
         Cmd.Parameters.AddWithValue("@URL", Req.FullUrl);
         Cmd.Parameters.AddWithValue("@SessionPlugin", SessionPlugin);
         Cmd.Parameters.AddWithValue("@InjectionPoints", InjectionPoints);
         Cmd.Parameters.AddWithValue("@FormatPlugin", FormatPlugin);
         Cmd.Parameters.AddWithValue("@ScanPlugins", ScanPlugins);
         Cmd.ExecuteNonQuery();
         }
     }
 }
开发者ID:0ks3ii,项目名称:IronWASP,代码行数:26,代码来源:IronDB.cs

示例3: CreateScan

 internal static void CreateScan(int ScanID, Request Req)
 {
     using(SQLiteConnection DB = new SQLiteConnection("data source=" + IronProjectFile))
     {
     DB.Open();
     using (SQLiteCommand Cmd = DB.CreateCommand())
     {
         Cmd.CommandText = "INSERT INTO ScanQueue (ScanID, RequestHeaders, RequestBody, BinaryRequest, Status, Method, URL) VALUES (@ScanID, @RequestHeaders, @RequestBody, @BinaryRequest, @Status, @Method, @URL)";
         Cmd.Parameters.AddWithValue("@ScanID", ScanID);
         Cmd.Parameters.AddWithValue("@RequestHeaders", Req.GetHeadersAsString());
         if (Req.IsBinary)
             Cmd.Parameters.AddWithValue("@RequestBody", Req.BinaryBodyString);
         else
             Cmd.Parameters.AddWithValue("@RequestBody", Req.BodyString);
         Cmd.Parameters.AddWithValue("@BinaryRequest", AsInt(Req.IsBinary));
         Cmd.Parameters.AddWithValue("@Status", "Not Started");
         Cmd.Parameters.AddWithValue("@Method", Req.Method);
         Cmd.Parameters.AddWithValue("@URL", Req.FullUrl);
         Cmd.ExecuteNonQuery();
     }
     }
     //CreateScan(ScanID, Req, "Not Started", "", "", "", "");
 }
开发者ID:0ks3ii,项目名称:IronWASP,代码行数:23,代码来源:IronDB.cs

示例4: LogMTRequest

 internal static void LogMTRequest(Request Request)
 {
     using (SQLiteConnection MT_DB = new SQLiteConnection("data source=" + TestLogFile))
     {
         MT_DB.Open();
         using (SQLiteCommand Cmd = MT_DB.CreateCommand())
         {
             Cmd.CommandText = "INSERT INTO TestLog (ID, SSL, HostName, Method, URL, File, Parameters, RequestHeaders, RequestBody, BinaryRequest, Notes) VALUES (@ID, @SSL, @HostName, @Method, @URL, @File, @Parameters, @RequestHeaders, @RequestBody, @BinaryRequest, @Notes)";
             Cmd.Parameters.AddWithValue("@ID", Request.ID);
             Cmd.Parameters.AddWithValue("@SSL", AsInt(Request.SSL));
             Cmd.Parameters.AddWithValue("@HostName", Request.Host);
             Cmd.Parameters.AddWithValue("@Method", Request.Method);
             Cmd.Parameters.AddWithValue("@URL", Request.URL);
             Cmd.Parameters.AddWithValue("@File", Request.File);
             Cmd.Parameters.AddWithValue("@Parameters", Request.GetParametersString());
             //Cmd.Parameters.AddWithValue("@RequestHeaders", Request.GetHeadersAsStringWithoutFullURL());
             Cmd.Parameters.AddWithValue("@RequestHeaders", Request.GetHeadersAsString());
             if (Request.IsBinary)
                 Cmd.Parameters.AddWithValue("@RequestBody", Request.BinaryBodyString);
             else
                 Cmd.Parameters.AddWithValue("@RequestBody", Request.BodyString);
             //Cmd.Parameters.AddWithValue("@RequestBody", Request.BodyString);
             Cmd.Parameters.AddWithValue("@BinaryRequest", AsInt(Request.IsBinary));
             Cmd.Parameters.AddWithValue("@Notes", "Some Notes");
             Cmd.ExecuteNonQuery();
         }
     }
 }
开发者ID:0ks3ii,项目名称:IronWASP,代码行数:28,代码来源:IronDB.cs

示例5: GetRequestTriggerHighlighting

        public static string GetRequestTriggerHighlighting(string Trigg, Request Req)
        {
            StringBuilder SB = new StringBuilder();
            string ReqHeader = Req.GetHeadersAsString();
            string ReqBody = Req.BodyString;

            List<string> AllTriggerVariations = new List<string>();
            AllTriggerVariations.Add(Trigg);
            if (!AllTriggerVariations.Contains(Request.PathPartEncode(Trigg))) AllTriggerVariations.Add(Request.PathPartEncode(Trigg));
            if (!AllTriggerVariations.Contains(QueryParameters.Encode(Trigg))) AllTriggerVariations.Add(QueryParameters.Encode(Trigg));
            if (!AllTriggerVariations.Contains(CookieParameters.Encode(Trigg))) AllTriggerVariations.Add(CookieParameters.Encode(Trigg));
            if (!AllTriggerVariations.Contains(HeaderParameters.Encode(Trigg))) AllTriggerVariations.Add(HeaderParameters.Encode(Trigg));

            try
            {
                List<string> HeaderAdjustments = GetHeaderVariations(Trigg, Req.Headers, ReqHeader);
                foreach (string HA in HeaderAdjustments)
                {
                    if (!AllTriggerVariations.Contains(HA))
                    {
                        AllTriggerVariations.Add(HA);
                    }
                }
            }
            catch { }

            List<string> HeaderTriggerVariations = new List<string>();

            foreach (string CurrentVariation in AllTriggerVariations)
            {
                if (!HeaderTriggerVariations.Contains(CurrentVariation) && ReqHeader.Contains(CurrentVariation))
                {
                    HeaderTriggerVariations.Add(CurrentVariation);
                }
            }
            ReqHeader = Highlighter.InsertHighlights(ReqHeader, HeaderTriggerVariations);

            ReqBody = GetRequestBodyHighlighting(ReqBody, Trigg);
            if (!ReqHeader.Contains("<i<hlg>>") && !ReqBody.Contains("<i<hlg>>"))
            {
                foreach (string TriggLine in Tools.SplitLines(Trigg))
                {
                    ReqBody = GetRequestBodyHighlighting(ReqBody, TriggLine);
                }
            }

            SB.Append(Highlighter.SnipHeaderSection(ReqHeader).TrimEnd());
            SB.AppendLine(); SB.AppendLine();
            SB.Append(Highlighter.SnipBodySection(ReqBody));
            return SB.ToString().Replace("\n", "<i<br>>");
        }
开发者ID:0ks3ii,项目名称:IronWASP,代码行数:51,代码来源:Finding.cs

示例6: IsSame

 public static bool IsSame(Request A, Request B)
 {
     try
     {
         if (!A.GetHeadersAsString().Equals(B.GetHeadersAsString())) return false;
         if (A.BodyLength != B.BodyLength) return false;
         for (int i = 0; i < A.BodyLength; i++)
         {
             if (A.BodyArray[i] != B.BodyArray[i]) return false;
         }
     }
     catch { return false; }
     return true;
 }
开发者ID:herotheo,项目名称:IronWASP,代码行数:14,代码来源:Request.cs


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