Ejemplo n.º 1
0
        private void LoadTraceViewerBtn_Click(object sender, EventArgs e)
        {
            try
            {
                int            ID          = SelectedTraceId;
                LogTraceViewer TraceViewer = new LogTraceViewer(ID, CurrentUiResults);

                //string[] OverviewAndMessage = IronDB.GetScanTraceOverviewAndMessage(ID);
                //string OverviewXml = OverviewAndMessage[0];
                //string Message = OverviewAndMessage[1];
                //IronTrace ScanTraceRecord = IronDB.GetScanTraces(ID, 1)[0];


                ////string Message = IronDB.GetScanTraceMessage(ID);
                //StringBuilder SB = new StringBuilder(@"{\rtf1{\colortbl ;\red0\green77\blue187;\red247\green150\blue70;\red255\green0\blue0;\red0\green200\blue50;\red255\green255\blue255;}");
                //SB.Append(Tools.RtfSafe(Message));
                //LogTraceViewer TraceViewer = new LogTraceViewer(OverviewXml, ScanTraceRecord.Section);
                //TraceViewer.ScanTraceMsgRTB.Rtf = SB.ToString();

                //try
                //{
                //    List<Dictionary<string, string>> OverviewEntries = IronTrace.GetOverviewEntriesFromXml(OverviewXml);

                //    foreach (Dictionary<string, string> Entry in OverviewEntries)
                //    {
                //        TraceViewer.ScanTraceOverviewGrid.Rows.Add(new object[] { false, Entry["id"], Entry["log_id"], Entry["payload"], Entry["code"], Entry["length"], Entry["mime"], Entry["time"], Entry["signature"] });
                //    }

                //    TraceViewer.SetAnalysisUiResults(CurrentUiResults);
                //}
                //catch
                //{
                //    //Probaly an entry from the log of an older version
                //}
                //TraceViewer.ShouldDoAnalysis = false;//We already updaing these values, they don't have to be calculated again
                TraceViewer.Show();
            }
            catch (Exception Exp)
            {
                IronException.Report("Error reading ScanTrace Message from DB", Exp.Message, Exp.StackTrace);
            }
        }
Ejemplo n.º 2
0
        private void ResultsShowScanTraceBtn_Click(object sender, EventArgs e)
        {
            try
            {
                List<IronTrace> Traces = IronDB.GetScanTraces(Finding.CurrentPluginResult);
                List<LogTraceViewer> Viewers = new List<LogTraceViewer>();

                foreach (IronTrace Trace in Traces)
                {
                    LogTraceViewer TraceViewer = new LogTraceViewer(Trace);
                    Viewers.Add(TraceViewer);
                    //StringBuilder SB = new StringBuilder(@"{\rtf1{\colortbl ;\red0\green77\blue187;\red247\green150\blue70;\red255\green0\blue0;\red0\green200\blue50;}");
                    //SB.Append(Tools.RtfSafe(Trace.Message));
                    //TraceViewer.ScanTraceMsgRTB.Rtf = SB.ToString();

                    //try
                    //{
                    //    List<Dictionary<string, string>> OverviewEntries = IronTrace.GetOverviewEntriesFromXml(Trace.OverviewXml);
                    //    //ScanTraceOverviewGrid.Rows.Clear();
                    //    foreach (Dictionary<string, string> Entry in OverviewEntries)
                    //    {
                    //        TraceViewer.ScanTraceOverviewGrid.Rows.Add(new object[] { false, Entry["id"], Entry["log_id"], Entry["payload"], Entry["code"], Entry["length"], Entry["mime"], Entry["time"], Entry["signature"] });
                    //    }
                    //    Viewers.Add(TraceViewer);
                    //}
                    //catch
                    //{
                    //    //Probaly an entry from the log of an older version
                    //}
                }
                foreach (LogTraceViewer Viewer in Viewers)
                {
                    Viewer.Show();
                }
                if (Viewers.Count > 1)
                {
                    MessageBox.Show(string.Format("{0} traces entries matched this finding, so {0} windows have been opened", Viewers.Count));
                }
                else if (Viewers.Count == 0)
                {
                    MessageBox.Show("No trace entries matching this finding could be find. Please look for the associated trace manually in the 'Scan Trace' section of the 'Automated Scanning' section.");
                }
            }
            catch (Exception Exp)
            {
                IronException.Report("Unable to load logs associated with Finding", Exp);
            }
        }
Ejemplo n.º 3
0
 private void LoadSelectedTraceBtn_Click(object sender, EventArgs e)
 {
     //IronTrace Trace = IronDB.GetScanTrace(IronUI.MainViewSelectedScanTraceId);
     LogTraceViewer TraceViewer = new LogTraceViewer(IronUI.MainViewSelectedScanTraceId);
     //TraceViewer.ScanTraceMsgRTB.Rtf = ScanTraceMsgRTB.Rtf;
     //foreach (DataGridViewRow Row in ScanTraceOverviewGrid.Rows)
     //{
     //    object[] RowValues = new object[Row.Cells.Count + 1];
     //    RowValues[0] = false;
     //    foreach (DataGridViewCell Cell in Row.Cells)
     //    {
     //        RowValues[Cell.ColumnIndex + 1] = Cell.Value;
     //    }
     //    TraceViewer.ScanTraceOverviewGrid.Rows.Add(RowValues);
     //}
     TraceViewer.Show();
 }
