Пример #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);
            }
        }
        private void Connect()
        {
            ProcessStartInfo info = new ProcessStartInfo
            {
                FileName  = _puTTYSessionInfo.PuTTYLocation,
                Arguments = PuTTY.BuildCommandLine(_puTTYSessionInfo)
            };

            PuTTYProcess = Process.Start(info);

            PuTTYProcess.WaitForInputIdle();

            AppWin = PuTTYProcess.MainWindowHandle;

            NativeMethods.SetParent(AppWin, puTTYHost.Handle);

            // Show window before set style and resize
            NativeMethods.ShowWindow(AppWin, NativeMethods.WindowShowStyle.Maximize);

            // Remove border etc.
            int style = (int)NativeMethods.GetWindowLong(AppWin, NativeMethods.GWL_STYLE);

            style &= ~(NativeMethods.WS_BORDER | NativeMethods.WS_THICKFRAME);
            NativeMethods.SetWindowLongPtr(AppWin, NativeMethods.GWL_STYLE, new IntPtr(style));

            // Resize embedded application & refresh
            if (PuTTYProcess != null)
            {
                ResizeEmbeddedPuTTY();
            }
        }
Пример #3
0
        private void ConnectSessionExternalAction()
        {
            ProcessStartInfo info = new ProcessStartInfo
            {
                FileName  = SettingsManager.Current.PuTTY_PuTTYLocation,
                Arguments = PuTTY.BuildCommandLine(Models.PuTTY.PuTTYSessionInfo.Parse(SelectedSession))
            };

            Process.Start(info);
        }
Пример #4
0
        private async void Connect()
        {
            ProcessStartInfo info = new ProcessStartInfo
            {
                FileName  = _puTTYSessionInfo.PuTTYLocation,
                Arguments = PuTTY.BuildCommandLine(_puTTYSessionInfo)
            };

            try
            {
                PuTTYProcess = Process.Start(info);

                PuTTYProcess.EnableRaisingEvents = true;
                PuTTYProcess.Exited += PuTTYProcess_Exited;

                PuTTYProcess.WaitForInputIdle();

                // Embed putty window into panel, remove border etc.
                AppWin = PuTTYProcess.MainWindowHandle;

                NativeMethods.SetParent(AppWin, puTTYHost.Handle);

                // Show window before set style and resize
                NativeMethods.ShowWindow(AppWin, NativeMethods.WindowShowStyle.Maximize);

                // Remove border etc.
                long style = (int)NativeMethods.GetWindowLong(AppWin, NativeMethods.GWL_STYLE);
                style &= ~(NativeMethods.WS_CAPTION | NativeMethods.WS_POPUP | NativeMethods.WS_THICKFRAME);
                NativeMethods.SetWindowLongPtr(AppWin, NativeMethods.GWL_STYLE, new IntPtr(style));

                // Resize embedded application & refresh
                if (PuTTYProcess != null)
                {
                    ResizeEmbeddedPuTTY();
                }

                Connected = true;
            }
            catch (Exception ex)
            {
                MetroDialogSettings settings = AppearanceManager.MetroDialog;
                settings.AffirmativeButtonText = LocalizationManager.GetStringByKey("String_Button_OK");

                ConfigurationManager.Current.FixAirspace = true;

                await dialogCoordinator.ShowMessageAsync(this, LocalizationManager.GetStringByKey("String_Header_Error"), ex.Message, MessageDialogStyle.Affirmative, settings);

                ConfigurationManager.Current.FixAirspace = false;
            }
        }