LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-28-2011, 02:25 PM   #1
Jon_Roland
LQ Newbie
 
Registered: Jul 2004
Location: Austin, Texas
Distribution: Fedora, Suse
Posts: 15

Rep: Reputation: 0
Seek script to monitor sizes of list of files and send alert if size changes


I am looking for a utility that would do the following:

1. Be run manually on a list of files whose sizes should not change, to get a control file containing the sizes of each file.

2. Subsequent manual runs would report any changes in size of any of the files in the list, and allow option to accept the new sizes.

3. Be run as a cron job to check for changes in the file sizes and send an email alert if a change has occurred since the last time it was run.

The purpose is to detect possible hacks of key files on a website. It would not include files expected to change, but just those that should not change. It would be run manually a few times to get the control list one wants to monitor.

I have looked at Monit but it seems like overkill unless I can find a lot easier way to install and use it on my site. Any suggestions?
 
Old 03-28-2011, 02:33 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
http://aide.sourceforge.net/

AIDE will do this.
 
Old 03-28-2011, 02:35 PM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

There are several tools you can use to monitor files, watch, inotify, audit, ... But I think for the simple use you need it would be simpler to just write a script that checks either the size, modification time/date, md5 hash or other things, whatever you need. Store the information you want to check in a file and at a chosen time interval loop through that file to check the values of the file against what's in that file.

As with all script request here at LQ you'll need to put in the work and show us what you've got written already and where it's failing or where you're encountering problems.

Kind regards,

Eric
 
Old 03-28-2011, 04:37 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Jon_Roland View Post
Any suggestions?
Aide, Samhain, hell even tripwire would do. Wrt purpose and "detecting hacks of key files" please don't mistake the script you intend to use for proper security. Any add-ons like alerting should be preceded by proper hardening. Security should not be an afterthought and it should be more than running a wee script.

Would you like to know more?..
 
1 members found this post helpful.
  


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
Need advice on a script to search many files for list of terms, append hits to list jimmy the saint Programming 1 07-11-2010 03:59 AM
[SOLVED] check directory for new files and send email alert saifkhan123 Linux - General 3 09-12-2009 01:45 AM
[SOLVED] looking for a way to list files sorted by size mark_alfred Linux - General 4 08-22-2009 09:20 AM
trying to create shell script to monitor logfile size and email an alert message cat555 Programming 3 11-13-2008 01:59 AM
LXer: Perl script to monitor disk space and send an email alert LXer Syndicated Linux News 1 02-23-2007 01:12 PM

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

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