LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-28-2005, 12:38 AM   #1
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
How do I 'break' an unwanted Internet connection?


I was looking at the 'Active Connections' on Firestarter. Most of them I was aware of and approved, but there were a couple I didn't understand. Had to reboot to get rid of them. Is there a command I could issue to break such a connection? Hopefully one that needs only the port # or ip address since that's all the info Firestarter is giving me.
 
Old 12-28-2005, 01:07 AM   #2
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
Could you give us some examples of connections you didn't want?
 
Old 12-28-2005, 11:42 AM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by rickh
...Is there a command I could issue to break such a connection? Hopefully one that needs only the port # or ip address since that's all the info Firestarter is giving me.
Well, you could just kill the process that is using the port. That may or may not be a good thing.

To find out what process is using a given network connection:

As root, try running "netstat -np" or "lsof -i". Depending on how many connections you have you will probably need to pipe the output to a pager (pg, more, less, etc.) This will give you the process id and program name of the thing that's using the connection. Non-root users cannot get this information AFAIK.
 
Old 12-29-2005, 07:50 AM   #4
rolsch
LQ Newbie
 
Registered: Jul 2004
Location: Berlin, Germany
Distribution: Debian Sarge, Fedora Core 4, Suse 9.1
Posts: 13

Rep: Reputation: 0
Sounds like you need dsniff, a package that basically sniffes network connections, but also comes with 2 useful tools you might want to take a look at:

* tcpkill - kills specified in-progress TCP connections.
* tcpnice - slow down specified TCP connections via "active" traffic shaping.

There is also a tool called 'cutter' which cuts off active ip connections, but I haven't used it. Just google for it.

Hope this helps.
 
Old 12-29-2005, 12:22 PM   #5
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Original Poster
Rep: Reputation: 62
Quote:
dsniff
Ooh! that sounds like exactly what I need. I was trying to get the problem to reoccur, so I could be a little more specific about the connections I didn't want, but it hasn't yet. It will tho, and I'm sure that the process involved is going to be java, which is also controlling connections I want to keep. Thus haertig's kill suggestion above is probably not going to work. His suggested troubleshooting commands work nicely, tho.

All I want to do is slam the door on specific connected ports.
 
Old 12-30-2005, 12:07 AM   #6
finger_my_tty
LQ Newbie
 
Registered: Dec 2005
Location: pa
Distribution: debian slackware ubuntu
Posts: 4

Rep: Reputation: 0
another easy way to track connections is netstat.
"netstat -l" shows listening sockets
"netstat -p" shows pid of whats on the socket
"netstat -c" will scroll the connections continuos
those are just the couple i know off the top of my head reading man netstat should help if you need anything else.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
receiving unwanted data from internet mohtasham1983 Linux - General 2 11-28-2005 12:37 PM
Retain Server Connection Up, If Client Break, write system call return SIGPIPE anandss2004 Programming 2 10-24-2005 12:16 AM
Detecting connection break on serial port listener on linux neelc20 Programming 6 12-04-2003 01:08 AM
Detecting connection break on serial port listener on linux neelc20 Linux - Newbie 3 11-29-2003 03:29 PM
MSN to break Linux connection used with msn I think read maximalred Linux - General 1 08-24-2003 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration