pydivert icon indicating copy to clipboard operation
pydivert copied to clipboard

Similar project for linux?

Open ghost opened this issue 8 years ago • 3 comments

I have been looking for exactly this but for linux, anyone knows a project that does this?

ghost avatar Apr 08 '17 00:04 ghost

Initially I was interested in doing this also for platforms other than windows. Anyway on unix systems there are already some kernel facilities or os utilities that can accomplish the same result. On *BSD systems, and OSX there's pf whereas at least on debian derived linux distros there's divert.

One can think about wrapping them into this binding, maybe with a pydivert.Divert class, but right now I'm low on time. Maybe in future, or maybe if someone wants to contribute 😉

ffalcinelli avatar Apr 08 '17 14:04 ffalcinelli

To bring FakeNet-NG on Linux, I used a cython wrapper for libnetfilter_queue called python-netfilterqueue. It has two issues, though:

  1. Hard-coded 4,096-byte buffer in the release version only admits 4,012-byte datagrams after accounting for overhead, meaning that you will can miss data on some interfaces with high maximum transmittal units (MTUs) such as lo which is often greater than 4k. Recompiling is an option but then your users can't use the normal Python package management facilities to get python-netfilterqueue installed automatically (e.g. via setup.py); and,
  2. It doesn't accommodate multi-threaded applications in and of itself, but you can work around this using a socket timeout and a loop

strictlymike avatar Dec 20 '17 14:12 strictlymike

Did this get any updates regarding writing wrappers for non-Windows systems?

SamG101-Developer avatar May 26 '24 12:05 SamG101-Developer