public PluginDNSPoisonUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              #region DATAGRID HEADERS

              DataGridViewTextBoxColumn cHostNameCol = new DataGridViewTextBoxColumn();
              cHostNameCol.DataPropertyName = "HostName";
              cHostNameCol.Name = "HostName";
              cHostNameCol.HeaderText = "Host name";
              cHostNameCol.ReadOnly = true;
              cHostNameCol.Width = 296;
              DGV_Spoofing.Columns.Add(cHostNameCol);

              DataGridViewTextBoxColumn cIPAddressCol = new DataGridViewTextBoxColumn();
              cIPAddressCol.DataPropertyName = "IPAddress";
              cIPAddressCol.Name = "IPAddress";
              cIPAddressCol.HeaderText = "Spoofed IP address";
              cIPAddressCol.ReadOnly = true;
              cIPAddressCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              DGV_Spoofing.Columns.Add(cIPAddressCol);

              cDNSPoisonRecords = new BindingList<DNSPoisonRecord>();
              DGV_Spoofing.DataSource = cDNSPoisonRecords;

              #endregion

              /*
               * Plugin configuration
               */
              cPluginParams = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (pPluginParams != null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (pPluginParams != null) ? pPluginParams.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);
              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "DNS Poison",
            PluginDescription = "Poisoning systems DNS request and servers DNS responses.",
            PluginVersion = "0.11",
            Ports = "",
            IsActive = true
              };

              // Get object instance from the lower layer
              cTask = TaskFacade.getInstance(this);

              // Register at the observable
              DomainFacade.getInstance(this).addObserver(this);
        }
        /// <summary>
        /// 
        /// </summary>
        public PluginIPAccountingUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              /*
               * Set DGV double buffer on
               */
              Type dgvType = DGV_TrafficData.GetType();
              PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
              pi.SetValue(DGV_TrafficData, true, null);

              /*
               * Plugin configuration
               */
              cPluginParams = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (pPluginParams != null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (pPluginParams != null) ? pPluginParams.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);

              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "IP accounting",
            PluginDescription = "Listing data traffic statistics.",
            PluginVersion = "0.8",
            Ports = "",
            IsActive = true
              };

              /*
               * Initialisation
               */
              RB_Service_Click(null, null);

              cAccountingRecords = new BindingList<AccountingItem>();
              DGV_TrafficData.DataSource = cAccountingRecords;

              IPAccountingConfig lConfig = new IPAccountingConfig()
                                       {
                                         BasisDirectory = Config.BaseDir,
                                         isDebuggingOn = false, //cPluginParams.HostApplication.IsDebuggingOn(),
                                         Interface = null, //cPluginParams.HostApplication.GetInterface(),
                                         onUpdateList = update,
                                         onIPAccountingExit = null
                                       };
              cTask = TaskFacade.getInstance(lConfig, this);
              DomainFacade.getInstance(lConfig, this).addObserver(this);
        }
    public DefaultTabPageSimsang(PluginParameters pPluginParams)
    {
      /*
       * Plugin configuration
       */
      cPluginParams = pPluginParams;
      String lBaseDir = String.Format(@"{0}\", (pPluginParams != null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
      String lSessionDir = (pPluginParams != null) ? pPluginParams.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);
      Config = new PluginProperties()
      {
        PluginBaseDir = lBaseDir,
        SessionDir = lSessionDir,
        PluginName = "Simsang",
        PluginDescription = "Simsang default plugin to activate/deactivate other plugins",
        PluginVersion = "0.1",
        Ports = "",
        IsActive = true
      };

    }
        public PluginHTTPRequestsUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              #region DATAGRID HEADER

              DataGridViewTextBoxColumn cMACCol = new DataGridViewTextBoxColumn();
              cMACCol.DataPropertyName = "SrcMAC";
              cMACCol.Name = "SrcMAC";
              cMACCol.HeaderText = "MAC address";
              cMACCol.ReadOnly = true;
              cMACCol.Width = 140;
              DGV_HTTPRequests.Columns.Add(cMACCol);

              DataGridViewTextBoxColumn cSrcIPCol = new DataGridViewTextBoxColumn();
              cSrcIPCol.DataPropertyName = "SrcIP";
              cSrcIPCol.Name = "SrcIP";
              cSrcIPCol.HeaderText = "Source IP";
              cSrcIPCol.ReadOnly = true;
              cSrcIPCol.Width = 120;
              DGV_HTTPRequests.Columns.Add(cSrcIPCol);

              DataGridViewTextBoxColumn cTimestampCol = new DataGridViewTextBoxColumn();
              cTimestampCol.DataPropertyName = "Timestamp";
              cTimestampCol.Name = "Timestamp";
              cTimestampCol.HeaderText = "Timestamp";
              cTimestampCol.ReadOnly = true;
              cTimestampCol.Visible = false;
              cTimestampCol.Width = 120;
              DGV_HTTPRequests.Columns.Add(cTimestampCol);

              DataGridViewTextBoxColumn cRequestMethodCol = new DataGridViewTextBoxColumn();
              cRequestMethodCol.DataPropertyName = "Method";
              cRequestMethodCol.Name = "Method";
              cRequestMethodCol.HeaderText = "Method";
              cRequestMethodCol.ReadOnly = true;
              cRequestMethodCol.Visible = true;
              cRequestMethodCol.Width = 60;
              DGV_HTTPRequests.Columns.Add(cRequestMethodCol);

              DataGridViewTextBoxColumn cRemHostCol = new DataGridViewTextBoxColumn();
              cRemHostCol.DataPropertyName = "RemoteHost";
              cRemHostCol.Name = "RemoteHost";
              cRemHostCol.HeaderText = "Server";
              cRemHostCol.ReadOnly = true;
              cRemHostCol.Width = 150;
              DGV_HTTPRequests.Columns.Add(cRemHostCol);

              DataGridViewTextBoxColumn cRemFileNameCol = new DataGridViewTextBoxColumn();
              cRemFileNameCol.DataPropertyName = "RemoteFile";
              cRemFileNameCol.Name = "RemoteFile";
              cRemFileNameCol.HeaderText = "File name";
              cRemFileNameCol.ReadOnly = true;
              cRemFileNameCol.Width = 216;// 173;
              cRemFileNameCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              DGV_HTTPRequests.Columns.Add(cRemFileNameCol);

              DataGridViewTextBoxColumn cURLCol = new DataGridViewTextBoxColumn();
              cURLCol.DataPropertyName = "URL";
              cURLCol.Name = "URL";
              cURLCol.HeaderText = "URL";
              cURLCol.Visible = false;
              DGV_HTTPRequests.Columns.Add(cURLCol);

              DataGridViewTextBoxColumn cCookiesCol = new DataGridViewTextBoxColumn();
              cCookiesCol.DataPropertyName = "SessionCookies";
              cCookiesCol.Name = "SessionCookies";
              cCookiesCol.HeaderText = "Cookies";
              cCookiesCol.Visible = false;
              DGV_HTTPRequests.Columns.Add(cCookiesCol);

              DataGridViewTextBoxColumn cRequestCol = new DataGridViewTextBoxColumn();
              cRequestCol.DataPropertyName = "Request";
              cRequestCol.Name = "Request";
              cRequestCol.HeaderText = "Request";
              cRequestCol.Visible = false;
              DGV_HTTPRequests.Columns.Add(cRequestCol);

              cHTTPRequests = new BindingList<HTTPRequests>();
              DGV_HTTPRequests.DataSource = cHTTPRequests;

              #endregion

              /*
               * Plugin configuration
               */
              T_GUIUpdate.Interval = 1000;
              PluginParameters = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (pPluginParams != null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (pPluginParams != null) ? pPluginParams.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);

              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "HTTP requests",
            PluginDescription = "Listing client systems HTTP requests.",
            PluginVersion = "0.7",
            Ports = "TCP:80;TCP:443;",
            IsActive = true
              };

              cDataBatch = new List<String>();

              // Make it double buffered.
              typeof(DataGridView).InvokeMember("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, DGV_HTTPRequests, new object[] { true });
              T_GUIUpdate.Start();

              cTask = TaskFacade.getInstance(this);
              DomainFacade.getInstance(this).addObserver(this);
        }
        public PluginHTTPInjectUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              #region DATAGRID HEADER

              DataGridViewTextBoxColumn cTypeCol = new DataGridViewTextBoxColumn();
              cTypeCol.DataPropertyName = "Type";
              cTypeCol.Name = "Type";
              cTypeCol.HeaderText = "Type";
              cTypeCol.ReadOnly = true;
              cTypeCol.Width = 70;
              DGV_Inject.Columns.Add(cTypeCol);

              DataGridViewTextBoxColumn cReqHostCol = new DataGridViewTextBoxColumn();
              cReqHostCol.DataPropertyName = "RequestedHost";
              cReqHostCol.Name = "RequestedHost";
              cReqHostCol.HeaderText = "Requested host";
              cReqHostCol.ReadOnly = true;
              cReqHostCol.Width = 250;
              DGV_Inject.Columns.Add(cReqHostCol);

              DataGridViewTextBoxColumn cReqURLCol = new DataGridViewTextBoxColumn();
              cReqURLCol.DataPropertyName = "RequestedURL";
              cReqURLCol.Name = "RequestedURL";
              cReqURLCol.HeaderText = "Requested URL";
              cReqURLCol.ReadOnly = true;
              cReqURLCol.Width = 250;
              DGV_Inject.Columns.Add(cReqURLCol);

              DataGridViewTextBoxColumn cInjHostNameCol = new DataGridViewTextBoxColumn();
              cInjHostNameCol.DataPropertyName = "InjectedHost";
              cInjHostNameCol.Name = "InjectedHost";
              cInjHostNameCol.HeaderText = "Injected host";
              cInjHostNameCol.ReadOnly = true;
              cInjHostNameCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              DGV_Inject.Columns.Add(cInjHostNameCol);

              DataGridViewTextBoxColumn cInjURLNameCol = new DataGridViewTextBoxColumn();
              cInjURLNameCol.DataPropertyName = "InjectedURL";
              cInjURLNameCol.Name = "InjectedURL";
              cInjURLNameCol.HeaderText = "Injected URL/file";
              cInjURLNameCol.ReadOnly = true;
              cInjURLNameCol.Width = 250;
              DGV_Inject.Columns.Add(cInjURLNameCol);

              DataGridViewTextBoxColumn cInjURLFullPathCol = new DataGridViewTextBoxColumn();
              cInjURLFullPathCol.DataPropertyName = "InjectedFileFullPath";
              cInjURLFullPathCol.Name = "InjectedFileFullPath";
              cInjURLFullPathCol.HeaderText = String.Empty;
              cInjURLFullPathCol.ReadOnly = true;
              //      cInjURLNameCol.Width = 250;
              cInjURLFullPathCol.Visible = false;
              DGV_Inject.Columns.Add(cInjURLFullPathCol);

              cInjectedURLs = new BindingList<InjectedURLRecord>();
              DGV_Inject.DataSource = cInjectedURLs;

              #endregion

              RB_Redirect.Checked = true;
              RB_Redirect_CheckedChanged(null, null);

              /*
               * Plugin configuration
               */
              PluginParameters = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (PluginParameters != null) ? PluginParameters.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (PluginParameters != null) ? PluginParameters.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);

              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "HTTP inject",
            PluginDescription = "Injecting data packets in an established HTTP data connection.",
            PluginVersion = "0.5",
            Ports = "TCP:80;",
            IsActive = true
              };

              /*
               * Proxy server configuration
               */
              cConfigParams = new InjectionConfig
              {
            isDebuggingOn = (PluginParameters != null) ? PluginParameters.HostApplication.IsDebuggingOn() : false,
            BasisDirectory = Config.BaseDir,
            onWebServerExit = onMicroWebExited,
            InjectionRulesPath = (PluginParameters != null) ? PluginParameters.HostApplication.GetAPEInjectionRulesFile() : String.Empty
              };

              cTask = TaskFacade.getInstance(cConfigParams, this);
              DomainFacade.getInstance(cConfigParams, this).addObserver(this);
        }
        /// <summary>
        /// Constructor.
        /// Instantiate the UserControl.
        /// </summary>
        public PluginSystemsUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              #region DATAGRID HEADER

              DGV_Systems.AutoGenerateColumns = false;

              DataGridViewTextBoxColumn cMACCol = new DataGridViewTextBoxColumn();
              cMACCol.DataPropertyName = "SrcMAC";
              cMACCol.Name = "SrcMAC";
              cMACCol.HeaderText = "MAC address";
              cMACCol.ReadOnly = true;
              cMACCol.Width = 120;
              cMACCol.Resizable = System.Windows.Forms.DataGridViewTriState.False;
              DGV_Systems.Columns.Add(cMACCol);

              DataGridViewTextBoxColumn cSrcIPCol = new DataGridViewTextBoxColumn();
              cSrcIPCol.DataPropertyName = "SrcIP";
              cSrcIPCol.Name = "SrcIP";
              cSrcIPCol.HeaderText = "Source IP";
              cSrcIPCol.Width = 140;
              cSrcIPCol.ReadOnly = true;
              cSrcIPCol.Resizable = System.Windows.Forms.DataGridViewTriState.False;
              DGV_Systems.Columns.Add(cSrcIPCol);

              DataGridViewTextBoxColumn cAppURLCol = new DataGridViewTextBoxColumn();
              cAppURLCol.DataPropertyName = "OperatingSystem";
              cAppURLCol.Name = "OperatingSystem";
              cAppURLCol.HeaderText = "Operating System";
              cAppURLCol.ReadOnly = true;
              cAppURLCol.Width = 200; // 373;
              cAppURLCol.Resizable = System.Windows.Forms.DataGridViewTriState.False;
              DGV_Systems.Columns.Add(cAppURLCol);

              DataGridViewTextBoxColumn cHWVendorCol = new DataGridViewTextBoxColumn();
              cHWVendorCol.DataPropertyName = "HWVendor";
              cHWVendorCol.Name = "HWVendor";
              cHWVendorCol.HeaderText = "Hardware vendor";
              cHWVendorCol.ReadOnly = true;
              cHWVendorCol.Width = 200; // 373;
              cHWVendorCol.Resizable = System.Windows.Forms.DataGridViewTriState.False;
              DGV_Systems.Columns.Add(cHWVendorCol);

              DataGridViewTextBoxColumn cLastSeenCol = new DataGridViewTextBoxColumn();
              cLastSeenCol.DataPropertyName = "LastSeen";
              cLastSeenCol.Name = "LastSeen";
              cLastSeenCol.HeaderText = "Last seen";
              cLastSeenCol.ReadOnly = true;
              //cLastSeenCol.Width = 120;
              cLastSeenCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              cLastSeenCol.Resizable = System.Windows.Forms.DataGridViewTriState.False;
              DGV_Systems.Columns.Add(cLastSeenCol);

              cSystems = new BindingList<SystemRecord>();
              DGV_Systems.DataSource = cSystems;

              #endregion

              /*
               * Plugin configuration
               */
              T_GUIUpdate.Interval = 1000;
              cPluginParams = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (pPluginParams != null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (pPluginParams != null) ? pPluginParams.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);

              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "Systems",
            PluginDescription = "Listing detected client systems, their OS type and the timestamp when it was last seen.",
            PluginVersion = "0.8",
            Ports = "TCP:80;TCP:443;",
            IsActive = true
              };

              cDataBatch = new List<String>();

              // Make it double buffered.
              typeof(DataGridView).InvokeMember("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, DGV_Systems, new object[] { true });
              T_GUIUpdate.Start();

              cTask = TaskFacade.getInstance(this);
              DomainFacade.getInstance(this).addRecordObserver(this);
              DomainFacade.getInstance(this).addSystemPatternObserver(this);
              cSystemPatterns = new List<ManageSystems.SystemPattern>();
        }
