LinuxQuestions.org
Review your favorite Linux distribution.
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-15-2011, 10:03 AM   #1
eliteparakeet
LQ Newbie
 
Registered: May 2011
Posts: 6

Rep: Reputation: 0
Host Based IDS Questions


Hi all,

I was wondering if people had experience with Linux HID's, and which ones they believed worked the best.

I was thinking about working on a HIDS for fun / resume boosting. It would be fairly basic and not rely on much network signatures. It would be solely reliant on determining whether or not a remote shell has been opened.

For example: you have a production web server with whom no users should be logging in to except for documented & scheduled maintenance. Any other access to the system at times other than this should always be considered malicious. Is it simple enough to just determine that whenever a shell is opened, that this signifies a user accessing the system?

The only other users that may be running would be Apache configured for /dev/null shell, and perhaps some type of DB (mysql or oracle) also configured with /dev/null (no login).

Is there an IDS like this that exists currently?
Where would I find the information of whenever an interactive shell is opened?
- I'm familiar with /var/log/secure for SSH & other logins, but is there a log / location that just determines when an interactive shell is opened?

Apologies if I am missing some key concepts here, only been in Linux for about a year now.

Any help / discussion is greatly appreciated.

Thanks!
 
Old 12-15-2011, 03:31 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
As far as a HIDS goes, there are several to look at. Three come to mind immediately: Aide, Samhain, Ossec. I personally use Ossec. Pretty much for any of these, you could write custom rules, such as for a shell log in. For monitoring access and shell logins, logwatch will report this information on a daily basis as well as give you a snap-shot summary from the system logs. If you are looking for resume building stuff, look into Snort and learn to write custom rules for it.
 
Old 12-15-2011, 04:05 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
...and in addition (I'm getting slow ;-p) to what was posted already:
Quote:
Originally Posted by eliteparakeet View Post
which ones they believed worked the best.
To ask which item X (Linux distribution, Desktop Environment, Window Manager, text editor) is "the best" may be of limited value. Without providing the basis for comparison yourself it only invites everybody to post their opinion. Besides, there are a lot of host-based intrusion detection systems for Linux (AIDE, Samhain, OSSEC HIDS, Osiris, Fcheck, Afick, Integrit, Prelude, tripwire and even Monit and Rootkit Hunter can check hashes) but they're just a tool in your toolkit. They shouldn't be used as the only tool, they shouldn't be used without having first hardened the system properly and you should save a copy of the binary, configuration files and databases elsewhere.
As far as differences go I'll recycle some old posts: http://www.linuxquestions.org/questi...3/#post2567153, http://www.linuxquestions.org/questi...1/#post1146681 and for some perspective: http://www.linuxquestions.org/questi...6/#post3879831.
For me the combination of SELinux, Audit and Samhain cover most of my requirements.


Quote:
Originally Posted by eliteparakeet View Post
(..) not rely on much network signatures.
That would be a NIDS not a HIDS?..


Quote:
Originally Posted by eliteparakeet View Post
Is there an IDS like this that exists currently?
If you mean NIDS then the obvious first thing would be to check for Snort / Bro / Prelude rules that trigger on any shell string. If you mean HIDS then Samhain allows you to check processes and log files using regular expressions but the Audit service can easily log syscalls too. For instance a rule like 'auditcl -a always,exit -F path=/usr/bin/wget -F perm=x -F auid=48 -k HTTPD_problem' will alert you if UID 48 (may differ but for me it's the web server user) executes the 'wget' binary. From there it's simply using SEC or equivalent or Logwatch to generate reports or alerts.


Quote:
Originally Posted by eliteparakeet View Post
Where would I find the information of whenever an interactive shell is opened?
- I'm familiar with /var/log/secure for SSH & other logins, but is there a log / location that just determines when an interactive shell is opened?
Yeah, that would complete your "project" in one reply ;-p Distinctions of a shell being interactive or not aren't made that way as a shell is always anchored at the user who is allowed to log in or not (as in existence, shell, password, any access restrictions). Minimally, as far as init, getty's and login are concerned there's /var/run/utmp and /var/log/wtmp and on systems using PAM there's /var/log/secure (or wherever else Syslog is configured to log logins and violations to).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Linux based filtering tap for IDS aarondcounts Linux - Security 4 12-16-2009 12:37 PM
A host based IDS rojoraider82 Linux - Software 4 12-15-2006 05:25 AM
host based IDS in distributed setting nedianz Linux - Security 3 07-22-2005 09:58 AM
Host-Based IDS... Linux~Powered Linux - Security 1 03-18-2004 04:58 PM
The remote host uses non-random IP IDs - How to fix this??? ForumKid Linux - Security 1 02-04-2002 01:39 PM

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

All times are GMT -5. The time now is 11:37 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