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 07-07-2006, 02:11 AM   #1
chibi
Member
 
Registered: Aug 2004
Location: Canada
Distribution: Archlabs
Posts: 65

Rep: Reputation: 15
View active/past connections? (was dos'd)


Hello,

I had a small DOS today that didn't really work. It just slowed down the server, it was like a continuous thing it wasnt like a single attack, more of a lag bringer for hours.

I suspected I knew who this person was so I blocked their isp and their webserver IPs using iptables, and like magic my server was lag free.

I want more proof of this, so I would appreciate someone telling me where I can see logs of all the connections (incoming and outgoing?). I am not really sure what sort of formats it'd have: if I can search for IPs with grep or not. Or maybe I have to do something first to even have logs, I don't know..

I don't really think I could go and install snort or something like that. I always wondered how to see whos connecting and where (is a firewall really necessary because I kinda thought Linux just auto logs this stuff). I know the netstat command but are there any alternatives people would recommend or some sort of logging system thats easy to setup?

I really feel having some insight into this would be very beneficial should something very serious happen. Thanks everyone.

Last edited by chibi; 07-07-2006 at 02:12 AM.
 
Old 07-07-2006, 08:08 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You can use tcpdump/ethereal to track packets. The beauty of these is if you have a specific IP address or range you suspect you can limit its capture to that.

Other than actual logins without turning on the above there is little that is tracked automatically. You can review /var/log/messages to see if it repeatedly shows attempts for logins that were refused. But to truly track it you need something like tcpdump/ethereal.

Linux does have configurable security but having a firewall between your ISP and the Linux machine is always a good extra measure especially if you have multiple machines inside the firewall. Several vendors (Linksys and Belkin to mention a couple) have 4 port (and wireless) firewall routers that you can just plug in and do minimal configuration on to get things going.
 
Old 07-07-2006, 09:23 AM   #3
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Also check your individual application logs (like SSH, Apache) as they will often include a more detailed log of indivdual connections. Tcpdump/Ethereal is definitely the tool of choice during the attack.

Note that you can configure iptables to log large numbers of connections or packets from a single source IP using the limit match.

Last edited by Capt_Caveman; 07-07-2006 at 09:25 AM.
 
Old 07-07-2006, 09:28 AM   #4
MoMule
Member
 
Registered: Jul 2006
Posts: 134

Rep: Reputation: 15
Dos

The problem with your IPTables solution is that a true attacker will instantly catch on and change IP's to continue the attack (you can't physically monitor this 24/7).

Here's a nice little script that can monitor your logs (yes you have logs by default on Linux) and will automatically block any IP that fails any type of authentication that you set up (ftp, ssh, smtp, etc.).

Go to http://www.rfxnetworks.com/bfd.php and read up on the script.

I have friends who run multiple servers and are constantly barraged by various attacking attempts. They use BFD (Brute Force Detection) set at 3 failed attempts. After the three attempts, the attacker's IP is automatically banned for a preset time (or permanently).

Deion "Mule" Christopher
 
Old 07-07-2006, 02:13 PM   #5
chibi
Member
 
Registered: Aug 2004
Location: Canada
Distribution: Archlabs
Posts: 65

Original Poster
Rep: Reputation: 15
Excellent. Thank you guys very very much.
 
  


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
how to kill active TCP connections ~=gr3p=~ Linux - Networking 2 02-11-2006 09:58 AM
How can I get info re. current active connections? rickh Linux - Security 4 01-16-2006 08:18 AM
Active network connections crabboy AIX 1 08-04-2004 03:14 PM
GUI for active connections twistedpair Linux - Networking 3 03-30-2004 03:22 PM
Killing Active Connections Crashed_Again Linux - General 5 05-17-2003 01:48 AM

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

All times are GMT -5. The time now is 04:17 PM.

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