centos yum安装
yum -y install dsniff --enablerepo=epel
安装完成后可以发现系统多了一个tcpkill的命令,命令使用方法如下:
tcpkill -9 port ftp &>/dev/null
tcpkill -9 host 192.168.10.30 &>/dev/null
tcpkill -9 port 53 and port 8000 &>/dev/null
tcpkill -9 net 192.168.10 &>/dev/null
tcpkill -9 net 192.168.10 and port 22 &>/dev/null
如果想踢掉分发端口为59986的连接
tcpkill -i eth0 -9 port 59986
在使用tcpkill时,会发现一件奇怪的事情,运行tcpkill命令后并不会马上中断匹配的tcp连接,只有当该连接有新的tcp包发送接收时,tcpkill才会“kill”这个tcp连接