
(特定の)TCP、UDP、ICMPトラフィックを別の宛先にリダイレクトします。
StreamDivertは、システム上の受信および送信ネットワーク接続をman-in-the-middle(中間者攻撃)またはリレーするツールです。たとえば、すべての着信SMB接続をポート445から別のサーバーにリレーしたり、特定の送信元IPセットからの特定の着信SMB接続のみを別のサーバーにリレーしたりできます。まとめると、StreamDivertは以下のことができます。
StreamDivertのプリコンパイル済みバイナリはこちらからダウンロードできます。
StreamDivertの使用方法: 管理者権限でツールを実行します:
streamdivert.exe config_file [-f] [-v]
設定ファイルには、リダイレクトしたいストリームのエントリが含まれています。設定ファイルの例:
//Divert all inbound TCP connections to port 445 (SMB) coming from 10.0.1.50 to 10.0.1.49 port 445
tcp < 445 10.0.1.50 -> 10.0.1.49 445
//Divert all inbound TCP connections to port 445 (SMB) coming from 10.0.1.51 to a local SOCKS server
tcp < 445 10.0.1.51 -> socks
//Divert all inbound TCP connections to port 445 (SMB) coming from fe80::f477:846a:775d:d37 to fe80::20c:29ff:fe6f:88ff port 445
tcp < 445 fe80::f477:846a:775d:d37 -> fe80::20c:29ff:fe6f:88ff 445
//Divert all inbound TCP connections to port 445 (SMB) to 10.0.1.48 port 445
tcp < 445 0.0.0.0 -> 10.0.1.48 445
//Divert all inbound UDP connections to to port 53 (DNS) to 10.0.1.49 port 53
udp < 53 0.0.0.0 -> 10.0.1.49 53
//Divert all inbound ICMP packets coming from 10.0.1.50 to 10.0.1.49
icmp < 10.0.1.50 -> 10.0.1.49
//Divert all outbound TCP connections to 10.0.1.50, port 80 to 10.0.1.49 port 8080
tcp > 10.0.1.50 80 -> 10.0.1.49 8080
//Send all packets going to 10.0.1.50 port 80 and prefer interface 9 to send them. If the interface does not exist or is not up, the packets are send from the default interface.
tcp > 10.0.1.50 80 -> 10.0.1.50 80 interface 9
//Force all packets going to 10.0.1.50 port 80 over interface 9, or drop the packets if the interface does not exist or is not up.
tcp > 10.0.1.50 80 -> 10.0.1.50 80 force interface 9
//Divert all outbound UDP connection to port 53 (DNS) to 10.0.1.49 port 53
udp > 0.0.0.0 53 -> 10.0.1.49 53
[-f]フラグを指定すると、Windowsファイアウォールが変更され、アプリケーションが着信トラフィックを別のポートに適切にリダイレクトするための例外が追加されます。[-v]フラグはログの詳細度を制御します。指定すると、StreamDivertはリダイレクトされたパケットとストリームの詳細をログに記録します。
リダイレクト接続を設定する際に注意すべき点は、競合するリダイレクトストリームを作らないことです。次の設定ファイルの例を考えてみてください:
icmp < 0.0.0.0 -> 10.0.1.50
icmp > 10.0.1.49 -> 10.0.1.48
これら2つのリダイレクトストリームは互いに競合します。最初のリダイレクトストリームのパケットが2番目のパケット「diverter」にも拾われるためです。通常、このような問題はUDPおよびICMPとワイルドカードを使用する場合にのみ発生します。
また、UDPおよびICMPトラフィックでは、IPv4からIPv6アドレスへのリダイレクト、およびその逆はサポートされていません。
希望する機能: