Esempio n. 1
0
        public void onStartAttack()
        {
            if (Config.IsActive)
            {
                if (InvokeRequired)
                {
                    BeginInvoke(new onStartAttackDelegate(onStartAttack), new object[] { });
                    return;
                } // if (InvokeRequired)


                try
                {
                    setGUIInactive();
                    cTask.onStart();
                    PluginParameters.HostApplication.PluginSetStatus(this, "green");
                }
                catch (InjWarningException lEx)
                {
                    PluginParameters.HostApplication.LogMessage(String.Format("{0}: {1}", Config.PluginName, lEx.Message));
                    PluginParameters.HostApplication.PluginSetStatus(this, "grey");
                    cTask.onStop();
                }
                catch (Exception lEx)
                {
                    setGUIActive();
                    PluginParameters.HostApplication.PluginSetStatus(this, "red");
                    PluginParameters.HostApplication.LogMessage(String.Format("{0}: {1}", Config.PluginName, lEx.Message));
                    cTask.onStop();
                }
            } // if (cIsActiv...
        }
        private void onIPAccountingExited()
        {
            if (InvokeRequired)
            {
                BeginInvoke(new onIPAccountingExitedDelegate(onIPAccountingExited), new object[] { });
                return;
            }

            setGUIActive();
            cTask.onStop();
            cPluginParams.HostApplication.PluginSetStatus(this, "red");
        }
Esempio n. 3
0
        public delegate void onIMAP4ProxyExitedDelegate(); //object sender, System.EventArgs e);

        private void onIMAP4ProxyExited()                  //object sender, System.EventArgs e)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new onIMAP4ProxyExitedDelegate(onIMAP4ProxyExited), new object[] { /* sender, e */ });
                return;
            } // if (InvokeRequired)

            PluginParameters.HostApplication.PluginSetStatus(this, "red");
            PluginParameters.HostApplication.LogMessage(String.Format("{0}: Stopped for unknown reason", Config.PluginName));
            setGUIActive();
            cTask.onStop();
        }
Esempio n. 4
0
        public void onStartAttack()
        {
            if (Config.IsActive)
            {
                if (InvokeRequired)
                {
                    BeginInvoke(new onStartAttackDelegate(onStartAttack), new object[] { });
                    return;
                } // if (InvokeRequired)

                PluginParameters.HostApplication.PluginSetStatus(this, "green");
                setGUIInactive();


                if ((!CB_RedirectTo.Checked && !String.IsNullOrEmpty(TB_RemoteHost.Text)) ||
                    (CB_RedirectTo.Checked && !String.IsNullOrEmpty(TB_RedirectURL.Text)))
                {
                    WebServerConfig pConfig = new WebServerConfig
                    {
                        BasisDirectory  = Config.BaseDir,
                        isDebuggingOn   = PluginParameters.HostApplication.IsDebuggingOn(),
                        isRedirect      = CB_RedirectTo.Checked,
                        RedirectToURL   = TB_RedirectURL.Text,
                        RemoteHostName  = TB_RemoteHost.Text,
                        onWebServerExit = onWebServerExited
                    };


                    try
                    {
                        cTask.startProxies(pConfig);
                    }
                    catch (Exception lEx)
                    {
                        String lLogMsg = String.Format("{0}: {1}", Config.PluginName, lEx.Message);
                        setGUIActive();
                        PluginParameters.HostApplication.LogMessage(lLogMsg);
                        PluginParameters.HostApplication.PluginSetStatus(this, "red");

                        PluginParameters.HostApplication.LogMessage(String.Format("{0}: {1}", Config.PluginName, lEx.Message));
                        cTask.onStop();
                    }
                }
                else
                {
                    PluginParameters.HostApplication.LogMessage(String.Format("{0}: No forwarding host/URL defined. Stopping the pluggin.", Config.PluginName));
                    PluginParameters.HostApplication.PluginSetStatus(this, "grey");
                    cTask.onStop();
                } // if (lRemoteHost ...
            }     // if (cIsActiv...
        }
Esempio n. 5
0
        public void onStopAttack()
        {
            if (InvokeRequired)
            {
                BeginInvoke(new onStopAttackDelegate(onStopAttack), new object[] { });
                return;
            } // if (InvokeRequired)

            setGUIActive();
            PluginParameters.HostApplication.PluginSetStatus(this, "grey");

            // Delete firewall rules file
            String lFWRulesPath = PluginParameters.HostApplication.GetAPEFWRulesFile();

            cTask.onStop(lFWRulesPath);
        }