raspi / WinLLDPService

LLDP Service for Windows
https://raspi.github.io/projects/winlldpservice/
78 stars 13 forks source link

WinPcap/Npcap isolation? #19

Open Voljka1 opened 6 years ago

Voljka1 commented 6 years ago
raspi commented 6 years ago

It's impossible to send ethernet frames with native .NET framework. There's no API for it. I would need to create custom NDIS driver for network cards with C or C++ using WDK. WinPcap and Npcap are doing just this and are battle-tested and well supported.

The other option would be re-writing WinLLDPService with C/C++ so that low-level network APIs such as winsock can be accessed to allow sending ethernet frames. I'm not a C/C++ programmer.

WinLLDPService opens network cards in promiscuous mode for a less than a second for sending and then closes it immediately after that.

Users can capture traffic with Microsoft's own tools such as Microsoft Message Analyzer and Microsoft Network Monitor. Is the network properly isolated with VLANs already?

For the sending issue open a new issue and fill up the questions that are asked there.

I'll look into this possible service isolation with the capture libraries.

Voljka1 commented 6 years ago

So just to be sure: If I'll install npcap in Admin mode (admin rights are needed to use driver), then winlldpservice are able to run and use this driver (under localsystem account)?

raspi commented 6 years ago

Yes.

Installer handles the service installation with Account="[SERVICEACCOUNT]" Password="[SERVICEPASSWORD]" which is SYSTEM. WinLLDPService uses the Packet.Net and SharpPcap libraries to send the actual LLDP packet. All winpcap/npcap related stuff is handled by SharpPcap library.