Ejemplo n.º 4
0
 private void LoadSelectedTraceBtn_Click(object sender, EventArgs e)
 {
     LogTraceViewer TraceViewer = new LogTraceViewer();
     TraceViewer.ScanTraceMsgRTB.Rtf = ScanTraceMsgRTB.Rtf;
     foreach (DataGridViewRow Row in ScanTraceOverviewGrid.Rows)
     {
         object[] RowValues = new object[Row.Cells.Count + 1];
         RowValues[0] = false;
         foreach (DataGridViewCell Cell in Row.Cells)
         {
             RowValues[Cell.ColumnIndex + 1] = Cell.Value;
         }
         TraceViewer.ScanTraceOverviewGrid.Rows.Add(RowValues);
     }
     TraceViewer.Show();
 }
        private void LoadTraceViewerBtn_Click(object sender, EventArgs e)
        {
            try
            {
                int ID = SelectedTraceId;
                LogTraceViewer TraceViewer = new LogTraceViewer(ID, CurrentUiResults);

                //string[] OverviewAndMessage = IronDB.GetScanTraceOverviewAndMessage(ID);
                //string OverviewXml = OverviewAndMessage[0];
                //string Message = OverviewAndMessage[1];
                //IronTrace ScanTraceRecord = IronDB.GetScanTraces(ID, 1)[0];

                ////string Message = IronDB.GetScanTraceMessage(ID);
                //StringBuilder SB = new StringBuilder(@"{\rtf1{\colortbl ;\red0\green77\blue187;\red247\green150\blue70;\red255\green0\blue0;\red0\green200\blue50;\red255\green255\blue255;}");
                //SB.Append(Tools.RtfSafe(Message));
                //LogTraceViewer TraceViewer = new LogTraceViewer(OverviewXml, ScanTraceRecord.Section);
                //TraceViewer.ScanTraceMsgRTB.Rtf = SB.ToString();

                //try
                //{
                //    List<Dictionary<string, string>> OverviewEntries = IronTrace.GetOverviewEntriesFromXml(OverviewXml);

                //    foreach (Dictionary<string, string> Entry in OverviewEntries)
                //    {
                //        TraceViewer.ScanTraceOverviewGrid.Rows.Add(new object[] { false, Entry["id"], Entry["log_id"], Entry["payload"], Entry["code"], Entry["length"], Entry["mime"], Entry["time"], Entry["signature"] });
                //    }

                //    TraceViewer.SetAnalysisUiResults(CurrentUiResults);
                //}
                //catch
                //{
                //    //Probaly an entry from the log of an older version
                //}
                //TraceViewer.ShouldDoAnalysis = false;//We already updaing these values, they don't have to be calculated again
                TraceViewer.Show();
            }
            catch (Exception Exp)
            {
                IronException.Report("Error reading ScanTrace Message from DB", Exp.Message, Exp.StackTrace);
            }
        }
        private void LoadTraceViewerBtn_Click(object sender, EventArgs e)
        {
            try
            {
                int ID = SelectedTraceId;
                string[] OverviewAndMessage = IronDB.GetScanTraceOverviewAndMessage(ID);
                string OverviewXml = OverviewAndMessage[0];
                string Message = OverviewAndMessage[1];

                //string Message = IronDB.GetScanTraceMessage(ID);
                StringBuilder SB = new StringBuilder(@"{\rtf1{\colortbl ;\red0\green77\blue187;\red247\green150\blue70;\red255\green0\blue0;\red0\green200\blue50;}");
                SB.Append(Tools.RtfSafe(Message));
                LogTraceViewer TraceViewer = new LogTraceViewer();
                TraceViewer.ScanTraceMsgRTB.Rtf = SB.ToString();

                try
                {
                    List<Dictionary<string, string>> OverviewEntries = IronTrace.GetOverviewEntriesFromXml(OverviewXml);

                    foreach (Dictionary<string, string> Entry in OverviewEntries)
                    {
                        TraceViewer.ScanTraceOverviewGrid.Rows.Add(new object[] { false, Entry["id"], Entry["log_id"], Entry["payload"], Entry["code"], Entry["length"], Entry["mime"], Entry["time"], Entry["signature"] });
                    }
                }
                catch
                {
                    //Probaly an entry from the log of an older version
                }

                TraceViewer.Show();

            }
            catch (Exception Exp)
            {
                IronException.Report("Error reading ScanTrace Message from DB", Exp.Message, Exp.StackTrace);
            }
        }