Exemple #1
0
        //----- Start Worker -----



        //********  Work With Running Applications ********
        //Skontroluje spustene aplikacie
        void WorkWithRunningApplications()
        {
            if (day != ((short)DateTime.Now.Day))
            {
                PCHour = 0;
                PCMin  = 0;
                appinfo.Clear();
                day = (short)DateTime.Now.Day;
            }

            if (File.Exists(PathMS + "/Temp/appreport.dat"))
            {
                try
                {
                    save.Destroy();
                    save = new SaveWriter(PathMS + "/Temp/appreport.dat");
                    save.Load();
                    int count = save.GetItemInt("Count");
                    for (int i = 0; i < count; i++)
                    {
                        bool   found      = false;
                        string executable = save.GetItem("Module_" + i);
                        for (int j = 0; j < appinfo.Count; j++)
                        {
                            if (appinfo[j].ExecutableName.Equals(executable))
                            {
                                found = true;
                                appinfo[j].AddTime(5);
                            }
                        }

                        if (!found)
                        {
                            appinfo.Add(new ApplicationInfo(save.GetItem("Title_" + i), executable));
                        }
                    }
                    save.Destroy();
                }
                catch (Exception ex)
                {
                    ApplicationLoader.PROCESS_INFORMATION procInfos;
                    ApplicationLoader.StartProcessAndBypassUAC(AppDomain.CurrentDomain.BaseDirectory + "/Apps/GetRunningApplications.exe", out procInfos);
                    DebugService.WriteError("Bad load data:   " + ex);
                    return;
                }
            }

            ApplicationLoader.PROCESS_INFORMATION procInfo;
            ApplicationLoader.StartProcessAndBypassUAC(AppDomain.CurrentDomain.BaseDirectory + "/Apps/GetRunningApplications.exe", out procInfo);
        }
Exemple #2
0
        //---------- Save App Monitoring ----------



        //********* Load App Monitoring *********
        void LoadAppMonitoring()
        {
            try
            {
                Directory.CreateDirectory(PathMS + "/MonitoringReports/App/");
                if (File.Exists(PathMS + "/MonitoringReports/App/" + DateTime.Now.Day + "-" + DateTime.Now.Month + "-" + DateTime.Now.Year + ".apprep"))
                {
                    save = new SaveWriter(PathMS + "/MonitoringReports/App/" + DateTime.Now.Day + "-" + DateTime.Now.Month + "-" + DateTime.Now.Year + ".apprep");
                    save.Load();
                    for (int i = 0; i < save.GetItemInt("Count"); i++)
                    {
                        ApplicationInfo inf = new ApplicationInfo(save.GetItem("Title_" + i), save.GetItem("Module_" + i));
                        inf.SetTime(save.GetItemInt("TimeHours_" + i), save.GetItemInt("TimeMin_" + i));
                        appinfo.Add(inf);
                    }

                    PCHour = save.GetItemInt("PCTimeHour");
                    PCMin  = save.GetItemInt("PCTimeMinutes");
                    save.Destroy();
                }
            }
            catch (Exception ex)
            {
                DebugService.WriteError("" + ex);
            }
        }
Exemple #3
0
        //********* Load App Monitoring *********
        public static List <ApplicationInfo> LoadAppMonitoring(string name)
        {
            List <ApplicationInfo> appinfo = new List <ApplicationInfo>();

            try
            {
                SaveWriter save = new SaveWriter();
                if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "/My Spy/MonitoringReports/App/" + name + ".apprep"))
                {
                    save = new SaveWriter(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "/My Spy/MonitoringReports/App/" + name + ".apprep");
                    save.Load();
                    for (int i = 0; i < save.GetItemInt("Count"); i++)
                    {
                        ApplicationInfo inf = new ApplicationInfo(save.GetItem("Title_" + i), save.GetItem("Module_" + i));
                        inf.SetTime(save.GetItemInt("TimeHours_" + i), save.GetItemInt("TimeMin_" + i));
                        appinfo.Add(inf);
                    }
                    PCHour = save.GetItemInt("PCTimeHour");
                    PCMin  = save.GetItemInt("PCTimeMinutes");
                    save.Destroy();
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("" + ex);
                return(appinfo);
            }
            return(appinfo);
        }
Exemple #4
0
        }//----- Form 1 Load -----

        //******* Get notice ********
        void GetNotice()
        {
            Directory.CreateDirectory(PathMS + "/MonitoringReports/Notes/");
            Directory.CreateDirectory(PathMS + "/Temp/");

            DirectoryInfo dir = new DirectoryInfo(PathMS + "/MonitoringReports/Notes/");

            SaveWriter load = new SaveWriter();

            if (File.Exists(PathMS + "/Temp/Rnotes.dat"))
            {
                File.Delete(PathMS + "/Temp/Rnotes.dat");
            }

            SaveWriter save = new SaveWriter(PathMS + "/Temp/Rnotes.dat");

            int k = 0;

            foreach (FileInfo file in dir.GetFiles("*.notesp"))
            {
                load.Destroy();
                load.PathToFile = file.FullName;
                load.Load();
                if (load.GetItemBool("Warn"))
                {
                    save.AddItem("NotePath" + k, file.FullName);
                    save.AddItem("NoteDate" + k, load.GetItem("WarnTimeDate"));
                    k++;
                }
            }
            save.AddItem("Count", k);
            save.Save();
        }
Exemple #5
0
        private void Form1_Load(object sender, EventArgs e)
        {
            day = DateTime.Now.Day;

            keylogger = bool.Parse((string)registry.GetValue("Keylogger", "False"));

            internet = bool.Parse((string)registry.GetValue("Internet", "False"));

            if (keylogger)
            {
                ShowWarning();
            }

            if (internet)
            {
                try
                {
                    RegistryKey registryi = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
                    registryi.SetValue("ProxyEnable", 1);
                    registryi.SetValue("ProxyServer", "127.0.0.1:8333");

                    InternetReports.BlockSites       = bool.Parse((string)registry.GetValue("InternetBlockList", "False"));
                    InternetReports.BlockSocialSites = bool.Parse((string)registry.GetValue("InternetBlockSocial", "False"));

                    if (InternetReports.BlockSites)
                    {
                        if (File.Exists(PathMS + "/Block/BlockWebsites.dat"))
                        {
                            SaveWriter set = new SaveWriter(PathMS + "/Block/BlockWebsites.dat");
                            set.Load();
                            for (int i = 0; i < set.GetItemInt("Count"); i++)
                            {
                                InternetReports.WebBlock.Add(set.GetItem("Website" + i));
                            }
                        }
                    }

                    Directory.CreateDirectory(PathMS + "/MonitoringReports/Internet/");

                    InternetReports.save = new StreamWriter(PathMS + "/MonitoringReports/Internet/" + DateTime.Now.Day + "-" + DateTime.Now.Month + "-" + DateTime.Now.Year + ".dat", true);

                    int port = 8333;
                    //const bool bUseIPv6 = false;

                    TcpServer Server = new TcpServer(port, false);

                    Server.Start(TransparentProxy.CreateProxy);
                }catch (Exception ex)
                {
                    Debug.WriteLine("" + ex);
                }
            }
        }
Exemple #6
0
        private void AddNote_Load(object sender, EventArgs e)
        {
            if (Edit)
            {
                SaveWriter save = new SaveWriter(SPath);
                save.Load();
                richTextBox1.Text = File.ReadAllText(Path);
                this.Text         = ResourcesFiles.ProgramStrings.EditNote;
                button2.Text      = ResourcesFiles.ProgramStrings.EditNote;
                this.Icon         = Properties.Resources.noteediticon;

                dateTimePicker1.Value = DateTime.Parse(save.GetItem("WarnTimeDate"));
                dateTimePicker2.Value = DateTime.Parse(save.GetItem("WarnTimeDate"));
                Createdate            = DateTime.Parse(save.GetItem("DateofCreate"));

                checkBox1.Checked = save.GetItemBool("Warn");
                checkBox2.Checked = save.GetItemBool("Password");

                save.Clear();

                //dateTimePicker1.Value = DateTime.Parse(save.GetItem("WarnTimeDate"));
            }
        }
Exemple #7
0
        //------------- On Start ---------------


        //******* Get notice ********
        void ReadNotice()
        {
            notice.Clear();
            try
            {
                Directory.CreateDirectory(PathMS + "/Temp/");

                if (File.Exists(PathMS + "/Temp/Rnotes.dat"))
                {
                    SaveWriter save = new SaveWriter(PathMS + "/Temp/Rnotes.dat");
                    save.Load();
                    int cnt = save.GetItemInt("Count");

                    for (int i = 0; i < cnt; i++)
                    {
                        notice.Add(new NoteRemind(save.GetItem("NotePath" + i), DateTime.Parse(save.GetItem("NoteDate" + i))));
                    }
                    //notice.Add
                }
            }catch (Exception ex)
            {
                DebugService.WriteError("" + ex);
            }
        }
Exemple #8
0
 private void PictureBoxAlert_MouseHover(object sender, EventArgs e)
 {
     tt.SetToolTip(this.imageButtonAlert, ResourcesFiles.ProgramStrings.RemindDate + " - " + save.GetItem("WarnTimeDate"));
 }
