/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void Bt_ScanLan_Click_Event(object sender, EventArgs e) { MinaryConfig minaryConfig = this.minaryTaskFacade.GetCurrentMinaryConfig(); this.arpScanHandler.ShowArpScanGui(this.targetList, minaryConfig); this.PassNewTargetListToPlugins(); }
public void ShowArpScanGui(BindingList <string> targetStringList, MinaryConfig minaryConfig, bool isModal = true) { if (this.InvokeRequired == true) { this.BeginInvoke(new ShowArpScanGuiDelegate(this.ShowArpScanGui), new object[] { targetStringList, minaryConfig, isModal }); return; } // Initialize GUI values try { this.interfaceId = minaryConfig.InterfaceId; this.startIp = minaryConfig.StartIp; this.stopIp = minaryConfig.StopIp; this.gatewayIp = minaryConfig.GatewayIp; this.localIp = minaryConfig.LocalIp; this.localMac = minaryConfig.LocalMac; this.communicator = PcapHandler.Inst.OpenPcapDevice(this.interfaceId, 1); this.targetStringList = targetStringList; this.tb_Subnet1.Text = this.startIp; this.tb_Subnet2.Text = this.stopIp; this.tb_Netrange1.Text = this.startIp; this.tb_Netrange2.Text = this.stopIp; this.rb_Subnet.Checked = true; this.RB_Subnet_CheckedChanged(null, null); } catch (Exception ex) { LogCons.Inst.Write(LogLevel.Error, "ArpScan.ShowDialog(): {0}", ex.Message); } // Start ARP packet listener BGW if (this.bgw_ArpScanListener.IsBusy == false) { this.bgw_ArpScanListener.RunWorkerAsync(); } try { if (isModal == true) { this.ShowDialog(); } else { this.Show(); } } catch (Exception ex) { LogCons.Inst.Write(LogLevel.Error, "ArpScan.ShowDialog(): {0}", ex.Message); } }
public MinaryConfig GetCurrentMinaryConfig() { MinaryConfig config = new MinaryConfig() { InterfaceId = this.minaryMain.GetCurrentInterface(), StartIp = this.minaryMain.NetworkStartIp, StopIp = this.minaryMain.NetworkStopIp, GatewayIp = this.minaryMain.CurrentGatewayIp, LocalIp = this.minaryMain.CurrentLocalIp, LocalMac = this.minaryMain.CurrentLocalMac }; return(config); }
public void ShowArpScanGui(BindingList <string> targetStringList, MinaryConfig minaryConfig, bool isModal = true) { if (this.InvokeRequired == true) { this.BeginInvoke(new ShowArpScanGuiDelegate(this.ShowArpScanGui), new object[] { targetStringList, minaryConfig, isModal }); return; } // Initialize GUI values try { this.interfaceId = minaryConfig.InterfaceId; this.startIp = minaryConfig.StartIp; this.stopIp = minaryConfig.StopIp; this.gatewayIp = minaryConfig.GatewayIp; this.localIp = minaryConfig.LocalIp; this.localMac = minaryConfig.LocalMac; this.targetStringList = targetStringList; this.tb_Subnet1.Text = this.startIp; this.tb_Subnet2.Text = this.stopIp; this.tb_Netrange1.Text = this.startIp; this.tb_Netrange2.Text = this.stopIp; this.rb_Subnet.Checked = true; this.RB_Subnet_CheckedChanged(null, null); } catch (Exception ex) { LogCons.Inst.Write(LogLevel.Error, "ArpScan.ShowDialog(EXC1): {0}", ex.Message); } try { if (isModal == true) { this.ShowDialog(); } else { this.Show(); } } catch (Exception ex) { LogCons.Inst.Write(LogLevel.Error, "ArpScan.ShowDialog(EXC2): {0}", ex.Message); } }