Beispiel #1
0
        public MainForm()
        {
            InitializeComponent();

            _files = new HashSet <string>();

            // Create the DAL and BLL objects.
            _processor = new PcapProcessor.Processor();
            _analyzer  = new PcapAnalyzer.Analyzer();
            _processor.BuildTcpSessions = true;

            // Create the user controls.
            _networkMapUserControl            = new NetworkMapUserControl();
            _networkMapUserControl.Dock       = DockStyle.Fill;
            _sessionsExplorerUserControl      = new SessionsExplorerUserControl();
            _sessionsExplorerUserControl.Dock = DockStyle.Fill;
            _hashesUserControl         = new HashesUserControl();
            _hashesUserControl.Dock    = DockStyle.Fill;
            _passwordsUserControl      = new GenericTableUserControl();
            _passwordsUserControl.Dock = DockStyle.Fill;

            // Contract the events.
            _processor.TcpPacketArived           += (s, e) => _analyzer.Analyze(Casting.CastProcessorTcpPacketToAnalyzerTcpPacket(e.Packet));
            _processor.TcpSessionArived          += (s, e) => _analyzer.Analyze(Casting.CastProcessorTcpSessionToAnalyzerTcpSession(e.TcpSession));
            _processor.FileProcessingStarted     += (s, e) => SwitchToMainThreadContext(() => OnFileProcessStart(s, e));
            _processor.FileProcessingEnded       += (s, e) => SwitchToMainThreadContext(() => OnFileProcessEnd(s, e));
            _processor.ProcessingPrecentsChanged += (s, e) => SwitchToMainThreadContext(() => OnProcessingPrecentsChanged(s, e));
            _analyzer.ParsedItemDetected         += (s, e) => SwitchToMainThreadContext(() => OnParsedItemDetected(s, e));
            _processor.TcpSessionArived          += (s, e) => SwitchToMainThreadContext(() => OnSessionArived(Casting.CastProcessorTcpSessionToBruteSharkDesktopTcpSession(e.TcpSession)));
            _processor.ProcessingFinished        += (s, e) => SwitchToMainThreadContext(() => OnProcessingFinished(s, e));

            InitilizeFilesIconsList();
            this.modulesTreeView.ExpandAll();
        }
