开发者

Block outgoing TCP connection to a given host or IP?

开发者 https://www.devze.com 2023-01-26 21:55 出处:网络
Is it possible to intercept an outgoing TCP connection to a given host or IP in Windows and block that connection on the TCP level, i.e. at the connect(...) laye开发者_Python百科r? Or prevent connecti

Is it possible to intercept an outgoing TCP connection to a given host or IP in Windows and block that connection on the TCP level, i.e. at the connect(...) laye开发者_Python百科r? Or prevent connection to a specific IP in the first place?

Or do I need to write a packet filter to intercept traffic to a certain address?


It's probably best to simply use the system's firewall API. On Windows: http://msdn.microsoft.com/en-us/library/aa366449(v=VS.85).aspx

Otherwise you are going to be writing drivers and such... complete hassle considering the functionality is built into the OS these days.


On linux? Configure iptables to drop the connection, perhaps.

0

精彩评论

暂无评论...
验证码 换一张
取 消