public FacebookViewModel(WindsorContainer applicationWindsorContainer, ExportVm model, IFacebookView view) : base(applicationWindsorContainer, model, view)
        {
            try
            {
                this.Comments      = model.SnooperExportedObjects.Where(i => i is FacebookComment).Cast <FacebookComment>().ToArray();
                this.Messages      = model.SnooperExportedObjects.Where(i => i is FacebookMessage).Cast <FacebookMessage>().ToArray();
                this.GroupMessages = model.SnooperExportedObjects.Where(i => i is FacebookGroupMessage).Cast <FacebookGroupMessage>().ToArray();
                this.Statuses      = model.SnooperExportedObjects.Where(i => i is FacebookStatus).Cast <FacebookStatus>().ToArray();
                this.Photos        = model.SnooperExportedObjects.Where(i => i is FacebookMessengerPhoto).Cast <FacebookMessengerPhoto>().ToArray();
                this.Files         = model.SnooperExportedObjects.Where(i => i is FacebookMessengerFile).Cast <FacebookMessengerFile>().ToArray();
                this.GroupPhotos   = model.SnooperExportedObjects.Where(i => i is FacebookMessengerGroupPhoto).Cast <FacebookMessengerGroupPhoto>().ToArray();
                this.GroupFiles    = model.SnooperExportedObjects.Where(i => i is FacebookMessengerGroupFile).Cast <FacebookMessengerGroupFile>().ToArray();

                if (this.AnyObjects())
                {
                    this.IsActive = true;
                    this.IsHidden = false;
                }
                else
                {
                    this.IsHidden = true;
                    this.IsActive = false;
                }

                //this.ExportVmObserver.RegisterHandler(p => p.SelectedSnooperExportObject, p => this.OnPropertyChanged(nameof(this.SelectedComment)));
            }
            catch (Exception ex)
            {
                this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
            }
        }
        public async Task <IActionResult> Export([FromBody] ExportVm vm)
        {
            if (vm == null)
            {
                return(BadRequest());
            }

            int userId;

            try
            {
                userId = IdentityHelper.GetUserId(User);
            }
            catch (UnauthorizedAccessException)
            {
                return(Unauthorized());
            }

            string directory        = Path.Combine(_webHostEnvironment.ContentRootPath, "storage", "temp");
            var    exportAsCsvModel = new ExportAsCsv(userId, directory, vm.FileId, _localizer["Uncategorized"], _localizer["Encrypted"]);

            FileStream file = await _transactionService.ExportAsCsvAsync(exportAsCsvModel);

            Response.Headers.Add("Content-Disposition", "attachment; filename=\"transactions.csv\"");
            return(new FileStreamResult(file, "text/csv"));
        }
 private void ExportResultsListViewOnExportResultSelected(ExportVm exportResultVm, bool bringIntoView)
 {
     ExportResultMessage.SendExportResultMessage(exportResultVm, ExportResultMessage.MessageType.ExportResultSelected);
     if (bringIntoView)
     {
         BringToFrontMessage.SendBringToFrontMessage("ExportResultView");
     }
 }
Beispiel #4
0
        public void WindowTest()
        {
            this.FrameworkController.ProcessCapture(this.PrepareCaptureForProcessing(SnoopersPcaps.Default.webmail_webmail_gmail_pcapng));

            var conversations = this.L7Conversations.ToArray();
            var pk            = File.ReadAllText(PrivateKeys.Default.pk_pem);

            foreach (var conversation in conversations)
            {
                conversation.Key = new CypherKey
                {
                    ServerPrivateKey = pk
                };
            }

            this.FrameworkController.ExportData(this.AvailableSnoopers, conversations, this.CurrentTestBaseDirectory, true);

            var exportsObservableCollection = new ObservableCollection <HTTPMsg>();

            foreach (var exportobject in this.SnooperExports.ToList()[0].ExportObjects)
            {
                var httpExport = exportobject as SnooperExportedDataObjectHTTP;
                if (httpExport != null)
                {
                    exportsObservableCollection.Add(httpExport.Message);
                }
            }

            var exportVm  = new ExportVm(this.WindsorContainer, this.SnooperExports.ToList()[0]);
            var viewModel = new SnooperHTTPViewModel(this.WindsorContainer, exportVm, null);

            Thread t = new Thread(() =>
            {
                var window = new TestWindow();
                var uc     = new HTTPExportsView
                {
                    DataContext = viewModel
                };
                window.Content = uc;

                // Initiates the dispatcher thread shutdown when the window closes
                window.Closed += (s, e) => window.Dispatcher.InvokeShutdown();

                window.Show();

                // Makes the thread support message pumping
                System.Windows.Threading.Dispatcher.Run();
            });

            t.SetApartmentState(ApartmentState.STA);

            t.Start();
            t.Join();
        }
Beispiel #5
0
 public VoIPExplorerVm(WindsorContainer applicationWindsorContainer, ExportVm model, IVoIPExplorerView view) : base(applicationWindsorContainer, model, view)
 {
     try
     {
         this.IsHidden             = !this.ExportVm.Calls.Any();
         this.IsActive             = this.ExportVm.Calls.Any();
         this.DockPositionPosition = DetectiveDockPosition.DockedLeft;
         this.ExportVmObserver.RegisterHandler(p => p.SelectedSnooperExportObject, p => this.OnPropertyChanged(nameof(this.SelectedCall)));
     }
     catch (Exception ex) {
         this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
     }
 }
 public BTCExportViewModel(WindsorContainer applicationWindsorContainer, ExportVm model, IBTCExportView view) : base(applicationWindsorContainer, model, view)
 {
     try
     {
         this.BTCObjects = new ObservableCollection <SnooperExportedDataObjectBTC>(
             model.SnooperExportedObjects.Where(x => x is SnooperExportedDataObjectBTC).Cast <SnooperExportedDataObjectBTC>());
         this.IsHidden = !this.BTCObjects.Any();
         this.IsActive = this.BTCObjects.Any();
     }
     catch (Exception ex) {
         this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
     }
 }
Beispiel #7
0
 public SnooperWebmailViewModel(WindsorContainer applicationWindsorContainer, ExportVm model, IWebmailExportsView view) : base(applicationWindsorContainer, model, view)
 {
     try
     {
         this.WebmailEvents = model.SnooperExportedObjects.Where(x => x is WebmailEventBase).Cast <WebmailEventBase>().ToArray();
         this.IsHidden      = !this.WebmailEvents.Any();
         this.IsActive      = this.WebmailEvents.Any();
         this.ExportVmObserver.RegisterHandler(x => x.SelectedSnooperExportObject, x => this.OnPropertyChanged(nameof(this.SelectedEvent)));
     }
     catch (Exception ex)
     {
         this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
     }
 }
 public VoIPSummaryVm(WindsorContainer applicationWindsorContainer, ExportVm model, IVoIPSummary view) : base(applicationWindsorContainer, model, view)
 {
     try
     {
         Task.Run(() =>
         {
             this.IsHidden = !this.ExportVm.Calls.Any();
             this.IsActive = this.ExportVm.Calls.Any();
             this.ExportVmObserver.RegisterHandler(p => p.SelectedSnooperExportObject, p => this.OnPropertyChanged(nameof(this.SelectedCall)));
         });
     }
     catch (Exception ex) {
         this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
     }
 }
Beispiel #9
0
        public VoIPCallDetailVm(WindsorContainer applicationWindsorContainer, ExportVm model, IVoIPCallDetailView view) : base(applicationWindsorContainer, model, view)
        {
            try
            {
                this.IsHidden             = !this.ExportVm.Calls?.Any() ?? true;
                this.IsActive             = this.ExportVm.Calls?.Any() ?? false;
                this.DockPositionPosition = DetectiveDockPosition.DockedDocument;
                this.ExportVmObserver.RegisterHandler(p => p.SelectedSnooperExportObject, p =>
                {
                    if (p.SelectedSnooperExportObject is ICall)
                    {
                        try
                        {
                            this.SelectedCall = p.SelectedSnooperExportObject as ICall;
                            this.IsHidden     = false;
                            this.IsActive     = true;

                            this.UpdateCallStreams();

                            this.CallStreams         = this.SelectedCall.CallStreams.Select(callStream => new CallStreamVm(callStream)).ToArray();
                            this.PossibleCallStreams = this.SelectedCall.PossibleCallStreams.Select(callStream => new CallStreamVm(callStream)).ToArray();

                            this.CPlay.RaiseCanExecuteChanged();
                            this.CPause.RaiseCanExecuteChanged();
                            this.CStop.RaiseCanExecuteChanged();
                        }
                        catch (Exception ex)
                        {
                            this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
                            this.SelectedCall = null;
                            this.IsHidden     = true;
                            this.IsActive     = false;
                        }
                    }
                    else
                    {
                        this.SelectedCall = null;
                        this.IsHidden     = true;
                        this.IsActive     = false;
                    }
                });
            }
            catch (Exception ex) {
                this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
            }
        }
Beispiel #10
0
 //public SnooperHTTPViewModel(WindsorContainer investigationOrAppWindsorContainer, ObservableCollection<HTTPMsg> model) : base(investigationOrAppWindsorContainer, model)
 //{
 //   this.HTTPMsgs = model;
 //}
 public SnooperHTTPViewModel(IWindsorContainer applicationWindsorContainer, ExportVm model, IHTTPExportsView view) : base(applicationWindsorContainer, model, view)
 {
     try
     {
         Task.Run(() =>
         {
             this.HTTPMsgs = model.SnooperExportedObjects.Where(i => i is SnooperExportedDataObjectHTTP).Cast <SnooperExportedDataObjectHTTP>().ToArray();
             this.IsHidden = !this.HTTPMsgs.Any();
             this.IsActive = this.HTTPMsgs.Any();
             this.ExportVmObserver.RegisterHandler(p => p.SelectedSnooperExportObject, p => this.OnPropertyChanged(nameof(this.SelectedMsg)));
         });
     }
     catch (Exception ex)
     {
         this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
     }
 }
        public void WindowTest()
        {
            this.FrameworkController.ProcessCapture(this.PrepareCaptureForProcessing(SnoopersPcaps.Default.webmail_webmail_yahoo_rc4_pcapng));

            var conversations = this.L7Conversations.ToArray();
            var pk            = File.ReadAllText(PrivateKeys.Default.pk_pem);

            foreach (var conversation in conversations)
            {
                conversation.Key = new CypherKey();
                conversation.Key.ServerPrivateKey = pk;
            }

            this.FrameworkController.ExportData(this.AvailableSnoopers.Where(x => x is Netfox.SnooperHTTP.SnooperHTTP), conversations, this.CurrentTestBaseDirectory, true);

            this.FrameworkController.ExportData(this.AvailableSnoopers.Where(x => x is SnooperWebmails), this.SnooperExports, this.CurrentTestBaseDirectory);


            var exportVm  = new ExportVm(this.WindsorContainer, this.SnooperExports.ToList()[0]);
            var viewModel = new SnooperWebmailViewModel(this.WindsorContainer, exportVm, null);

            Thread t = new Thread(() =>
            {
                var window = new TestWindow();
                var uc     = new WebmailExportsView //todo
                {
                    DataContext = viewModel
                };
                window.Content = uc;

                // Initiates the dispatcher thread shutdown when the window closes
                window.Closed += (s, e) => window.Dispatcher.InvokeShutdown();

                window.Show();

                // Makes the thread support message pumping
                System.Windows.Threading.Dispatcher.Run();
            });

            t.SetApartmentState(ApartmentState.STA);

            t.Start();
            t.Join();
        }
Beispiel #12
0
        public void Warcraft_Snooper_Conversation_View_Test()
        {
            var infos = new List <FileInfo>
            {
                this.PrepareCaptureForProcessing(SnoopersPcaps.Default.warcraft_xberan33_1_wdat)
            };

            this.FrameworkController.ExportData(this.AvailableSnoopers, infos, this.CurrentTestBaseDirectory);


            Assert.IsTrue(this.SnooperExports.Count == 1);
            Assert.IsTrue(this.SnooperExports.First().ExportObjects.Count == 526);

            var exportVm = new ExportVm(this.WindsorContainer, this.SnooperExports.ToList()[0]);
            var snooperWarcraftViewModel = new WarcraftMessageViewModel(this.WindsorContainer, exportVm, null);

            // The dispatcher thread
            var t = new Thread(() =>
            {
                var window = new WarcraftSnooperTestWindow();
                var uc     = new WarcraftConversationView
                {
                    DataContext = snooperWarcraftViewModel
                };
                window.Content = uc;

                // Initiates the dispatcher thread shutdown when the window closes
                window.Closed += (s, e) => window.Dispatcher.InvokeShutdown();

                window.Show();

                // Makes the thread support message pumping
                Dispatcher.Run();
            });

            // Configure the thread
            t.SetApartmentState(ApartmentState.STA);
            t.Start();
            t.Join();
        }
