<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7036.0">
<TITLE>Security Breach?</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">Hi all, hope you can help me out with this question I have just been sent which is as follows: -</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">"We have had a security warning from the hosting company, one of the Nagios User processes was using up 90% of the CPU:</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">8521 nagios 25 0 6144 2168 1524 R 90.4 0.0 566:17.51 x</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">A review of the users access logs show this appeared to start last night, and the account has been remotely logged in to, suggesting its fully compromised:</FONT></P>

<P><FONT SIZE=2 FACE="Arial">nagios pts/3 :pts/1:S.0 Sat Apr 3 11:35 - 11:36 (00:00)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/3 :pts/1:S.0 Sat Apr 3 11:32 - 11:35 (00:03)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/3 :pts/1:S.0 Sat Apr 3 01:41 - 11:30 (09:49)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/1 79.119.233.48 Sat Apr 3 01:36 - 15:36 (13:59)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/3 :pts/1:S.0 Fri Apr 2 23:50 - 01:36 (01:45)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/3 :pts/1:S.0 Fri Apr 2 22:25 - 23:37 (01:12)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/1 79.119.233.48 Fri Apr 2 20:55 - 01:36 (04:41)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/3 :pts/1:S.0 Fri Apr 2 12:47 - 13:18 (00:31)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/3 :pts/1:S.0 Fri Apr 2 10:50 - 12:47 (01:56)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/3 :pts/1:S.0 Fri Apr 2 10:49 - 10:49 (00:00)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/2 :pts/1:S.0 Fri Apr 2 10:36 - 10:49 (00:12)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/2 :pts/1:S.0 Fri Apr 2 10:02 - 10:36 (00:33)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/1 79.119.227.50 Fri Apr 2 09:35 - 13:18 (03:43)</FONT>

