Пример #1
0
 public void initialize()
 {
     form2Path           = "";
     form3Paths          = null;
     form3PathSelected   = null;
     form3Record         = null;
     form3RecordSelected = null;
     form3RecordMerged   = null;
     form3RecordEdited   = null;
     form3Panel3State    = Form3Panel3State.NULL;
 }
 /// <summary>
 /// This is the getData method.3
 /// </summary>
 /// <param name="paths">file paths that including the useful information (String array).</param>
 /// <returns>a Record (all findings) from given paths.</returns>
 public Record.Record getData(String[] paths)
 {
     record = new Record.Record();
     foreach (String path in paths)
     {
         Parser parser = getInputParser(path);
         if (parser != null)
         {
             parser.getData(path, ref record);
         }
     }
     return(record);
 }
        public IPHostTable()
        {
            InitializeComponent();
            Record.Record record = Program.state.panelRecordEdit_record;
            labelNumRisk.Text = "Number of risks: High " + record.getHighRisk().Count() +
                                " Medium " + record.getMediumRisk().Count() +
                                " Low " + record.getLowRisk().Count() +
                                " None " + record.getNoneRisk().Count() +
                                " Open " + record.getOpenPort().Count();
            //dataGridViewIPHostTable.Sort(new Sort());
            dataGridViewIPHostTable.DataSource = Program.state.panelRecordEdit_recordDatabaser.getBindingSourceIPHostTable();

            this.TopMost = true;
            this.TopMost = false;
        }
 /// <summary>
 /// This is the getData method.		/// </summary>
 /// <param name="paths">file paths that including the useful information (List of string storing the paths).</param>
 /// <returns>a Record (all findings) from given paths.</returns>
 public Record.Record getData(List <String> paths)
 {
     record = new Record.Record();
     foreach (String path in paths)
     {
         Parser inputParser = getInputParser(path);
         if (inputParser != null)
         {
             string[] tempString = path.Split('\\');
             string   fileName   = "";
             if (tempString.Length > 0)
             {
                 fileName = tempString[tempString.Length - 1];
             }
             inputParser.setFileName(fileName);
             inputParser.getData(path, ref record);
         }
     }
     return(record);
 }
Пример #5
0
        public static void Main(string[] args)
        {
            if (args.Length <= 1)
            {
                Console.WriteLine("Usage: ReportGenerator <.nessus Folder Directory> <output filename>");
                Environment.Exit(0);
            }

            if (!Directory.Exists(args[0]))
            {
                Console.WriteLine(args[0] + " is not a directory");
                Environment.Exit(0);
            }

            String[] paths = Directory.GetFiles(args[0], "*.nessus", SearchOption.AllDirectories);
            if (paths.Length == 0)
            {
                Console.WriteLine("No .nessus files found in " + args[0]);
                Environment.Exit(0);
            }

            // get data from report inputer
            ReportInputer reportInputer = new ReportInputer();

            Record.Record record = reportInputer.getData(paths);

            // data process by end-user


            // output the report by the report outputer
            ReportOutputer reportOutputer = new ReportOutputer();

            if (args.Length > 2)
            {
                reportOutputer.output(args[2], args[1], ref record);
            }
            else
            {
                reportOutputer.output(args[1], ref record);
            }
        }
Пример #6
0
        /// <summary>
        /// This is the initialize method.
        /// It is used to initialize all variables in State.
        /// </summary>
        public void initialize()
        {
            #region             // FormCaseCreateAndOpen Parameter Initialize
            formCaseCreateAndOpenPath = "";
            #endregion

            #region             // formMain Parameter Initialize
            panelRecordEdit_isSaveDatabase = false;

            formMainInputPaths        = null;
            formMainInputPathSelected = null;

            panelRecordEdit_recordDatabaser = null;
            panelRecordEdit_record          = null;
            panelRecordEdit_ConfirmedRecord = null;
            panelRecordEdit_RecordSelected  = null;
            panelRecordEdit_RecordMerged    = null;
            panelRecordEdit_RecordEdited    = null;

            panelRecordEdit_undoDataEntryList = null;
            panelRecordEdit_undoEdited        = null;
            panelRecordEdit_undoMegered       = null;

            dataGridView_Id         = null;
            dataGridView_OldId      = null;
            dataGridView_DatabaseId = null;

            panelRecordEdit_DatabasePath = "";

            panelRecordEdit_showHigh     = true;
            panelRecordEdit_showMedium   = true;
            panelRecordEdit_showLow      = true;
            panelRecordEdit_showNone     = true;
            panelRecordEdit_showOpenPort = true;
            panelRecordEdit_showNessus   = true;
            panelRecordEdit_showNmap     = true;
            panelRecordEdit_showMbsa     = true;

            panelOutputSelect_OutputPath       = "";
            panelOutputSelect_TemplatePath     = "";
            panelOutputSelect_isOutputHotfix   = true;
            panelOutputSelect_isOutputOpenPort = true;
            panelOutputSelect_isOutputIpHost   = true;

            panelTemplateStringEdit_dict = null;

            panelOutputSelect_State = PanelOutputSelectState.NULL;
            #endregion
            fileNames = null;
            #region             // formEditFinding Parameter Initialize
            formEditFindingState = FormEditFindingState.NULL;
            formEditFindingEntry = null;
            #endregion

            #region             // formEditFindingString Parameter Initialize
            formEditFindingStringState       = FormEditFindingStringState.NULL;
            formEditFindingString_stringText = "";
            #endregion

            #region             // formEditTemplateString Parameter Initialize
            formEditTemplateStringState       = FormEditTemplateStringState.NULL;
            formEditTemplateString_stringText = "";
            #endregion
        }