Beispiel #13
0
        public void Minecraft_Snooper_View_Test()
        {
            this.FrameworkController.ProcessCapture(this.PrepareCaptureForProcessing(SnoopersPcaps.Default.minecraft_xberan33_minecraft_search_asd_pcap));
            var conversations = this.L7Conversations.Where(c => c.IsXyProtocolConversation("Minecraft")).ToArray();

            this.FrameworkController.ExportData(this.AvailableSnoopers, conversations, this.CurrentTestBaseDirectory, true);

            Assert.IsTrue(this.SnooperExports.Count == 1);
            Assert.IsTrue(this.SnooperExports.First().ExportObjects.Count == 11);

            var exportVm = new ExportVm(this.WindsorContainer, this.SnooperExports.ToList()[0]);
            var snooperMinecraftViewModel = new MinecraftMessageViewModel(this.WindsorContainer, exportVm, null);

            MinecraftSnooperTestWindow window;
            // The dispatcher thread
            var t = new Thread(() =>
            {
                window = new MinecraftSnooperTestWindow();
                var uc = new MinecraftMsgView
                {
                    DataContext = snooperMinecraftViewModel
                };
                window.Content = uc;

                // Initiates the dispatcher thread shutdown when the window closes
                window.Closed += (s, e) => window.Dispatcher.InvokeShutdown();

                window.Show();

                // Makes the thread support message pumping
                Dispatcher.Run();
            });

            // Configure the thread
            t.SetApartmentState(ApartmentState.STA);
            t.Start();
            t.Join();
        }
 public EmailDetailVm(WindsorContainer applicationWindsorContainer, ExportVm model, IEmailDetailView view) : base(applicationWindsorContainer, model, view)
 {
     try
     {
         this.IsHidden             = !this.ExportVm.Emails?.Any() ?? true;
         this.IsActive             = this.ExportVm.Emails?.Any() ?? false;
         this.DockPositionPosition = DetectiveDockPosition.DockedDocument;
         this.ExportVmObserver.RegisterHandler(p => p.SelectedSnooperExportObject, p =>
         {
             if (p.SelectedSnooperExportObject is IEMail)
             {
                 this.SelectedEmail = this.ApplicationOrInvestigationWindsorContainer.Resolve <EmailVm>(new
                 {
                     model = p.SelectedSnooperExportObject as IEMail,
                     investigationOrAppWindsorContainer = this.ApplicationOrInvestigationWindsorContainer
                 });
                 this.IsHidden           = false;
                 this.IsActive           = true;
                 this.SelectedBodieIndex = 0;
                 ///Studiod hack to bypas Telerik malfunctioning tab selection
                 Task.Run(() =>
                 {
                     Thread.Sleep(500);
                     this.SelectedBodieIndex = 0;
                 });
             }
             else
             {
                 this.SelectedEmail = null;
                 this.IsHidden      = true;
                 this.IsActive      = false;
             }
         });
     }
     catch (Exception ex) {
         this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
     }
 }
        public XchatViewModel(WindsorContainer applicationOrAppWindsorContainer, ExportVm model, IXChatView view) : base(applicationOrAppWindsorContainer, model, view)
        {
            try
            {
                this.PrivateMessages = model.SnooperExportedObjects.Where(i => i is XChatPrivateMessage).Cast <XChatPrivateMessage>().OrderBy(it => it.Time).ToArray();
                this.RoomMessages    = model.SnooperExportedObjects.Where(i => i is XChatRoomMessage).Cast <XChatRoomMessage>().OrderBy(it => it.Time).ToArray();

                if (this.AnyObjects())
                {
                    this.IsActive = true;
                    this.IsHidden = false;
                }
                else
                {
                    this.IsHidden = true;
                    this.IsActive = false;
                }
            }
            catch (Exception ex)
            {
                this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
            }
        }
