Kill TCP connection


Recommended Posts

Ok so netstat is showing 2 connections which seem to be running on the [system].

I'd like to kill these to see what happens.

If I need anything, then a free program would be nice.

Link to comment
Share on other sites

Try this:

tcpkill -i eth0 { expression }

(a) Kill all outgoing ftp (port 21) connection:

tcpkill -i eth0 port 21

(b) Kill all all packets arriving at or departing from host 192.168.1.2 (host12.nixcraft.com)

tcpkill host 192.168.1.2

OR

tcpkill host host12.nixcraft.com

© To kill all IP packets between 192.168.1.2 and any host except 192.168.1.111, type the following:

tcpkill ip host 192.168.1.2 and not 192.168.1.111

Or if you want you can use the Currports, http://www.nirsoft.net/utils/cports.html

Link to comment
Share on other sites

are we talking windows or linux?

tcpkill is not a standard windows command, nor linux -- I do believe its part of the dsniff package. Install that if you want to be able to use tcpkill, but I do not believe the ports I have seen for dsniff to windows includes tcpkill

currports is a windows program. Or there is a windows version of tcpkill tcpkillNT -- but its quite old, still might work.

if your trying to kill a network connection, your best best is to just find the pid of the program making the connection, an then kill that process -- in windows you can do that with taskkill or pskill (free tool) in linux use the kill command or killall

netstat -b will give you the binary name of the process making the connection -o will give you the pid.

in linux netstat -p will give you the pid/program name

Link to comment
Share on other sites

Well I ended up restarting my system, but it was rather strange as I did mention it was running as System.

I am on windows btw.

It's also a nice thing to know as well on how to kill these things later

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.