Exemplo n.º 1
0
        private void bckWorkerSearch_DoWork(object sender, DoWorkEventArgs e)
        {
            checked
            {
                /*try
                 * {*/
                __RunningWorker     = true;
                this.__ScannerConf_ = (stScannerConf)e.Argument;

                //On les initialise tous
                __ScannerEngines        = default(stScannerEngines);
                __ScannerEngines.Google = new SearchEngineUrls(SearchEngineUrls.Host.Google, __ScannerConf_.Retry, __ScannerConf_.TimeOut);
                ScannerAddEvents(__ScannerEngines.Google);
                __ScannerEngines.Bing = new SearchEngineUrls(SearchEngineUrls.Host.Bing, __ScannerConf_.Retry, __ScannerConf_.TimeOut);
                ScannerAddEvents(__ScannerEngines.Bing);
                __ScannerEngines.Yahoo = new SearchEngineUrls(SearchEngineUrls.Host.Yahoo, __ScannerConf_.Retry, __ScannerConf_.TimeOut);
                ScannerAddEvents(__ScannerEngines.Yahoo);
                __ScannerEngines.Aol = new SearchEngineUrls(SearchEngineUrls.Host.Aol, __ScannerConf_.Retry, __ScannerConf_.TimeOut);
                ScannerAddEvents(__ScannerEngines.Aol);
                __ScannerEngines.Yandex = new SearchEngineUrls(SearchEngineUrls.Host.Yandex, __ScannerConf_.Retry, __ScannerConf_.TimeOut);
                ScannerAddEvents(__ScannerEngines.Yandex);
                __ScannerEngines.Ask = new SearchEngineUrls(SearchEngineUrls.Host.Ask, __ScannerConf_.Retry, __ScannerConf_.TimeOut);
                ScannerAddEvents(__ScannerEngines.Ask);
                __ScannerEngines.Wow = new SearchEngineUrls(SearchEngineUrls.Host.Wow, __ScannerConf_.Retry, __ScannerConf_.TimeOut);
                ScannerAddEvents(__ScannerEngines.Wow);
                __ScannerEngines.WebCrawler = new SearchEngineUrls(SearchEngineUrls.Host.WebCrawler, __ScannerConf_.Retry, __ScannerConf_.TimeOut);
                ScannerAddEvents(__ScannerEngines.WebCrawler);
                __ScannerEngines.MyWebSearch = new SearchEngineUrls(SearchEngineUrls.Host.MyWebSearch, __ScannerConf_.Retry, __ScannerConf_.TimeOut);
                ScannerAddEvents(__ScannerEngines.MyWebSearch);
                __ScannerEngines.Sapo = new SearchEngineUrls(SearchEngineUrls.Host.Sapo, __ScannerConf_.Retry, __ScannerConf_.TimeOut);
                ScannerAddEvents(__ScannerEngines.Sapo);

                //on demmare ceux sélectionner
                if (__ScannerConf_.Google)
                {
                    __ScannerEngines.Google.StartScanning(ScannerBuildDorks(SearchEngineUrls.Host.Google, __ScannerConf_.DorkList), __ScannerConf_.Threads, __ScannerConf_.Delay);
                }
                if (__ScannerConf_.Bing)
                {
                    __ScannerEngines.Bing.StartScanning(ScannerBuildDorks(SearchEngineUrls.Host.Bing, __ScannerConf_.DorkList), __ScannerConf_.Threads, __ScannerConf_.Delay);
                }
                if (__ScannerConf_.Yahoo)
                {
                    __ScannerEngines.Yahoo.StartScanning(ScannerBuildDorks(SearchEngineUrls.Host.Yahoo, __ScannerConf_.DorkList), __ScannerConf_.Threads, __ScannerConf_.Delay);
                }
                if (__ScannerConf_.Aol)
                {
                    __ScannerEngines.Aol.StartScanning(ScannerBuildDorks(SearchEngineUrls.Host.Aol, __ScannerConf_.DorkList), __ScannerConf_.Threads, __ScannerConf_.Delay);
                }
                if (__ScannerConf_.Yandex)
                {
                    __ScannerEngines.Yandex.StartScanning(ScannerBuildDorks(SearchEngineUrls.Host.Yandex, __ScannerConf_.DorkList), __ScannerConf_.Threads, __ScannerConf_.Delay);
                }
                if (__ScannerConf_.Ask)
                {
                    __ScannerEngines.Ask.StartScanning(ScannerBuildDorks(SearchEngineUrls.Host.Ask, __ScannerConf_.DorkList), __ScannerConf_.Threads, __ScannerConf_.Delay);
                }
                if (__ScannerConf_.Wow)
                {
                    __ScannerEngines.Wow.StartScanning(ScannerBuildDorks(SearchEngineUrls.Host.Wow, __ScannerConf_.DorkList), __ScannerConf_.Threads, __ScannerConf_.Delay);
                }
                if (__ScannerConf_.WebCrawler)
                {
                    __ScannerEngines.WebCrawler.StartScanning(ScannerBuildDorks(SearchEngineUrls.Host.WebCrawler, __ScannerConf_.DorkList), __ScannerConf_.Threads, __ScannerConf_.Delay);
                }
                if (__ScannerConf_.MyWebSearch)
                {
                    __ScannerEngines.MyWebSearch.StartScanning(ScannerBuildDorks(SearchEngineUrls.Host.MyWebSearch, __ScannerConf_.DorkList), __ScannerConf_.Threads, __ScannerConf_.Delay);
                }
                if (__ScannerConf_.Sapo)
                {
                    __ScannerEngines.Sapo.StartScanning(ScannerBuildDorks(SearchEngineUrls.Host.Sapo, __ScannerConf_.DorkList), __ScannerConf_.Threads, __ScannerConf_.Delay);
                }

                while (true)
                {
                    if (__ScannerEngines.Complete())
                    {
                        __RunningWorker = false;
                        Globals.GUI.sendUrls(__ScannerConf_.Order, __URLS__);
                        break;
                    }
                    ScannerProgressStatusBar();
                    int num = 0;
                    do
                    {
                        Application.DoEvents();
                        Thread.Sleep(100);
                        num++;
                    }while (num <= 9);
                }

                /* }
                 * catch (Exception expr_6A8)
                 * {
                 *   ProjectData.SetProjectError(expr_6A8);
                 *   ProjectData.ClearProjectError();
                 * }
                 * finally
                 * {
                 * }*/
            }
        }
