I'm trying to catch packets that I receive on Windows 10, before Windows could process them, and modify them.
How actually I can do it?
Some thoughts -
to catch packets on this new adapter, modify them, and then send them to real network adapter.
A little bit more info:
Im creating a vpn server ( proxy + encrypted payload )
So, on client , i catch all my trafic "on a fly" modifying them ( encrypt payload ), send it to server, server decrypts packet, and sends it to internet, receives response, encrypts it, and sends it back. The client receives - (for example simple http html response) with encrypted payload. And before windows network stack will receive this packet to process it, i need to decrypt it.
So, found out the answer.
To achieve, what i was trying to do you can use Pydivert - https://pypi.org/project/pydivert/ Using it, you can stop inbound and outbound packets and modify them, before they will be processed by Windows network stack.