Пример #1
0
 private void smurfToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (FrmSmurf.Instantiations > 0)
     {
         MessageBox.Show("Only 1 smurf window right now allowed");
     }
     else
     {
         Fsmurf = new FrmSmurf();
         Fsmurf.Show();
     }
 }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            using (
                PacketCommunicator communicator = frmCapture.myDevice.Open(100, PacketDeviceOpenAttributes.Promiscuous,
                                                                           1000))
            {
                var ethernetFrame = Utils.BuildEthernetFrame(new MacAddress(FrmSmurf.MacAddressFormat(data.MacAddress)),
                                                             new MacAddress("FF:FF:FF:FF:FF:FF"));

                Packet packet;
                var    Ips = GenerateIps();
                foreach (string ip in Ips)
                {
                    var arpFrame = Utils.BuildArpFrame(data.MacAddress, data.IpAddressInformation.Address,
                                                       IPAddress.Parse(ip));
                    packet = Utils.BuildArpPacket(ethernetFrame, arpFrame);
                    communicator.SendPacket(packet);
                }
            }
        }
Пример #3
0
        public arpCache()
        {
            InitializeComponent();
            network  = IPNetwork.Parse(data.IpAddressInformation.Address, data.IpAddressInformation.IPv4Mask);
            arpTable = Utils.GetArpTable();

            //My data
            txtDnsSuffix.Text  = data.DnsSuffix;
            txtIp.Text         = data.IpAddressInformation.Address.ToString();
            txtMacAddress.Text = FrmSmurf.MacAddressFormat(data.MacAddress);
            txtClass.Text      = classLevel;
            txtMask.Text       = data.IpAddressInformation.IPv4Mask.ToString();

            //octets Data
            var addressBytes = network.Network.GetAddressBytes();

            txtFirstOctet.Text  = addressBytes[0].ToString();
            txtSecondOctet.Text = addressBytes[1].ToString();
            txtThirdOctet.Text  = addressBytes[2].ToString();
            txtFourthOctet.Text = addressBytes[3].ToString();
            DisableTxtWithNetwork();
        }
Пример #4
0
 private void updateUI(IPAddress client)
 {
     txtOutput.AppendText($"{client} ---> {FrmSmurf.MacAddressFormat(arpTable[client])}\n");
 }