Esempio n. 1
0
        /// <summary>
        /// Initailize scanning.
        /// This is called before a scan starts.
        /// In fact, this checks some preconditions and starts the backgroundworker
        /// for scanning and also the backgroundworker for the animation.
        /// </summary>
        private void InitializeScanning()
        {
            Trace.WriteLineIf(Debug.Trace.TraceGoolag.TraceVerbose, "InitializeScanning()");

            if (inScanning)
            {
                Trace.WriteLineIf(Debug.Trace.TraceGoolag.TraceWarning,
                                  "..there is already a scan running.");
                return;
            }

            if (Properties.Settings.Default.AllowFreeScan == false)
            {
                if (String.IsNullOrEmpty(scanHostTextBox.Text.Trim()))
                {
                    Trace.WriteLineIf(Debug.Trace.TraceGoolag.TraceWarning,
                                      "..no host entered. AllowFreeScan not set.");
                    MessageBox.Show(rm.GetString("RES_E_ENTERHOST"), rm.GetString("RES_E_SCANERROR"), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }

            inScanning = true;

            summaryStat = new SummaryStat();
            summaryStat.captureStartTime();

            resultListView.Sorting = SortOrder.None;
            StatusLabel.Text       = mResScanning + "...";

            pictureMenuAnim.Enabled = true;

            updateScanButtons();
            progressBar1.Value = 0;
            backgroundScan.RunWorkerAsync();
            backgroundAnim.RunWorkerAsync();

            Trace.WriteLineIf(Debug.Trace.TraceGoolag.TraceVerbose,
                              "Backgroundworker for scanning started.");

            this.Update();

            if (dorksToScan.Count > 1 && Properties.Settings.Default.ShowMassScanDialog == true)
            {
                scanningdialog = new ScanningDialog(dorksToScan.Count, StopScanning);
                scanningdialog.Show();
                scanningdialog.UpdateTitle(0);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="hostScanned">Host that was scanned.</param>
        /// <param name="summaryStat">Instance of SummaryStat object.</param>
        public SummaryReport(string hostScanned, SummaryStat summaryStat)
        {
            this.summaryStat = summaryStat;
            InitializeComponent();
            hostScannedBox.Text = hostScanned;

            if (summaryStat != null)
            {
                this.labelScanStart.Text = summaryStat.StartTime.ToLocalTime().ToString();
                System.TimeSpan dt = summaryStat.EndTime - summaryStat.StartTime;
                this.labelScanDuration.Text = string.Format("{0:##00}:{1:##00}:{2:##00}", dt.Hours, dt.Minutes, dt.Seconds);
                sumListView.Items[0].SubItems.Add("Successful dorks");
                sumListView.Items[0].SubItems.Add(summaryStat.ScansSuccess.ToString());
                sumListView.Items[1].SubItems.Add("Dorks without result");
                sumListView.Items[1].SubItems.Add(summaryStat.ScansNoResult.ToString());
                sumListView.Items[2].SubItems.Add("Failures while scanning");
                sumListView.Items[2].SubItems.Add(summaryStat.ScansFailed.ToString());
            }
        }