Exemplo n.º 2
0
        public void StartWorker(dynamic order, int TimeOut, int numSearchDelay, List <string> DorkList, int nbrThread, int numHttpRetry = 2, bool google = false, bool bing = false, bool yahoo = false, bool aol = false, bool yandex = false, bool ask = false, bool wow = false, bool webCrawler = false, bool myWebSearch = false, bool sapo = false)
        {
            /*if (__RunningWorker)
             * {
             *  return;
             * }*/
            checked
            {
                IniScannerObjects();
                stScannerConf stScannerConf = default(stScannerConf);
                stScannerConf.Order = order;
                Globals.UpDateStatus(order, "Scanner DORKS", "Scanner thread, loading please wait..");
                stScannerConf.TimeOut  = Convert.ToInt32(TimeOut);
                stScannerConf.Delay    = Convert.ToInt32(numSearchDelay);
                stScannerConf.Url      = "";
                stScannerConf.Method   = enHTTPMethod.GET;
                stScannerConf.Threads  = Convert.ToInt32(nbrThread);
                stScannerConf.Retry    = Convert.ToInt32(numHttpRetry);
                stScannerConf.DorkList = DorkList;

                if (stScannerConf.DorkList.Count == 0)
                {
                    Globals.UpDateStatus(__ScannerConf_.Order, "Scanner DORKS", "Scanner thread, Dork list is empty.");
                    Interaction.Beep();
                    return;
                }
                stScannerConf.Google      = google;
                stScannerConf.Bing        = bing;
                stScannerConf.Yahoo       = yahoo;
                stScannerConf.Aol         = aol;
                stScannerConf.Yandex      = yandex;
                stScannerConf.Ask         = ask;
                stScannerConf.Wow         = wow;
                stScannerConf.WebCrawler  = webCrawler;
                stScannerConf.MyWebSearch = myWebSearch;
                stScannerConf.Sapo        = sapo;
                if (stScannerConf.Google)
                {
                    stScannerConf.TotalEngines++;
                }
                if (stScannerConf.Bing)
                {
                    stScannerConf.TotalEngines++;
                }
                if (stScannerConf.Yahoo)
                {
                    stScannerConf.TotalEngines++;
                }
                if (stScannerConf.Aol)
                {
                    stScannerConf.TotalEngines++;
                }
                if (stScannerConf.Yandex)
                {
                    stScannerConf.TotalEngines = 1;
                }
                if (stScannerConf.Ask)
                {
                    stScannerConf.TotalEngines++;
                }
                if (stScannerConf.Wow)
                {
                    stScannerConf.TotalEngines++;
                }
                if (stScannerConf.WebCrawler)
                {
                    stScannerConf.TotalEngines++;
                }
                if (stScannerConf.MyWebSearch)
                {
                    stScannerConf.TotalEngines++;
                }
                if (stScannerConf.Sapo)
                {
                    stScannerConf.TotalEngines++;
                }
                if (stScannerConf.TotalEngines == 0)
                {
                    global::Globals.UpDateStatus(__ScannerConf_.Order, "Scanner DORKS", "Scanner thread, select one or more search engine.");
                    Interaction.Beep();
                    return;
                }

                //Commencer
                this.bckWorkerSearch.RunWorkerAsync(stScannerConf);

                goto IL_FD3;
                Interaction.Beep();
                return;

IL_FD3:
                Console.WriteLine("SetGUI OK ==> 159");
            }
        }