Skip to content

Instantly share code, notes, and snippets.

@amcorreia
Forked from christianchristensen/killtcp.md
Created April 8, 2014 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amcorreia/10204572 to your computer and use it in GitHub Desktop.
Save amcorreia/10204572 to your computer and use it in GitHub Desktop.
kill TCP connection

Kill an active TCP connection

Some notes on killing a TCP connection...

Info gathering

(remember to be root!)

  • lsof | awk '{ print $2; }' | sort -rn | uniq -c | sort -rn | head
    • lsof | grep <PID>
  • netstat -tonp
  • Killcx deps: libnet-rawip-perl libnet-pcap-perl libnetpacket-perl
  • tcpkill deps: dsniff

Motivations

CLOSE_WAIT related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment