zoukankan      html  css  js  c++  java
  • 利用dsniff的tcpkill杀TCP连接

    利用dsniff的tcpkill杀TCP连接

    Linux连接久久不能释放的现象不常见,但偶然也会发生。进程虽不复存在,但是客户端的连接咬定青山不放松,死活也不肯吐出连接,导致重启进程时因操作系统判断监听端口被占用而无法启动。常规手段已经束手无策,这时候不得不想办法杀连接。
    一、tcpkill介绍
    tcpkill是网络嗅探工具包dsniff其中提供的一个利器,用于杀掉TCP连接。因此事先要安装dsniff。如rhel5中,搜索下载dsniff-2.4-0.1.b1.el5.rf.rpm,rpm -ivh安装后,很容易调出tcpkill命令。我们可以先看看manual:
    [root@xxxx ~]# man tcpkill
    TCPKILL(8)                                                          TCPKILL(8)
    NAME
           tcpkill - kill TCP connections on a LAN
     
    SYNOPSIS
           tcpkill [-i interface] [-1...9] expression
     
    DESCRIPTION
           tcpkill kills specified in-progress TCP connections (useful for libnids-based applications which require a full
           TCP 3-whs for TCB creation).
     
    OPTIONS
           -i interface
                  Specify the interface to listen on.
     
           -1...9 Specify the degree of brute force to use in killing a connection. Fast connections may require a  higher
                  number in order to land a RST in the moving receive window. Default is 3.
     
           expression
                  Specify a tcpdump(8) filter expression to select the connections to kill.
     
    SEE ALSO
           dsniff(8), tcpnice(8)
     
    AUTHOR
           Dug Song <dugsong@monkey.org>                                         
                               TCPKILL(8)
    二、tcpkill实战
    在该示例中,FIN_WAIT1 的TCP连接一直无法释放,顽强无比。

    进程监听端口16000,客户端连接端口43255。

    使用tcpkill的效果又是如何呢?

     命令如下:tcpkill -9 host 客户端连接ip

    可以看到客户端140.4:43255的连接被杀掉后,它又重新尝试新的连接。

  • 相关阅读:
    如何打开肉鸡的3389端口(xp的)
    XP鲜为人知的实用技巧(一)
    利用Ms08067工具进行溢出攻击
    教你建一个别人看不到打不开的文件夹
    在IE上显示自己的名字
    QQ使用的七大非常规秘籍
    第五篇:Python函数基础篇
    Centos7之Systemd(Service文件)详解
    Linux GCC make文件的写法3
    DSP/BIOS学习笔记——2.SWI
  • 原文地址:https://www.cnblogs.com/archoncap/p/5125180.html
Copyright © 2011-2022 走看看