<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>System Network Programming Solution - Linux - windows - centos- security- cpanel - plesk -directadmin helm&#187; Security</title>
	<atom:link href="http://thegioinguonmo.com/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://thegioinguonmo.com</link>
	<description>SHARING EVERYTHING</description>
	<lastBuildDate>Mon, 06 Feb 2012 09:45:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>[WARNING] Sorry, cleartext sessions are not accepted.</title>
		<link>http://thegioinguonmo.com/hosting-controller/cpanel-control-panel/warning-sorry-cleartext-sessions-are-not-accepted.html</link>
		<comments>http://thegioinguonmo.com/hosting-controller/cpanel-control-panel/warning-sorry-cleartext-sessions-are-not-accepted.html#comments</comments>
		<pubDate>Mon, 23 Jan 2012 09:40:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[layer]]></category>
		<category><![CDATA[pure ftpd]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[server logs]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[TLS]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=900</guid>
		<description><![CDATA[Your Ftp server rejects your access to the server on providing the username and do not prompt for a password as well and you may see the following error in the your server logs: Jan 10 11:22:33 mai1 pure-ftpd: (?@xx.xx.xx.xx) [WARNING] Sorry, cleartext sessions are not accepted on this server. Please reconnect using SSL/TLS security [...]]]></description>
			<content:encoded><![CDATA[<p>Your Ftp server rejects your access to the server on providing the username and do not prompt for a password as well and you may see the following error in the your server logs:</p>
<blockquote><p><strong>Jan 10 11:22:33 mai1 pure-ftpd: (?@xx.xx.xx.xx) [WARNING] Sorry, cleartext sessions are not accepted on this server. Please<br />
reconnect using SSL/TLS security mechanisms.</strong></p></blockquote>
<p>Ftp can accept three values:</p>
<blockquote><p><strong># 0 : disable SSL/TLS encryption layer (default).<br />
# 1 : accept both traditional and encrypted sessions.<br />
# 2 : refuse connections that don’t use SSL/TLS security mechanisms.</strong></p></blockquote>
<p>If the <strong>“TLS” directive</strong> below these options is set to 2, you will receive the face the above stated problem. In order to overcome the issue, <strong>change the value of “TLS” from 2 to 1</strong> and restart pure-ftpd service:</p>
<p><strong>/scripts/restartsrv pure-ftpd</strong></p>
<p>This will now allow you to access Ftp without using a SSL/TLS security mechanisms.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/hosting-controller/cpanel-control-panel/warning-sorry-cleartext-sessions-are-not-accepted.html" title="pure-ftpd conf centos plesk">pure-ftpd conf centos plesk</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/hosting-controller/cpanel-control-panel/warning-sorry-cleartext-sessions-are-not-accepted.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Set Up Kippo SSH Honeypot On CentOS 5.5</title>
		<link>http://thegioinguonmo.com/os/linux/set-kippo-ssh-honeypot-centos-55.html</link>
		<comments>http://thegioinguonmo.com/os/linux/set-kippo-ssh-honeypot-centos-55.html#comments</comments>
		<pubDate>Fri, 20 Jan 2012 10:04:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Honeypot]]></category>
		<category><![CDATA[Kippo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=2217</guid>
		<description><![CDATA[Kippo is a medium interaction SSH honeypot designed to log brute force attacks and, most importantly, the entire shell interaction performed by the attacker. Kippo is inspired, but not based on Kojoney. If you need more information about Kippo please visit its official site on http://code.google.com/p/kippo/. This tutorial shows how you can compile and install [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Kippo</strong> is a medium interaction SSH honeypot designed to log brute force attacks and, most importantly, the entire shell interaction performed by the attacker. Kippo is inspired, but not based on Kojoney. If you need more information about Kippo please visit its official site on <a rel="nofollow" target="_blank" href="http://code.google.com/p/kippo/" target="_blank">http://code.google.com/p/kippo/</a>. This tutorial shows how you can compile and install Kippo on a CentOS 5.5 server.</p>
<p>I do not issue any guarantee that this will work for you!</p>
<p>&nbsp;</p>
<h3>Python 2.6 Installation</h3>
<p>As you already know, CentOS only comes with Python 2.4, so you need to install Python 2.6 by using the tutorial from the following link:</p>
<p><a rel="nofollow" target="_blank" href="http://www.geekymedia.com/tech-articles/rhel5-centos5-rpms-for-python-2-5-and-2-6/" target="_blank">http://www.geekymedia.com/tech-articles/rhel5-centos5-rpms-for-python-2-5-and-2-6/</a>.</p>
<p>Important Notes!:</p>
<p><strong>1)</strong> Just install the RPMs for the version that you want. You will need at least the base python version package and the libs package.<br />
<strong>2)</strong> To start Python 2.6, type python26 at your command line rather than python. (Your original Python 2.4 is still installed.)<br />
<strong>3)</strong> If you are installing packages with setuptools, make sure to use the correct python version. (i.e. python26 setup.py install)</p>
<p>&nbsp;</p>
<h3>Twisted, Zope Interface And Pycrypto Installation</h3>
<p>Twisted is an event-driven networking engine written in Python and licensed under the MIT license. Twisted projects variously support TCP, UDP, SSL/TLS, multicast, Unix sockets, a large number of protocols (including HTTP, NNTP, IMAP, SSH, IRC, FTP, and others), and much more.</p>
<p>cd /tmp<br />
wget http://twistedmatrix.com/Releases/Twisted/10.2/Twisted-10.2.0.tar.bz2<br />
tar -xvf Twisted-10.2.0.tar.bz2<br />
cd Twisted-10.2.0<br />
python26 setup.py build<br />
python26 setup.py install</p>
<p>Zope is an open source web application server primarily written in the Python programming language.</p>
<p>cd /tmp<br />
wget http://www.zope.org/Products/ZopeInterface/3.3.0/zope.interface-3.3.0.tar.gz<br />
tar -xvf zope.interface-3.3.0.tar.gz<br />
cd zope.interface-3.3.0<br />
python26 setup.py build<br />
python26 setup.py install</p>
<p>Pycrypto is a collection of cryptographic algorithms and protocols, implemented for use from Python.</p>
<p>cd /tmp<br />
wget wget http://www.amk.ca/files/python/crypto/pycrypto-2.0.1.tar.gz<br />
tar -xvf pycrypto-2.0.1.tar.gz<br />
cd pycrypto-2.0.1<br />
python26 setup.py build<br />
python26 setup.py install</p>
<p>ASN.1 types and codecs (BER, CER, DER) implementation in Python programming language.</p>
<p>cd /tmp<br />
wget http://sourceforge.net/projects/pyasn1/files/pyasn1-devel/0.0.12a/pyasn1-0.0.12a.tar.gz/download<br />
tar -xvf pyasn1-0.0.12a.tar.gz<br />
cd pyasn1-0.0.12a<br />
python26 setup.py build<br />
python26 setup.py install</p>
<p>&nbsp;</p>
<h3>Create Regular User</h3>
<p>Kippo doesnt run under root user! So we must create a regular user.</p>
<p>useradd kippouser</p>
<p>&nbsp;</p>
<h3>Download Kippo Source Package</h3>
<p>You need to download latest version of Kippo source package from <a rel="nofollow" target="_blank" href="http://kippo.googlecode.com/" target="_blank">http://kippo.googlecode.com</a>.</p>
<p>su &#8211; kippouser<br />
wget http://kippo.googlecode.com/files/kippo-0.5.tar.gz<br />
tar -xvf kippo-0.5.tar.gz<br />
cd kippo-0.5</p>
<p>&nbsp;</p>
<h3>Configure Kippo</h3>
<p>vi kippo.cfg</p>
<pre>#
# Kippo configuration file (kippo.cfg)
#
[honeypot]
# IP addresses to listen for incoming SSH connections.
#
# (default: 0.0.0.0) = any address
#ssh_addr = 0.0.0.0
# Port to listen for incoming SSH connections.
#
# (default: 2222)
ssh_port = 2222
# Hostname for the honeypot. Displayed by the shell prompt of the virtual
# environment.
#
# (default: sales)
hostname = sales
# Directory where to save log files in.
#
# (default: log)
log_path = log
# Directory where to save downloaded (malware) files in.
#
# (default: dl)
download_path = dl
# Directory where virtual file contents are kept in.
#
# This is only used by commands like 'cat' to display the contents of files.
# Adding files here is not enough for them to appear in the honeypot - the
# actual virtual filesystem is kept in filesystem_file (see below)
#
# (default: honeyfs)
contents_path = honeyfs
# File in the python pickle format containing the virtual filesystem.
#
# This includes the filenames, paths, permissions for the whole filesystem,
# but not the file contents. This is created by the createfs.py utility from
# a real template linux installation.
#
# (default: fs.pickle)
filesystem_file = fs.pickle
# Directory for miscellaneous data files, such as the password database.
#
# (default: data_path)
data_path = data
# Directory for creating simple commands that only output text.
#
# The command must be placed under this directory with the proper path, such
# as:
#   txtcmds/usr/bin/vi
# The contents of the file will be the output of the command when run inside
# the honeypot.
#
# In addition to this, the file must exist in the virtual
# filesystem {filesystem_file}
#
# (default: txtcmds)
txtcmds_path = txtcmds
# Public and private SSH key files. If these don't exist, they are created
# automatically.
#
# (defaults: public.key and private.key)
public_key = public.key
private_key = private.key
# Initial root password. Future passwords will be stored in
# {data_path}/pass.db
#
# (default: 123456)
password = 123456
# IP address to bind to when opening outgoing connections. Used exclusively by
# the wget command.
#
# (default: not specified)
#out_addr = 0.0.0.0
# Sensor name use to identify this honeypot instance. Used by the database
# logging modules such as mysql.
#
# If not specified, the logging modules will instead use the IP address of the
# connection as the sensor name.
#
# (default: not specified)
#sensor_name=myhostname
# Fake address displayed as the address of the incoming connection.
# This doesn't affect logging, and is only used by honeypot commands such as
# 'w' and 'last'
#
# If not specified, the actual IP address is displayed instead (default
# behaviour).
#
# (default: not specified)
#fake_addr = 192.168.66.254
# MySQL logging module
#
# Database structure for this module is supplied in doc/sql/mysql.sql
#
# To enable this module, remove the comments below, including the
# [database_mysql] line.
#[database_mysql]
#host = localhost
#database = kippo
#username = kippo
#password = secret</pre>
<p>&nbsp;</p>
<h3>Start Kippo</h3>
<p>./start.sh</p>
<p>&nbsp;</p>
<h3>Log File</h3>
<p>By default kippo output will be redirected to the file log/kippo.log. To see the Kippo logging data use the following command:</p>
<p>tail -f log/kippo.log</p>
<p>&nbsp;</p>
<h3>Note: How To Make Kippo Accessible To The World!</h3>
<p>By default,Kippo is running on port 2222. If its running on Windows, port 22 is usually free and it&#8217;s ok to run kippo on that port. On linux, port 22 is restricted for root only, except if you do this (quote from #twisted):</p>
<p>iptables -t nat -A PREROUTING -i IN_IFACE -p tcp &#8211;dport 22 -j REDIRECT &#8211;to-port 2222</p>
<p>Replace IN_IFACE with your real interface name such as eth0!</p>
<p>&nbsp;</p>
<h3>Testing</h3>
<p>Connect to the Kippo server on port 2222 by using root as username and 123456 as password.</p>
<p>ssh 127.0.0.1 -p 2222 -l root</p>
<p>You must see the following banner after successful login:</p>
<p>sales:~#</p>
<p>&nbsp;</p>
<h3>Links</h3>
<p>The Honeynet Project: <a rel="nofollow" target="_blank" href="http://www.honeynet.org/" target="_blank">http://www.honeynet.org/</a><br />
Honeypot: <a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Honeypot_%28computing%29" target="_blank">http://en.wikipedia.org/wiki/Honeypot_(computing)</a><br />
Kippo Project: <a rel="nofollow" target="_blank" href="http://kippo.googlecode.com/" target="_blank">http://kippo.googlecode.com/</a><br />
Iran Honeynet Project: <a rel="nofollow" target="_blank" href="http://www.honeynet.ir/" target="_blank">http://www.honeynet.ir/</a><br />
CentOS: <a rel="nofollow" target="_blank" href="http://www.centos.org/" target="_blank">http://www.centos.org/</a></p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/set-kippo-ssh-honeypot-centos-55.html" title="The gioi set">The gioi set</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/set-kippo-ssh-honeypot-centos-55.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Steps to Secure Apache</title>
		<link>http://thegioinguonmo.com/web-server/apache/basic-steps-to-secure-apache.html</link>
		<comments>http://thegioinguonmo.com/web-server/apache/basic-steps-to-secure-apache.html#comments</comments>
		<pubDate>Sun, 15 Jan 2012 09:41:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Symbolic Links]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=426</guid>
		<description><![CDATA[Here are some basic steps to secure Apache Web Server IMPORTANT NOTE: These suggestions may vary from server to server and modify the values as per your server configurations. It is up to you to determine if any of the changes suggested here are not compatible with your requirements. 1. Hide the Apache Version number, [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some basic steps to secure Apache Web Server</p>
<p><strong>IMPORTANT NOTE:</strong><strong> These suggestions may vary from server to server and modify the values as per your server configurations. It is up to you to determine if any of the changes suggested here are not compatible with your requirements</strong>.</p>
<p><strong>1. Hide the Apache Version number, and other sensitive information.</strong></p>
<p>&nbsp;</p>
<p>By default many Apache installations provides information about version of Apache, operating system/version you’re running, and Apache Modules are installed on the server. Attackers/Hackers can use this information to their advantage when performing an attack.</p>
<p>Open /etc/httpd/conf/httpd.conf file and add OR edit following</p>
<p>&nbsp;</p>
<p><strong>ServerSignature Off<br />
ServerTokens Prod</strong></p>
<p>The <strong>ServerSignature</strong> appears on the bottom of pages generated by apache such as 404 pages, directory listings, etc.</p>
<p>The <strong>ServerTokens</strong> directive is used to determine what Apache will put in the Server HTTP response header. By setting it to Prod it sets the HTTP response header as follows:</p>
<p><strong>Server: Apache</strong></p>
<p><strong><br />
2. Make sure apache is running under its own user account and group</strong></p>
<p>By default apache installations have it run as the user nobody. So suppose both Apache and your mail server were running as nobody and attack through Apache may allow the mail server to also be compromised, and vise versa.</p>
<p>&nbsp;</p>
<p><strong>User apache<br />
Group apache</strong></p>
<p>&nbsp;</p>
<p>In case of CPanel, it set the username as the ftp username of the domain which user set at the time of creating domain.</p>
<p><strong><br />
3. Ensure that files outside the web root are not served</strong></p>
<p>Apache shouldn’t able to access any files out side of its web root. So all your web sites should be placed under one directory (public_html for cPanel and httpdocs incase of Plesk as control panel), you would set it up as follows:</p>
<p><strong>&lt;Directory /&gt;<br />
Order Deny,Allow<br />
Deny from all<br />
Options None<br />
AllowOverride None<br />
&lt;/Directory&gt;<br />
&lt;Directory /public_html&gt;<br />
Order Allow,Deny<br />
Allow from all<br />
&lt;/Directory&gt;</strong></p>
<p>&nbsp;</p>
<p><strong> </strong>Note that because we set Options None and AllowOverride None this will turn off all options and overrides for the server. You now have to add them explicitly for each directory that requires an Option or Override using .htaccess .</p>
<p><strong><br />
4. Turn off directory browsing</strong></p>
<p>You can do this with an Options directive inside a Directory tag. Set Options to either None or –Indexes to disable Directory listing for the domain</p>
<p><strong>Options -Indexes</strong></p>
<p><strong><br />
5. Turn off server side includes</strong></p>
<p><strong>SSI (Server Side Includes)</strong> is directives that are placed in HTML pages, and evaluated on the server while the pages are being served. They let you add dynamically generated content to an existing HTML page, without having to serve the entire page via a CGI program, or other dynamic technology.</p>
<p>This can done with the Options directive inside a Directory tag. Set Options to either None or -Includes</p>
<p><strong>Options -Includes</strong></p>
<p><strong><br />
6. Turn off CGI execution</strong></p>
<p>The <strong>CGI (Common Gateway Interface)</strong> defines a way for a web server to interact with external content-generating programs, which are often referred to as CGI programs or CGI scripts. It is the simplest, and most common, way to put dynamic content on your web site</p>
<p>If you’re not using CGI turn it off with the Options directive inside a Directory tag. Set Options to either None or -ExecCGI</p>
<p><strong>Options -ExecCGI</strong></p>
<p><strong><br />
7. Don’t allow apache to follow Symbolic Links</strong></p>
<p>&nbsp;</p>
<p><strong>Symbolic Link</strong> (also <strong><em>symlink</em></strong> or <strong><em>soft link</em></strong>) is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.<strong> </strong></p>
<p><strong>Symbolic Links</strong> can be disabled using the Options directive inside a Directory tag. Set Options to either None or –FollowSymLinks</p>
<p><strong>Options -FollowSymLinks</strong></p>
<p><strong><br />
8.  Turn off support for .htaccess files</strong></p>
<p>&nbsp;</p>
<p><strong><code>.htaccess</code></strong> files (or “distributed configuration files”) provide a way to make configuration changes on a per-directory basis.</p>
<p>This is done in a Directory tag but with the AllowOverride directive. Set it to None.</p>
<p><strong>AllowOverride None</strong></p>
<p><strong><br />
9) Run mod_security</strong></p>
<p><em>ModSecurity</em> is an open source web application firewall. it’s a super handy Apache module written by Ivan Ristic, the author of Apache Security from O’Reilly press.</p>
<p>You can do the following with mod_security:</p>
<p>* Simple filtering<br />
* Regular Expression based filtering<br />
* URL Encoding Validation<br />
* Unicode Encoding Validation<br />
* Auditing<br />
* Null byte attack prevention<br />
* Upload memory limits* Server identity masking<br />
* Built in Chroot support<br />
* And more<br />
<strong><br />
10) Restricting Access by IP</strong></p>
<p>If you have a resource that should only by accessed by a certain network, or IP address you can enforce this in your apache configuration. For instance if you want to restrict access to your intranet to allow only the 92.48 network:</p>
<p>Order Deny,Allow<br />
Deny from all<br />
Allow from 92.48.0.0/16</p>
<p><strong>Or by IP:</strong></p>
<p>Order Deny,Allow<br />
Deny from all<br />
Allow from 127.0.0.1</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/web-server/apache/basic-steps-to-secure-apache.html" title="plesk IPCCommTimeout">plesk IPCCommTimeout</a> (2)</li><li><a href="http://thegioinguonmo.com/web-server/apache/basic-steps-to-secure-apache.html" title="centos basic programming">centos basic programming</a> (1)</li><li><a href="http://thegioinguonmo.com/web-server/apache/basic-steps-to-secure-apache.html" title="directadmin rewriteengine">directadmin rewriteengine</a> (1)</li><li><a href="http://thegioinguonmo.com/web-server/apache/basic-steps-to-secure-apache.html" title="mysql remote access 10 0 0 0/8">mysql remote access 10 0 0 0/8</a> (1)</li><li><a href="http://thegioinguonmo.com/web-server/apache/basic-steps-to-secure-apache.html" title="secure apache web server">secure apache web server</a> (1)</li><li><a href="http://thegioinguonmo.com/web-server/apache/basic-steps-to-secure-apache.html" title="working with apache basic steps">working with apache basic steps</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/web-server/apache/basic-steps-to-secure-apache.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress </title>
		<link>http://thegioinguonmo.com/security/wordpress.html</link>
		<comments>http://thegioinguonmo.com/security/wordpress.html#comments</comments>
		<pubDate>Thu, 12 Jan 2012 09:43:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[TLD]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=275</guid>
		<description><![CDATA[I. VULNERABILITY WordPress &#60;= 2.8.3 Remote admin reset password II. BACKGROUND WordPress is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. WordPress is both free and priceless at the same time. More simply, WordPress is what you use when you want to work with your blogging software, not fight it. [...]]]></description>
			<content:encoded><![CDATA[<p>I. VULNERABILITY<br />
WordPress &lt;= 2.8.3 Remote admin reset password</p>
<p>II. BACKGROUND</p>
<p>WordPress is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. WordPress is both free and priceless at the same time. More simply, WordPress is what you use when you want to work with your blogging software, not fight it.<br />
III. DESCRIPTION</p>
<p>The way WordPress handle a password reset looks like this: You submit your email adress or username via this form /wp-login.php?action=lostpassword ;<br />
Wordpress send you a reset confirmation like that via email:</p>
<p>”<br />
Someone has asked to reset the password for the following site and username. http://DOMAIN_NAME.TLD/wordpress<br />
Username: admin<br />
To reset your password visit the following address, otherwise just ignore this email and nothing will happen</p>
<p>http://DOMAIN_NAME.TLD/wordpress/wp-login.php?action=rp&amp;key=o7naCKN3OoeU2KJMMsag ”</p>
<p>You click on the link, and then WordPress reset your admin password, and sends you over another email with your new credentials.</p>
<p>Let’s see how it works:</p>
<p>wp-login.php:<br />
…[snip]….<br />
line 186:<br />
function reset_password($key) {</p>
<p>global $wpdb;</p>
<p>$key = preg_replace(’/[^a-z0-9]/i’, ”, $key);</p>
<p>if ( empty( $key ) )</p>
<p>return new WP_Error(’invalid_key’, __(’Invalid key’));</p>
<p>$user = $wpdb-&gt;get_row($wpdb-&gt;prepare(”SELECT * FROM $wpdb-&gt;users WHERE user_activation_key = %s”, $key));</p>
<p>if ( empty( $user ) )</p>
<p>return new WP_Error(’invalid_key’, __(’Invalid key’)); …[snip]….<br />
line 276:<br />
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ‘login’; $errors = new WP_Error();</p>
<p>if ( isset($_GET['key']) )</p>
<p>$action = ‘resetpass’;</p>
<p>// validate action so as to default to the login screen if ( !in_array($action, array(’logout’, ‘lostpassword’, ‘retrievepassword’, ‘resetpass’, ‘rp’, ‘register’, ‘login’)) &amp;&amp; false === has_filter(’login_form_’ . $action) )</p>
<p>$action = ‘login’;<br />
…[snip]….</p>
<p>line 370:</p>
<p>break;</p>
<p>case ‘resetpass’ :<br />
case ‘rp’ :</p>
<p>$errors = reset_password($_GET['key']);</p>
<p>if ( ! is_wp_error($errors) ) {<br />
wp_redirect(’wp-login.php?checkemail=newpass’);<br />
exit();</p>
<p>}</p>
<p>wp_redirect(’wp-login.php?action=lostpassword&amp;error=invalidkey’); exit();</p>
<p>break;<br />
…[snip ]…</p>
<p>You can abuse the password reset function, and bypass the first step and then reset the admin password by submiting an array to the $key variable.</p>
<p>Source:</p>
<p>IV. PROOF OF CONCEPT</p>
<p>A web browser is sufficiant to reproduce this Proof of concept: http://DOMAIN_NAME.TLD/wp-login.php?action=rp&amp;key[]= The password will be reset without any confirmation.</p>
<p>V. BUSINESS IMPACT</p>
<p>An attacker could exploit this vulnerability to compromise the admin account of any wordpress/wordpress-mu &lt;= 2.8.3</p>
<p>VI. SYSTEMS AFFECTED</p>
<p>All</p>
<p>VII. SOLUTION</p>
<p>No patch aviable for the moment.</p>
<p>VIII. REFERENCES</p>
<p>http://seclists.org/fulldisclosure/2009/Aug/0113.html</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/security/wordpress.html" title="tar -xzf csf tgz CPANEL">tar -xzf csf tgz CPANEL</a> (1)</li><li><a href="http://thegioinguonmo.com/security/wordpress.html" title="wp-login php?action=resetpass login=admin key=">wp-login php?action=resetpass login=admin key=</a> (1)</li><li><a href="http://thegioinguonmo.com/security/wordpress.html" title="wp_login action wordpress">wp_login action wordpress</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/security/wordpress.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How do I install Rootkit Hunter?</title>
		<link>http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html</link>
		<comments>http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html#comments</comments>
		<pubDate>Wed, 11 Jan 2012 21:40:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Note It]]></category>
		<category><![CDATA[tar zxf]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=273</guid>
		<description><![CDATA[Download the gzipped tarball, extract it and run the installation script. download: # wget http://downloads.rootkit.nl/rkhunter-&#60;version&#62;.tar.gz Note: It doesn’t matter where you save the tarball extract: # tar zxf rkhunter-&#60;version&#62;.tar.gz installation: # cd rkhunter # ./installer.sh (Source: http://www.evolution-security.com/) (Source: http://www.rootkit.nl/articles/rootkit_hunter_faq.html) Incoming search terms:centos xen windows windows\system32\config\system (3)qmhandle centos install wget (2)rootkit hunter windows 2012 (1)rootkit hunter [...]]]></description>
			<content:encoded><![CDATA[<p>Download the gzipped tarball, extract it and run the installation script.<br />
download:<br />
# wget <a rel="nofollow" target="_blank" href="http://downloads.rootkit.nl/rkhunter-" target="_blank">http://downloads.rootkit.nl/rkhunter-</a>&lt;version&gt;.tar.gz<br />
Note: It doesn’t matter where you save the tarball</p>
<p>extract:<br />
# tar zxf rkhunter-&lt;version&gt;.tar.gz</p>
<p>installation:<br />
# cd rkhunter<br />
# ./installer.sh</p>
<p>(Source: <a rel="nofollow" target="_blank" href="http://www.evolution-security.com/" target="_blank">http://www.evolution-security.com/</a>)<br />
(Source: <a rel="nofollow" target="_blank" href="http://www.rootkit.nl/articles/rootkit_hunter_faq.html" target="_blank">http://www.rootkit.nl/articles/rootkit_hunter_faq.html</a>)</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html" title="centos xen windows windows\system32\config\system">centos xen windows windows\system32\config\system</a> (3)</li><li><a href="http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html" title="qmhandle centos install wget">qmhandle centos install wget</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html" title="rootkit hunter windows 2012">rootkit hunter windows 2012</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html" title="rootkit hunter windows">rootkit hunter windows</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html" title="plesk install rootkit">plesk install rootkit</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html" title="linux system files libz2">linux system files libz2</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html" title="install rootkit plesk">install rootkit plesk</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html" title="directadmin rootkit">directadmin rootkit</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html" title="directadmin rookit install">directadmin rookit install</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html" title="tarzxg">tarzxg</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/how-do-i-install-rootkit-hunter.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prevent SYN attacks</title>
		<link>http://thegioinguonmo.com/os/linux/prevent-syn-attacks.html</link>
		<comments>http://thegioinguonmo.com/os/linux/prevent-syn-attacks.html#comments</comments>
		<pubDate>Tue, 10 Jan 2012 21:49:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[queue]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=268</guid>
		<description><![CDATA[1. Enable SYN cookies mechanism in the server by the executing command: # echo 1 &#62; /proc/sys/net/ipv4/tcp_syncookies 2. Increase the backlog queue to 2048 by the command: # sysctl -w net.ipv4.tcp_max_syn_backlog=”2048″ Incoming search terms:linux mail queue maildrop permission denied (1)]]></description>
			<content:encoded><![CDATA[<p>1. Enable SYN cookies mechanism in the server by the executing command:</p>
<p># echo 1 &gt; /proc/sys/net/ipv4/tcp_syncookies</p>
<p>2. Increase the backlog queue to 2048 by the command:</p>
<p># sysctl -w net.ipv4.tcp_max_syn_backlog=”2048″</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/prevent-syn-attacks.html" title="linux mail queue maildrop permission denied">linux mail queue maildrop permission denied</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/prevent-syn-attacks.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Install OCS Inventory NG Server 2 On CentOS 5.5</title>
		<link>http://thegioinguonmo.com/os/linux/install-ocs-inventory-ng-server-2-centos-55.html</link>
		<comments>http://thegioinguonmo.com/os/linux/install-ocs-inventory-ng-server-2-centos-55.html#comments</comments>
		<pubDate>Sun, 08 Jan 2012 15:37:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ng server]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=2205</guid>
		<description><![CDATA[Introduction OCS Inventory is a great software to make inventories. The NG Server is formed by: communication server, deployment server, and administration console. Click here to know how it works. The computers that will be inventoried must run an agent (installed on each computer), to connect to the OCS NG Server. We are using the [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>OCS Inventory is a great software to make inventories. The NG Server is formed by: communication server, deployment server, and administration console. Click <a rel="nofollow" target="_blank" href="http://wiki.ocsinventory-ng.org/index.php/Documentation:Server" target="_blank">here</a> to know how it works.</p>
<p>The computers that will be inventoried must run an agent (installed on each computer), to connect to the OCS NG Server. We are using the CentOS 5.5 (64bits) distribution, but it will probably work on Fedora (and Red Hat, for sure).</p>
<p>&nbsp;</p>
<h3>1 Some Prerequisites</h3>
<h4>Installing MySQL Server</h4>
<p>We need to install it (if it&#8217;s not already installed):</p>
<p>yum install mysql-server php-mysql php-pecl-zip php-gd</p>
<p>Starting MySQL:</p>
<pre class="brush:shell">/etc/init.d/mysqld start
chkconfig --level 35 mysqld on</pre>
<p>Setting a root password on mysql:</p>
<pre class="brush:shell">/usr/bin/mysqladmin -u root password 'secret'</pre>
<p>&nbsp;</p>
<h4>Starting Apache:</h4>
<p>We need to start Apache (OCS uses it):</p>
<pre class="brush:shell">/etc/init.d/httpd start
chkconfig --level 35 httpd on</pre>
<h4>Installing Packages</h4>
<p>Next, we need to install EPEL repository:</p>
<pre class="brush:shell">rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm</pre>
<p>Afterwards, let&#8217;s install the packages:</p>
<pre class="brush:shell">yum install -y perl-XML-Simple perl-Compress-Zlib perl-DBI perl-DBD-MySQL perl-Net-IP perl-XML-Entities perl-Apache-DBI perl-Apache2-SOAP perl-SOAP-Lite mod_perl
</pre>
<p>&nbsp;</p>
<h4>Configure PHP</h4>
<p>Edit the /etc/php.ini file, and change the following lines:</p>
<pre class="brush:shell">vi /etc/php.ini

post_max_size = 200M
upload_max_filesize = 200M</pre>
<p>Restart Apache:</p>
<pre class="brush:shell">/etc/init.d/httpd restart</pre>
<p>&nbsp;</p>
<h3>2 Installing OCS Inventory NG Server 2</h3>
<p>First, we need to download the tarball from OCS Inventory website. Click <a rel="nofollow" target="_blank" href="http://www.ocsinventory-ng.org/index.php?page=downloads" target="_blank">here</a>.</p>
<pre class="brush:shell">mkdir /download
cd /download
wget http://launchpad.net/ocsinventory-server/stable-2.0/2.0rc1/+download/OCSNG_UNIX_SERVER-2.0rc1.tar.gz</pre>
<p>Initiate the installer:</p>
<pre class="brush:shell">tar -zxvf OCSNG_UNIX_SERVER-2.0rc1.tar.gz
cd /download/OCSNG_UNIX_SERVER-2.0rc1
sh setup.sh</pre>
<p>The install script is very simple, it&#8217;s a wizard. Almost all the options, we&#8217;ll select the default option.<br />
These are the questions:</p>
<p><em>If you leave the question in blank, it will select the default option.</em></p>
<p>Do you wish to continue ([y]/n)?y</p>
<p>Your MySQL client seems to be part of MySQL version 5.0.<br />
Your computer seems to be running MySQL 4.1 or higher, good <img src='http://thegioinguonmo.com/wp-includes/images/smilies/icon_wink.gif' alt="icon wink How To Install OCS Inventory NG Server 2 On CentOS 5.5" class='wp-smiley' title="How To Install OCS Inventory NG Server 2 On CentOS 5.5" /><br />
Which host is running database server [localhost] ?localhost</p>
<p>On which port is running database server [3306] ? 3306</p>
<p>Where is Apache daemon binary [/usr/sbin/httpd] ?</p>
<p>Where is Apache main configuration file [/etc/httpd/conf/httpd.conf] ?</p>
<p>Which user account is running Apache web server [apache] ?</p>
<p>Which user group is running Apache web server [apache] ?</p>
<p>Where is Apache Include configuration directory [/etc/httpd/conf.d/] ?</p>
<p>Where is PERL Intrepreter binary [/usr/bin/perl] ?</p>
<p>Do you wish to setup Communication server on this computer ([y]/n)?y</p>
<p>Where to put Communication server log directory [/var/log/ocsinventory-server] ?</p>
<p>OCS setup.sh can install perl module from packages for you<br />
The script will use the native package from your operating system like apt or rpm<br />
Do you wish to continue (y/[n])? y</p>
<p>To ensure Apache loads mod_perl before OCS Inventory NG Communication Server,</p>
<p>Setup can name Communication Server Apache configuration file<br />
&#8216;z-ocsinventory-server.conf&#8217; instead of &#8216;ocsinventory-server.conf&#8217;.<br />
Do you allow Setup renaming Communication Server Apache configuration file<br />
to &#8216;z-ocsinventory-server.conf&#8217; ([y]/n) ?y</p>
<p>Do you wish to setup Administration Server (Web Administration Console)<br />
on this computer ([y]/n)?y</p>
<p>CAUTION: Setup now install files in accordance with Filesystem Hierarchy<br />
Standard. So, no file is installed under Apache root document directory<br />
(Refer to Apache configuration files to locate it).<br />
If you&#8217;re upgrading from OCS Inventory NG Server 1.01 and previous, YOU<br />
MUST REMOVE (or move) directories &#8216;ocsreports&#8217; and &#8216;download&#8217; from Apache<br />
root document directory.<br />
If you choose to move directory, YOU MUST MOVE &#8216;download&#8217; directory to<br />
Administration Server writable/cache directory (by default<br />
/var/lib/ocsinventory-reports), especialy if you use deployement feature.<br />
Do you wish to continue ([y]/n)?y</p>
<p>Where to copy Administration Server static files for PHP Web Console<br />
[/usr/share/ocsinventory-reports] ?</p>
<p>Where to create writable/cache directories for deployement packages,<br />
IPDiscover and SNMP [/var/lib/ocsinventory-reports] ?</p>
<p>&nbsp;</p>
<h3>3 Configuring OCS Inventory NG Server 2</h3>
<h4>Creating a MySQL database:</h4>
<p>First, we need to open mysql shell:</p>
<p>mysql -u root -p&#8221;secret&#8221;</p>
<p>Then create the database named ocsweb, and grant permissions to user ocs, with password ocs:</p>
<p>CREATE DATABASE ocsweb;<br />
GRANT ALL ON ocsweb.* to &#8216;ocs&#8217;@'localhost&#8217; identified by &#8216;ocs&#8217;;</p>
<p><em>If you want, you can change these parameters (database name, username or password). This is the default of ocs.</em></p>
<p>Now, point your browser to ocsreports interface, to manage the server with the administration tool:</p>
<p>http://server-ip/ocsreports/</p>
<p>The default user is &#8220;admin&#8221; and password is &#8220;admin&#8221;.</p>
<p>Finally, we must delete the install script:</p>
<p>rm -f /usr/share/ocsinventory-reports/ocsreports/install.php</p>
<p>Now, all you have to do is configure the server with the machine options. Install the agents on the network computers pointing the server ip on them.<br />
For more information, take a look at the wiki of OCS clicking <a rel="nofollow" target="_blank" href="http://wiki.ocsinventory-ng.org/index.php/Documentation:Main" target="_blank">here</a>.</p>
<p>&nbsp;</p>
<h3>References</h3>
<p>OCS Inventory: <a rel="nofollow" target="_blank" href="http://wiki.ocsinventory-ng.org/index.php/Documentation:Main" target="_blank">http://wiki.ocsinventory-ng.org/index.php/Documentation:Main</a></p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/install-ocs-inventory-ng-server-2-centos-55.html" title="centos apache mysql sysnetpro">centos apache mysql sysnetpro</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/install-ocs-inventory-ng-server-2-centos-55.html" title="ocs inventory">ocs inventory</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/install-ocs-inventory-ng-server-2-centos-55.html" title="howto ocs inventory debian">howto ocs inventory debian</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/install-ocs-inventory-ng-server-2-centos-55.html" title="instalasi ocs inventory">instalasi ocs inventory</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/install-ocs-inventory-ng-server-2-centos-55.html" title="ocs inventory ng freebsd client">ocs inventory ng freebsd client</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/install-ocs-inventory-ng-server-2-centos-55.html" title="ocsinventory centos iptables">ocsinventory centos iptables</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/install-ocs-inventory-ng-server-2-centos-55.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Icinga (Monitoring Solution) Installation And Configuration On CentOS</title>
		<link>http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html</link>
		<comments>http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html#comments</comments>
		<pubDate>Sun, 08 Jan 2012 15:32:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Icinga]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[monitoring-tools]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=2202</guid>
		<description><![CDATA[Icinga is an enterprise grade open source monitoring system which keeps watch over networks and any conceivable network resource, notifies the user of errors and recoveries and generates performance data for reporting. Scalable and extensible, Icinga can monitor complex, large environments across dispersed locations. I am going with the Icinga basic installation and this is [...]]]></description>
			<content:encoded><![CDATA[<p>Icinga is an enterprise grade open source monitoring system which keeps watch over networks and any conceivable network resource, notifies the user of errors and recoveries and generates performance data for reporting. Scalable and extensible, Icinga can monitor complex, large environments across dispersed locations.</p>
<p>I am going with the Icinga basic installation and this is similar to Nagios and this document can also be referred for Nagios installation, too. Lots of documents are available on the Internet and they will be installing with nagios user but for my setup I made use of the default user which is already present in the system (daemon) and also I will not be installing it on the default path instead I will be referring to /opt since I find it very convenient. The UI of Icinga is much better than Nagios.</p>
<p>In this tutorial I will using three servers:</p>
<p>192.168.1.20 – Icinga monitoring server (centos5)<br />
192.168.1.30 – win 2008 to be monitored<br />
192.168.1.40 – Ubuntu 10.10 server to be monitored</p>
<p>&nbsp;</p>
<h3>Requirements</h3>
<p>Note: Make sure development tools and development libraries have been installed during installation:</p>
<ul>
<li>GCC compiler</li>
<li>C/C++ development libraries</li>
<li><a rel="nofollow" target="_blank" href="http://www.boutell.com/gd/" target="_blank">GD</a> development libraries</li>
</ul>
<p>&nbsp;</p>
<h3>Packages Needed</h3>
<p>1. Xampp for Linux:</p>
<p>[root@sunil~]# mkdir /software<br />
[root@sunil~]# cd /software<br />
[root@sunil software]# wget http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/1.7.3/xampp-linux-1.7.3.tar.gz/download</p>
<p>2. Icinga core:</p>
<p>[root@sunil software]# wget http://sourceforge.net/projects/icinga/files/icinga/1.2.1/icinga-1.2.1.tar.gz/download</p>
<p>&nbsp;</p>
<h3>Installation of Icinga</h3>
<p>1. Untar the xampp package:</p>
<p>[root@sunil software]# tar -zxvf xampp-linux-1.7.3.tar.gz<br />
[root@sunil software]# mv lampp/ /opt/</p>
<p>Xampp package is very neatly compilied package and extracting the same is more than enough for more details can refer to xampp page:</p>
<p><a rel="nofollow" target="_blank" href="http://www.apachefriends.org/en/xampp.html" target="_blank">http://www.apachefriends.org/en/xampp.html</a></p>
<p>2. Untar the Icinga package:</p>
<p>[root@sunil software]# tar -zxvf icinga-1.2.1.tar.gz<br />
[root@sunil software]# cd icinga-1.2.1<br />
[root@sunil icinga-1.2.1]# ./configure &#8211;prefix=/opt/icinga &#8211;with-icinga-user=daemon &#8211;with-icinga-group=daemon &#8211;with-httpd-conf=/opt/lampp/etc</p>
<p>Note: please make sure you do not get any error while compiling. If you are getting errors make sure the required packages are installed.</p>
<p>[root@sunil icinga-1.2.1]# make all<br />
[root@sunil icinga-1.2.1]# make install<br />
[root@sunil icinga-1.2.1]# make install-config<br />
[root@sunil icinga-1.2.1]# make install-commandmode<br />
[root@sunil icinga-1.2.1]# make install-webconf</p>
<p>3. Now need to configure Apache with Icinga:</p>
<p>[root@sunil icinga-1.2.1]# cd /opt/lampp/etc/<br />
[root@suniletc]# vim httpd.conf</p>
<p>4. Add the following line:</p>
<pre>Include etc/icinga.conf</pre>
<p>5. Set password for login:</p>
<p>[root@sunil /]# cd /opt/lampp/bin/<br />
[root@sunil bin]# ./htpasswd –c /opt/icinga/etc/htpasswd.users icingaadmin</p>
<p>New password:<br />
Re-type new password:<br />
Adding password for user icingaadmin</p>
<p>6. Start Apache:</p>
<p>[root@sunillampp]# cd /opt/lampp/<br />
[root@sunillampp]# ./lamp startapache</p>
<p>XAMPP: Starting Apache with SSL (and PHP5)&#8230;<br />
XAMPP: Error 1! Couldn&#8217;t start Apache!<br />
XAMPP: Starting diagnose&#8230;<br />
XAMPP: Make the httpd.conf fit your system.<br />
XAMPP: Next try&#8230;<br />
XAMPP: Starting Apache with SSL (and PHP5)&#8230;</p>
<p>7. Check whether Apache is working:</p>
<p>http://192.168.1.20</p>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/1.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/1.png" alt="1 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="298" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<div><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/1.png"><img src="http://static.howtoforge.com/images/click_to_enlarge.png" alt="click to enlarge Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="100" height="12" border="0" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /> </a></div>
<p>8. Now we need to start Icinga but before that we need to check whether Icinga has been compiled properly and all the configuration are set:</p>
<p>[root@sunillampp]# cd /opt/icinga/</p>
<p>9. Before configuring Icinga we will start and see whether we get the page:</p>
<p>[root@sunilicinga]# /opt/icinga/bin/icinga –v /opt/icinga/etc/icinga.cfg</p>
<p>Total Warnings: 0<br />
Total Errors: 0</p>
<p>Things look okay &#8211; No serious problems were detected during the pre-flight check.</p>
<p>10. Now start Icinga since we do not get any errors:</p>
<p>[root@sunilicinga]# /opt/icinga/bin/icinga -d /opt/icinga/etc/icinga.cfg<br />
[root@sunilicinga]# ps -ef|grep icinga</p>
<p>daemon 6961 1 0 19:03 ? 00:00:00 /opt/icinga/bin/icinga -d /opt/icinga/etc/icinga.cfg<br />
root 6998 2929 0 19:05 pts/1 00:00:00 grep icinga</p>
<p>[root@sunilrw]# chmod 777 /opt/<br />
[root@sunilrw]# chmod 777 /opt/icinga/<br />
[root@sunilrw]# chmod 777 /opt/icinga/var/<br />
[root@sunilrw]# chmod 777 /opt/icinga/var/rw/<br />
[root@sunilrw]# chmod 777 /opt/icinga/var/rw/icinga.cmd</p>
<p>11. Login to check whether Icinga website opens:</p>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/2.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/2.png" alt="2 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="231" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<div><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/2.png"><img src="http://static.howtoforge.com/images/click_to_enlarge.png" alt="click to enlarge Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="100" height="12" border="0" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /> </a></div>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/3.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/3.png" alt="3 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="295" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<h3>Installation of Nagios plugins for monitoring</h3>
<div></div>
<p>1. Download the Nagios plugin and compile the same:</p>
<p>[root@sunil software]# wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz<br />
[root@sunil software]# tar -zxvf nagios-plugins-1.4.15.tar.gz<br />
[root@sunil software]# cd nagios-plugins-1.4.15<br />
[root@sunil nagios-plugins-1.4.15]# ./configure &#8211;prefix=/opt/icinga/ &#8211;with-nagios-user=daemon &#8211;with-nagios-group=daemon<br />
[root@sunil nagios-plugins-1.4.15]# make &amp;&amp; make install</p>
<p>&nbsp;</p>
<h3>Cutomization of Icinga</h3>
<p><strong> Mail alert configuration:</strong></p>
<p>[root@sunil /]# cd /opt/icinga/etc/<br />
[root@suniletc]# vi objects/contacts.cfg</p>
<pre>define contact{
contact_nameicingaadmin             ; Short name of user
use     generic-contact         ; Inherit default values from generic-contact template (defined above)
alias Icinga Admin            ; Full name of user
emaildaemon@localhost        ; &lt;&lt;***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
        }</pre>
<p>Change the email address from daemon@localhost to your email address test@sunil.cc.</p>
<p><strong> Make sure you had configured smarthost in the CentOS server.</strong></p>
<p>&nbsp;</p>
<h3>To configure smart host in CentOS</h3>
<p>[root@suniletc]# rpm -qa|grepsendmail</p>
<p>sendmail-8.13.8-2.el5</p>
<p>[root@suniletc]# vim /etc/mail/sendmail.mc</p>
<p>Disable the following line:</p>
<pre>DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
dnl#DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl</pre>
<p>Enable the following line:</p>
<pre>dnl define(`SMART_HOST', `smtp.your.provider')dnl</pre>
<p>Give your smtp address here &#8211; in this case sunil.cc:</p>
<pre>define(`SMART_HOST', `smtp.sunil.cc')dnl</pre>
<p>[root@sunil /]#m4 /etc/mail/sendmail.mc &gt; /etc/mail/sendmail.cf<br />
[root@sunil /]#/etc/init.d/sendmail restart</p>
<p>&nbsp;</p>
<h3>Installing Nagios Plugin and nrpe in Ubuntu 192.168.1.40</h3>
<p>1. For Ubuntu to be monitored by the Icinga server we need to install Nagios plugin and nrpe:</p>
<p>root@ubuntu10:~# apt-get install gcc*</p>
<p>root@ubuntu10:~#wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz</p>
<p>root@ubuntu10:~# tar -zxvf nagios-plugins-1.4.15.tar.gz</p>
<p>2. Compiling Nagios plugin:</p>
<p>root@ubuntu10:~# cd nagios-plugins-1.4.15/<br />
root@ubuntu10:~/nagios-plugins-1.4.15# ./configure &#8211;with-nagios-user=daemon &#8211;with-nagios-group=daemon<br />
root@ubuntu10:~/nagios-plugins-1.4.15# make &amp;&amp; make install<br />
root@ubuntu10:~/nagios-plugins-1.4.15# chown -R daemon:daemon /usr/local/nagios/</p>
<p>&nbsp;</p>
<h3>Installation of NRPE (Nagios Remote Plugin Executor)</h3>
<p>1. Download and compile NRPE:</p>
<p>root@ubuntu10:~# wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz</p>
<p>root@ubuntu10:~# tar -zxvf nrpe-2.12.tar.gz<br />
root@ubuntu10:~# cd nrpe-2.12/<br />
root@ubuntu10:~/nrpe-2.12# apt-get install openssllibssl-dev<br />
root@ubuntu10:~# make all<br />
root@ubuntu10:~# make install-plugin<br />
root@ubuntu10:~# make install-daemon<br />
root@ubuntu10:~# make install-daemon-config<br />
root@ubuntu10:~/nrpe-2.12# apt-get installxinetd<br />
root@ubuntu10:~# make install-xinetd</p>
<p>2. We need to configure the nrpe as a xinetd service:</p>
<p>root@ubuntu10:~/nrpe-2.12# vim /etc/xinetd.d/nrpe</p>
<pre>servicenrpe
{
flags           = REUSE
socket_type     = stream
port            = 5666
wait            = no
user            = daemon
group           = daemon
server          = /usr/local/nagios/bin/nrpe
server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure  += USERID
disable         = no
only_from       = 127.0.0.1
}</pre>
<p>3. Edit by adding the Icinga server IP in only_from:</p>
<pre>servicenrpe
{
flags           = REUSE
socket_type     = stream
port            = 5666
wait            = no
user            = daemon
group           = daemon
server          = /usr/local/nagios/bin/nrpe
server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure  += USERID
disable         = no
only_from       = 127.0.0.1 192.168.1.20
}</pre>
<p>4. Now we need to run it as a service by adding the following line:</p>
<p>root@ubuntu10:~# vim /etc/services</p>
<pre>nrpe 5666/tcp</pre>
<p>5. Restart the xinetd service:</p>
<p>root@ubuntu10:~# /etc/init.d/xinetd restart</p>
<p>6. Check whether nrpe has started:</p>
<p>root@ubuntu10:~# netstat -a |grep nrpe</p>
<p>To check whether Ubuntu is able to communicate with the Icinga server:</p>
<p>root@ubuntu10:~# /usr/local/nagios/libexec/check_nrpe -H localhost</p>
<p>NRPE v2.12</p>
<p>You should be able to get this output.</p>
<h3>Client Side Configuration Windows 2008 (192.168.1.30)</h3>
<div></div>
<p>1. Download from <a rel="nofollow" target="_blank" href="http://nsclient.org/nscp/downloads" target="_blank">http://nsclient.org/nscp/downloads</a>.</p>
<p>2. Just follow the screenshots:</p>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/4.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/4.png" alt="4 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="412" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<div><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/4.png"><img src="http://static.howtoforge.com/images/click_to_enlarge.png" alt="click to enlarge Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="100" height="12" border="0" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /> </a></div>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/5.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/5.png" alt="5 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="411" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<div><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/5.png"><img src="http://static.howtoforge.com/images/click_to_enlarge.png" alt="click to enlarge Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="100" height="12" border="0" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /> </a></div>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/6.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/6.png" alt="6 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="412" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<div><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/6.png"><img src="http://static.howtoforge.com/images/click_to_enlarge.png" alt="click to enlarge Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="100" height="12" border="0" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /> </a></div>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/7.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/7.png" alt="7 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="411" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<div><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/7.png"><img src="http://static.howtoforge.com/images/click_to_enlarge.png" alt="click to enlarge Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="100" height="12" border="0" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /> </a></div>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/8.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/8.png" alt="8 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="412" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<div><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/8.png"><img src="http://static.howtoforge.com/images/click_to_enlarge.png" alt="click to enlarge Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="100" height="12" border="0" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /> </a></div>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/9.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/9.png" alt="9 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="417" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<div><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/9.png"><img src="http://static.howtoforge.com/images/click_to_enlarge.png" alt="click to enlarge Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="100" height="12" border="0" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /> </a></div>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/10.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/10.png" alt="10 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="407" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<div><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/10.png"><img src="http://static.howtoforge.com/images/click_to_enlarge.png" alt="click to enlarge Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="100" height="12" border="0" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /> </a></div>
<p>3. Verify that nsclient++ is running as a service:</p>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/11.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/11.png" alt="11 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="413" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<h3>Configuration of Ubuntu and Win 2008 on the server side</h3>
<div></div>
<p>1.</p>
<p>[root@sunil /]# cd /opt/icinga/etc/objects/</p>
<p>2. First we configure the Ubuntu client.</p>
<p>3. Create a cfg file for the same with the following content you can also refer to localhost.cfg present in the same directory:</p>
<p>[root@sunil ~]# vim /opt/icinga/etc/objects/ubuntu10.cfg</p>
<pre>define host{
uselinux-server
host_name ubuntu10
alias ubuntu10
address 192.168.1.40
}
define service{
use local-service
host_name ubuntu10
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
define service{
use local-service
host_name ubuntu10
service_description Root
check_command check_local_disk!20%!10%!/
}
define service{
use local-service
host_name ubuntu10
service_description Current Users
check_command check_local_users!20!50
}
define service{
use local-service
host_name ubuntu10
service_description Total Processes
check_command check_local_procs!250!400!RSZDT
}
define service{
use local-service
host_name ubuntu10
service_description Current Load
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}
define service{
use local-service
host_name ubuntu10
service_description Swap Usage
check_command check_local_swap!20!10
}
define service{
use local-service
host_name ubuntu10
service_description SSH
check_commandcheck_ssh
notifications_enabled 0
}</pre>
<p>For grouping of servers you can append this line to ubuntu10.cfg:</p>
<pre>definehostgroup{
hostgroup_namelinux-servers ; The name of the hostgroup
alias           Linux Servers ; Long name of the group
memberslocalhost, ubuntu10     ; Comma separated list of hosts that belong to this group
        }</pre>
<p>4. For Windows 2008 we will referring to windows.cfg:</p>
<pre>define host{
use             windows-server  ; Inherit default values from a template
host_namewin2008 ; The name we're giving to this host
alias           My Windows Server       ; A longer name associated with the host
address         192.168.1.30    ; IP address of the host
        }

define service{
use                     generic-service
host_name               win2008
service_descriptionNSClient++ Version
check_commandcheck_nt!CLIENTVERSION
        }
define service{
use                     generic-service
host_name               win2008
service_description     Uptime
check_commandcheck_nt!UPTIME
        }
define service{
use                     generic-service
host_name               win2008
service_description     CPU Load
check_commandcheck_nt!CPULOAD!-l 5,80,90
        }
define service{
use                     generic-service
host_name               win2008
service_description     Memory Usage
check_commandcheck_nt!MEMUSE!-w 80 -c 90
        }
define service{
use                     generic-service
host_name               win2008
service_description     C:\ Drive Space
check_commandcheck_nt!USEDDISKSPACE!-l c -w 80 -c 90
        }</pre>
<p>5. We need to set the password to log into the Windows server:</p>
<p>[root@sunil etc]# vim objects/commands.cfg</p>
<pre># 'check_nt' command definition
define command{
command_namecheck_nt
command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v $ARG1$ $ARG2$
        }</pre>
<p>6. Add your password:</p>
<pre>define command{
command_namecheck_nt
command_line    $USER1$/check_nt -H $HOSTADDRESS$ -p 12489 –s password@123 -v $ARG1$ $ARG2$
        }</pre>
<p>[root@sunil objects]# chown -R daemon:daemon /opt/icinga/</p>
<p>[root@suniletc]# vimicinga.cfg</p>
<pre>cfg_file=/opt/icinga/etc/objects/ubuntu10.cfg
cfg_file=/opt/icinga/etc/objects/win2008.cfg</pre>
<p>Add the two lines.</p>
<p>Stop and start Icinga.</p>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/12.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/12.png" alt="12 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="296" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<div><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/12.png"><img src="http://static.howtoforge.com/images/click_to_enlarge.png" alt="click to enlarge Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="100" height="12" border="0" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /> </a></div>
<p><a rel="nofollow" target="_blank" href="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/big/13.png"><img src="http://static.howtoforge.com/images/icinga_installation_and_configuration_centos_5/13.png" alt="13 Icinga (Monitoring Solution) Installation And Configuration On CentOS " width="550" height="295" title="Icinga (Monitoring Solution) Installation And Configuration On CentOS " /></a></p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html" title="icinga directadmin">icinga directadmin</a> (6)</li><li><a href="http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html" title="icinga and plesk">icinga and plesk</a> (3)</li><li><a href="http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html" title="nsclient nagios screenshot">nsclient nagios screenshot</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html" title="installing icinga cpanel">installing icinga cpanel</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html" title="icinga cpanel">icinga cpanel</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html" title="icinga lconf install on centos">icinga lconf install on centos</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html" title="icinga localhost cfg configuration">icinga localhost cfg configuration</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html" title="icinga nrpe tar file download">icinga nrpe tar file download</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html" title="icinga object location centos">icinga object location centos</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html" title="icinga plesk">icinga plesk</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/icinga-monitoring-solution-installation-configuration-centos.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Host Based Intrusion Detection &#8211; Samhain</title>
		<link>http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html</link>
		<comments>http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html#comments</comments>
		<pubDate>Sun, 08 Jan 2012 15:28:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Samhain]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=2197</guid>
		<description><![CDATA[I am not going to ramble on about what host based intrusion detection is or why to use it, as there are plenty of articles already covering those subjects. This article is just to show you how to get Samhain up and running in a client / server configuration with a couple bells and whistles [...]]]></description>
			<content:encoded><![CDATA[<p>I am not going to ramble on about what host based intrusion detection is or why to use it, as there are plenty of articles already covering those subjects. This article is just to show you how to get Samhain up and running in a client / server configuration with a couple bells and whistles thrown in for fun.</p>
<p><strong>I highly recommend you read the entire guide before you start, it will most certainly help.</strong></p>
<p>There is a lot of swapping between client and server as I try my best to confuse you, so stay sharp!</p>
<p>&nbsp;</p>
<h3>Prerequisites</h3>
<p>You will need all the required build tools installed as we are going to compile Samhain. Here is a quick refresher:</p>
<p>Red Hat</p>
<p>yum groupinstall &#8220;Development Tools&#8221;</p>
<p>Debian</p>
<p>apt-get install build-essential</p>
<p><strong>NOTE:</strong> Please keep in mind that development tools on production servers is perhaps not the best of ideas. These packages may further assist the wannebe hacker, fill up precious megabyte or eat your cat. It is recommended to build the required packages on your build server, test them, create rpm / deb package and then deploy said packages on your production environment.</p>
<p>Here is a short check list to follow:</p>
<ol>
<li>You will need MySQL and Apache running on your server. This guide will assume a vanilla MySQL and Apache configuration. I leave it up to the reader to figure out how to install and configure these services on your favourite distribution.</li>
<li>You will need the MySQL development package (generaly mysql-devel) installed for the server side of things.</li>
<li>MySQL must have a root password set. If the MySQL root password is not set, go and do that first. While your at MySQL, you may want to look at this : /usr/bin/mysql_secure_installation</li>
<li>The server and client(s) host name must be fully qualified.</li>
<li>The server and client(s) /etc/host file must be correct (really correct, not Red Hat default correct), and DNS must be working for both forward and reverse lookups.</li>
<li>Port 50888 TCP should be open, or whatever port you set when building.</li>
<li>ImageMagick is required on the client.</li>
</ol>
<p>&nbsp;</p>
<h3>Download And Install</h3>
<p><a rel="nofollow" target="_blank" href="http://www.la-samhna.de/samhain/s_download.html" target="_blank">http://www.la-samhna.de/samhain/s_download.html</a></p>
<p>The above page has a full description of where to download the latest version of Samhain, and how to verify the integrity of the package. <strong>It is critical that the integrity of the package is checked</strong>. If you do not have a good foundation to build on, your house will surely crumble <img src='http://thegioinguonmo.com/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Host Based Intrusion Detection   Samhain" class='wp-smiley' title="Host Based Intrusion Detection   Samhain" /> </p>
<p>&nbsp;</p>
<h3>Server Setup</h3>
<p>Yule is the server side component of Samhain.</p>
<p>After you have extracted and checked the package, make sure you are the <strong>root</strong> user, in the top level directory of the unpacked source files.</p>
<p>We start by creating a user for the service, and generating a gpg key as that user:</p>
<pre class="brush:shell">adduser yule
su - yule
gpg --gen-key</pre>
<p>You will be asked the following questions:</p>
<p>gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.<br />
This program comes with ABSOLUTELY NO WARRANTY.<br />
This is free software, and you are welcome to redistribute it<br />
under certain conditions. See the file COPYING for details.<br />
gpg: directory `/home/mytest/.gnupg&#8217; created<br />
gpg: new configuration file `/home/yule/.gnupg/gpg.conf&#8217; created<br />
gpg: WARNING: options in `/home/yule/.gnupg/gpg.conf&#8217; are not yet active during this run<br />
gpg: keyring `/home/yule/.gnupg/secring.gpg&#8217; created<br />
gpg: keyring `/home/yule/.gnupg/pubring.gpg&#8217; created<br />
Please select what kind of key you want:<br />
(1) DSA and Elgamal (default)<br />
(2) DSA (sign only)<br />
(5) RSA (sign only)<br />
Your selection? &lt;&#8211; The default is fine, just press <strong>ENTER</strong><br />
DSA keypair will have 1024 bits.<br />
ELG-E keys may be between 1024 and 4096 bits long.<br />
What keysize do you want? (2048) <strong>4096 </strong>&lt;&#8211; 4096 For the paranoid<br />
Requested keysize is 4096 bits<br />
Please specify how long the key should be valid.<br />
0 = key does not expire<br />
&lt;n&gt; = key expires in n days<br />
&lt;n&gt;w = key expires in n weeks<br />
&lt;n&gt;m = key expires in n months<br />
&lt;n&gt;y = key expires in n years<br />
Key is valid for? (0) <strong>2y </strong>&lt;&#8211; Some may feel 2 years is to long, it&#8217;s up to you &#8230;<br />
Key expires at Sat 15 Dec 2012 22:24:38 GMT<br />
Is this correct? (y/N) <strong>y </strong>&lt;&#8211; If you are happy and you know it clap your hands<br />
You need a user ID to identify your key; the software constructs the user ID<br />
from the Real Name, Comment and Email Address in this form:<br />
&#8220;Heinrich Heine (Der Dichter)&lt;heinrichh@duesseldorf.de&gt;&#8221;</p>
<p>Real name: <strong>yules </strong>&lt;&#8211; Whatever name you want to use<br />
Email address: <strong>yules@you.com </strong> &lt;&#8211; Some e-mail address<br />
Comment: <strong>20 questions </strong> is a fun game<br />
You selected this USER-ID:<br />
&#8220;yules (20 questions) &lt;yules@you.com&gt;&#8221;</p>
<p>Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? <strong>O </strong>&lt;&#8211; If you are happy, OK it<br />
You need a Passphrase to protect your secret key.</p>
<p>Enter passphrase: <strong>This is a long passphrase ! </strong>&lt;&#8211; Enter a strong passphrase<br />
We need to generate a lot of random bytes. It is a good idea to perform<br />
some other action (type on the keyboard, move the mouse, utilize the<br />
disks) during the prime generation; this gives the random number<br />
generator a better chance to gain enough entropy.<br />
++++++++++++++++++++++++++++++++++++++++.++++++++++.++++++++++.++++++++++..+++++.+++++++++++++++.++++++++++.++++++++++++++++++++++++++++++<br />
++++++++++&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..+++++</p>
<p>Not enough random bytes available. Please do some other work to give<br />
the OS a chance to collect more entropy! (Need 284 more bytes)</p>
<p>gpg: /home/yule/.gnupg/trustdb.gpg: trustdb created<br />
gpg: key B7043C9A marked as ultimately trusted<br />
public and secret key created and signed.</p>
<p>gpg: checking the trustdb<br />
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model<br />
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u<br />
gpg: next trustdb check due at 2012-12-15<br />
pub 1024D/B7043C9A 2010-12-16 [expires: 2012-12-15]<br />
Key fingerprint = 421E CFE8 533E 017F 95C8 170A DB54 28E7 B704 3C9A<br />
uid yules (20 questions) &lt;yules@you.com&gt;<br />
sub 4096g/EB230E29 2010-12-16 [expires: 2012-12-15]</p>
<p>Quit this shell, so that we are back to the root user.</p>
<p>exit</p>
<p>So now we have a gpg key, lets get on with building the packages.</p>
<p>The default gpg binary does not support the TIGER192 checksum. As such, we first build a vanilla Samhain binary so that we can get that capability from the Samhain binary.</p>
<pre class="brush:shell">./configure
make</pre>
<p>Right, now we build the real thing &#8230;</p>
<pre class="brush:shell">./configure --with-gpg=/usr/bin/gpg --enable-network=server --with-database=mysql --enable-xml-log --with-port=50888 --enable-identity=yule
make
make install</pre>
<p>At this point, the following should come up:</p>
<p>You need to sign the configuration file now<br />
/usr/bin/gpg -a &#8211;clearsign yulerc<br />
using &#8211;homedir /home/yule/.gnupg<br />
gpg: WARNING: unsafe ownership on homedir `/home/yule/.gnupg&#8217;<br />
You need a passphrase to unlock the secret key for<br />
user: &#8220;yules (20 questions) &lt;yules@you.com&gt;&#8221;<br />
1024-bit DSA key, ID BAFB6B91, created 2010-12-21<br />
Enter passphrase: <strong>This is a long passphrase ! </strong>&lt;&#8211; This is the passphrase we set earlier.</p>
<p><strong>Side note: </strong> I am unsure why gpg is complaining about the ownership, as the permissions is just fine.</p>
<p>Now install the initialization script, set up MySQL user / permission and fix some file permissions.</p>
<pre class="brush:shell">make install-boot
mysql -p &lt; sql_init/samhain.mysql.init
echo "grant select, insert on samhain.log to samhain@localhost IDENTIFIED BY 'samhain';" | mysql -p &lt;-- This will ask for your root MySQL password.
echo "FLUSH PRIVILEGES;" | mysql -p &lt;-- This will ask for your root MySQL password.
chown yule:yule /var/log/yule
chown yule:yule /etc/yulerc
chown yule:yule /var/lib/yule</pre>
<p>Set yule to start at boot.</p>
<p>Red Hat</p>
<pre class="brush:shell">chkconfig --add yule
chkconfig yule on</pre>
<p>Debian</p>
<p>update-rc.d yule defaults</p>
<p>Start yule with:</p>
<p>/etc/init.d/yule start</p>
<p>Yule may complain with something like :</p>
<p>&lt;log sev=&#8221;WARN&#8221; tstamp=&#8221;2010-12-21T11:46:42+0000&#8243; msg=&#8221;Invalid line 102 in configuration file: incorrect format, unrecognized option, or missing section header&#8221; /&gt;<br />
&lt;log sev=&#8221;WARN&#8221; tstamp=&#8221;2010-12-21T11:46:42+0000&#8243; msg=&#8221;Invalid line 106 in configuration file: incorrect format, unrecognized option, or missing section header&#8221; /&gt;</p>
<p>However, the service should start fine. These two warnings are due to the [Database] header being commented out. Either uncomment it, or comment said two lines out. They are true by default.</p>
<p>For a list of configuration options with full explanations, see <a rel="nofollow" target="_blank" href="http://la-samhna.de/samhain/manual/compilation-options.html" target="_blank">http://la-samhna.de/samhain/manual/compilation-options.html</a></p>
<p>&nbsp;</p>
<h3>Apache Configuration</h3>
<p>Add the following in:</p>
<p>Red Hat</p>
<p>/etc/httpd/conf.d/samhain.conf</p>
<p>Debian</p>
<p>/etc/apache2/conf.d/samhain.conf</p>
<pre>&lt;Directory "/var/log/yule/"&gt;
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
&lt;/Directory&gt;
Alias /yule.html "/var/log/yule/yule.html"</pre>
<p>Then reload Apache with:</p>
<p>Red Hat</p>
<p>service httpd restart</p>
<p>Debian</p>
<p>/etc/init.d/apache2 restart</p>
<p>Now visit http://yourserver/yule.hml</p>
<h3>Client Setup</h3>
<div></div>
<p>Log in on the server you wish to install the Samhain client on and make sure you are the <strong>root</strong> user. Also make sure you have all the essential build packages installed, refer to the overview for installation of these essential build packages.</p>
<p>First, we need a gpg key for root.</p>
<p>See previous example for detailed steps.</p>
<p>gpg &#8211;gen-key</p>
<p>Now we need to pull out the fingerprint for this key, so that we can use it when building the Samhain binary.</p>
<p>MY_FP=`gpg &#8211;fingerprint root | grep fingerpr | sed &#8216;s/ //g&#8217; | awk &#8216;BEGIN { FS = &#8220;=&#8221; } ; {print $2}&#8217;`</p>
<p>As before, we need TIGER192 checksum capability first.</p>
<p>./configure<br />
make</p>
<p>Now, since we are having a bit of fun, we are going to change the name of the binary and process. Classical security by obscurity. I&#8217;m picking the name <strong>john</strong>, a general purpose password cracker. Pick a name that will not stand out in a process listing and shout out &#8220;THIS IS A HIDS PROCESS !!!!11&#8243;. Then again, know how much/little a name change actually hides what this binary does before you rely on it to hide you&#8217;re HIDS from a l33t haxor.</p>
<p>We further specify that the configuration and data files should be pulled from the server. If you want to take this one step further, look into the following compile options : &#8211;enable-khide,&#8211;enable-suidcheck and &#8211;with-kcheck=/path/to/System.map</p>
<p>Make sure to change <strong>IP_OF_YOUR_SERVER</strong> to the actual IP address of your Yule server.</p>
<p>./configure &#8211;with-gpg=/usr/bin/gpg &#8211;enable-network=client &#8211;with-config-file=REQ_FROM_SERVER &#8211;with-data-file=REQ_FROM_SERVER/var/lib/john/john \<br />
&#8211;enable-stealth=129 &#8211;enable-install-name=john &#8211;enable-srp &#8211;with-fp=$MY_FP &#8211;with-port=50888 \<br />
&#8211;with-logserver=<strong>IP_OF_YOUR_SERVER</strong> &#8211;with-sender=john<br />
make</p>
<p>Make the required directories, copy the binary over (with the correct name) and put the initialization script in place.</p>
<pre class="brush:shell">mkdir /var/lib/john/
cp init/samhain.startLinux /etc/init.d/john
chmod 744 /etc/init.d/john
cp samhain /usr/local/sbin/john
cp samhain_setpwd /usr/local/sbin/john_setpwd
cp samhain_stealth /usr/local/sbin/john_stealth
cd /usr/local/sbin</pre>
<p>Set the password and overwrite the binary.</p>
<pre class="brush:shell">/usr/local/sbin/john_setpwd john jingle 161718abcd212324
mv john.jingle john</pre>
<p>&#8220;jingle&#8221; Does not matter, it&#8217;s just the append and the number is what you want in 16 bit 0-9, A-F (A.K.A HEX). You can use yule -G on the server to generate a random number for you.</p>
<p>The output should look something like:</p>
<p>INFO old password found<br />
INFO replaced: f7c312aaaa12c3f7 by: 161718abcd212324<br />
INFO finished</p>
<p>Change the description in the initialization script.</p>
<p>sed -i &#8216;s/File Integrity Checking/Password Cracking/&#8217; /etc/init.d/john</p>
<p>Make sure the daemon starts at boot.</p>
<p>Red Hat</p>
<pre class="brush:shell">chkconfig --add john
chkconfig john on</pre>
<p>Debian</p>
<pre class="brush:shell">update-rc.d john defaults</pre>
<p>&nbsp;</p>
<h3>A Little Work On The Server</h3>
<p>The HEX key we just embedded in the client binary, we need it now to tell the server about that client.</p>
<p>/usr/local/sbin/yule -P 161718abcd212324 | sed &#8216;s/HOSTNAME/<strong>CliENT_HOSTNAME_HERE</strong>/&#8217; &gt;&gt; /etc/yulerc &lt;&#8211; Make sure to put the client host name (FQDN) in.</p>
<p>Edit /etc/yulerc and move the key above the GPG signature.</p>
<p>For example, the last couple of lines of /etc/yulerc mihgt look like this:</p>
<pre># Client=HOSTNAME@00000000@C39F0EEFBC64E4A8BBF72349637CC07577F714B420B62882
# Client=HOSTNAME@8F81BA58956F8F42@8932D08C49CA76BD843C51EDD1D6640510FA032A7A2403E572BBDA2E5C6B753991CF7E091141D20A2499C5CD3E14C1639D17482E14E1548E5246ACF4E7193D524CDDAC9C9D6A9A36C596B4ECC68BEB0C5BB7082224946FC98E3ADE214EA1343E2DA8DF4229D4D8572AD8679228928A787B6E5390D3A713102FFCC9D0B2188C92
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFNEI7oerU1Wrr7a5ERAkWqAJ9sZEuRLp8rPOjXdUokT03bEfjGuwCfa+Tr
pDK7/KmGj3Hx8vRMufxNx7A=
=zI4S
-----END PGP SIGNATURE-----
Client=rhc2.sys.local@F1DF72033799940C@37FC42534A812B2351007A24820537466495F97ED352EFC1D9DCAEACBBF5CB98AEF183057CE6D101151F112693C2DAE361435CED1C95E822272FE287A56B4D38EE91B00830A56AE2F26E4738DF099CAEF3372342BE0ACDB78C12FD176EED1FBA376A0399537F848B6FA9AD4E61E6C771A5566F43D62C1F9836AB976CB1111545</pre>
<p>We need to change that to look like this:</p>
<pre># Client=HOSTNAME@00000000@C39F0EEFBC64E4A8BBF72349637CC07577F714B420B62882
# Client=HOSTNAME@8F81BA58956F8F42@8932D08C49CA76BD843C51EDD1D6640510FA032A7A2403E572BBDA2E5C6B753991CF7E091141D20A2499C5CD3E14C1639D17482E14E1548E5246ACF4E7193D524CDDAC9C9D6A9A36C596B4ECC68BEB0C5BB7082224946FC98E3ADE214EA1343E2DA8DF4229D4D8572AD8679228928A787B6E5390D3A713102FFCC9D0B2188C92
Client=rhc2.sys.local@F1DF72033799940C@37FC42534A812B2351007A24820537466495F97ED352EFC1D9DCAEACBBF5CB98AEF183057CE6D101151F112693C2DAE361435CED1C95E822272FE287A56B4D38EE91B00830A56AE2F26E4738DF099CAEF3372342BE0ACDB78C12FD176EED1FBA376A0399537F848B6FA9AD4E61E6C771A5566F43D62C1F9836AB976CB1111545
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFNEI7oerU1Wrr7a5ERAkWqAJ9sZEuRLp8rPOjXdUokT03bEfjGuwCfa+Tr
pDK7/KmGj3Hx8vRMufxNx7A=
=zI4S
-----END PGP SIGNATURE-----</pre>
<p>The following steps are always required when you&#8217;ve made changes to the configuration files.</p>
<p>Edit /etc/yulerc and remove the first 3 and last 7 lines, this is the GPG/PGP signature.</p>
<p>Example:</p>
<pre>-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
There will be another line here later on.
#####################################################################
#
# Configuration file template for yule.
#
#####################################################################

Lots of Yule configuration removed ...

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFNEI7oerU1Wrr7a5ERAkWqAJ9sZEuRLp8rPOjXdUokT03bEfjGuwCfa+Tr
pDK7/KmGj3Hx8vRMufxNx7A=
=zI4S
-----END PGP SIGNATURE-----</pre>
<p>Then sign the configuration file again with the user yule and copy the file in place as the <strong>root</strong> user:</p>
<p>su &#8211; yule<br />
gpg -o yulerc.asc -a &#8211;clearsign &#8211;not-dash-escaped /etc/yulerc &lt;&#8211; Type in the passphrase we set earlier.<br />
exit<br />
/bin/mv /home/yule/yulerc.asc /etc/yulerc<br />
service yule reload</p>
<p>&nbsp;</p>
<h3>A Little More Work On The Client</h3>
<p>We will need to create the configuration file and embed it into a postscript file. Make sure you have Imagemagick installed, as you will need convert.</p>
<p>Go and download a good looking picture like <a rel="nofollow" target="_blank" href="http://apod.nasa.gov/apod/image/0903/tycho_chandra_big.jpg" target="_blank">http://apod.nasa.gov/apod/image/0903/tycho_chandra_big.jpg</a>. You will want at least a 200K size image, if not larger, to hide the configuration file in it. Also, it is handy to have an original configuration file as backup.</p>
<p><strong>NOTE:</strong> The following steps has to be done each time you wish to modify the configuration file of the client.</p>
<p>cd <strong>TOPLEVEL_OF_SOURCE_DIR</strong><br />
wget http://apod.nasa.gov/apod/image/0903/tycho_chandra_big.jpg<br />
convert tycho_chandra_big.jpg tycho_chandra_big.ps &lt;&#8211; Convert the JPG to a postscript file.<br />
cp samhainrc.linux rc.`hostname` &lt;&#8211; Get a default configuration.<br />
gpg -a &#8211;clearsign &#8211;not-dash-escaped rc.`hostname` &lt;&#8211; Clear sign the configuration.<br />
mv rc.`hostname`.asc rc.`hostname` &lt;&#8211; Move the signed file to the normal file name for the configuration file.<br />
/usr/local/sbin/john_stealth -s tycho_chandra_big.ps rc.`hostname`&lt;&#8211; Steganographically hide the configuration file inside the postscript file.<br />
rm rc.`hostname` tycho_chandra_big.* &lt;&#8211; Remove the &#8220;clean&#8221; files.</p>
<p>Make sure that the resulting postscript file is not very large, or Samhain will fail to download it. I do not have exact numbers, but from experience 66Mb is too large <img src='http://thegioinguonmo.com/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Host Based Intrusion Detection   Samhain" class='wp-smiley' title="Host Based Intrusion Detection   Samhain" /> </p>
<p>Now copy the file over to your server:</p>
<p>scp tycho_chandra_big.ps <strong>YULE_SERVER</strong>:~/rc.`hostname` &lt;&#8211; Assuming scp with root. In real life, please do not open ssh for root.</p>
<p>Back to the <strong>server</strong>:</p>
<p>cp ~/rc.<strong>CliENT_FQDN</strong> /var/lib/yule/ &lt;&#8211; Make sure to fill in the clients FQDN.<br />
chown yule:yule /var/lib/yule/rc.<strong>CliENT_FQDN</strong> &lt;&#8211; Make sure to fill in the clients FQDN.</p>
<p>Back to the <strong>client</strong>:</p>
<p>/usr/local/sbin/john -t init -p info</p>
<p>This will now build the database in /var/lib/john. Don&#8217;t worry about all the output at this stage, we are just getting things up and running now.</p>
<p>After we have a database, we have to sign it and copy it over to the server.</p>
<p>gpg -a &#8211;clearsign &#8211;not-dash-escaped /var/lib/john/john<br />
scp /var/lib/john/john.asc <strong>YULE_SERVER</strong>:~/file.`hostname` &lt;&#8211; Assuming scp with root. In real life, please do not open ssh for root.<br />
rm /var/lib/john/john*</p>
<p>Back to the <strong>server</strong>, we move this file to the correct place:</p>
<p>mv ~/file.<strong>CliENT_FQDN</strong> /var/lib/yule<br />
chown yule:yule /var/lib/yule/*</p>
<p>It is important that all configuration files start with rc and all database files start with file.</p>
<p>&nbsp;</p>
<h3>Troubleshooting</h3>
<p>Trouble, what trouble?</p>
<ol>
<li>Start with tailing the log file on the server : tail -f /var/log/yule/yule_log</li>
<li>Change the log level in /etc/yulerc to info or above (always remember to re-sign the configuration file as described).</li>
<li>Recompile without some of the options to test.</li>
<li>Have a look at this link : <a rel="nofollow" target="_blank" href="http://www.la-samhna.de/samhain/s_documentation.html" target="_blank">http://www.la-samhna.de/samhain/s_documentation.html</a></li>
</ol>
<p>&nbsp;</p>
<h3>Clean Up</h3>
<p>Now we don&#8217;t want to be leaving breadcrumbs behind us, some clean up is required.</p>
<ol>
<li>Delete all the source files and any tarballs that was downloaded if you built directly on a production server.</li>
<li>Delete <strong>all</strong> entries from your shell history.</li>
<li>Remove all the development packages that was installed if you built directly on a production server.</li>
<li>Remove /usr/local/sbin/john_stealth and /usr/local/sbin/john_setpwd.</li>
</ol>
<p>Basically, get rid of any evidence of what you just did.</p>
<p>&nbsp;</p>
<h3>Tuning</h3>
<p>Arguably, this is where the guide should start. Samhain does not understand what is right and what is wrong for this particular server. As such, you need to tune it. The simplest way is to build Samhain without any options what so ever like:</p>
<p>./configure<br />
make<br />
mkdir /var/lib/samhain/</p>
<p>Put the configuration file in /etc/samhainrc, and run</p>
<p>samhain -t init -p info &gt; my_output 2&gt;&amp;1</p>
<p>You can then examine the output file and make the appropriate changes to the Samhain configuration file. The database will be created in /var/lib/samhain. Do not run samhain -t init more than once without deleting the database.</p>
<p>Once you are happy with the configuration, build Samhain in server / client mode.</p>
<p><strong>NOTE:</strong> It is however rather important that you profile your server and tune Samhain before it is connected to the Internet.</p>
<p>&nbsp;</p>
<h3>Honey Pot!</h3>
<p>Now for a bit of fun. We really <strong>do</strong> want intruders to let us know they are on our system. So, we create 2 (or more) files with catchy names and tell Samhain to monitor those files for <strong>any</strong> changes (that includes access times).</p>
<p>cp /etc/passwd /home/cracked_passwords<br />
cp /etc/hosts /home/customers/credit_cards_2008.xls</p>
<p>Now, in Samhain&#8217;s configuration file, there is a section called [IgnoreNone], add these files in that section. You can test this by simply catting those files and then run the check. The output should be something like:</p>
<p>CRIT : [2009-04-27T21:33:11+0100] msg=&lt;POliCY [User1] &#8212;&#8212;&#8211;T-&gt;, path=&lt;/home/cracked_passwords&gt;, atime_old=&lt;[2009-04-27T20:25:39]&gt;,<br />
atime_new=[2009-04-27T20:32:37]&gt;,</p>
<p>&nbsp;</p>
<h3>Nagios Integration</h3>
<p>I have not tested this yet, this is just on top of my head, so it may well be very wrong.</p>
<p>So now we have alerts for when things go wrong. By default, the standard Nagios plugin pack ships with check_log. Our Nagios check command will look something like:</p>
<pre>check_log -F /var/log/yule_log -O /var/log/yule/yule_nagios_diff_log -q "ERROR|CRIT|ALERT"</pre>
<p>You will need to modify how to alert on this particular service. By default Nagios will check 3 times before alerting, but with check_log you will never get an alert. The reason is as follows:</p>
<ol>
<li>check 1: The check returns an error, as it spotted your query (lets say CRIT) in the difference from the old stored log file and the current running log file. The check command now updates the old stored log file.</li>
<li>check 2: There is no longer a difference between the old stored log file and the current running one, thus the check passes OK.</li>
</ol>
<p>Either modify Nagios to alert after a single failure, or write a wrapper specifically for this check to create a lock file somewhere. You then check for this lock file and alert if it exists. Both approaches have some down sides. If we alert on a single check, be prepared for false alerts due to packet loss or a shift in the force. If we create a lock file, you will have to manually remove it.</p>
<p>Now that we are monitoring the log file for changes detected, we also need to monitor that the client process is still up and running. Of course, you will also want to monitor that the server process is running all the time.</p>
<p>I am sure someone will come up with a better way of Nagios integration, like I said, this is just thinking out loud.</p>
<p>&nbsp;</p>
<h3>What It All Means</h3>
<p>At the end of the day, the clear text configuration of each machine being monitored, is neither kept on the client nor on the server. The clear text configuration files should be kept on a different machine inside an encrypted partition.</p>
<p>Nagios makes sure we are alerted of anything (via e-mail or SMS) and hopefully, an intruder will bite on the honey so that we can see him, potentially, even quicker.</p>
<p>Further more, you can not access any help files (such as ./samhain &#8211;help or man pages) to indicate that there is a HIDS running on the client.</p>
<p>Of course, if you get access to the server, you can see all the clients who logs in. There are further compiler options so that the logs are also encrypted.</p>
<p>&nbsp;</p>
<h3>Layers</h3>
<p>In the voice of Shrek: &#8220;Security is like an onion, it has many layers.&#8221; Remember that host based intrusion detection is just one more layer in this onion. You also need a good firewall, network intrusion detection, monitoring, centralised logging, log analysis, TCP wrappers, SELinux (or some other mandatory access control mechanism), brute force blockers like fail2ban and much more.</p>
<p>As an example of this, the entire host based intrusion detection is rendered moot if the hacker just kills the process and you are not using monitoring to make sure that the service is running.</p>
<p>Please do not hesitate to contact me with any corrections or improvements or even some constructive criticism. <img src='http://thegioinguonmo.com/wp-includes/images/smilies/icon_smile.gif' alt="icon smile Host Based Intrusion Detection   Samhain" class='wp-smiley' title="Host Based Intrusion Detection   Samhain" /> </p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html" title="/samhain-install sh: error: cannot find signed file yulerc asc">/samhain-install sh: error: cannot find signed file yulerc asc</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html" title="step by step configuration of samhain in linux">step by step configuration of samhain in linux</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html" title="set up samhianrc to use port 50888">set up samhianrc to use port 50888</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html" title="samhain windows client">samhain windows client</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html" title="samhain trusted userid">samhain trusted userid</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html" title="samhain logs to yule server">samhain logs to yule server</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html" title="samhain cpanel">samhain cpanel</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html" title="samhain configuration">samhain configuration</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html" title="samhain and mysql setup">samhain and mysql setup</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html" title="red hat samhain">red hat samhain</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/host-based-intrusion-detection-samhain.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Honeyd 1.5c And Arpd 0.2 Under CentOS 5 (With gcc 4.x)</title>
		<link>http://thegioinguonmo.com/os/linux/installing-honeyd-15c-arpd-02-centos-5-gcc-4x.html</link>
		<comments>http://thegioinguonmo.com/os/linux/installing-honeyd-15c-arpd-02-centos-5-gcc-4x.html#comments</comments>
		<pubDate>Sun, 08 Jan 2012 15:18:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Arpd]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Honeypot]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=2193</guid>
		<description><![CDATA[Introduction Traditionally, information security has been primarily defensive. Firewalls, Intrusion Detection Systems, encryption; all of these mechanisms are used defensively to protect one’s resources. The strategy is to defend one’s organization as best as possible, detect any failures in the defense, and then react to those failures. The problem with this approach is it [is] [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>Traditionally, information security has been primarily defensive. Firewalls, Intrusion Detection Systems, encryption; all of these mechanisms are used defensively to protect one’s resources. The strategy is to defend one’s organization as best as possible, detect any failures in the defense, and then react to those failures. The problem with this approach is it [is] purely defensive, the enemy has the initiative. In computer terminology, a honeypot is a trap set to detect, deflect, or in some manner counteract attempts at unauthorized use of information systems. Generally it consists of a computer, data, or a network site that appears to be part of a network, but is actually isolated and monitored, and which seems to contain information or a resource of value to attacker.</p>
<p>This tutorial shows how you can compile and install honeyd 1.5c on CentOS 5.5 server. I do not issue any guarantee that this will work for you!</p>
<p>&nbsp;</p>
<h3>Preliminary Note</h3>
<p>In this tutorial I will use the following hosts:</p>
<p>* Host Server : 192.168.245.128<br />
* Virtual Honeypot 1 : 192.168.245.200<br />
* Virtual Honeypot 2 : 192.168.245.201</p>
<p>Here&#8217;s a little diagram that shows our setup:</p>
<p>Host IP=192.168.245.128</p>
<p>192.168.245.200 192.168.245.201<br />
&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8211;<br />
|                 |<br />
+&#8211;+&#8211;+         +&#8211;+&#8211;+<br />
| hp1  |         | hp2   |<br />
+&#8212;&#8211;+          +&#8212;&#8211;+<br />
Virtual            Virtual<br />
Honeypot1     Honeypot2</p>
<p>&nbsp;</p>
<h3>Preparation</h3>
<p>You need to remove libdnet and libevent packages otherwise you wont be able to compile honeyd.(See note)</p>
<p>yum remove libevent libevent-devel libdnet libdnet-devel<br />
yum install autoconf gcc python-devel</p>
<p>Note: Don&#8217;t use latest version of libevent and libdnet because of some inconsistency in honeyd</p>
<p>&nbsp;</p>
<h3>Download required packages</h3>
<p>You need to download few packages before installing honeyd.</p>
<pre class="brush:shell">cd /tmp
wget http://monkey.org/~provos/libevent-1.3a.tar.gz
wget http://space.dl.sourceforge.net/project/libdnet/libdnet/libdnet-1.11/libdnet-1.11.tar.gz
wget http://www.citi.umich.edu/u/provos/honeyd/arpd-0.2.tar.gz</pre>
<p>Important Note: Don&#8217;t download latest version of libevent and libdnet because of some inconsistency in honeyd.</p>
<p>&nbsp;</p>
<h3>Install required packages</h3>
<pre class="brush:shell">cd /tmp
tar -xvf libevent-1.3a.tar.gz
cd libevent-1.3a
./configure
make
make install

cd /tmp
tar -xvf libdnet-1.11.tar.gz
cd libdnet-1.11
./configure
make
make install</pre>
<p>&nbsp;</p>
<h3>Download Arpd updated packages</h3>
<p>For arpd-0.2 to compile under gcc 4.0.0 the file arpd.c must be modified. Replace it with the one from the <a rel="nofollow" target="_blank" href="http://www.honeynet.ir/" target="_blank">Iran Honeynet Project</a> web site , then compile and install.</p>
<pre class="brush:shell">cd /tmp
tar -xvf arpd-0.2.tar.gz
cd arpd
wget http://www.honeynet.ir/software/honeyd/arpd.c
./configure
make
make install</pre>
<h3>Run arpd</h3>
<p>Arpd is a daemon that listens to ARP requests and answers for IP addresses that are unallocated. Using Arpd in conjunction with Honeyd, it is possible to populate the unallocated address space in a production network with virtual honeypots.</p>
<p>/usr/local/sbin/arpd &#8217;192.168.245.200-192.168.245.201&#8242;</p>
<p>&nbsp;</p>
<h3>Install Honeyd 1.5c</h3>
<pre class="brush:shell">cd /tmp
wget http://www.honeyd.org/uploads/honeyd-1.5c.tar.gz
tar -xvf honeyd-1.5c.tar.gz
cd honeyd-1.5c
./configure
make
make install</pre>
<h3>Configure Honeyd</h3>
<pre class="brush:shell">cd /usr/local/share/honeyd
cp -v config.ethernet honeyd.conf
vi honeyd.conf</pre>
<p>Some configurations that outline features available in Honeyd.org Web Site.</p>
<p>This is sample configuration:</p>
<pre>create default
set default default tcp  action block
set default default udp  action block
set default default icmp action block
create honeypot-template
set honeypot-template  ethernet "00:22:FA:cc:dd:ee"
set honeypot-template  personality "Microsoft Windows XP SP2"
set honeypot-template  uptime 1234567
set honeypot-template  default tcp  action reset
set honeypot-template  default udp  action reset
set honeypot-template  default icmp action open
add honeypot-template  tcp port 135  open
add honeypot-template  tcp port 139  open
add honeypot-template  tcp port 445  open
add honeypot-template  tcp port 3389 block
add honeypot-template  tcp port 53 proxy 8.8.8.8:53
bind 192.168.245.200 honeypot-template
bind 192.168.245.201 honeypot-template</pre>
<p>Important Note: The IP Addresses should be in the same network segment with the hosting machine, or you should modify the routing table of your router to allow the packets destined to those IP Addresses to reach your honeyd hosting computer.</p>
<p>&nbsp;</p>
<h3>Configure Linux firewall</h3>
<p>Modify the rules of your firewall to accept packets for the IP Addresses defined in the honeyd&#8217;s configuration file. You should have something like this:</p>
<pre class="brush:plain">$IPTABLES -A INPUT -d 192.168.245.200 -j ACCEPT
$IPTABLES -A INPUT -d 192.168.245.201 -j ACCEPT
$IPTABLES -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT</pre>
<h3>Run Honeyd</h3>
<pre class="brush:shell">/usr/local/bin/honeyd -d -f /usr/local/share/honeyd/honeyd.conf -p /usr/local/share/honeyd/nmap.prints -x /usr/local/share/honeyd/xprobe2.conf -a /usr/local/share/honeyd/nmap.assoc --disable-webserver '192.168.245.200-192.168.245.201'</pre>
<h3>Test Honeyd</h3>
<p>Run this test only from an IP Addresses outside host machine.</p>
<pre class="brush:shell">nmap -T4 -A -v 192.168.245.200</pre>
<h3>Links</h3>
<p><strong>Iran Honeynet Project</strong>: <a rel="nofollow" target="_blank" href="http://www.honeynet.ir/" target="_blank"> http://www.honeynet.ir/</a><br />
<strong>The Honeynet Project</strong>: <a rel="nofollow" target="_blank" href="http://www.honeynet.org/" target="_blank">http://www.honeynet.org</a><br />
<strong>Honeypot</strong>: <a rel="nofollow" target="_blank" href="http://en.wikipedia.org/wiki/Honeypot_%28computing%29" target="_blank">http://en.wikipedia.org/wiki/Honeypot_(computing)</a><br />
<strong>Honeyd Virtual Honeypot:</strong> <a rel="nofollow" target="_blank" href="http://www.honeyd.org/index.php" target="_blank"> http://honeyd.org/</a><br />
<strong>CentOS</strong>: <a rel="nofollow" target="_blank" href="http://www.centos.org/" target="_blank">http://www.centos.org/</a></p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/installing-honeyd-15c-arpd-02-centos-5-gcc-4x.html" title="add a honeypot to cpanel server">add a honeypot to cpanel server</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/installing-honeyd-15c-arpd-02-centos-5-gcc-4x.html" title="arp d download">arp d download</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/installing-honeyd-15c-arpd-02-centos-5-gcc-4x.html" title="http ; THE GIOI 4x wen n">http ; THE GIOI 4x wen n</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/installing-honeyd-15c-arpd-02-centos-5-gcc-4x.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: thegioinguonmo.com @ 2012-02-07 11:10:57 -->
