Пример #1
0
        /// <summary>
        /// Extracts the complete URL (which means ScanProvider plus query) of
        /// the selected Dork.
        /// </summary>
        /// <returns>URL of the selected Dork.</returns>
        private string GetRequestFromSelected()
        {
            TreeNode treenode = tvwDorks.SelectedNode;

            if (treenode != null)
            {
                Dork dork = treenode.Tag as Dork;
                if (dork != null)
                {
                    IScanProvider  scanProvider = new ScanGoogleProvider();
                    RequestBuilder req          = new RequestBuilder(scanProvider);

                    return(req.getRequest(dork.Query, scanHostTextBox.Text.Trim(), 0));
                }
            }
            return(null);
        }
Пример #2
0
        /// <summary>
        /// MouseMove-event. This enables drag-and-drop if a dork is dragged somewhere,
        /// (to a browser eg).
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tvw_MouseMove(object sender, MouseEventArgs e)
        {
            if ((e.Button & MouseButtons.Left) == MouseButtons.Left)
            {
                TreeNode treenode = tvwDorks.SelectedNode;
                if (treenode != null)
                {
                    Dork dork = treenode.Tag as Dork;
                    if (dork != null)
                    {
                        IScanProvider  scanProvider = new ScanGoogleProvider();
                        RequestBuilder req          = new RequestBuilder(scanProvider);

                        string currentRequest = req.getRequest(dork.Query, "", 0);
                        tvwDorks.DoDragDrop(currentRequest, DragDropEffects.Copy);
                    }
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Run a scan with a DorkDone.
        /// </summary>
        /// <param name="DorkToScan">DorkDone to scan.</param>
        /// <returns>True if no errors occured.</returns>
        public bool DoDork(DorkDone DorkToScan)
        {
            _ScanStatus = (int)SCANTHREADSTATE.Working;
            RequestBuilder req = new RequestBuilder(scanProvider);

            httpGet = new HttpSimpleGet(Properties.Settings.Default.ScanTimeOut);

            string currentRequest = req.getRequest(DorkToScan.Query,
                                                   DorkToScan.Host,
                                                   DorkToScan.NextPage);

            Trace.WriteLineIf(Debug.Trace.TraceGoolag.TraceInfo, currentRequest, "ScanURL:");

            if (!httpGet.Do(currentRequest))
            {
                DorkToScan.ErrorMessage = httpGet.GetErrorMessage();
                DorkToScan.ScanResult   = (int)RESULT_STATUS.Failure;
                _ScanStatus             = (int)SCANTHREADSTATE.Finished;
                firstResultDork         = DorkToScan;
                return(false);
            }

            ParseHtmlResults parser = new ParseHtmlResults(scanProvider, DorkToScan.NextPage);

            parsedResults = parser.Parse(httpGet.GetResults());

            if (parsedResults.Count > 0)
            {
                DorkToScan.ScanResult = (int)RESULT_STATUS.ScanWithResult;
                DorkToScan.NextPage   = parser.NextPage;

                DorkDone tmpDork = null;

                foreach (string parsedUrl in parsedResults)
                {
                    DorkDone newDork = new DorkDone();
                    newDork           = (DorkDone)DorkToScan.Clone();
                    newDork.ResultURL = parsedUrl;
                    newDork.Next      = tmpDork;
                    tmpDork           = newDork;
                }

                firstResultDork = tmpDork;
            }
            else
            {
                DorkToScan.Next = null;
                firstResultDork = DorkToScan;

                if (parser.Blocked)
                {
                    DorkToScan.ScanResult = (int)RESULT_STATUS.Blocked;
                    DorkToScan.ResultURL  = httpGet.ResponseUri;
                }
                else
                {
                    DorkToScan.ScanResult = (int)RESULT_STATUS.Nothing;
                }
            }

            _ScanStatus = (int)SCANTHREADSTATE.Finished;
            return(true);
        }