jellever / StreamDivert

Redirecting (specific) TCP, UDP and ICMP traffic to another destination.
343 stars 71 forks source link

Divert to different physical adapter #5

Open viruzeno opened 2 years ago

viruzeno commented 2 years ago

I'm trying to divert all traffic from interface 1 to interface 2

Your readme states - Force redirected packets over a specific network interface.

What would the config for this look like?

I've tried variations like this (10.10.10.10) the IP of the other interface

icmp < 0.0.0.0 -> 10.10.10.10
icmp > 0.0.0.0 -> 10.10.10.10
tcp < 0.0.0.0 -> 10.10.10.10
tcp > 0.0.0.0 -> 10.10.10.10
udp < 0.0.0.0 -> 10.10.10.10
udp > 0.0.0.0 -> 10.10.10.10

It finds 4 of the 6 rules, but does not seem to do anything.

PS C:\Users\Administrator\Downloads\StreamDivert.x64> ./StreamDivert.exe config.txt
[*] Parsing config file...
[*] Parsed 3 inbound and 1 outbound relay entries.
[*] Starting packet diverters...
[*] InboundTCPDivertProxy(0:?) Start
[*] SocksProxyServer(0): Start
[*] SocksProxyServer(50162): Start completed
[*] InboundTCPDivertProxy(0:50161) Start
[*] InboundTCPDivertProxy(0:50161) tcp and ((tcp.SrcPort == 50161) or (tcp.SrcPort == 50162) or (tcp.DstPort == 0 and ipv6.SrcAddr 
== ffff:ffff::46f1:dc13:f77f:0))
[*] InboundUDPDivertProxy() Start
[*] InboundUDPDivertProxy() udp and ((udp.DstPort == 0 and ipv6.SrcAddr == ffff:ffff::46f1:dc13:f77f:0) or (udp.SrcPort == 41438 and 
ipv6.SrcAddr == ::))
[*] InboundICMPDivertProxy() Start
[*] InboundICMPDivertProxy() (icmp or icmpv6) and ((ipv6.SrcAddr == ::) or (ipv6.SrcAddr == ffff:ffff::46f1:dc13:f77f:0))
[*] OutboundDivertProxy() Start
[*] OutboundDivertProxy() (icmp or icmpv6)
jellever commented 2 years ago

Hi,

Currently it is only supported to intercept and force the traffic over another interface for specific streams. You would configure this like so: tcp > 1.1.1.1 80 -> 1.1.1.1 80 force interface 9

This would intercept all tcp traffic going to external ip 1.1.1.1, destination port 80 (the tcp > 1.1.1.1 80 part) and change the destination address and port to 1.1.1.1 80 (the -> 1.1.1.1 80 part), and force the packets over interface number 9 (the force interface 9 part). You can inspect the network interfaces and their number by running stream divert:

StreamDivert.exe interfaces

viruzeno commented 2 years ago

Oh, I'll have to give that a try,

What I'm trying to do is capture traffic within a virtual stack and push it out via a GRE tunnel / seperate interface.

Is there a rule option that will leave the forwarded traffic unmodified?

Cheers.

On Thu, 17 Feb 2022, 17:30 Jelle Vergeer, @.***> wrote:

Hi,

Currently it is only supported to intercept and force the traffic over another interface for specific streams. You would configure this like so: tcp > 1.1.1.1 80 -> 1.1.1.1 80 force interface 9

This would intercept all tcp traffic going to external ip 1.1.1.1, destination port 80 (the tcp > 1.1.1.1 80 part) and change the destination address and port to 1.1.1.1 80 (the -> 1.1.1.1 80 part), and force the packets over interface number 9 (the force interface 9 part). You can inspect the network interfaces and their number by running stream divert:

StreamDivert.exe interfaces

— Reply to this email directly, view it on GitHub https://github.com/jellever/StreamDivert/issues/5#issuecomment-1042618111, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEHGPA5FSA7KMPZ4VZV3VRDU3SIZNANCNFSM5OTPTDFQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

zeltrax00 commented 2 years ago

Hi,

Currently it is only supported to intercept and force the traffic over another interface for specific streams. You would configure this like so: tcp > 1.1.1.1 80 -> 1.1.1.1 80 force interface 9

This would intercept all tcp traffic going to external ip 1.1.1.1, destination port 80 (the tcp > 1.1.1.1 80 part) and change the destination address and port to 1.1.1.1 80 (the -> 1.1.1.1 80 part), and force the packets over interface number 9 (the force interface 9 part). You can inspect the network interfaces and their number by running stream divert:

StreamDivert.exe interfaces

Can I divert UDP to other interfaces ? According to my testing, I can do it with TCP but not UDP