Exemple #9
0
        private void Form1_Load(object sender, EventArgs e)
        {
            if (!File.Exists(PathMS + "/Settings/chat.dat"))
            {
                MessageBox.Show("Login or register to continue.", "Not logged in");
                RegisterLoginForm frm = new RegisterLoginForm();
                frm.Show();
            }
            else
            {
                SaveWriter save = new SaveWriter(PathMS + "/Settings/chat.dat");

                save.Load();
                string usr  = save.GetItem("Username");
                string pass = encryptpass.DecryptString(save.GetItem("Password"), "1cPOnaLrV2MusS4Cq3aU6dja");

                Administrator = save.GetItemBool("Admin");


                if (Administrator)
                {
                    label1.Visible = true;
                }



                if (Administrator)
                {
                    ReceiverJID = usr + "@" + XmppConnection.Server;
                    usr         = "******" + usr;
                }
                else
                {
                    ReceiverJID = "Admin_" + usr + "@" + XmppConnection.Server;
                }


                //connection.Login(usr, pass);
                //connection.Connect();


                connection.ConnectToXMPPIM(usr, pass);

                /*
                 * XmppIm xmppim = new XmppIm("", "", "");
                 * xmppim;*/

                //Debug.WriteLine(connection.GetXmppClient().Authenticated);
                //Debug.WriteLine(connection.IsConnected());

                Debug.WriteLine("Connected as " + connection.GetXmppIm().Jid);
                connection.GetXmppIm().Message += Connection_Message;


                Debug.WriteLine("Size: " + connection.Rostersize());
                connection.AddToRoster(ReceiverJID);

                connection.GetXmppIm().RequestSubscription(ReceiverJID);
                connection.ApproveRequest(ReceiverJID);

                connection.GetXmppIm().Status += Connection_Status;


                Debug.WriteLine("ReceiverJID: " + ReceiverJID);
            }

            /*
             * RegisterLoginForm frm = new RegisterLoginForm();
             * frm.Show();
             */
        }
Exemple #10
0
        //********* ONSTART ***********
        protected override void OnStart(string[] args)
        {
            DebugService.Write("*******   " + DateTime.Now + "   ********");
            DebugService.Write("Start");

            //nacitaju sa nastavenia
            MonApp    = bool.Parse((string)registry.GetValue("MonitorApplications", "False"));
            Keylogger = bool.Parse((string)registry.GetValue("Keylogger", "False"));
            StatsEn   = bool.Parse((string)registry.GetValue("Statistics", "True"));
            Internet  = bool.Parse((string)registry.GetValue("Internet", "False"));

            DebugService.Write("Monitoring Applications: " + MonApp + "  Keylogger: " + Keylogger + "  Statistics: " + StatsEn);


            day      = (short)DateTime.Now.Day;
            RestartD = DateTime.Now.Day;

            //kazdych 5 minut
            timer1          = new System.Timers.Timer();
            timer1.Elapsed += new ElapsedEventHandler(OnTimer1_Tick);
            timer1.Interval = 300000;
            timer1.Enabled  = true;

            //kazdu minutu
            timer2          = new System.Timers.Timer();
            timer2.Elapsed += new ElapsedEventHandler(OnTimer2_Tick);
            timer2.Interval = 60000;
            timer2.Enabled  = true;


            //timer pre odosielanie dat na Web - 20 minut
            timerWeb          = new System.Timers.Timer();
            timerWeb.Elapsed += new ElapsedEventHandler(OnTimerWeb_Tick);
            timerWeb.Interval = 1200000;
            timerWeb.Enabled  = true;

            if (File.Exists(PathMS + "/Temp/ExpiredTime.dat"))
            {
                short TimeDay = short.Parse(File.ReadAllText(PathMS + "/Temp/ExpiredTime.dat"));
                if (TimeDay == day)
                {
                    ShutDownVerify = true;
                    ApplicationLoader.PROCESS_INFORMATION procInfo;
                    ApplicationLoader.StartProcessAndBypassUAC(AppDomain.CurrentDomain.BaseDirectory + "/Apps/VerifyUser.exe", out procInfo);
                }
                else
                {
                    ShutDownVerify = false;
                    File.Delete(PathMS + "/Temp/ExpiredTime.dat");
                }
            }


            if (MonApp)
            {
                ApplicationLoader.PROCESS_INFORMATION procInfo;
                ApplicationLoader.StartProcessAndBypassUAC(AppDomain.CurrentDomain.BaseDirectory + "/Apps/GetRunningApplications.exe", out procInfo);

                LoadAppMonitoring();
            }


            if (Keylogger || Internet)
            {
                StartWorker();
            }


            if (StatsEn)
            {
                LoadStatistics();
            }


            ReadNotice();

            Directory.CreateDirectory(PathMS + "/Block/");


            SetRemainingPCTime();

            if (File.Exists(PathMS + "/Block/BlockApps.dat"))
            {
                SaveWriter set = new SaveWriter(PathMS + "/Block/BlockApps.dat");
                set.Load();
                BlockApps = set.GetItemBool("Enabled");
                for (int i = 0; i < set.GetItemInt("Count"); i++)
                {
                    blockapplist.Add(set.GetItem("Pr" + i));
                }
            }

            DebugService.Write("PCTime: " + PCTime);



            client.BaseAddress = new Uri("http://myspy.diodegames.eu");


            Newtonsoft.Json.Serialization.DefaultContractResolver dcr = new Newtonsoft.Json.Serialization.DefaultContractResolver();
            dcr.DefaultMembersSearchFlags |= System.Reflection.BindingFlags.NonPublic;
            jss.ContractResolver           = dcr;
        }
