Visit Our UNIX and Linux User Community


email Alert


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting email Alert
# 1  
Old 10-07-2007
email Alert

Hello,


I want a script that will scan the file /etc/httpd/conf/httpd.conf and the folder /etc/httpd/libexec/


-bash-2.05b# grep mod_r /etc/httpd/conf/httpd.conf
LoadModule rewrite_module libexec/mod_rewrite.so
AddModule mod_rewrite.c
-bash-2.05b#



-bash-2.05b# find /etc/httpd/libexec/ -name mod_r*
/etc/httpd/libexec/mod_rewrite.so



If the scan finds malicious entry like

mod_rphp or mod_root in httpd.conf

it will email an alert to a particular email.


-bash-2.05b# grep mod_r /etc/httpd/conf/httpd.conf | grep -v mod_rewrite
-bash-2.05b#




If the scan finds malicious files in the folder /etc/httpd/libexec/ like mod_rphp.so or mod_rootme

-bash-2.05b# find /etc/httpd/libexec/ -name mod_r* | grep -v mod_rewrite.so
-bash-2.05b#


it will email an alert to a particular email.



Please advise.

format is basically..

1)

if
entry exists
do
email alert

2)

if
file exists
do
email alert




Thanks
# 2  
Old 10-07-2007
Are you really looking for an intrusion detection system?
# 3  
Old 10-07-2007
IDS is fine too.. but I want an advice on that script too.
# 4  
Old 10-07-2007
Do a search on this site, there are plenty of examples of people sending emails using scripts.
# 5  
Old 10-07-2007
Smilie ... ty.. I think I got lazy

Previous Thread | Next Thread
Test Your Knowledge in Computers #48
Difficulty: Easy
Alan Turing is considered to be the 'Father of Cryptography'.
True or False?

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Email alert after termination

I am running the gaussian program on UNIX with bash and I want to form a script that will email me once the output life terminates either "normal termination" or "false" I just started learning this last week so could you let me know how to go about this.:b: (13 Replies)
Discussion started by: Jade_Michael
13 Replies

2. UNIX for Beginners Questions & Answers

Email Alert in UNIX

Hi There I have to wrote a script where I am able to echo a result of an SQL script, however I want to be able to send an email to myself when it is more than 0 (so whenever a value is returned) is this possible? I tried one way from looking on the web but this didn't work, I have added my... (8 Replies)
Discussion started by: simpsa27
8 Replies

3. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

4. Shell Programming and Scripting

Email alert script

I need to code a script, which will run via cron, every 30 minutes. The script will read a file containing a date&time and number (which represents disk space). The file gets appended to every 30 minutes. Here's a sample of the file: CPU 1:04/25/02 1:00 am:1972554 CPU 1:04/25/02 1:30... (1 Reply)
Discussion started by: moon
1 Replies

Featured Tech Videos