private void AddAttackToListViewEx(Attack attack) { ListViewItem lvi = new ListViewItem(); lvi.Tag = attack; lvi.Text = attack.attackType.ToString(); // type lvi.SubItems.Add(""); // control lvi.SubItems.Add(""); // active listViewExAttacks.Items.Add(lvi); if (attack is MitmAttack) { if (attack.attackType == AttackType.SlaacMitm) { ControlSlaacMitm contr = new ControlSlaacMitm(attack); listViewExAttacks.AddEmbeddedControl(contr, 1, listViewExAttacks.Items.Count - 1); lvi.SubItems[1].Tag = contr; } else { ControlMitmAttack contr = new ControlMitmAttack(attack); listViewExAttacks.AddEmbeddedControl(contr, 1, listViewExAttacks.Items.Count - 1); lvi.SubItems[1].Tag = contr; } } else if (attack is DNSHijackAttack) { ControlDNSHijacking contr = new ControlDNSHijacking(attack); listViewExAttacks.AddEmbeddedControl(contr, 1, listViewExAttacks.Items.Count - 1); lvi.SubItems[1].Tag = contr; } else if (attack is InvalidMacSpoofAttackIpv4Attack) { ControlInvalidMacIpv4 contr = new ControlInvalidMacIpv4(attack); listViewExAttacks.AddEmbeddedControl(contr, 1, listViewExAttacks.Items.Count - 1); lvi.SubItems[1].Tag = contr; } else if (attack is DhcpIPv6) { ControlDHCPv6 contr = new ControlDHCPv6(attack); listViewExAttacks.AddEmbeddedControl(contr, 1, listViewExAttacks.Items.Count - 1); lvi.SubItems[1].Tag = contr; } else if (attack is DoSSLAACAttack) { ControlDosSlaac contr = new ControlDosSlaac(attack); listViewExAttacks.AddEmbeddedControl(contr, 1, listViewExAttacks.Items.Count - 1); lvi.SubItems[1].Tag = contr; } CheckBox cbActive = new CheckBox(); if (attack.attackStatus == AttackStatus.Attacking) cbActive.Checked = true; else cbActive.Checked = false; cbActive.Tag = attack; cbActive.CheckedChanged += new EventHandler(cbActive_CheckedChanged); listViewExAttacks.AddEmbeddedControl(cbActive, 2, listViewExAttacks.Items.Count - 1); }
public void AddAttack(Attack attack) { attacks.Add(attack); }
public ControlMitmAttack(Attack attack) { this.attack = attack; InitializeComponent(); }
public ControlDosSlaac(Attack attack) { InitializeComponent(); this.attack = attack; }
public ControlDHCPv6(Attack attack) { this.attack = attack; InitializeComponent(); }
public ControlInvalidMacIpv4(Attack attack) { this.attack = attack; InitializeComponent(); }
public ControlSlaacMitm(Attack attack) { this.attack = attack; InitializeComponent(); }
public ControlDNSHijacking(Attack attack) { this.attack = attack; InitializeComponent(); }