Exemple #11
0
        void SetRemainingPCTime()
        {
            if (!ShutDownVerify)
            {
                bool custommaxtimepc = false;

                if (File.Exists(PathMS + "/Block/RemTime.dat"))
                {
                    save = new SaveWriter(PathMS + "/Block/RemTime.dat");
                    save.Load();
                    if (save.GetItemInt("Day") == DateTime.Now.Day)
                    {
                        MaxTimePC       = save.GetItemInt("Time");
                        custommaxtimepc = true;
                    }
                    else
                    {
                        File.Delete(PathMS + "/Block/RemTime.dat");
                    }
                }

                if (File.Exists(PathMS + "/Block/ComputerTime.dat"))
                {
                    SaveWriter save = new SaveWriter(PathMS + "/Block/ComputerTime.dat");
                    save.Load();

                    if (save.GetItemBool("Enable"))
                    {
                        PCTime = true;

                        DateTime time = DateTime.Parse(save.GetItem("Time"));

                        if (!custommaxtimepc)
                        {
                            MaxTimePC = (time.Hour * 60) + time.Minute;
                        }

                        warning     = save.GetItemBool("Warning");
                        warningtime = save.GetItemInt("WarningTime");

                        if (MaxTimePC <= 1)
                        {
                            if (File.Exists(PathMS + "/Temp/ExpiredTime.dat"))
                            {
                                File.Delete(PathMS + "/Temp/ExpiredTime.dat");
                            }

                            File.WriteAllText(PathMS + "/Temp/ExpiredTime.dat", "" + DateTime.Now.Day);
                            PCTime         = false;
                            ShutDownVerify = true;
                            ApplicationLoader.PROCESS_INFORMATION procInfo;
                            ApplicationLoader.StartProcessAndBypassUAC(AppDomain.CurrentDomain.BaseDirectory + "/Apps/VerifyUser.exe", out procInfo);
                        }
                    }

                    save.Destroy();
                }
                else
                {
                    PCTime = false;
                }
            }
        }
Exemple #12
0
        private void backgroundWorkerWeather_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                bool showw = bool.Parse(HelpClass.GETHtml("http://myspy.diodegames.eu/ShowWeather.txt"));

                if (showw)
                {
                    SaveWriter Loc = new SaveWriter(PathMS + "/Temp/location.dat");
                    Loc.Load();
                    string Latitude = "", Longtitude = "", CityName = "";

                    Latitude   = Loc.GetItem("Latitude");
                    Longtitude = Loc.GetItem("Longtitude");
                    CityName   = Loc.GetItem("City");


                    if (File.Exists(PathMS + "/Temp/weather.dat"))
                    {
                        SaveWriter save = new SaveWriter(PathMS + "/Temp/weather.dat");
                        save.Load();

                        if (save.GetItemInt("Day") != DateTime.Now.Day || DateTime.Now.Hour >= save.GetItemInt("Hour") + 3)
                        {
                            Debug.WriteLine("New Weather: Day: " + save.GetItemInt("Day") + "   Hour: " + save.GetItemInt("Hour"));
                            NewWeather(Latitude, Longtitude, CityName);
                        }
                        else
                        {
                            Debug.WriteLine("Weather from file");
                            weather.weatherinfo.Temperature = save.GetItem("Temperature");
                            weather.weatherinfo.Cloudiness  = save.GetItem("Clouds");
                            weather.weatherinfo.CityName    = save.GetItem("City");
                            weathericon = (Bitmap)Bitmap.FromFile(PathMS + "/Temp/weathericon.dat");

                            SaveWriter wsave = new SaveWriter(PathMS + "/Temp/weathersettings.dat");
                            wsave.Load();
                            bool wunit = wsave.GetItemBool("Unit");

                            if (wunit)
                            {
                                weather.weatherinfo.TemperatureUnit = "F";
                            }
                            else
                            {
                                weather.weatherinfo.TemperatureUnit = "C";
                            }

                            backgroundWorkerWeather.ReportProgress(0, "");
                        }
                    }
                    else
                    {
                        Debug.WriteLine("New Weather because file not found");
                        NewWeather(Latitude, Longtitude, CityName);
                    }
                }
            }catch (Exception ex)
            {
                Debug.WriteLine("" + ex);
            }
        }