public void Add(string RequestTrigger, string RequestTriggerDescription, Request Req) { if (Req != null) { Trigger T = new Trigger(RequestTrigger, RequestTriggerDescription, Req); this.TriggerList.Add(T); } }
public void Add(string RequestTrigger, string RequestTriggerDescription, Request Req, string ResponseTrigger, string ResponseTriggerDescription, Response Res) { if (Req != null || Res != null) { Trigger T = new Trigger(RequestTrigger, RequestTriggerDescription, Req, ResponseTrigger, ResponseTriggerDescription, Res); this.TriggerList.Add(T); } }
internal static void DisplayPluginResultsTrigger(int TriggerID) { ResetPluginResultsFields(); Trigger SelectedTrigger; if (TriggerID == -1) { if (Finding.CurrentPluginResult.BaseRequest != null && Finding.CurrentPluginResult.BaseResponse != null) { SelectedTrigger = new Trigger("", Finding.CurrentPluginResult.BaseRequest, "", Finding.CurrentPluginResult.BaseResponse); } else { return; } } else { SelectedTrigger = Finding.CurrentPluginResult.Triggers.GetTrigger(TriggerID); } if (SelectedTrigger.Request != null) { DisplayPluginResultsRequest(SelectedTrigger.Request); } if (SelectedTrigger.Response != null) { DisplayPluginResultsResponse(SelectedTrigger.Response); } if (SelectedTrigger.Request != null || SelectedTrigger.Response != null) { UI.ResultsTriggerOptionsPanel.Visible = true; } if (UI.SelectForDiffTriggersGrid.Rows.Count > 1) { UI.ResultsTriggersComparePanel.Visible = true; } if (Finding.CurrentPluginResult.FromActiveScan) { UI.ResultsScanTracePanel.Visible = true; } StringBuilder SB = new StringBuilder(@"{\rtf1{\colortbl ;\red0\green77\blue187;\red247\green150\blue70;\red255\green0\blue0;\red0\green200\blue50;}"); SB.AppendLine(@" \fs20 "); SB.AppendLine(Tools.RtfSafe(Finding.GetTriggerHighlighting(SelectedTrigger, Finding.CurrentPluginResult.FinderType, TriggerID == -1))); SB.Append(@" \par \par"); UI.TriggerHighlightRTB.Rtf = SB.ToString(); }
private void DoDiffBtn_Click(object sender, EventArgs e) { List<int> TriggerIds = new List<int>(); TriggerIds = new List<int>(Finding.TriggersSelectedForDiff); if (TriggerIds.Count == 2) { SessionsDiffer SD = new SessionsDiffer(); Trigger A; Trigger B; if (TriggerIds[0] == 0) { A = new Trigger("", Finding.CurrentPluginResult.BaseRequest, "", Finding.CurrentPluginResult.BaseResponse); } else { A = Finding.CurrentPluginResult.Triggers.GetTrigger(TriggerIds[0] - 1); } if (TriggerIds[1] == 0) { B = new Trigger("", Finding.CurrentPluginResult.BaseRequest, "", Finding.CurrentPluginResult.BaseResponse); } else { B = Finding.CurrentPluginResult.Triggers.GetTrigger(TriggerIds[1] - 1); } Session First = null; Session Second = null; if (A.Response == null) { First = new Session(A.Request); } else { First = new Session(A.Request, A.Response); } if (B.Response == null) { Second = new Session(B.Request); } else { Second = new Session(B.Request, B.Response); } SD.SetSessions(First, Second); SD.Show(); } else { if (TriggerIds.Count == 0) { MessageBox.Show("Select two items before doing a Diff. You have NOT selected any items currently"); } else if (TriggerIds.Count == 1) { MessageBox.Show("Select two items before doing a Diff. You have selected only one item currently"); } else if (TriggerIds.Count > 2) { MessageBox.Show("Select two items before doing a Diff. You have selected more than two items currently"); } } }
public static string GetTriggerHighlighting(Trigger SelectedTrigger, string FinderType, bool IsNormal, bool IncludeDesc) { if (IsNormal) { return @" IronWASP's scanner identified this vulnerability by sending special payloads to the application and observing how its responded. Before sending the payloads the scanner sends a normal request and sees how the server responds to it. You can see this normal request and response in the adjacent tabs. Click on the items named <i<cb>>Trigger<i</cb>> (and an ID number) on the left-side to see the Requests containing the special payloads and corresponding Responses. Head to the <i<cb>><i<b>>Trigger Analysis Tools<i</b>><i</cb>> tab to: 1) Do a diff of the normal Request/Response with the Trigger Request/Response or do a diff of two Trigger Request/Response. 2) View all the payloads, requests and responses associated with the scan that discovered this vulnerability. 3) Resend any Requests from this section or perform other similar actions "; } bool RequestTriggerPresent = false; bool ResponseTriggerPresent = false; bool RequestTriggerHighlighted = false; bool ResponseTriggerHighlighted = false; string HighlightedRequest = ""; string HighlightedResponse = ""; if (SelectedTrigger.RequestTrigger.Length > 0) { RequestTriggerPresent = true; if (SelectedTrigger.Request != null) { HighlightedRequest = GetRequestTriggerHighlighting(SelectedTrigger.RequestTrigger, SelectedTrigger.Request); if (HighlightedRequest.Contains("<i<hlg>>") && HighlightedRequest.Contains("<i</hlg>>")) { RequestTriggerHighlighted = true; } } } if (SelectedTrigger.ResponseTrigger.Length > 0) { ResponseTriggerPresent = true; if (SelectedTrigger.Response != null) { HighlightedResponse = GetResponseTriggerHighlighting(SelectedTrigger.ResponseTrigger, SelectedTrigger.Response); if (HighlightedResponse.Contains("<i<hlg>>") && HighlightedResponse.Contains("<i</hlg>>")) { ResponseTriggerHighlighted = true; } } } StringBuilder SB = new StringBuilder(); switch (FinderType) { case ("ActivePlugin"): if (IncludeDesc) { SB.Append("One pair of Request and Response that was helpful in identifing this vulnerability is available in the adjacent tabs."); SB.Append("<i<br>>"); SB.Append(GetHighlightDescription(RequestTriggerPresent, ResponseTriggerPresent)); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } if (RequestTriggerHighlighted) { SB.Append("<i<hh>> Request sent by Scanner: <i</hh>>"); if (SelectedTrigger.RequestTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.RequestTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(HighlightedRequest); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } else { if (RequestTriggerPresent) { SB.Append("<i<hh>> Interesting part of Request sent by Scanner: <i</hh>>"); if (SelectedTrigger.RequestTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.RequestTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append("IronWASP is not able to automatically highlight the interesting section of the Request, you would have to identify it manually."); SB.Append("<i<br>>"); SB.Append("The scanner reported the following text as being of interest in this case:"); SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(GetInterestingTextWrap(SelectedTrigger.RequestTrigger)); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } else if (SelectedTrigger.RequestTriggerDescription.Trim().Length > 0) { SB.Append("<i<hh>> Information about the Request sent by Scanner: <i</hh>>"); SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.RequestTriggerDescription); SB.Append("<i</cb>>"); SB.Append("<i<br>><i<br>>"); } } if (ResponseTriggerHighlighted) { SB.Append("<i<hh>> Response from the Server: <i</hh>>"); if (SelectedTrigger.ResponseTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.ResponseTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(HighlightedResponse); SB.Append("<i<br>>"); } else { if (ResponseTriggerPresent) { SB.Append("<i<hh>> Interesting part of Response from the Server: <i</hh>>"); if (SelectedTrigger.ResponseTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.ResponseTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append("IronWASP is not able to automatically highlight the interesting section of the Response, you would have to identify it manually."); SB.Append("<i<br>>"); SB.Append("The scanner reported the following text as being of interest in this case:"); SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(GetInterestingTextWrap(SelectedTrigger.ResponseTrigger)); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } else if (SelectedTrigger.ResponseTriggerDescription.Trim().Length > 0) { SB.Append("<i<hh>> Information about the Response from the Server: <i</hh>>"); SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.ResponseTriggerDescription); SB.Append("<i</cb>>"); SB.Append("<i<br>><i<br>>"); } else { if (SelectedTrigger.Response != null) { SB.Append(string.Format("<i<hh>> The Response from the Server came back in {0} milli seconds <i</hh>>", SelectedTrigger.Response.RoundTrip)); } } } break; case ("PassivePlugin"): if (IncludeDesc) { SB.Append("One pair of Request and Response that was analyzed to identify this vulnerability is available in the adjacent tabs."); SB.Append("<i<br>>"); SB.Append(GetHighlightDescription(RequestTriggerPresent, ResponseTriggerPresent)); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } if (RequestTriggerHighlighted) { SB.Append("<i<hh>> Analyzed Request: <i</hh>>"); if (SelectedTrigger.RequestTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.RequestTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(HighlightedRequest); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } else { if (RequestTriggerPresent) { SB.Append("<i<hh>> Interesting part of Analyzed Request: <i</hh>>"); if (SelectedTrigger.RequestTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.RequestTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append("IronWASP is not able to automatically highlight the interesting section of the Request, you would have to identify it manually."); SB.Append("<i<br>>"); SB.Append("IronWASP's Passive Analyzer reported the following text as being of interest in this case:"); SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(GetInterestingTextWrap(SelectedTrigger.RequestTrigger)); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } else if (SelectedTrigger.RequestTriggerDescription.Trim().Length > 0) { SB.Append("<i<hh>> Information about the Analyzed Request: <i</hh>>"); SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.RequestTriggerDescription); SB.Append("<i</cb>>"); SB.Append("<i<br>><i<br>>"); } } if (ResponseTriggerHighlighted) { SB.Append("<i<hh>> Analyzed Response: <i</hh>>"); if (SelectedTrigger.ResponseTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.ResponseTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(HighlightedResponse); SB.Append("<i<br>>"); } else { if (ResponseTriggerPresent) { SB.Append("<i<hh>> Interesting part of Analyzed Response: <i</hh>>"); if (SelectedTrigger.ResponseTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.ResponseTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append("IronWASP is not able to automatically highlight the interesting section of the Response, you would have to identify it manually."); SB.Append("<i<br>>"); SB.Append("IronWASP's Passive Analyzer reported the following text as being of interest in this case:"); SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(GetInterestingTextWrap(SelectedTrigger.ResponseTrigger)); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } else if (SelectedTrigger.ResponseTriggerDescription.Trim().Length > 0) { SB.Append("<i<hh>> Information about the Analyzed Response: <i</hh>>"); SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.ResponseTriggerDescription); SB.Append("<i</cb>>"); SB.Append("<i<br>><i<br>>"); } } break; default: if (IncludeDesc) { SB.Append("One pair of Request and Response that is associated with this vulnerability is available in the adjacent tabs."); SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(GetHighlightDescription(RequestTriggerPresent, ResponseTriggerPresent)); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } if (RequestTriggerHighlighted) { SB.Append("<i<hh>> Associated Request: <i</hh>>"); if (SelectedTrigger.RequestTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.RequestTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(HighlightedRequest); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } else { if (RequestTriggerPresent) { SB.Append("<i<hh>> Interesting part of Associated Request: <i</hh>>"); if (SelectedTrigger.RequestTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.RequestTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append("IronWASP is not able to automatically highlight the interesting section of the Request, you would have to identify it manually."); SB.Append("<i<br>>"); SB.Append("The component that identified this vulnerability reported the following text as being of interest in this case:"); SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(GetInterestingTextWrap(SelectedTrigger.RequestTrigger)); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } } if (ResponseTriggerHighlighted) { SB.Append("<i<hh>> Associated Response: <i</hh>>"); if (SelectedTrigger.ResponseTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.ResponseTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(HighlightedResponse); SB.Append("<i<br>>"); } else { if (ResponseTriggerPresent) { SB.Append("<i<hh>> Interesting part of Associated Response: <i</hh>>"); if (SelectedTrigger.ResponseTriggerDescription.Trim().Length > 0) { SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.ResponseTriggerDescription); SB.Append("<i</cb>>"); } SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append("IronWASP is not able to automatically highlight the interesting section of the Response, you would have to identify it manually."); SB.Append("<i<br>>"); SB.Append("The component that identified this vulnerability reported the following text as being of interest in this case:"); SB.Append("<i<br>>"); SB.Append("<i<br>>"); SB.Append(GetInterestingTextWrap(SelectedTrigger.ResponseTrigger)); SB.Append("<i<br>>"); SB.Append("<i<br>>"); } else if (SelectedTrigger.ResponseTriggerDescription.Trim().Length > 0) { SB.Append("<i<hh>> Information about the Associated Response: <i</hh>>"); SB.Append("<i<br>><i<br>>"); SB.Append("<i<cb>>"); SB.Append(SelectedTrigger.ResponseTriggerDescription); SB.Append("<i</cb>>"); SB.Append("<i<br>><i<br>>"); } } break; } return SB.ToString(); }
public static string GetTriggerHighlighting(Trigger SelectedTrigger, string FinderType, bool IsNormal) { return GetTriggerHighlighting(SelectedTrigger, FinderType, IsNormal, true); }