void ShowSelectedLog(object SelectedLogInfoObject) { object[] SelectedLogInfo = (object[])SelectedLogInfoObject; string Source = SelectedLogInfo[0].ToString(); int LogId = (int)SelectedLogInfo[1]; try { Session Session = Session.FromLog(LogId, Source); if (Session.Request != null) { RequestView.SetRequest(Session.Request); if (Session.Response != null) { ResponseView.SetResponse(Session.Response, Session.Request); } } } catch (ThreadAbortException) { } catch (Exception Exp) { IronException.Report("Error loading Selected Log info in Log Analyzer", Exp); } finally { EndLogLoad(); } }
void LoadAndShowSession() { this.ReqView.ClearRequest(); this.ResView.ClearResponse(); this.ReqView.ShowProgressBar(true); this.ResView.ShowProgressBar(true); Session Sess = null; try { Sess = Session.FromLog(this.intLogId, this.intLogSource); } catch { } this.ReqView.ShowProgressBar(false); this.ResView.ShowProgressBar(false); if (Sess != null) { if (Sess.Request != null) { this.ReqView.SetRequest(Sess.Request); } if (Sess.Response != null) { this.ResView.SetResponse(Sess.Response, Sess.Request); } } }
void DoDiff() { try { if (FetchFromLogs) { this.A = Session.FromLog(this.ALogId, this.LogSource); this.B = Session.FromLog(this.BLogId, this.LogSource); } string RequestA = ""; string RequestB = ""; string ResponseA = ""; string ResponseB = ""; if (A != null) { if (A.Request != null) { RequestA = A.Request.ToString(); } if (A.Response != null) { ResponseA = A.Response.ToString(); } } if (B != null) { if (B.Request != null) { RequestB = B.Request.ToString(); } if (B.Response != null) { ResponseB = B.Response.ToString(); } } string[] RequestSidebySideResults = DiffWindow.DoSideBySideDiff(RequestA, RequestB); string[] ResponseSidebySideResults = DiffWindow.DoSideBySideDiff(ResponseA, ResponseB); string RequestSinglePageResults = DiffWindow.DoSinglePageDiff(RequestA, RequestB); string ResponseSinglePageResults = DiffWindow.DoSinglePageDiff(ResponseA, ResponseB); RequestDRV.ShowDiffResults(RequestSinglePageResults, RequestSidebySideResults[0], RequestSidebySideResults[1]); ResponseDRV.ShowDiffResults(ResponseSinglePageResults, ResponseSidebySideResults[0], ResponseSidebySideResults[1]); } catch (Exception Exp) { IronException.Report("Error doing diff on Sessions", Exp); ShowError(); } EndDiff(); }
static void DoLoadSessionPluginTraceLog() { try { Session Sess = Session.FromLog(SelectedSessionPluginTraceLogId, SelectedSessionPluginTraceSource); IronUI.ShowSessionPluginTraceLog(Sess.Request, Sess.Response); } catch (ThreadAbortException) { } catch (Exception Exp) { IronException.Report(string.Format("Error loading log-{0} from {1} log", SelectedSessionPluginTraceLogId, SelectedSessionPluginTraceSource), Exp); } finally { IronUI.ShowHideSessionPluginTraceProgressBar(false); } }
internal static Session GetLog(string Source, int ID) { Session IrSe = null; switch (Source) { case RequestSource.Proxy: IrSe = Session.FromProxyLog(ID); break; case RequestSource.Scan: IrSe = Session.FromScanLog(ID); break; case RequestSource.Shell: IrSe = Session.FromShellLog(ID); break; case RequestSource.Test: IrSe = Session.FromTestLog(ID); break; case RequestSource.Probe: IrSe = Session.FromProbeLog(ID); break; case RequestSource.Trigger: if (ID == 0) { IrSe = new Session(Finding.CurrentPluginResult.BaseRequest, Finding.CurrentPluginResult.BaseResponse); } else { Trigger SelectedTrigger = Finding.CurrentPluginResult.Triggers.GetTrigger(ID - 1); if (SelectedTrigger.Request != null) { if (SelectedTrigger.Response == null) { IrSe = new Session(SelectedTrigger.Request); } else { IrSe = new Session(SelectedTrigger.Request, SelectedTrigger.Response); } } } break; case RequestSource.TestGroup: //if (ManualTesting.RedGroupSessions.ContainsKey(ID)) return ManualTesting.RedGroupSessions[ID].GetClone(); //if (ManualTesting.BlueGroupSessions.ContainsKey(ID)) return ManualTesting.BlueGroupSessions[ID].GetClone(); //if (ManualTesting.GreenGroupSessions.ContainsKey(ID)) return ManualTesting.GreenGroupSessions[ID].GetClone(); //if (ManualTesting.GrayGroupSessions.ContainsKey(ID)) return ManualTesting.GrayGroupSessions[ID].GetClone(); //if (ManualTesting.BrownGroupSessions.ContainsKey(ID)) return ManualTesting.BrownGroupSessions[ID].GetClone(); foreach (string Group in ManualTesting.GroupSessions.Keys) { if (ManualTesting.GroupSessions[Group].ContainsKey(ID)) { return(ManualTesting.GroupSessions[Group][ID].GetClone()); } } break; case RequestSource.SelectedLogEntry: return(IronLog.CurrentSession.GetClone()); case RequestSource.CurrentProxyInterception: return(IronProxy.CurrentSession.GetClone()); default: IrSe = Session.FromLog(ID, Source); break; } return(IrSe); }