Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-07-2006, 02:11 AM
|
#1
|
Member
Registered: Aug 2004
Location: Canada
Distribution: Archlabs
Posts: 65
Rep:
|
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.
|
|
|
07-07-2006, 08:08 AM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
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.
|
|
|
07-07-2006, 09:23 AM
|
#3
|
Senior Member
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658
Rep:
|
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.
|
|
|
07-07-2006, 09:28 AM
|
#4
|
Member
Registered: Jul 2006
Posts: 134
Rep:
|
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
|
|
|
07-07-2006, 02:13 PM
|
#5
|
Member
Registered: Aug 2004
Location: Canada
Distribution: Archlabs
Posts: 65
Original Poster
Rep:
|
Excellent. Thank you guys very very much.
|
|
|
All times are GMT -5. The time now is 09:34 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|