Esempio n. 1
0
        /// <summary>
        /// After the list Dorks is collected before a real mass-scan, the
        /// order of the scans can be randomized with this, if the user wants to.
        /// </summary>
        /// <param name="listofdorks">List of Dorks for scanning.</param>
        private void RandomizeOrder(List <SSelectedDork> listofdorks)
        {
            Random r    = new Random();
            int    capa = listofdorks.Count;

            SSelectedDork[] sd = new SSelectedDork[capa];
            int             u  = 0;

            do
            {
                int d = r.Next(listofdorks.Count);

                if (sd[u].Dork == null)
                {
                    sd[u] = listofdorks[d];
                    listofdorks.RemoveAt(d);
                    u++;
                }
            } while (listofdorks.Count > 0);

            // rebuild list
            for (int i = 0; i < capa; i++)
            {
                listofdorks.Add(sd[i]);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="DorkToEdit">The currently selected Dork.</param>
 /// <param name="SingleScanMethod">Delegate to a method which scans for us.</param>
 public EditDorkScan(SSelectedDork DorkToEdit, singleScan SingleScanMethod)
 {
     _singleScan   = SingleScanMethod;
     dorktoedit    = DorkToEdit;
     originalQuery = DorkToEdit.Dork.Query;
     InitializeComponent();
     SetTextElements();
 }
Esempio n. 3
0
        /// <summary>
        /// Creates new DorkDone object from a given SSelectedDork object.
        /// Presets attributes like status, time, host
        /// </summary>
        /// <param name="scanDork">A selected Dork (eg from ui)</param>
        /// <returns>Corresponding DorkDone object</returns>
        private DorkDone CreateDorkForScanning(SSelectedDork scanDork)
        {
            DorkDone dorkdone = new DorkDone(scanDork);

            dorkdone.ScanResult = (int)RESULT_STATUS.WhileScan;
            dorkdone.Host       = scanHostTextBox.Text.Trim();
            dorkdone.Now();
            return(dorkdone);
        }
Esempio n. 4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="dork">SSelectedDork (normally provided from the UI).</param>
 public DorkDone(SSelectedDork dork)
 {
     this.Category = dork.Dork.Category;
     this.Comment  = dork.Dork.Comment;
     this.Name     = dork.Dork.Name;
     this.Query    = dork.Dork.Query;
     this.Title    = dork.Dork.Title;
     _LastNode     = dork.TreeNode;
     _NextPage     = dork.NextPage;
 }
Esempio n. 5
0
        /// <summary>
        /// Creates a ListViewItem of the currently selected Dork and
        /// displays it in the ResultListView with 'scanning' status.
        /// Also updates the Dork infobox and statusline.
        /// </summary>
        /// <param name="scanDork">Selected dork</param>
        /// <returns>ListViewItem</returns>
        private ListViewItem ShowTemporaryDork(SSelectedDork scanDork)
        {
            ListViewItem lv = resultListView.Items.Add(rm.GetString("RES_SCAN") + "...",
                                                       (int)RESULT_STATUS.WhileScan);

            lv.SubItems.Add(scanDork.Dork.Title);
            lv.SubItems.Add("...");
            resultListView.EnsureVisible(lv.Index);

            formatDorkToRichText(scanDork.Dork);

            StatusLabel.Text = mResScanning + ": " + scanDork.Dork.Category + " ...";

            return(lv);
        }
Esempio n. 6
0
 private void singleScan(SSelectedDork selectedDork)
 {
     dorksToScan = new List <SSelectedDork>();
     dorksToScan.Add(selectedDork);
     InitializeScanning();
 }