|
i'm new with pcap .net.
Like it, but there a few things.
1. I have the feeling that the reading of packets is very delayed.
2. To know the library better i tried to make a simple Syn Scanner.
_packetCommunicator = _livePacketDevice.Open(65536, PacketDeviceOpenAttributes.Promiscuous, 1000);
new Thread(delegate()
{_packetCommunicator.ReceivePackets(0, HandleResponse);}).Start()
foreach(Endpoint endPoint in endPoints)
{
SendSyn(endPoint.Address, endPoint.Port);
}
.........................................
private void HandleResponse(Packet responsePacket)
{
if (tcpDatagram.ControlBits != (TcpControlBits.Synchronize | TcpControlBits.Acknowledgment))
return;
if (SequenceNumber != tcpDatagram.AcknowledgmentNumber - 1)
return;
openEndPointItems.Add(ipV4Datagram.Source, tcpDatagram.SourcePort);
}
................................................
I send synchronise packets to different hosts and handle the response as an open port. This seems extremly fast. Just need some seconds for 1000 ip's.
But after 600-1200 ip's i dont get any response from my sendet synchronise packets. I wondering what is blocking. Its SendPacket(send without any exception) or ReceivePackets(still gets some other packets).
What is freaky "allways a unamed thread exits before this happends and its not my thread).
I dont think its my os (WinXP) with some querky settings. Nmap runns and other scanning software runs as well.
What happend when i send a synchronise without an reset ? Is there a open connection for the os or networkcard or they dont think about the packets sendet by capturing ?
Where is my bottle neck ?
|