Beispiel #2
0
        public MainForm()
        {
            InitializeComponent();

            _files       = new HashSet <string>();
            _cts         = new CancellationTokenSource();
            _connections = new HashSet <PcapAnalyzer.NetworkConnection>();

            // Create the DAL and BLL objects.
            _processor = new PcapProcessor.Processor();
            _sniffer   = new PcapProcessor.Sniffer();
            _analyzer  = new PcapAnalyzer.Analyzer();
            _processor.BuildTcpSessions = true;
            _processor.BuildUdpSessions = true;

            // Create the user controls.
            _networkMapUserControl            = new NetworkMapUserControl();
            _networkMapUserControl.Dock       = DockStyle.Fill;
            _sessionsExplorerUserControl      = new SessionsExplorerUserControl();
            _sessionsExplorerUserControl.Dock = DockStyle.Fill;
            _hashesUserControl           = new HashesUserControl();
            _hashesUserControl.Dock      = DockStyle.Fill;
            _passwordsUserControl        = new GenericTableUserControl();
            _passwordsUserControl.Dock   = DockStyle.Fill;
            _filesUserControl            = new FilesUserControl();
            _filesUserControl.Dock       = DockStyle.Fill;
            _dnsResponseUserControl      = new DnsResponseUserControl();
            _dnsResponseUserControl.Dock = DockStyle.Fill;
            _voipCallsUserControl        = new VoipCallsUserControl();
            _voipCallsUserControl.Dock   = DockStyle.Fill;

            // Contract the events.
            _sniffer.UdpPacketArived               += (s, e) => _analyzer.Analyze(CommonUi.Casting.CastProcessorUdpPacketToAnalyzerUdpPacket(e.Packet));
            _sniffer.TcpPacketArived               += (s, e) => _analyzer.Analyze(CommonUi.Casting.CastProcessorTcpPacketToAnalyzerTcpPacket(e.Packet));
            _sniffer.TcpSessionArrived             += (s, e) => _analyzer.Analyze(CommonUi.Casting.CastProcessorTcpSessionToAnalyzerTcpSession(e.TcpSession));
            _sniffer.TcpSessionArrived             += (s, e) => SwitchToMainThreadContext(() => OnSessionArived(Casting.CastProcessorTcpSessionToBruteSharkDesktopTcpSession(e.TcpSession)));
            _sniffer.UdpSessionArrived             += (s, e) => SwitchToMainThreadContext(() => OnSessionArived(Casting.CastProcessorUdpSessionToBruteSharkDesktopUdpSession(e.UdpSession)));
            _processor.UdpPacketArived             += (s, e) => _analyzer.Analyze(CommonUi.Casting.CastProcessorUdpPacketToAnalyzerUdpPacket(e.Packet));
            _processor.TcpPacketArived             += (s, e) => _analyzer.Analyze(CommonUi.Casting.CastProcessorTcpPacketToAnalyzerTcpPacket(e.Packet));
            _processor.TcpSessionArrived           += (s, e) => _analyzer.Analyze(CommonUi.Casting.CastProcessorTcpSessionToAnalyzerTcpSession(e.TcpSession));
            _processor.TcpSessionArrived           += (s, e) => SwitchToMainThreadContext(() => OnSessionArived(Casting.CastProcessorTcpSessionToBruteSharkDesktopTcpSession(e.TcpSession)));
            _processor.UdpSessionArrived           += (s, e) => SwitchToMainThreadContext(() => OnSessionArived(Casting.CastProcessorUdpSessionToBruteSharkDesktopUdpSession(e.UdpSession)));
            _processor.FileProcessingStatusChanged += (s, e) => SwitchToMainThreadContext(() => OnFileProcessingStatusChanged(s, e));
            _processor.ProcessingPrecentsChanged   += (s, e) => SwitchToMainThreadContext(() => OnProcessingPrecentsChanged(s, e));
            _processor.ProcessingFinished          += (s, e) => SwitchToMainThreadContext(() => OnProcessingFinished(s, e));
            _analyzer.ParsedItemDetected           += (s, e) => SwitchToMainThreadContext(() => OnParsedItemDetected(s, e));
            _analyzer.UpdatedItemProprertyDetected += (s, e) => SwitchToMainThreadContext(() => OnUpdatedItemProprertyDetected(s, e));

            InitilizeFilesIconsList();
            InitilizeModulesCheckedListBox();
            InitilizeInterfacesComboBox();
            this.modulesTreeView.ExpandAll();
        }
Beispiel #3
0
 private void InitilizeModulesUserControls()
 {
     _networkMapUserControl            = new NetworkMapUserControl(_networkContext);
     _networkMapUserControl.Dock       = DockStyle.Fill;
     _sessionsExplorerUserControl      = new SessionsExplorerUserControl(_networkContext);
     _sessionsExplorerUserControl.Dock = DockStyle.Fill;
     _hashesUserControl           = new HashesUserControl(_networkContext);
     _hashesUserControl.Dock      = DockStyle.Fill;
     _passwordsUserControl        = new GenericTableUserControl();
     _passwordsUserControl.Dock   = DockStyle.Fill;
     _filesUserControl            = new FilesUserControl();
     _filesUserControl.Dock       = DockStyle.Fill;
     _dnsResponseUserControl      = new DnsResponseUserControl();
     _dnsResponseUserControl.Dock = DockStyle.Fill;
     _voipCallsUserControl        = new VoipCallsUserControl();
     _voipCallsUserControl.Dock   = DockStyle.Fill;
 }