コード例 #1
0
ファイル: Data.cs プロジェクト: ztxyzu/EvilFOCA
        public void AddNeighbor(Neighbor neighbor)
        {
            NeighborEventArgs ea;

            if (neighbor.physicalAddress == null)
            {
                throw new Exception("Neighbor without physical address");
            }
            if (neighbor.physicalAddress.Equals(device.Interface.MacAddress))
            {
                return;
            }
            lock (neighborLock)
            {
                if (ExistsNeighbor(neighbor))
                {
                    Neighbor newNeighbor = GetNeighbor(neighbor.physicalAddress);
                    newNeighbor.Combine(neighbor);
                    ea      = new NeighborEventArgs(newNeighbor);
                    ea.Tipo = NeighborOperacionTreeView.Actualizar;
                    NewNeighbor(newNeighbor, ea);
                    return;
                }

                if (neighbor.GetIPs().Count == 0)
                {
                    throw new Exception("Neighbor without ips");
                }

                neighbors.Add(neighbor);
                ea      = new NeighborEventArgs(neighbor);
                ea.Tipo = NeighborOperacionTreeView.Añadir;
                NewNeighbor(neighbor, ea);
            }
            ReverseResolutionAsync(neighbor); // Resolucion de nombre a partir de IP
            _CheckIfNeighborRoutesPackets(neighbor);
        }
コード例 #2
0
ファイル: PasiveScan.cs プロジェクト: ignaciots/EvilFOCA
 private void OnNewNeighbor(NeighborEventArgs e)
 {
     EventHandler<NeighborEventArgs> handler = NewNeighbor;
     if (handler != null)
     {
         if (!e.Neighbor.physicalAddress.Equals(localPhysicalAddress))
             handler(this, e);
     }
 }
コード例 #3
0
ファイル: Data.cs プロジェクト: ignaciots/EvilFOCA
        public void AddNeighbor(Neighbor neighbor)
        {

            NeighborEventArgs ea;

            if (neighbor.physicalAddress == null)
                throw new Exception("Neighbor without physical address");
            if (neighbor.physicalAddress.Equals(device.Interface.MacAddress))
                return;
            lock (neighborLock)
            {

                if (ExistsNeighbor(neighbor))
                {
                    Neighbor newNeighbor = GetNeighbor(neighbor.physicalAddress);
                    newNeighbor.Combine(neighbor);
                    ea = new NeighborEventArgs(newNeighbor);
                    ea.Tipo = NeighborOperacionTreeView.Actualizar;
                    NewNeighbor(newNeighbor, ea);
                    return;
                }

                if (neighbor.GetIPs().Count == 0)
                    throw new Exception("Neighbor without ips");

                neighbors.Add(neighbor);
                ea = new NeighborEventArgs(neighbor);
                ea.Tipo = NeighborOperacionTreeView.Añadir;
                NewNeighbor(neighbor, ea);

            }
            ReverseResolutionAsync(neighbor); // Resolucion de nombre a partir de IP
            _CheckIfNeighborRoutesPackets(neighbor);

        }
コード例 #4
0
ファイル: FormMain.cs プロジェクト: msignataur/EvilFOCA
 void pasiveScan_NewNeighbor(object sender, NeighborEventArgs e)
 {
     if (!(e.Neighbor.physicalAddress.Equals(Program.CurrentProject.data.GetDevice().Interface.MacAddress)))
         Program.LogThis("New neighbor detected with " + e.Neighbor.physicalAddress.ToString() + " as physical address", Logs.Log.LogType.NeighborSpoofing);
 }