예제 #1
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...
        }