<BR><FONT SIZE=2 FACE="Arial">nagios pts/1 91.194.84.177 Fri Apr 2 01:52 - 01:52 (00:00"</FONT>

<BR><FONT SIZE=2 FACE="Arial">Could you help me out to try and understand how this has happened please as I'm at a complete loss, if you need more info I will endeavour to get it for you.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">Thanks all</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Nrpe.cfg and hosts allow are below.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">######################################################</FONT>

<BR><FONT SIZE=2 FACE="Arial"># LOG FACILITY</FONT>

<BR><FONT SIZE=2 FACE="Arial"># The syslog facility that should be used for logging purposes.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">log_facility=daemon</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># PID FILE</FONT>

<BR><FONT SIZE=2 FACE="Arial"># The name of the file in which the NRPE daemon should write it's process ID</FONT>

<BR><FONT SIZE=2 FACE="Arial"># number.  The file is only written if the NRPE daemon is started by the root</FONT>

<BR><FONT SIZE=2 FACE="Arial"># user and is running in standalone mode.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">pid_file=/var/run/nrpe.pid</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># PORT NUMBER</FONT>

<BR><FONT SIZE=2 FACE="Arial"># Port number we should wait for connections on.</FONT>

<BR><FONT SIZE=2 FACE="Arial"># NOTE: This must be a non-priviledged port (i.e. > 1024).</FONT>

<BR><FONT SIZE=2 FACE="Arial"># NOTE: This option is ignored if NRPE is running under either inetd or xinetd</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">server_port=5666</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># SERVER ADDRESS</FONT>

<BR><FONT SIZE=2 FACE="Arial"># Address that nrpe should bind to in case there are more than one interface</FONT>

<BR><FONT SIZE=2 FACE="Arial"># and you do not want nrpe to bind on all interfaces.</FONT>

<BR><FONT SIZE=2 FACE="Arial"># NOTE: This option is ignored if NRPE is running under either inetd or xinetd</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">#server_address=127.0.0.1</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># NRPE USER</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This determines the effective user that the NRPE daemon should run as.  </FONT>

<BR><FONT SIZE=2 FACE="Arial"># You can either supply a username or a UID.</FONT>

<BR><FONT SIZE=2 FACE="Arial"># </FONT>

<BR><FONT SIZE=2 FACE="Arial"># NOTE: This option is ignored if NRPE is running under either inetd or xinetd</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">nrpe_user=nagios</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># NRPE GROUP</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This determines the effective group that the NRPE daemon should run as.  </FONT>

<BR><FONT SIZE=2 FACE="Arial"># You can either supply a group name or a GID.</FONT>

<BR><FONT SIZE=2 FACE="Arial"># </FONT>

<BR><FONT SIZE=2 FACE="Arial"># NOTE: This option is ignored if NRPE is running under either inetd or xinetd</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">nrpe_group=nagios</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># ALLOWED HOST ADDRESSES</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This is an optional comma-delimited list of IP address or hostnames </FONT>

<BR><FONT SIZE=2 FACE="Arial"># that are allowed to talk to the NRPE daemon.</FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># Note: The daemon only does rudimentary checking of the client's IP</FONT>

<BR><FONT SIZE=2 FACE="Arial"># address.  I would highly recommend adding entries in your /etc/hosts.allow</FONT>

<BR><FONT SIZE=2 FACE="Arial"># file to allow only the specified host to connect to the port</FONT>

<BR><FONT SIZE=2 FACE="Arial"># you are running this daemon on.</FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># NOTE: This option is ignored if NRPE is running under either inetd or xinetd</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">allowed_hosts=127.0.0.1</FONT>

<BR><FONT SIZE=2 FACE="Arial"> </FONT>

<BR><FONT SIZE=2 FACE="Arial"># COMMAND ARGUMENT PROCESSING</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This option determines whether or not the NRPE daemon will allow clients</FONT>

<BR><FONT SIZE=2 FACE="Arial"># to specify arguments to commands that are executed.  This option only works</FONT>

<BR><FONT SIZE=2 FACE="Arial"># if the daemon was configured with the --enable-command-args configure script</FONT>

<BR><FONT SIZE=2 FACE="Arial"># option.  </FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># *** ENABLING THIS OPTION IS A SECURITY RISK! *** </FONT>

<BR><FONT SIZE=2 FACE="Arial"># Read the SECURITY file for information on some of the security implications</FONT>

<BR><FONT SIZE=2 FACE="Arial"># of enabling this variable.</FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># Values: 0=do not allow arguments, 1=allow command arguments</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">dont_blame_nrpe=0</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># COMMAND PREFIX</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This option allows you to prefix all commands with a user-defined string.</FONT>

<BR><FONT SIZE=2 FACE="Arial"># A space is automatically added between the specified prefix string and the</FONT>

<BR><FONT SIZE=2 FACE="Arial"># command line from the command definition.</FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># *** THIS EXAMPLE MAY POSE A POTENTIAL SECURITY RISK, SO USE WITH CAUTION! ***</FONT>

<BR><FONT SIZE=2 FACE="Arial"># Usage scenario: </FONT>

<BR><FONT SIZE=2 FACE="Arial"># Execute restricted commmands using sudo.  For this to work, you need to add</FONT>

<BR><FONT SIZE=2 FACE="Arial"># the nagios user to your /etc/sudoers.  An example entry for alllowing </FONT>

<BR><FONT SIZE=2 FACE="Arial"># execution of the plugins from might be:</FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># nagios          ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/</FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This lets the nagios user run all commands in that directory (and only them)</FONT>

<BR><FONT SIZE=2 FACE="Arial"># without asking for a password.  If you do this, make sure you don't give</FONT>

<BR><FONT SIZE=2 FACE="Arial"># random users write access to that directory or its contents!</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># command_prefix=/usr/bin/sudo </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># DEBUGGING OPTION</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This option determines whether or not debugging messages are logged to the</FONT>

<BR><FONT SIZE=2 FACE="Arial"># syslog facility.</FONT>

<BR><FONT SIZE=2 FACE="Arial"># Values: 0=debugging off, 1=debugging on</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">debug=0</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># COMMAND TIMEOUT</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This specifies the maximum number of seconds that the NRPE daemon will</FONT>

<BR><FONT SIZE=2 FACE="Arial"># allow plugins to finish executing before killing them off.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">command_timeout=60</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># CONNECTION TIMEOUT</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This specifies the maximum number of seconds that the NRPE daemon will</FONT>

<BR><FONT SIZE=2 FACE="Arial"># wait for a connection to be established before exiting. This is sometimes</FONT>

<BR><FONT SIZE=2 FACE="Arial"># seen where a network problem stops the SSL being established even though</FONT>

<BR><FONT SIZE=2 FACE="Arial"># all network sessions are connected. This causes the nrpe daemons to</FONT>

<BR><FONT SIZE=2 FACE="Arial"># accumulate, eating system resources. Do not set this too low.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">connection_timeout=300</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># WEEK RANDOM SEED OPTION</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This directive allows you to use SSL even if your system does not have</FONT>

<BR><FONT SIZE=2 FACE="Arial"># a /dev/random or /dev/urandom (on purpose or because the necessary patches</FONT>

<BR><FONT SIZE=2 FACE="Arial"># were not applied). The random number generator will be seeded from a file</FONT>

<BR><FONT SIZE=2 FACE="Arial"># which is either a file pointed to by the environment valiable $RANDFILE</FONT>

<BR><FONT SIZE=2 FACE="Arial"># or $HOME/.rnd. If neither exists, the pseudo random number generator will</FONT>

<BR><FONT SIZE=2 FACE="Arial"># be initialized and a warning will be issued.</FONT>

<BR><FONT SIZE=2 FACE="Arial"># Values: 0=only seed from /dev/[u]random, 1=also seed from weak randomness</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">#allow_weak_random_seed=1</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial"># INCLUDE CONFIG FILE</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This directive allows you to include definitions from an external config file.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">#include=<somefile.cfg></FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial"># INCLUDE CONFIG DIRECTORY</FONT>

<BR><FONT SIZE=2 FACE="Arial"># This directive allows you to include definitions from config files (with a</FONT>

<BR><FONT SIZE=2 FACE="Arial"># .cfg extension) in one or more directories (with recursion).</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">#include_dir=<somedirectory></FONT>

<BR><FONT SIZE=2 FACE="Arial">#include_dir=<someotherdirectory></FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial"># COMMAND DEFINITIONS</FONT>

<BR><FONT SIZE=2 FACE="Arial"># Command definitions that this daemon will run.  Definitions</FONT>

<BR><FONT SIZE=2 FACE="Arial"># are in the following format:</FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># command[<command_name>]=<command_line></FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># When the daemon receives a request to return the results of <command_name></FONT>

<BR><FONT SIZE=2 FACE="Arial"># it will execute the command specified by the <command_line> argument.</FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># Unlike Nagios, the command line cannot contain macros - it must be</FONT>

<BR><FONT SIZE=2 FACE="Arial"># typed exactly as it should be executed.</FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># Note: Any plugins that are used in the command lines must reside</FONT>

<BR><FONT SIZE=2 FACE="Arial"># on the machine that this daemon is running on!  The examples below</FONT>

<BR><FONT SIZE=2 FACE="Arial"># assume that you have plugins installed in a /usr/local/nagios/libexec</FONT>

<BR><FONT SIZE=2 FACE="Arial"># directory.  Also note that you will have to modify the definitions below</FONT>

<BR><FONT SIZE=2 FACE="Arial"># to match the argument format the plugins expect.  Remember, these are</FONT>

<BR><FONT SIZE=2 FACE="Arial"># examples only!</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial"># The following examples use hardcoded command arguments...</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10</FONT>

<BR><FONT SIZE=2 FACE="Arial">command[check_load]=/usr/local/nagios/libexec/check_load -w 35,30,25 -c 50,45,40</FONT>

<BR><FONT SIZE=2 FACE="Arial">command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1</FONT>

<BR><FONT SIZE=2 FACE="Arial">command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z</FONT>

<BR><FONT SIZE=2 FACE="Arial">command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 1500 -c 2000 </FONT>

<BR><FONT SIZE=2 FACE="Arial">command[check_disk1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda3</FONT>

<BR><FONT SIZE=2 FACE="Arial">command[check_disk2]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1</FONT>

<BR><FONT SIZE=2 FACE="Arial">command[check_disk3]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p tmpfscommand[check_local_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%</FONT></P>

<P><FONT SIZE=2 FACE="Arial">command[check_local_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial">#command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$</FONT>

<BR><FONT SIZE=2 FACE="Arial">#command[check_load]=/usr/local/nagios/libexec/check_load -w $ARG1$ -c $ARG2$</FONT>

<BR><FONT SIZE=2 FACE="Arial">#command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$</FONT>

<BR><FONT SIZE=2 FACE="Arial">#command[check_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$</FONT>
</P>
<BR>

<P><B><FONT SIZE=2 FACE="Arial">hosts.allow</FONT></B>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial"># hosts.allow    This file describes the names of the hosts which are</FONT>

<BR><FONT SIZE=2 FACE="Arial">#        allowed to use the local INET services, as decided</FONT>

<BR><FONT SIZE=2 FACE="Arial">#        by the '/usr/sbin/tcpd' server.</FONT>

<BR><FONT SIZE=2 FACE="Arial">#</FONT>

<BR><FONT SIZE=2 FACE="Arial">nrpe: 17.0.0.1 xxx.27.117.xxx</FONT>
</P>

</BODY>
</HTML>