internal static string SourceName(RequestSource Source) { string StringSource = ""; switch (Source) { case RequestSource.Test: StringSource = "Test"; break; case RequestSource.Scan: StringSource = "Scan"; break; case RequestSource.Shell: StringSource = "Shell"; break; case RequestSource.Probe: StringSource = "Probe"; break; case RequestSource.Proxy: StringSource = "Proxy"; break; } return(StringSource); }
static void CopyResponse(object Details) { try { object[] DetailsArray = (object[])Details; RequestSource Source = (RequestSource)DetailsArray[0]; int ID = (int)DetailsArray[1]; Session IrSe = GetLog(Source, ID); if (IrSe == null) { IronUI.ShowLogStatus("Unable to read Response from log", true); return; } if (IrSe.Response == null) { IronUI.ShowLogStatus("Unable to read Response from log", true); return; } IronUI.SetClipBoard(IrSe.Response.ToString()); } catch (Exception Exp) { IronUI.ShowLogStatus("Unable to read Request from Log", true); IronException.Report("Error reading from log", Exp.Message, Exp.StackTrace); } }
static void MarkForScanning(object Details) { try { object[] DetailsArray = (object[])Details; RequestSource Source = (RequestSource)DetailsArray[0]; int ID = (int)DetailsArray[1]; Session IrSe = GetLog(Source, ID); if (IrSe == null) { IronUI.ShowLogStatus("Unable to read Request from log", true); return; } if (IrSe.Request == null) { IronUI.ShowLogStatus("Unable to read Request from log", true); return; } int ScanID = Interlocked.Increment(ref Config.ScanCount); IronDB.CreateScan(ScanID, IrSe.Request); IronUI.CreateScan(ScanID, "Not Started", IrSe.Request.Method, IrSe.Request.FullUrl); IronUI.ShowScanJobsQueue(); } catch (Exception Exp) { IronUI.ShowLogStatus("Unable to read Request from Log", true); IronException.Report("Error reading from log", Exp.Message, Exp.StackTrace); } }
static void MarkForJavaScriptTesting(object Details) { try { object[] DetailsArray = (object[])Details; RequestSource Source = (RequestSource)DetailsArray[0]; int ID = (int)DetailsArray[1]; Session IrSe = GetLog(Source, ID); if (IrSe == null) { IronUI.ShowLogStatus("Unable to read Response from log", true); return; } if (IrSe.Response == null) { IronUI.ShowLogStatus("Unable to read Response from log", true); return; } IronUI.FillAndShowJavaScriptTester(IrSe.Response.BodyString); } catch (Exception Exp) { IronUI.ShowLogStatus("Unable to read Response from Log", true); IronException.Report("Error reading from log", Exp.Message, Exp.StackTrace); } }
internal static void CopyResponse(RequestSource Source, int ID) { object[] Details = new object[] { Source, ID }; Thread Worker = new Thread(CopyResponse); Worker.Start(Details); }
internal Request(Fiddler.Session Sess) { this.InitiateParameters(); if (Sess.oFlags.ContainsKey("IronFlag-ID")) { this.ID = Int32.Parse(Sess.oFlags["IronFlag-ID"]); } if (Sess.oFlags.ContainsKey("IronFlag-ScanID")) { this.ScanID = Int32.Parse(Sess.oFlags["IronFlag-ScanID"]); } if (Sess.oFlags.ContainsKey("IronFlag-Ticks")) { this.TimeObject = new DateTime(long.Parse(Sess.oFlags["IronFlag-Ticks"])); } if (Sess.oFlags.ContainsKey("IronFlag-BuiltBy")) { if (Sess.oFlags["IronFlag-BuiltBy"] == "ManualTestingSection") { this.Source = RequestSource.Test; } } this.AbsorbFullURL(Sess.fullUrl); this.Method = Sess.oRequest.headers.HTTPMethod; foreach (Fiddler.HTTPHeaderItem HHI in Sess.oRequest.headers) { this.Headers.Add(HHI.Name, HHI.Value); } this.SetBody(Sess.requestBodyBytes); }
internal static void MarkForJavaScriptTesting(RequestSource Source, int ID) { object[] Details = new object[] { Source, ID }; Thread Worker = new Thread(MarkForJavaScriptTesting); Worker.Start(Details); }
internal static void MarkForTesting(RequestSource Source, int ID, string Group) { object[] Details = new object[] { Source, ID, Group }; Thread Worker = new Thread(MarkForTesting); Worker.Start(Details); }
internal static void ShowLog(RequestSource Source, int ID) { CurrentSource = Source; CurrentID = ID; PrepareToShowLog(); CurrentThread = new Thread(ShowLog); CurrentThread.Start(); }
internal static void CopyResponse(RequestSource Source, string ID) { try { int IntID = Int32.Parse(ID); CopyResponse(Source, IntID); } catch { return; } }
internal static void MarkForJavaScriptTesting(RequestSource Source, string ID) { try { int IntID = Int32.Parse(ID); MarkForJavaScriptTesting(Source, IntID); } catch { return; } }
internal static void MarkForTesting(RequestSource Source, string ID, string Group) { try { int IntID = Int32.Parse(ID); MarkForTesting(Source, IntID, Group); } catch { return; } }
internal static void ShowLog(RequestSource Source, string ID, int RowID, bool IsSiteMapSelected) { try { int IntID = Int32.Parse(ID); CurrentRowID = RowID; IsSiteMap = IsSiteMapSelected; ShowLog(Source, IntID); } catch { return; } }
static void MarkForTesting(object Details) { try { object[] DetailsArray = (object[])Details; RequestSource Source = (RequestSource)DetailsArray[0]; int ID = (int)DetailsArray[1]; string Group = DetailsArray[2].ToString(); Session IrSe = GetLog(Source, ID); if (IrSe == null) { IronUI.ShowLogStatus("Unable to read Request from log", true); return; } if (IrSe.Request == null) { IronUI.ShowLogStatus("Unable to read Request from log", true); return; } int TestID = Interlocked.Increment(ref Config.TestRequestsCount); IrSe.Request.ID = TestID; IronDB.LogMTRequest(IrSe.Request); IronDB.ClearGroup(Group); ManualTesting.CurrentRequestID = TestID; ManualTesting.CurrentGroup = Group; ManualTesting.ClearGroup(Group, TestID); ManualTesting.StoreInGroupList(IrSe.Request); IronUI.SetNewTestRequest(IrSe.Request, Group); } catch (Exception Exp) { IronUI.ShowLogStatus("Unable to read Request from Log", true); IronException.Report("Error reading from log", Exp.Message, Exp.StackTrace); } }
internal Request(Fiddler.Session Sess) { this.InitiateParameters(); if (Sess.oFlags.ContainsKey("IronFlag-ID")) { this.ID = Int32.Parse(Sess.oFlags["IronFlag-ID"]); } if (Sess.oFlags.ContainsKey("IronFlag-ScanID")) { this.ScanID = Int32.Parse(Sess.oFlags["IronFlag-ScanID"]); } if (Sess.oFlags.ContainsKey("IronFlag-Ticks")) { this.TimeObject = new DateTime(long.Parse(Sess.oFlags["IronFlag-Ticks"])); } if (Sess.oFlags.ContainsKey("IronFlag-BuiltBy")) { if (Sess.oFlags["IronFlag-BuiltBy"] == "ManualTestingSection") this.Source = RequestSource.Test; } this.AbsorbFullURL(Sess.fullUrl); this.Method = Sess.oRequest.headers.HTTPMethod; foreach (Fiddler.HTTPHeaderItem HHI in Sess.oRequest.headers) { this.Headers.Add(HHI.Name, HHI.Value); } this.SetBody(Sess.requestBodyBytes); }
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; }
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); }
internal static string SourceName(RequestSource Source) { string StringSource = ""; switch (Source) { case RequestSource.Test: StringSource = "Test"; break; case RequestSource.Scan: StringSource = "Scan"; break; case RequestSource.Shell: StringSource = "Shell"; break; case RequestSource.Probe: StringSource = "Probe"; break; case RequestSource.Proxy: StringSource = "Proxy"; break; } return StringSource; }
internal static void ShowLog(RequestSource Source, string ID) { try { int IntID = Int32.Parse(ID); ShowLog(Source, IntID); } catch { return; } }
internal static void MarkForScanning(RequestSource Source, int ID) { object[] Details = new object[] { Source, ID}; Thread Worker = new Thread(MarkForScanning); Worker.Start(Details); }