public static List <Request> FromTestLog() { List <Request> Requests = new List <Request>(); List <Session> Sessions = Session.FromTestLog(); foreach (Session Sess in Sessions) { if (Sess.Request != null) { Requests.Add(Sess.Request); } } return(Requests); }
static Session GetLog(RequestSource 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: Trigger SelectedTrigger = PluginResult.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()); } break; case RequestSource.SelectedLogEntry: return(IronLog.CurrentSession.GetClone()); case RequestSource.CurrentProxyInterception: return(IronProxy.CurrentSession.GetClone()); } return(IrSe); }
public static Request FromTestLog(int ID) { Session IrSe = Session.FromTestLog(ID); return(IrSe.Request); }
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); }