コード例 #1
0
        private static string DigLikeThereIsNoTomorrow()
        {
            bool   isHighIntegrity = Utils.IsHighIntegrity();
            string findings        = "";

            findings += McAfee.Dig(isHighIntegrity);
            findings += GPP.Dig();
            findings += Unattended.Dig();
            findings += PSReadLine.Dig(isHighIntegrity);
            findings += AWS.Dig(isHighIntegrity);
            findings += Azure.Dig(isHighIntegrity);
            findings += GCP.Dig(isHighIntegrity);
            findings += RDP.Dig(isHighIntegrity);
            findings += PuTTY.Dig(isHighIntegrity);
            findings += SuperPuTTY.Dig(isHighIntegrity);
            findings += WinSCP.Dig(isHighIntegrity);
            findings += FileZilla.Dig(isHighIntegrity);
            findings += VNC.Dig(isHighIntegrity);
            findings += TeamViewer.Dig();
            findings += PulseSecure.Dig();

            if (string.IsNullOrEmpty(findings))
            {
                return("\nDid not find anything :(\n");
            }
            else
            {
                return(findings);
            }
        }
コード例 #2
0
ファイル: App.Runtime.cs プロジェクト: 824462811/mRemoteNC
            private static void OpenConnectionFinal(Connection.Info newConnectionInfo, Connection.Info.Force Force,
                                                    Form ConForm)
            {
                try
                {
                    if (newConnectionInfo.Hostname == "" &&
                        newConnectionInfo.Protocol != Protocols.IntApp)
                    {
                        MessageCollector.AddMessage(MessageClass.WarningMsg,
                                                    Language.strConnectionOpenFailedNoHostname);
                        return;
                    }

                    if (newConnectionInfo.PreExtApp != "")
                    {
                        ExternalTool extA = GetExtAppByName(newConnectionInfo.PreExtApp);
                        if (extA != null)
                        {
                            extA.Start(newConnectionInfo);
                        }
                    }

                    //TODO
                    if (!(((Force & Connection.Info.Force.DoNotJump) == Connection.Info.Force.DoNotJump) || !SwitchToOpenConnection(newConnectionInfo)))
                    {
                        return;
                    }
                    Base newProtocol = new Base();
                        // Create connection based on protocol type
                        switch (newConnectionInfo.Protocol)
                        {
                            case Protocols.RDP:
                                newProtocol = new RDP();
                                break;
                            case Protocols.VNC:
                                newProtocol = new VNC();
                                break;
                            case Protocols.SSH1:
                                newProtocol = new SSH1();
                                break;
                            case Protocols.SSH2:
                                newProtocol = new SSH2();
                                break;
                            case Protocols.Telnet:
                                newProtocol = new Telnet();
                                break;
                            case Protocols.Rlogin:
                                newProtocol = new Rlogin();
                                break;
                            case Protocols.Serial:
                                newProtocol = new Serial();
                                break;
                            case Protocols.RAW:
                                newProtocol = new RAW();
                                break;
                            case Protocols.HTTP:
                                newProtocol = new HTTP(newConnectionInfo.RenderingEngine);
                                break;
                            case Protocols.HTTPS:
                                newProtocol = new HTTPS(newConnectionInfo.RenderingEngine);
                                break;
                            case Protocols.TeamViewer:
                                newProtocol = new TeamViewer();
                                break;
                            case Protocols.RAdmin:
                                newProtocol = new RAdmin();
                                break;
                            case Protocols.ICA:
                                newProtocol = new ICA();
                                break;
                            case Protocols.IntApp:
                                newProtocol = new IntApp();
                                if (newConnectionInfo.ExtApp == "")
                                {
                                    throw (new Exception(Language.strNoExtAppDefined));
                                }
                                break;
                            default:
                                return;
                        }

                    string cPnl;
                    if (((newConnectionInfo.Panel == "") | ((Force & Connection.Info.Force.OverridePanel) == Connection.Info.Force.OverridePanel)) | Settings.Default.AlwaysShowPanelSelectionDlg)
                    {
                        var frmPnl = new frmChoosePanel();
                        if (frmPnl.ShowDialog() == DialogResult.OK)
                        {
                            cPnl = frmPnl.Panel;
                        }
                        else
                        {
                            return;
                        }
                    }
                    else
                    {
                        cPnl = newConnectionInfo.Panel;
                    }

                    Form cForm = ConForm ?? WindowList.FromString(cPnl);

                    if (cForm == null)
                    {
                        cForm = AddPanel(cPnl);
                        cForm.Focus();
                    }
                    else
                    {
                        (cForm as UI.Window.Connection).Show(frmMain.Default.pnlDock);
                        (cForm as UI.Window.Connection).Focus();
                    }

                    Control cContainer = (cForm as UI.Window.Connection).AddConnectionTab(newConnectionInfo);

                    if (newConnectionInfo.Protocol == Protocols.IntApp)
                    {
                        if (GetExtAppByName(newConnectionInfo.ExtApp).Icon != null)
                        {
                            (cContainer as TabPage).Icon =
                                GetExtAppByName(newConnectionInfo.ExtApp).Icon;
                        }
                    }

                    newProtocol.Closed +=  (cForm as UI.Window.Connection).Prot_Event_Closed;
                    newProtocol.Connected += (cForm as UI.Window.Connection).Prot_Event_Connected;
                    newProtocol.Disconnected += Prot_Event_Disconnected;
                    newProtocol.Connected += Prot_Event_Connected;
                    newProtocol.Closed += Prot_Event_Closed;
                    newProtocol.ErrorOccured += Prot_Event_ErrorOccured;
                    (cForm as UI.Window.Connection).ResizeBegin += newProtocol.ResizeBegin;
                    (cForm as UI.Window.Connection).ResizeEnd += newProtocol.ResizeEnd;
                    (cForm as UI.Window.Connection).Resize += newProtocol.Resize;

                    newProtocol.InterfaceControl = new InterfaceControl(cContainer, newProtocol, newConnectionInfo);

                    newProtocol.Force = Force;

                    if (newProtocol.SetProps() == false)
                    {
                        newProtocol.Close();
                        return;
                    }

                    if (newProtocol.Connect() == false)
                    {
                        newProtocol.Close();
                        return;
                    }

                    newConnectionInfo.OpenConnections.Add(newProtocol);

                    if (newConnectionInfo.IsQuicky == false)
                    {
                        if (newConnectionInfo.Protocol != Protocols.IntApp)
                        {
                            Node.SetNodeImage(newConnectionInfo.TreeNode, Enums.TreeImage.ConnectionOpen);
                        }
                        else
                        {
                            ExternalTool extApp = GetExtAppByName((string)newConnectionInfo.ExtApp);
                            if (extApp != null)
                            {
                                if (extApp.TryIntegrate)
                                {
                                    if (newConnectionInfo.TreeNode != null)
                                    {
                                        Node.SetNodeImage(newConnectionInfo.TreeNode,
                                                          Enums.TreeImage.ConnectionOpen);
                                    }
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageCollector.AddMessage(MessageClass.ErrorMsg,
                                                Language.strConnectionOpenFailed + Constants.vbNewLine +
                                                ex.Message);
                }
            }