Esempio n. 1
0
 private void MenuMainSetting_Click(object sender, RoutedEventArgs e)
 {
     if (this.Settingpage == null)
     {
         this.Settingpage = new MainSetting();
     }
     ChangePage.Content = new Frame()
     {
         Content = this.Settingpage
     };
 }
Esempio n. 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.Mainpage    = new MainPage();
            this.Payloadpage = new MainPayload();
            this.Settingpage = new MainSetting();

            //
            this.Mainpage.userProfile    = this.userProfile;
            this.Payloadpage.userProfile = this.userProfile;
            this.Payloadpage.listeners   = this.listeners;

            ChangePage.Content = new Frame()
            {
                Content = this.Mainpage
            };
            //检测是否有listeners并拉去

            DataFormat MessageData;

            MessageData.type  = "6";
            MessageData.token = userProfile.token;
            MessageData.data  = null;
            string sendMessage = JsonConvert.SerializeObject(MessageData);

            userProfile.sslTcpClient.ReadMessage(userProfile.sslTcpClient.SendMessage(sendMessage));
            JObject rMJson = (JObject)JsonConvert.DeserializeObject(userProfile.sslTcpClient.resultMessage);

            if (rMJson["code"].ToString() == "200")
            {
                foreach (var item in rMJson["result"])
                {
                    if ((bool)item["status"])
                    {
                        ListenersListView LLV = new ListenersListView(
                            Function.GenerateRandomString(6),
                            "",
                            "",
                            "",
                            item["port"].ToString(),
                            "",
                            "",
                            "",
                            ""
                            )
                        {
                        };
                        this.listeners.Add(LLV);
                    }

                    //Console.WriteLine(Function.GetDateTime(item["time"].ToString()).ToString());
                }
                //Thread.Sleep(1000);
            }
            else if (rMJson["code"].ToString() == "500")
            {
                MessageBox.Show(rMJson["error"].ToString());
            }
            else if (rMJson["code"].ToString() == "401")
            {
                MessageBox.Show(rMJson["error"].ToString());
            }

            //拉取implant
            AsyncObservableCollection <TargetListView> targetListViews = new AsyncObservableCollection <TargetListView>();

            this.Mainpage.BodySessionListView.ItemsSource = targetListViews;

            EventsContent eventsContent = new EventsContent()
            {
            };

            this.Mainpage.EventsTextBox.DataContext = eventsContent;

            GetImplantResultClass myThread = new GetImplantResultClass
            {
                userProfile     = this.userProfile,
                targetListViews = targetListViews,
                eventsContent   = eventsContent
                                  //BodySessionListView = this.Mainpage.BodySessionListView
            };


            Thread thread = new Thread(myThread.GetImplantResult);

            thread.Start();



            //Console.WriteLine(this.userProfile.sslTcpClient.resultMessage);
        }