private void Execute(object infoObj) { PluginInfo info = (PluginInfo)infoObj; PluginParameters results = info.Loader.OnExecuteWrapper(info); this.Unload(info, results, false, null); }
private void InitializeParameters(PluginParameters parameters) { // all parameter definitions are added to a central list. VstParameterInfoCollection parameterInfos = parameters.ParameterInfos; // retrieve the category for all delay parameters. VstParameterCategory paramCategory = parameters.GetParameterCategory(ParameterCategoryName); // delay time parameter var paramInfo = new VstParameterInfo { Category = paramCategory, CanBeAutomated = true, Name = "Transp.", Label = "Halfs", ShortLabel = "#", MinInteger = -100, MaxInteger = 100, LargeStepFloat = 5.0f, SmallStepFloat = 1.0f, StepFloat = 2.0f, DefaultValue = 0.0f }; TransposeMgr = paramInfo .Normalize() .ToManager(); parameterInfos.Add(paramInfo); }
/// <summary> /// Populate called on plugin creation and each time when any connection get connected/disconnected /// </summary> public override void Populate(PluginParameters args = null) { base.Populate(args); // Redraw renderer this.gdiRenderer.RedrawBufferedGraphic(); }
//This is the main execution entry point for the plugin. public override PluginParameters Main(PluginParameters args) { //Assigns parameters passed from the pluggable app to public members this.Param1 = (string)args.Get("Param1"); this.Param2 = (DateTime)args.Get("Param2"); this.Param3 = (double)args.Get("Param3"); //Creates a window wrapper for the pluggable app's main window. //This is only to ensure that the plugin form always stays in front of the pluggable app main window IntPtr handle = Process.GetCurrentProcess().MainWindowHandle; WindowWrapper wr = null; if (handle != IntPtr.Zero) { wr = new WindowWrapper(handle); } Application.Run(new MainView()); //This starts a new message loop for the plugin window. pluginForm.ShowDialog() may also be used instead. if (this.UnhandledException == null) { args.Add("ReturnValue", "Success"); // Demonstrates how serializeable/primitive types can be passed back to the pluggable app } else { args.Add("ReturnValue", "Failed"); } //returned values will be available in the pluggable app via PluginLoaderBase.PluginUnloaded event return(args); }
void Awake() { parameters = new PluginParameters(); devicePlugins = new Dictionary <string, DevicePlugin>(); OnAwake(); }
private PluginParameters OnExecuteWrapper(PluginInfo info) { try { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); PluginParameters results = this.OnExecute(info.Parameters); if (_currentPlugin.UnhandledException != null) { throw _currentPlugin.UnhandledException; } return(results); } catch (ThreadAbortException ex) { throw ex; } catch (PluginException ex) { info.Parameters.PluginException = ex; return(info.Parameters); } catch (Exception ex) { info.Parameters.PluginException = new PluginException(ex); return(info.Parameters); } }
public UnknownOptionException(string myOption, PluginParameters<Type> myParameters) { WrongParameter = myOption; AllowedParameters = myParameters; var parameterString = myParameters.Select(_=> string.Format("{0}({1})", _.Key, _.Value.Name)); _msg = String.Format("The option {0} is not allowed for this plugin. Please use only the following parameters: {1}", myOption, String.Join(", ", parameterString)); }
public string GetObjectAsXml(PluginParameters parameters) { var stringWriter = new StringWriter(); var serializer = new XmlSerializer(typeof(PluginParameters)); serializer.Serialize(stringWriter, parameters); return(stringWriter.ToString()); }
/// <summary> /// Initializes a new instance of the UnknownOptionException class. /// </summary> /// <param name="myOption"></param> /// <param name="myParameters"></param> /// <param name="innerException">The exception that is the cause of the current exception, this parameter can be NULL.</param> public UnknownOptionException(string myOption, PluginParameters <Type> myParameters, Exception innerException = null) : base(innerException) { WrongParameter = myOption; AllowedParameters = myParameters; var parameterString = myParameters.Select(_ => string.Format("{0}({1})", _.Key, _.Value.Name)); _msg = String.Format("The option {0} is not allowed for this plugin. Please use only the following parameters: {1}", myOption, String.Join(", ", parameterString.ToArray())); }
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); }
private void Unload(PluginInfo info, PluginParameters results, bool execCancelled, object execCancelledReason) { if (info != null) { try { AppDomain.Unload(info.Domain); } catch (AppDomainUnloadedException) { } this._currentInfoList.Remove(info); PluginUnloadedEventArgs pluginUnloadedArgs = new PluginUnloadedEventArgs(info, results, execCancelled, execCancelledReason); this.OnPluginUnloaded(pluginUnloadedArgs); } }
public PluginUnloadedEventArgs(PluginInfo info, PluginParameters results, bool execCancelled, object execCancelledReason) : base() { this.Info = info; if (results == null) { this.Results = new PluginParameters(); } else { this.Results = results; } this.ExecutionCancelled = execCancelled; if (execCancelled) { this.ExecutionCancelledReason = execCancelledReason; } else { this.PluginException = results.PluginException; } }
private void lbPlugins_DoubleClick(object sender, EventArgs e) { if (lbPlugins.SelectedItem != null) { //Get the PluginInfo object selected by the user for execution. PluginInfo template = (PluginInfo)lbPlugins.SelectedItem; try { //Create a PluginParameters object and add any parameters to be passed to the plugin PluginParameters args = new PluginParameters(); args.Add("Param1", "The quick brown fox jumped over the lazy dog"); args.Add("Param2", DateTime.Now); args.Add("Param3", 7.321); //Tell the plugin loader to load and execute the plugin this.PluginLoader.Load(template.PluginFileName, args); } catch (PluginException ex) { Console.WriteException(ex); } } }
/// <summary> /// Load all activated plugins /// </summary> public void LoadPlugins() { Type lObjType = null; String[] lSplitter; Assembly lAsm; String lFileName; String lTempPluginPath; String[] lPluginList = Config.GetPluginList(); /* * Iterate through all plugin directories. */ mPluginList = new IPlugin[lPluginList.Length]; for (int lPlugCnt = 0; lPlugCnt < lPluginList.Length; lPlugCnt++) { lTempPluginPath = lPluginList[lPlugCnt]; String[] lPluginFiles = Directory.GetFiles(lTempPluginPath, "plugin_*.dll"); for (int i = 0; i < lPluginFiles.Length; i++) { lFileName = lPluginFiles[i].Substring( lPluginFiles[i].LastIndexOf("\\") + 1, lPluginFiles[i].IndexOf(".dll") - lPluginFiles[i].LastIndexOf("\\") - 1); /* * Load plugin. */ try { if ((lAsm = Assembly.LoadFile(lPluginFiles[i])) != null) { lSplitter = Regex.Split(lFileName, "_"); if (lSplitter.Length == 2) { String lPluginName = "Plugin.Main.Plugin" + lSplitter[1] + "UC"; lObjType = lAsm.GetType(lPluginName, false, false); } // if (lSplit... } // if ((lAsm = As... } catch (Exception lEx) { LogConsole.Main.LogConsole.pushMsg("Error occurred while loading plugin " + lFileName + " : " + lEx.StackTrace + "\n" + lEx.ToString()); MessageBox.Show("Error occurred while loading plugin " + lFileName + " : " + lEx.Message); } /* * OK Lets create the object as we have the Report Type */ try { if (lObjType != null) { PluginParameters lPluginParams = new PluginParameters() { PluginDirectoryFullPath = lTempPluginPath, SessionDirectoryFullPath = String.Format(@"{0}{1}", lTempPluginPath, Config.SessionDir), HostApplication = (IPluginHost)this }; /* * Add loaded plugin to ... * - the global plugin list (IPlugin) * - the DGV list of used plugins * - the plugin position list (name + position) */ mPluginList[lPlugCnt] = (IPlugin)Activator.CreateInstance(lObjType, lPluginParams); mSimsangMain.DGVUsedPlugins.Add(new UsedPlugins(mPluginList[lPlugCnt].Config.PluginName, mPluginList[lPlugCnt].Config.PluginDescription, mPluginList[lPlugCnt].Config.PluginVersion, "1")); mPluginPosition.Add(mPluginList[lPlugCnt].Config.PluginName, lPlugCnt); } // if (lObjType... } catch (Exception lEx) { LogConsole.Main.LogConsole.pushMsg(String.Format("{0}: {1} {2}", lFileName, lEx.Message, lEx.StackTrace)); } } // for (int i = 0;... } // for (int i =... }
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>(); }
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); }
// This method initializes the plugin parameters this Dsp component owns. private void InitializeParameters(PluginParameters parameters) { // all parameter definitions are added to a central list. VstParameterInfoCollection parameterInfos = parameters.ParameterInfos; // retrieve the category for all delay parameters. VstParameterCategory paramCategory = parameters.GetParameterCategory(ParameterCategoryName); // delay time parameter var paramInfo = new VstParameterInfo { Category = paramCategory, CanBeAutomated = true, Name = "Time", Label = "MilSecs", ShortLabel = "ms", MinInteger = 0, MaxInteger = 1000, LargeStepInteger = 100, StepInteger = 10, DefaultValue = 200f }; DelayTimeMgr = paramInfo .Normalize() .ToManager(); parameterInfos.Add(paramInfo); // feedback parameter paramInfo = new VstParameterInfo { Category = paramCategory, CanBeAutomated = true, Name = "Feedbck", Label = "Factor", ShortLabel = "*", LargeStepFloat = 0.1f, SmallStepFloat = 0.01f, StepFloat = 0.05f, DefaultValue = 0.4f }; FeedbackMgr = paramInfo .Normalize() .ToManager(); parameterInfos.Add(paramInfo); // dry Level parameter paramInfo = new VstParameterInfo { Category = paramCategory, CanBeAutomated = true, Name = "Dry Lvl", Label = "Decibel", ShortLabel = "Db", LargeStepFloat = 0.1f, SmallStepFloat = 0.01f, StepFloat = 0.05f, DefaultValue = 0.8f }; DryLevelMgr = paramInfo .Normalize() .ToManager(); parameterInfos.Add(paramInfo); // wet Level parameter paramInfo = new VstParameterInfo { Category = paramCategory, CanBeAutomated = true, Name = "Wet Lvl", Label = "Decibel", ShortLabel = "Db", LargeStepFloat = 0.1f, SmallStepFloat = 0.01f, StepFloat = 0.05f, DefaultValue = 0.4f }; WetLevelMgr = paramInfo .Normalize() .ToManager(); parameterInfos.Add(paramInfo); }
/// <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); }
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); }
protected override PluginParameters OnExecute(PluginParameters args) { return(this.LoadedPlugin.Main(args)); }
public virtual void Load(string pluginFileName, PluginParameters args) { if (args == null) args = new PluginParameters(); AppDomainSetup domainSetup = new AppDomainSetup(); Assembly entryAsm = Assembly.GetEntryAssembly(); AssemblyProductAttribute[] atts = ((AssemblyProductAttribute[])entryAsm.GetCustomAttributes(typeof(AssemblyProductAttribute), false)); string productName = null; if (atts != null) { if (atts.Length > 0) productName = atts[0].Product; } if (String.IsNullOrEmpty(productName)) domainSetup.ApplicationName = Path.GetFileNameWithoutExtension(entryAsm.Location); else domainSetup.ApplicationName = productName; domainSetup.ConfigurationFile = Path.GetFileName(pluginFileName) + ".config"; domainSetup.ApplicationBase = Path.GetDirectoryName(pluginFileName); domainSetup.PrivateBinPath = "bin"; if (this.ShadowCopyEnabled) { domainSetup.ShadowCopyFiles = "true"; domainSetup.ShadowCopyDirectories = domainSetup.ApplicationBase + ";" + Path.Combine(domainSetup.ApplicationBase, "bin"); } PluginLoadingEventArgs loadingArgs = new PluginLoadingEventArgs(pluginFileName, domainSetup); this.OnPluginLoading(loadingArgs); if (!loadingArgs.Cancel) { AppDomain domain = null; domain = AppDomain.CreateDomain(loadingArgs.DomainSetup.ApplicationName, null, loadingArgs.DomainSetup); Type t = this.GetType(); PluginLoaderBase loader = (PluginLoaderBase)domain.CreateInstanceFromAndUnwrap(t.Assembly.Location, t.FullName); loader.AssemblyResolutionPaths = this.AssemblyResolutionPaths; PluginInfo info = loader.OnLoadWrapper(pluginFileName); if (info == null) AppDomain.Unload(domain); else { if (loader.IsPluginLoaded) { info.Domain = domain; this._currentInfoList.Add(info); PluginLoadedEventArgs pluginLoadedArgs = new PluginLoadedEventArgs(info); this.OnPluginLoaded(pluginLoadedArgs); PluginBase.ExecutionModes execMode = info.ExecutionMode; bool canExecute = false; if (!this.UseDefaultExecutionValidation) canExecute = true; else if (execMode == PluginBase.ExecutionModes.MultiInstance) canExecute = true; else if (execMode == PluginBase.ExecutionModes.Exclusive) { if (this._currentInfoList.Count == 1) canExecute = true; } else if (execMode == PluginBase.ExecutionModes.Singleton) { if (this.GetLoadedInstances(info.PluginFileName).Count == 1) canExecute = true; } else if (execMode == PluginBase.ExecutionModes.Custom) canExecute = true; if (canExecute) { info.Parameters = args; PluginExecutingEventArgs exeArgs = new PluginExecutingEventArgs(info); this.OnPluginExecuting(exeArgs); if (exeArgs.Cancel) this.Unload(info, args, true, exeArgs.CancelReason); else { info.Loader = loader; Thread pluginThread = new Thread(this.Execute); pluginThread.IsBackground = true; pluginThread.Start(info); } } else this.Unload(info, args, true, null); } else AppDomain.Unload(domain); } } }
/// <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); }
/// <summary> /// Initializes the paramaters for the Delay component. /// </summary> /// <param name="parameters"></param> public DelayParameters(PluginParameters parameters) { Throw.IfArgumentIsNull(parameters, nameof(parameters)); InitializeParameters(parameters); }
public virtual void Load(string pluginFileName, PluginParameters args) { if (args == null) { args = new PluginParameters(); } AppDomainSetup domainSetup = new AppDomainSetup(); Assembly entryAsm = Assembly.GetEntryAssembly(); AssemblyProductAttribute[] atts = ((AssemblyProductAttribute[])entryAsm.GetCustomAttributes(typeof(AssemblyProductAttribute), false)); string productName = null; if (atts != null) { if (atts.Length > 0) { productName = atts[0].Product; } } if (String.IsNullOrEmpty(productName)) { domainSetup.ApplicationName = Path.GetFileNameWithoutExtension(entryAsm.Location); } else { domainSetup.ApplicationName = productName; } domainSetup.ConfigurationFile = Path.GetFileName(pluginFileName) + ".config"; domainSetup.ApplicationBase = Path.GetDirectoryName(pluginFileName); domainSetup.PrivateBinPath = "bin"; if (this.ShadowCopyEnabled) { domainSetup.ShadowCopyFiles = "true"; domainSetup.ShadowCopyDirectories = domainSetup.ApplicationBase + ";" + Path.Combine(domainSetup.ApplicationBase, "bin"); } PluginLoadingEventArgs loadingArgs = new PluginLoadingEventArgs(pluginFileName, domainSetup); this.OnPluginLoading(loadingArgs); if (!loadingArgs.Cancel) { AppDomain domain = null; domain = AppDomain.CreateDomain(loadingArgs.DomainSetup.ApplicationName, null, loadingArgs.DomainSetup); Type t = this.GetType(); PluginLoaderBase loader = (PluginLoaderBase)domain.CreateInstanceFromAndUnwrap(t.Assembly.Location, t.FullName); loader.AssemblyResolutionPaths = this.AssemblyResolutionPaths; PluginInfo info = loader.OnLoadWrapper(pluginFileName); if (info == null) { AppDomain.Unload(domain); } else { if (loader.IsPluginLoaded) { info.Domain = domain; this._currentInfoList.Add(info); PluginLoadedEventArgs pluginLoadedArgs = new PluginLoadedEventArgs(info); this.OnPluginLoaded(pluginLoadedArgs); PluginBase.ExecutionModes execMode = info.ExecutionMode; bool canExecute = false; if (!this.UseDefaultExecutionValidation) { canExecute = true; } else if (execMode == PluginBase.ExecutionModes.MultiInstance) { canExecute = true; } else if (execMode == PluginBase.ExecutionModes.Exclusive) { if (this._currentInfoList.Count == 1) { canExecute = true; } } else if (execMode == PluginBase.ExecutionModes.Singleton) { if (this.GetLoadedInstances(info.PluginFileName).Count == 1) { canExecute = true; } } else if (execMode == PluginBase.ExecutionModes.Custom) { canExecute = true; } if (canExecute) { info.Parameters = args; PluginExecutingEventArgs exeArgs = new PluginExecutingEventArgs(info); this.OnPluginExecuting(exeArgs); if (exeArgs.Cancel) { this.Unload(info, args, true, exeArgs.CancelReason); } else { info.Loader = loader; Thread pluginThread = new Thread(this.Execute); pluginThread.IsBackground = true; pluginThread.Start(info); } } else { this.Unload(info, args, true, null); } } else { AppDomain.Unload(domain); } } } }
protected abstract PluginParameters OnExecute(PluginParameters args);
public PluginResult Execute(PluginParameters parameters, PluginQuery query) { return(_hostedPlugin.Execute(parameters, query)); }
public GainParameters(PluginParameters parameters) { InitializeParameters(parameters); }
public TransposeParameters(PluginParameters parameters) { InitializeParameters(parameters); }
/// <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 PluginUnloadedEventArgs(PluginInfo info, PluginParameters results, bool execCancelled, object execCancelledReason) : base() { this.Info = info; if (results == null) this.Results = new PluginParameters(); else this.Results = results; this.ExecutionCancelled = execCancelled; if (execCancelled) this.ExecutionCancelledReason = execCancelledReason; else this.PluginException = results.PluginException; }
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> /// 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>(); }