Beispiel #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SnooperMAFFViewModel"/> class.
 /// </summary>
 /// <param name="applicationOrAppWindsorContainer">The application or application windsor container.</param>
 /// <param name="model">The model holds exported objects from snoopers.</param>
 /// <param name="view">The view of Archive Visualization.</param>
 public SnooperMAFFViewModel(IWindsorContainer applicationOrAppWindsorContainer, ExportVm model, IMAFFExportsView view) : base(applicationOrAppWindsorContainer, model, view)
 {
     try
     {
         Task.Run(() =>
         {
             var tmpExports = model.SnooperExportedObjects.Where(i => i is SnooperExportedArchive).Cast <SnooperExportedArchive>().ToArray();
             if (tmpExports.Length > 0)
             {
                 this.ExportedArchive = tmpExports[0];
                 this.PartCount       = this.ExportedArchive.Archive.ListOfArchiveParts.Count;
                 CurrentPartEvent.GetInstance().Inicialize(this, this.PartCount);
                 this.IsActive = (this.PartCount > 0);
                 this.IsHidden = !(this.PartCount > 0);
             }
         });
     }
     catch (Exception ex)
     {
         this.Logger.Error($"{this.GetType().Name} MAFFVm instantiation failed", ex);
     }
 }
 public VoIPCallVm(WindsorContainer applicationOrAppWindsorContainer, ExportVm model, IVoIPSummary view) : base(applicationOrAppWindsorContainer, model, view)
 {
     this.IsHidden = !this.ExportVm.Calls.Any();
     this.IsActive = this.ExportVm.Calls.Any();
 }
 public ExportGroupVm ExportGroupByExportResult(ExportVm selectedExportResult)
 {
     return(null);
 }
 public WarcraftMessageViewModel(WindsorContainer applicationWindsorContainer, ExportVm model, IWarcraftConversationView view) : base(applicationWindsorContainer, model, view)
 {
     try
     {
         this.Messages = new ObservableCollection <SnooperExportedWarcraftMessage>(
             model.SnooperExportedObjects.Where(x => x is SnooperExportedWarcraftMessage).Cast <SnooperExportedWarcraftMessage>());
         this.IsHidden = !this.Messages.Any();
         this.IsActive = this.Messages.Any();
         this.ExportVmObserver.RegisterHandler(x => x.SelectedSnooperExportObject, x => this.OnPropertyChanged(nameof(this.SelectedWarcraftMessage)));
     }
     catch (Exception ex) {
         this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
     }
 }
Beispiel #20
0
 protected DetectiveExportDetailPaneViewModelBase(IWindsorContainer applicationWindsorContainer, ExportVm model, object view)
     : base(applicationWindsorContainer, model)
 {
     this.ExportVm         = model;
     this.View             = view;
     this.ExportVmObserver = new PropertyObserver <ExportVm>(this.ExportVm);
 }
 public ChatConversationDetailVm(WindsorContainer applicationWindsorContainer, ExportVm model, IChatConversationDetailView view)
     : base(applicationWindsorContainer, model, view)
 {
     try
     {
         this.IsHidden             = !this.ExportVm.SelectedChatConversation.Value?.Any() ?? true;
         this.IsActive             = this.ExportVm.SelectedChatConversation.Value?.Any() ?? false;
         this.DockPositionPosition = DetectiveDockPosition.DockedDocument;
         this.ExportVmObserver.RegisterHandler(p => p.SelectedChatConversation, p =>
         {
             this.IsHidden = !this.ExportVm.SelectedChatConversation.Value?.Any() ?? true;
             this.IsActive = this.ExportVm.SelectedChatConversation.Value?.Any() ?? false;
         });
     }
     catch (Exception ex) {
         this.Logger?.Error($"{this.GetType().Name} instantiation failed", ex);
     }
 }
 public ChatMessageVm(WindsorContainer applicationWindsorContainer, object model, ExportVm exportVm) : base(applicationWindsorContainer, model)
 {
     this.ChatMessage = model as IChatMessage;
     this.ExportVm    = exportVm;
 }
 public ExportGroupVm ExportGroupByExportResult(ExportVm selectedExportResult)
 {
     throw new NotImplementedException();
 }
Beispiel #24
0
 public EmailVm(WindsorContainer applicationWindsorContainer, object model, ExportVm exportVm) : base(applicationWindsorContainer, model)
 {
     this.Email    = model as IEMail;
     this.ExportVm = exportVm;
 }
Beispiel #25
0
 public CallVm(WindsorContainer applicationWindsorContainer, object model, ExportVm exportVm) : base(applicationWindsorContainer, model)
 {
     this.Call     = model as ICall;
     this.ExportVm = exportVm;
 }
 private void ExportResultActionHandler(SelectedExportResultMessage exportResultMessage)
 {
     this.ExportResult = exportResultMessage.ExportVm as ExportVm;
 }