Ejemplo n.º 1
0
 public void AddTarget(Target target)
 {
     lock (_targets)
     {
         if (!_targets.Contains(target))
             _targets.Add(target);
     }
 }
Ejemplo n.º 2
0
 public void RemoveTarget(Target target)
 {
     lock (_targets)
     {
         if (!_targets.Contains(target))
         {
             _targets.Remove(target);
         }
     }
 }
Ejemplo n.º 3
0
        private new void PacketHandler(Packet packet)
        {
            var arpPacket = packet.Ethernet.Arp;
            switch (arpPacket.Operation)
            {
                case PcapDotNet.Packets.Arp.ArpOperation.Reply:
                    var senderIp = arpPacket.SenderProtocolIpV4Address.ToString();
                    if (_isOwnIpIncluded || _ownIp != senderIp)
                    {
                        if (senderIp == _gatewayIp )
                        {
                            if(!_gateways.ContainsIP(senderIp)){
                                var target = new Target();
                                target.IP = senderIp;
                                //target.MAC = arpPacket.SenderHardwareAddress.ToString();
                                target.PMAC = new PhysicalAddress(arpPacket.SenderHardwareAddress.ToArray());
                                target.MAC = Helper.AddSeperatorToNakedMac(target.PMAC.ToString(), ":");
                                target.Vendor = VendorCodeResolver.instance.Resolve(target.MAC);
                                Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                                {
                                    _gateways.Add(target);
                                }));
                            }
                        } else if (!_targets.ContainsIP(senderIp))
                        {
                            var target = new Target();
                            target.IP = senderIp;
                            //target.MAC = arpPacket.SenderHardwareAddress.ToString();
                            target.PMAC = new PhysicalAddress(arpPacket.SenderHardwareAddress.ToArray());
                            target.MAC = Helper.AddSeperatorToNakedMac(target.PMAC.ToString(), ":");
                            target.Vendor = VendorCodeResolver.instance.Resolve(target.MAC);
                            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                            {
                                _targets.Add(target);
                            }));

                        }
                    }
                    break;
            }
        }
Ejemplo n.º 4
0
 private Packet BuildAntidoteArpPacketReply(Target PacketTarget, Target AntidoteSignature)
 {
     return BuildArpPacketReply(new IpV4Address(PacketTarget.IP),
         new MacAddress(PacketTarget.MAC), new IpV4Address(AntidoteSignature.IP), new MacAddress(AntidoteSignature.MAC));
 }
Ejemplo n.º 5
0
 private Packet BuildPoisonArpPacketReply(Target PacketTarget, Target TargetToSpoof)
 {
     return BuildArpPacketReply(new IpV4Address(PacketTarget.IP),
         new MacAddress(PacketTarget.MAC), new IpV4Address(TargetToSpoof.IP), _ownMacAddr);
 }
Ejemplo n.º 6
-1
        //constructors
        public ArpDosSender(LivePacketDevice device, Target Gateway)
        {
            _device = device;
            _gateway = Gateway;
            _ownMacAddr = _device.GetMacAddress();

            _bgWorker = new BackgroundWorker();
            _bgWorker.WorkerSupportsCancellation = true;
            _bgWorker.DoWork += new DoWorkEventHandler(DoWork);

            _targets = new List<Target>();
        }
Ejemplo n.º 7
-1
        //constructors
        public ArpPoisoner(LivePacketDevice device, Target Gateway)
        {
            _device = device;
            _gateway = Gateway;
            _ownMacAddr = _device.GetMacAddress();

            _bgWorker = new BackgroundWorker();
            _bgWorker.WorkerSupportsCancellation = true;
            _bgWorker.DoWork += new DoWorkEventHandler(DoWork);

            _targets = new List<Target>();
            _dnsSpoofingList = new DNSspoofingList();

            _forwardingListener = new Listener.Listener(device, "ip and ( udp or tcp) and ether dst " + _ownMacAddr.ToString() +
                " and not host " + _device.getIpV4Address().Address.ToString());
            _forwardingListener.StartCapture(Forwarder);
        }