如何在 Linux 上断开任意 TCP/IP 连接? [英] How do I break an arbitrary TCP/IP connection on Linux?

查看:58
本文介绍了如何在 Linux 上断开任意 TCP/IP 连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何命令可用于从某个程序中断现有的 TCP/IP 连接?

Is there any command that can be used to break an existing TCP/IP connection from some program?

操作系统是否知道 TCP 连接中的任何内容,或者操作系统是否只看到本地套接字上的 TCP 传输,而不知道哪个请求被提供给哪个套接字?

Is there anything in a TCP connection the OS is aware of, or do the OS only see TCP transfer on local sockets and doensn't know which request is served to which socket?

例如,如果 Firefox 向某个服务器的端口 80 发送请求并正在等待答复.那么是否有可能找到 Firefox 侦听端口并诱使 Firefox 显示 ERR_CONNECTION_REFUSED 或类似内容.

For example, if Firefox sends a request to some server's port 80 and is waiting for the answer. Is it possible then to find Firefox listening port and trick Firefox into showing ERR_CONNECTION_REFUSED or something similar.

我想要一个不阻止数据流并让应用程序以自己的方式处理这种情况的解决方案,而是关闭套接字或 TCP/IP 连接(这应该是可能的,因为套接字是操作系统的一部分)我认为负责?连接也是操作系统属性还是只是应用程序所做的事情?)所以应用程序会立即做出反应.

I would like a solution that does not prevent the data flow and lets the application handle this situation in its way, but rather close the socket or the TCP/IP connection (which should be possible as the socket is something the OS is responsible for I think? Is the connection also a OS property or just something the application does?) so the application would react immediately.

推荐答案

使用 tcpkill.

这篇关于如何在 Linux 上断开任意 TCP/IP 连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