Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packet manipulation #262

Open
AcTiViSioN911 opened this issue Mar 16, 2021 · 1 comment
Open

Packet manipulation #262

AcTiViSioN911 opened this issue Mar 16, 2021 · 1 comment

Comments

@AcTiViSioN911
Copy link

Hello. Is there any way to change the data of a packet before sending it? I could do it in Titanium Web Proxy, but it doesn't see tcp packets, only http. Sharppcap shows everything that wireshark sees, but I can't change the data ... am I doing something wrong, or is this not possible? Thank you.

@maxlluky
Copy link

maxlluky commented Mar 16, 2021

var device = new WinDivertDevice();
// WINDIVERT_FLAG_DROP will cause the original packet to be dropped
// you can inject it back (after modifications) using `device.SendPacket()`
device.Flags = WINDIVERT_FLAG_DROP;
device.Open();
// You can use any Libpcap example as reference for receiving

WinDivert allows user-mode applications to capture/modify/drop network packets sent to/from the Windows network stack. In summary, WinDivert can:

  • capture network packets
  • filter/drop network packets
  • sniff network packets
  • (re)inject network packets
  • modify network packets

If you want to block traffic, modify it and then send it forward, you need to implement the function of a router (a Proxy is a kind of Router). Such a programme would probably not be efficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants