Skip to content

Weird IP And Ports #120

@ahdzesq

Description

@ahdzesq

Hello Guys, I have an issue while I'm trying to read a package

imagen

The real IP And port are 192.168.200.199 : 8940

I'm using code like this:

        static void Main(string[] args)
        {
            List<LivePacketDevice> Devices = LivePacketDevice.AllLocalMachine.ToList();

            PacketDevice SelectedDevice = Devices[5];

            using (PacketCommunicator communicator = SelectedDevice.Open(65536 , PacketDeviceOpenAttributes.Promiscuous ,1000))
            {
                BerkeleyPacketFilter Filter = communicator.CreateFilter("tcp and port 8940");

                communicator.SetFilter(Filter);

                Console.WriteLine($"Listening on {SelectedDevice.Description}");

                communicator.ReceivePackets(0, PacketHandler);
            }
        }

        private static void PacketHandler(Packet Packet)
        {
            Console.WriteLine(Packet.Timestamp.ToString("yyyy-MM-dd hh:mm:ss.fff"));

            IpV4Datagram Ip = Packet.IpV4;
            TcpDatagram Tcp = Ip.Tcp;

            Console.WriteLine(Ip.Source + ":" + Tcp.SourcePort + " -> " + Ip.Destination + ":" + Tcp.DestinationPort);
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions