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

                try
                {
                    String lFWRulesPath = PluginParameters.HostApplication.GetAPEFWRulesFile();
                    cTask.onStart(lFWRulesPath);

                    setGUIInactive();
                    PluginParameters.HostApplication.PluginSetStatus(this, "green");
                }
                catch (ExceptionWarning lEx)
                {
                    PluginParameters.HostApplication.PluginSetStatus(this, "grey");
                    PluginParameters.HostApplication.LogMessage(String.Format("{0}: {1}", Config.PluginName, lEx.Message));
                }
            } // if (cIsActiv...
        }
示例#2
0
        public void onStartAttack()
        {
            if (Config.IsActive)
            {
                if (InvokeRequired)
                {
                    BeginInvoke(new onStartAttackDelegate(onStartAttack), new object[] { });
                    return;
                } // if (InvokeRequired)


                try
                {
                    ProxyConfig lProxyConfig = new ProxyConfig
                    {
                        BasisDirectory = PluginParameters.HostApplication.GetWorkingDirectory(),
                        isDebuggingOn  = PluginParameters.HostApplication.IsDebuggingOn(),
                        onProxyExit    = onIMAP4ProxyExited,
                        RemoteHostName = TB_ForwardHost.Text
                    };

                    setGUIInactive();
                    cTask.onStart(lProxyConfig);
                    PluginParameters.HostApplication.PluginSetStatus(this, "green");
                }
                catch (ExceptionWarning lEx)
                {
                    PluginParameters.HostApplication.PluginSetStatus(this, "grey");
                    setGUIActive();
                    cTask.onStop();

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

                    String lMsg = String.Format("{0}: {1}", Config.PluginName, lEx.Message);
                    PluginParameters.HostApplication.LogMessage(lMsg);
                    MessageBox.Show(lMsg, "Can't start proxy server", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            } // if (cIsActi...
        }
        public void onStartAttack()
        {
            if (Config.IsActive)
            {
                if (InvokeRequired)
                {
                    BeginInvoke(new onStartAttackDelegate(onStartAttack), new object[] { });
                    return;
                } // if (InvokeRequired)

                /*
                 * Start accounting application.
                 */

                try
                {
                    cTask.onInit();
//          setGUIInactive();

                    IPAccountingConfig lConfig = new IPAccountingConfig
                    {
                        BasisDirectory     = Config.BaseDir,
                        isDebuggingOn      = cPluginParams.HostApplication.IsDebuggingOn(),
                        onUpdateList       = update,
                        onIPAccountingExit = onIPAccountingExited,
                        Interface          = cPluginParams.HostApplication.GetInterface(),
                        StructureParameter = cAccountingBasis
                    };

                    cTask.onStart(lConfig);
                    cPluginParams.HostApplication.PluginSetStatus(this, "green");
                }
                catch (Exception lEx)
                {
                    cTask.onStop();
                    cPluginParams.HostApplication.PluginSetStatus(this, "red");

                    cPluginParams.HostApplication.LogMessage(String.Format("{0}: {1}", Config.PluginName, lEx.Message));
                }
            } // if (cIsActi...
        }