Exemple #7
0
        public PluginFirewallUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              #region DATAGRID HEADER

              DataGridViewTextBoxColumn cID = new DataGridViewTextBoxColumn();
              cID.DataPropertyName = "ID";
              cID.Name = "ID";
              cID.HeaderText = "ID";
              cID.ReadOnly = true;
              cID.Width = 0;
              cID.Visible = false;
              DGV_FWRules.Columns.Add(cID);

              DataGridViewTextBoxColumn cProtocolCol = new DataGridViewTextBoxColumn();
              cProtocolCol.DataPropertyName = "Protocol";
              cProtocolCol.Name = "Protocol";
              cProtocolCol.HeaderText = "Prot.";
              cProtocolCol.ReadOnly = true;
              cProtocolCol.Width = 50;
              DGV_FWRules.Columns.Add(cProtocolCol);

              DataGridViewTextBoxColumn cSrcIPCol = new DataGridViewTextBoxColumn();
              cSrcIPCol.DataPropertyName = "SrcIP";
              cSrcIPCol.Name = "SrcIP";
              cSrcIPCol.HeaderText = "Source IP";
              cSrcIPCol.ReadOnly = true;
              cSrcIPCol.Width = 95;
              DGV_FWRules.Columns.Add(cSrcIPCol);

              DataGridViewTextBoxColumn cSrcPortLowerCol = new DataGridViewTextBoxColumn();
              cSrcPortLowerCol.DataPropertyName = "SrcPortLower";
              cSrcPortLowerCol.Name = "SrcPortLower";
              cSrcPortLowerCol.HeaderText = "Src. port (lower)";
              cSrcPortLowerCol.ReadOnly = true;
              cSrcPortLowerCol.Width = 125;
              DGV_FWRules.Columns.Add(cSrcPortLowerCol);

              DataGridViewTextBoxColumn cSrcPortUpperCol = new DataGridViewTextBoxColumn();
              cSrcPortUpperCol.DataPropertyName = "SrcPortUpper";
              cSrcPortUpperCol.Name = "SrcPortUpper";
              cSrcPortUpperCol.HeaderText = "Src. port (upper)";
              cSrcPortUpperCol.ReadOnly = true;
              cSrcPortUpperCol.Width = 125;
              DGV_FWRules.Columns.Add(cSrcPortUpperCol);

              DataGridViewTextBoxColumn cDstIPCol = new DataGridViewTextBoxColumn();
              cDstIPCol.DataPropertyName = "DstIP";
              cDstIPCol.Name = "DstIP";
              cDstIPCol.HeaderText = "Dest. IP";
              cDstIPCol.ReadOnly = true;
              cDstIPCol.Width = 95;
              DGV_FWRules.Columns.Add(cDstIPCol);

              DataGridViewTextBoxColumn cDstPortLowerCol = new DataGridViewTextBoxColumn();
              cDstPortLowerCol.DataPropertyName = "DstPortLower";
              cDstPortLowerCol.Name = "DstPortLower";
              cDstPortLowerCol.HeaderText = "Dst. port (lower)";
              cDstPortLowerCol.ReadOnly = true;
              cDstPortLowerCol.Width = 125;
              DGV_FWRules.Columns.Add(cDstPortLowerCol);

              DataGridViewTextBoxColumn cDstPortUpperCol = new DataGridViewTextBoxColumn();
              cDstPortUpperCol.DataPropertyName = "DstPortUpper";
              cDstPortUpperCol.Name = "DstPortUpper";
              cDstPortUpperCol.HeaderText = "Dst. port (upper)";
              cDstPortUpperCol.ReadOnly = true;
              cDstPortUpperCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              //      cDstPortUpperCol.Width = 127;
              DGV_FWRules.Columns.Add(cDstPortUpperCol);

              cFWRules = new BindingList<FWRule>();
              DGV_FWRules.DataSource = cFWRules;

              #endregion

              /*
               * Plugin configuration
               */
              PluginParameters = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (pPluginParams != null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (pPluginParams != null) ? pPluginParams.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);

              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "Firewall",
            PluginDescription = "Letting pass or blocking client systems data packets.",
            PluginVersion = "0.5",
            Ports = "",
            IsActive = true
              };

              // Populate Protocol combobox
              CB_Protocol.Items.Add("TCP");
              CB_Protocol.Items.Add("UDP");
              CB_Protocol.SelectedIndex = 0;

              cTask = TaskFacade.getInstance(this);
              cDomain = DomainFacade.getInstance(this);
              cDomain.addObserver(this);

              cSrcTargetList = new List<String>();
              cDstTargetList = new List<String>();
        }
        /// <summary>
        /// 
        /// </summary>
        public PluginDNSRequestsUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              #region DATAGRID HEADERS

              DataGridViewTextBoxColumn cMACCol = new DataGridViewTextBoxColumn();
              cMACCol.DataPropertyName = "SrcMAC";
              cMACCol.Name = "SrcMAC";
              cMACCol.HeaderText = "MAC address";
              cMACCol.ReadOnly = true;
              cMACCol.Width = 140;
              DGV_DNSRequests.Columns.Add(cMACCol);

              DataGridViewTextBoxColumn cSrcIPCol = new DataGridViewTextBoxColumn();
              cSrcIPCol.DataPropertyName = "SrcIP";
              cSrcIPCol.Name = "SrcIP";
              cSrcIPCol.HeaderText = "Source IP";
              cSrcIPCol.ReadOnly = true;
              cSrcIPCol.Width = 120;
              DGV_DNSRequests.Columns.Add(cSrcIPCol);

              DataGridViewTextBoxColumn cTimestampCol = new DataGridViewTextBoxColumn();
              cTimestampCol.DataPropertyName = "Timestamp";
              cTimestampCol.Name = "Timestamp";
              cTimestampCol.HeaderText = "Timestamp";
              cTimestampCol.ReadOnly = true;
              cTimestampCol.Width = 120;
              DGV_DNSRequests.Columns.Add(cTimestampCol);

              DataGridViewTextBoxColumn cRemHostCol = new DataGridViewTextBoxColumn();
              cRemHostCol.DataPropertyName = "DNSHostname";
              cRemHostCol.Name = "DNSHostname";
              cRemHostCol.HeaderText = "DNS request";
              cRemHostCol.ReadOnly = true;
              cRemHostCol.Width = 180;
              cRemHostCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              DGV_DNSRequests.Columns.Add(cRemHostCol);

              DataGridViewTextBoxColumn cPacketTypeCol = new DataGridViewTextBoxColumn();
              cPacketTypeCol.DataPropertyName = "PacketType";
              cPacketTypeCol.Name = "PacketType";
              cPacketTypeCol.HeaderText = "Packet type";
              cPacketTypeCol.ReadOnly = true;
              //cRemHostCol.Width = 280;
              cPacketTypeCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              DGV_DNSRequests.Columns.Add(cPacketTypeCol);

              cDNSRequests = new BindingList<DNSRequestRecord>();
              DGV_DNSRequests.DataSource = cDNSRequests;

              #endregion

              /*
               * Plugin configuration
               */
              T_GUIUpdate.Interval = 2000;
              PluginParameters = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (pPluginParams != null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (pPluginParams != null) ? pPluginParams.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);

              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "DNS requests",
            PluginDescription = "Listing client systems DNS requests.",
            PluginVersion = "0.7",
            Ports = "UDP:53;",
            IsActive = true
              };

              cDataBatch = new List<String>();

              // Make it double buffered.
              typeof(DataGridView).InvokeMember("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, DGV_DNSRequests, new object[] { true });
              T_GUIUpdate.Start();

              cTask = TaskFacade.getInstance(this);
              cDomain = DomainFacade.getInstance(this);

              cDomain.addObserver(this);
        }
        public PluginHTTPProxyUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              #region DATAGRID HEADER

              DGV_Accounts.AutoGenerateColumns = false;

              DataGridViewTextBoxColumn cMACCol = new DataGridViewTextBoxColumn();
              cMACCol.DataPropertyName = "SrcMAC";
              cMACCol.Name = "SrcMAC";
              cMACCol.HeaderText = "MAC address";
              cMACCol.ReadOnly = true;
              cMACCol.Width = 120;
              //cMACCol.Visible = false;
              DGV_Accounts.Columns.Add(cMACCol);

              DataGridViewTextBoxColumn cSrcIPCol = new DataGridViewTextBoxColumn();
              cSrcIPCol.DataPropertyName = "SrcIP";
              cSrcIPCol.Name = "SrcIP";
              cSrcIPCol.HeaderText = "Source IP";
              cSrcIPCol.Visible = false;
              cSrcIPCol.ReadOnly = true;
              cSrcIPCol.Width = 120;
              DGV_Accounts.Columns.Add(cSrcIPCol);

              DataGridViewTextBoxColumn cDstIPCol = new DataGridViewTextBoxColumn();
              cDstIPCol.DataPropertyName = "DstIP";
              cDstIPCol.Name = "DstIP";
              cDstIPCol.HeaderText = "Destination";
              cDstIPCol.ReadOnly = true;
              cDstIPCol.Width = 200;
              DGV_Accounts.Columns.Add(cDstIPCol);

              DataGridViewTextBoxColumn cDestPortCol = new DataGridViewTextBoxColumn();
              cDestPortCol.DataPropertyName = "DstPort";
              cDestPortCol.Name = "DstPort";
              cDestPortCol.HeaderText = "Service";
              cDestPortCol.ReadOnly = true;
              cDestPortCol.Width = 60;
              DGV_Accounts.Columns.Add(cDestPortCol);

              DataGridViewTextBoxColumn cUserCol = new DataGridViewTextBoxColumn();
              cUserCol.DataPropertyName = "Username";
              cUserCol.Name = "Username";
              cUserCol.HeaderText = "Username";
              cUserCol.ReadOnly = true;
              cUserCol.Width = 150;
              DGV_Accounts.Columns.Add(cUserCol);

              DataGridViewTextBoxColumn cmPassCol = new DataGridViewTextBoxColumn();
              cmPassCol.DataPropertyName = "Password";
              cmPassCol.Name = "Password";
              cmPassCol.HeaderText = "Password";
              cmPassCol.ReadOnly = true;
              //            cmPassCol.Width = 120;
              cmPassCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              DGV_Accounts.Columns.Add(cmPassCol);

              cAccounts = new BindingList<Account>();
              DGV_Accounts.DataSource = cAccounts;
              #endregion

              /*
               * Plugin configuration
               */
              T_GUIUpdate.Interval = 1000;
              PluginParameters = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (pPluginParams != null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (pPluginParams != null) ? pPluginParams.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);

              cPeersDataSource = new List<PeerSystems>();
              cAccountPatterns = new List<ManageAuthentications.AccountPattern>();

              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "HTTP(S) proxy",
            PluginDescription = "HTTP and HTTPS reverse proxy server to sniff on (encrypted) HTTP connections.",
            PluginVersion = "0.7",
            Ports = "TCP:80;TCP:443;",
            IsActive = true
              };

              cDataBatch = new List<String>();

              // Make it double buffered.
              typeof(DataGridView).InvokeMember("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, DGV_Accounts, new object[] { true });
              T_GUIUpdate.Start();

              WebServerConfig lWebServerConfig = new WebServerConfig();
              lWebServerConfig.BasisDirectory = Config.BaseDir;

              cTask = TaskFacade.getInstance(lWebServerConfig, this);
              DomainFacade.getInstance(lWebServerConfig, this).addObserver(this);
        }
        public PluginUsedAppsUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              #region DATAGRID HEADER

              DataGridViewTextBoxColumn cMACCol = new DataGridViewTextBoxColumn();
              cMACCol.DataPropertyName = "SrcMAC";
              cMACCol.Name = "SrcMAC";
              cMACCol.HeaderText = "MAC address";
              cMACCol.ReadOnly = true;
              cMACCol.Visible = true;
              cMACCol.Width = 140;
              DGV_Applications.Columns.Add(cMACCol);

              DataGridViewTextBoxColumn cSrcIPCol = new DataGridViewTextBoxColumn();
              cSrcIPCol.DataPropertyName = "SrcIP";
              cSrcIPCol.Name = "SrcIP";
              cSrcIPCol.HeaderText = "Source IP";
              //cSrcIPCol.Visible = false;
              cSrcIPCol.ReadOnly = true;
              cSrcIPCol.Width = 120;
              DGV_Applications.Columns.Add(cSrcIPCol);

              DataGridViewTextBoxColumn cAppNameCol = new DataGridViewTextBoxColumn();
              cAppNameCol.DataPropertyName = "AppName";
              cAppNameCol.Name = "AppName";
              cAppNameCol.HeaderText = "Application name";
              cAppNameCol.ReadOnly = true;
              cAppNameCol.Visible = true;
              cAppNameCol.Width = 160;
              DGV_Applications.Columns.Add(cAppNameCol);

              DataGridViewTextBoxColumn cAppURLCol = new DataGridViewTextBoxColumn();
              cAppURLCol.DataPropertyName = "AppURL";
              cAppURLCol.Name = "AppURL";
              cAppURLCol.HeaderText = "Application URL";
              cAppURLCol.ReadOnly = true;
              cAppURLCol.Visible = true;
              //            cAppURLCol.Width = 230; // 213;
              cAppURLCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              DGV_Applications.Columns.Add(cAppURLCol);

              cApplications = new BindingList<ApplicationRecord>();
              DGV_Applications.DataSource = cApplications;

              #endregion

              /*
               * Plugin configuration
               */
              T_GUIUpdate.Interval = 1000;
              cPluginParams = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (pPluginParams != null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (pPluginParams != null) ? pPluginParams.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);

              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "Used apps",
            PluginDescription = "Listing with installed applications per client system.",
            PluginVersion = "0.7",
            Ports = "TCP:80;UDP:53;",
            IsActive = true
              };

              cDataBatch = new List<String>();

              // Make it double buffered.
              typeof(DataGridView).InvokeMember("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, DGV_Applications, new object[] { true });
              T_GUIUpdate.Start();

              cApplicationPatterns = new List<MngApplication.ApplicationPattern>();
              cTask = TaskFacade.getInstance(this);
              DomainFacade.getInstance(this).addObserver(this);
        }
        /// <summary>
        /// 
        /// </summary>
        public PluginIMAP4ProxyUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              #region DATAGRID HEADER

              DGV_Accounts.AutoGenerateColumns = false;

              DataGridViewTextBoxColumn cMACCol = new DataGridViewTextBoxColumn();
              cMACCol.DataPropertyName = "SrcMAC";
              cMACCol.Name = "SrcMAC";
              cMACCol.HeaderText = "MAC address";
              cMACCol.ReadOnly = true;
              cMACCol.Width = 120;
              //cMACCol.Visible = false;
              DGV_Accounts.Columns.Add(cMACCol);

              DataGridViewTextBoxColumn cSrcIPCol = new DataGridViewTextBoxColumn();
              cSrcIPCol.DataPropertyName = "SrcIP";
              cSrcIPCol.Name = "SrcIP";
              cSrcIPCol.HeaderText = "Source IP";
              cSrcIPCol.Visible = false;
              cSrcIPCol.ReadOnly = true;
              cSrcIPCol.Width = 120;
              DGV_Accounts.Columns.Add(cSrcIPCol);

              DataGridViewTextBoxColumn cDstIPCol = new DataGridViewTextBoxColumn();
              cDstIPCol.DataPropertyName = "DstIP";
              cDstIPCol.Name = "DstIP";
              cDstIPCol.HeaderText = "Destination";
              cDstIPCol.ReadOnly = true;
              cDstIPCol.Width = 200;
              DGV_Accounts.Columns.Add(cDstIPCol);

              DataGridViewTextBoxColumn cDestPortCol = new DataGridViewTextBoxColumn();
              cDestPortCol.DataPropertyName = "DstPort";
              cDestPortCol.Name = "DstPort";
              cDestPortCol.HeaderText = "Service";
              cDestPortCol.ReadOnly = true;
              cDestPortCol.Width = 60;
              DGV_Accounts.Columns.Add(cDestPortCol);

              DataGridViewTextBoxColumn cUserCol = new DataGridViewTextBoxColumn();
              cUserCol.DataPropertyName = "Username";
              cUserCol.Name = "Username";
              cUserCol.HeaderText = "Username";
              cUserCol.ReadOnly = true;
              cUserCol.Width = 150;
              DGV_Accounts.Columns.Add(cUserCol);

              DataGridViewTextBoxColumn cPassCol = new DataGridViewTextBoxColumn();
              cPassCol.DataPropertyName = "Password";
              cPassCol.Name = "Password";
              cPassCol.HeaderText = "Password";
              cPassCol.ReadOnly = true;
              //cPassCol.Width = 120;
              cPassCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              DGV_Accounts.Columns.Add(cPassCol);

              DataGridViewTextBoxColumn cServerCol = new DataGridViewTextBoxColumn();
              cServerCol.DataPropertyName = "Server";
              cServerCol.Name = "Server";
              cServerCol.HeaderText = "Server";
              cServerCol.ReadOnly = true;
              //cServerCol.Width = 120;
              cServerCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              DGV_Accounts.Columns.Add(cServerCol);

              cAccounts = new BindingList<IMAP4Account>();
              DGV_Accounts.DataSource = cAccounts;
              #endregion

              /*
               * Plugin configuration
               */
              T_GUIUpdate.Interval = 1000;
              PluginParameters = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (pPluginParams!=null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (pPluginParams!=null) ? pPluginParams.SessionDirectoryFullPath :  String.Format("{0}sessions", lBaseDir);

              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "IMAP4(S) proxy",
            PluginDescription = "IMAP4(S) reverse proxy server to intercept account data.",
            PluginVersion = "0.4",
            Ports = "TCP:993;TCP:143;",
            IsActive = true
              };

              cDataBatch = new List<String>();

              // Make it double buffered.
              typeof(DataGridView).InvokeMember("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, DGV_Accounts, new object[] { true });
              T_GUIUpdate.Start();

              /*
               * Proxy server configuration
               */
              ProxyConfig lProxyConfig = new ProxyConfig()
                  {
                    BasisDirectory = Config.BaseDir,
                    SessionDirectory = Config.SessionDir,
                    //RemoteHostName = String.Empty,
                    isDebuggingOn = (PluginParameters.HostApplication != null) ? PluginParameters.HostApplication.IsDebuggingOn() : false,
                    onProxyExit = onIMAP4ProxyExited
                  };
              cTask = TaskFacade.getInstance(lProxyConfig, this);
              cDomain = DomainFacade.getInstance(lProxyConfig, this);
              cDomain.addObserver(this);
        }
        /// <summary>
        /// 
        /// </summary>
        public PluginSessionsUC(PluginParameters pPluginParams)
        {
            InitializeComponent();

              TV_Sessions.ExpandAll();

              #region DATAGRID HEADER

              DGV_Sessions.AutoGenerateColumns = false;

              DataGridViewTextBoxColumn cSrcMAC = new DataGridViewTextBoxColumn();
              cSrcMAC.DataPropertyName = "SrcMAC";
              cSrcMAC.Name = "SrcMAC";
              cSrcMAC.HeaderText = "Source MAC";
              cSrcMAC.Width = 125;
              DGV_Sessions.Columns.Add(cSrcMAC);

              DataGridViewTextBoxColumn cSrcIPCol = new DataGridViewTextBoxColumn();
              cSrcIPCol.DataPropertyName = "SrcIP";
              cSrcIPCol.Name = "SrcIP";
              cSrcIPCol.HeaderText = "Source IP";
              cSrcIPCol.Width = 120;
              //            cSrcIPCol.Visible = false;
              DGV_Sessions.Columns.Add(cSrcIPCol);

              DataGridViewTextBoxColumn cServiceURLCol = new DataGridViewTextBoxColumn();
              cServiceURLCol.DataPropertyName = "URL";
              cServiceURLCol.Name = "URL";
              cServiceURLCol.HeaderText = "URL";
              cServiceURLCol.ReadOnly = true;
              cServiceURLCol.Resizable = System.Windows.Forms.DataGridViewTriState.False;
              //            cServiceURLCol.Width = 180;
              cServiceURLCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              DGV_Sessions.Columns.Add(cServiceURLCol);

              DataGridViewTextBoxColumn cDestPortCol = new DataGridViewTextBoxColumn();
              cDestPortCol.DataPropertyName = "DstPort";
              cDestPortCol.Name = "DstPort";
              cDestPortCol.HeaderText = "Service";
              cDestPortCol.Visible = false;
              cDestPortCol.ReadOnly = true;
              DGV_Sessions.Columns.Add(cDestPortCol);

              DataGridViewTextBoxColumn cCookiesCol = new DataGridViewTextBoxColumn();
              cCookiesCol.DataPropertyName = "SessionCookies";
              cCookiesCol.Name = "SessionCookies";
              cCookiesCol.HeaderText = "Cookies";
              cCookiesCol.Visible = false;
              DGV_Sessions.Columns.Add(cCookiesCol);

              DataGridViewTextBoxColumn cBrowserCol = new DataGridViewTextBoxColumn();
              cBrowserCol.DataPropertyName = "Browser";
              cBrowserCol.Name = "Browser";
              cBrowserCol.HeaderText = "Browser";
              cBrowserCol.Visible = false;
              cBrowserCol.Width = 120;
              DGV_Sessions.Columns.Add(cBrowserCol);

              DataGridViewTextBoxColumn cGroupCol = new DataGridViewTextBoxColumn();
              cGroupCol.DataPropertyName = "Group";
              cGroupCol.Name = "Group";
              cGroupCol.HeaderText = "Group";
              cGroupCol.Visible = false;
              cGroupCol.Width = 0;
              DGV_Sessions.Columns.Add(cGroupCol);

              cSessions = new BindingList<Session.Config.Session>();
              DGV_Sessions.DataSource = cSessions;
              #endregion

              /*
               * Plugin configuration
               */
              T_GUIUpdate.Interval = 1000;
              cPluginParams = pPluginParams;
              String lBaseDir = String.Format(@"{0}\", (pPluginParams != null) ? pPluginParams.PluginDirectoryFullPath : Directory.GetCurrentDirectory());
              String lSessionDir = (pPluginParams != null) ? pPluginParams.SessionDirectoryFullPath : String.Format("{0}sessions", lBaseDir);

              Config = new PluginProperties()
              {
            BaseDir = lBaseDir,
            SessionDir = lSessionDir,
            PluginName = "Sessions",
            PluginDescription = "Listing and taking over session where valid session cookies where found within HTTP requests.",
            PluginVersion = "0.8",
            Ports = "TCP:80;TCP:443;",
            IsActive = true
              };
              cDataBatch = new List<String>();

              // Make it double buffered.
              typeof(DataGridView).InvokeMember("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, DGV_Sessions, new object[] { true });
              T_GUIUpdate.Start();

              cSessionPatterns = new List<MngSessionsConfig.SessionPattern>();
              TV_Sessions.DoubleClick += TreeView_DoubleClick;

              cTask = TaskFacade.getInstance(this);
              DomainFacade.getInstance(this).addObserver(this);
        }