<?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; ids</title>
	<atom:link href="http://thegioinguonmo.com/tag/ids/feed/" rel="self" type="application/rss+xml" />
	<link>http://thegioinguonmo.com</link>
	<description>SHARING EVERYTHING</description>
	<lastBuildDate>Sat, 19 May 2012 21:40:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How To Configure The AIDE (Advanced Intrusion Detection Environment) File Integrity Scanner For Your Website</title>
		<link>http://thegioinguonmo.com/security/configure-aide-advanced-intrusion-detection-environment-file-integrity-scanner-website.html</link>
		<comments>http://thegioinguonmo.com/security/configure-aide-advanced-intrusion-detection-environment-file-integrity-scanner-website.html#comments</comments>
		<pubDate>Thu, 15 Mar 2012 09:44:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[aide]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[ids]]></category>
		<category><![CDATA[Intrusion]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[scan]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=2457</guid>
		<description><![CDATA[A file integrity scanner is something you need to have.  Imagine a hacker placing a backdoor on your web site, or changing your order form to email him a copy of everyone&#8217;s credit card while leaving it appear to be functionally normally. By setting up daily reporting, this notifies you within, at most, 24 hours [...]]]></description>
			<content:encoded><![CDATA[<p>A file integrity scanner is something you need to have.  Imagine a hacker placing a backdoor on your web site, or changing your order form to email him a copy of everyone&#8217;s credit card while leaving it appear to be functionally normally.</p>
<p>By setting up daily reporting, this notifies you within, at most, 24 hours of when any file was changed, added, or removed.  It also helps establish an audit trail in the event your site is compromised.</p>
<p>These instructions are designed for an end user, where you don&#8217;t need to have root access, to implement and assumes your server has the aide binary installed.  Most hosts will have this installed already, or will install it for you upon request.</p>
<p>&nbsp;</p>
<h3>Step 1: Download A Sample AIDE config file</h3>
<p>We will start with a simple one, this will scan your web root directory for md5 hash changes.</p>
<p>To download the file, SSH into your account and run:</p>
<pre class="brush:plain">$ wget securehostingdirectory.com/aide.conf</pre>
<p>What you will want to change in this file, is replace &#8220;username&#8221; on the first line, and confirm that is the path to your root directory.</p>
<p>Then on the last line, confirm that public_html is your web root directory.  If your host uses the cPanel control panel, then public_html is your web root.</p>
<p>&nbsp;</p>
<h3>Step 2: Initialize the AIDE database</h3>
<p>The command to initialize the AIDE database is:</p>
<pre class="brush:plain">$ nice -19 aide --init --config=/home/username/aide.conf</pre>
<p>AIDE is not the least resource intensive software in the world so we are running it with a 19 priority using nice.</p>
<p>Now copy your AIDE output database file to the input file:</p>
<pre class="brush:plain">$ cp aide.db.out aide.db.in</pre>
<p>You can test aide by doing:</p>
<pre class="brush:plain">$ nice -19 aide -C --config=/home/username/aide.conf</pre>
<p>Go ahead and run that now, it will say all files match, then make a change to a file and add a file, rerun it and see what the report says.</p>
<p>&nbsp;</p>
<h3>Step 3: Daily Reporting</h3>
<p>There are a few ways to get the aide reports, a common one is to have it email you the reports, for this you can set a cronjob to run aide everyday, or even more frequently if you&#8217;d like.</p>
<p>Open up the crontab editor and paste in:</p>
<pre>0 1 * * * nice -19 /usr/local/bin/aide --config=/home/username/aide.conf -C| mail you@domain -saide\ domain</pre>
<p>The reports can get rather lengthy overtime, so if you want to reset the database, say weekly, you can add this to the crontab:</p>
<pre>0 2 * * 0  nice -19 /usr/local/bin/aide --config=/home/username/aide.conf --init;mv -f /home/username/aide.db.out /home/username/aide.db.in</pre>
<p>&nbsp;</p>
<h3>Step 4: Extras</h3>
<p>We have covered the basics, and that is actually only the tip of the iceberg of what you can do with AIDE.</p>
<p>You can get the full AIDE config file here: <a rel="nofollow" target="_blank" href="http://securehostingdirectory.com/aide.conf.full.txt" target="_blank">Full AIDE Config File</a></p>
<p>And you might want to exclude certain files, for example if you have a forum or gallery and a lot of images are added regularly you can exclude those from the report. For example to exclude all jpg files in images/ you would put the following in the config file:</p>
<pre> !@@{TOPDIR}/public_html/images/.*\.jpg$</pre>
<p>And that would go right above this line:</p>
<pre>@@{TOPDIR}/public_html MD</pre>
<p>Another thing you can do for extra security is, have your host chown your in database file, and your config file to another user, this way if your user is compromised, the hacker could not compromise your AIDE database, without also gaining access to the second user.</p>
<p>To be even more secure, you can download your AIDE database after creating it, and then upload it before you run a scan.</p>
<p>I hope this Howto lets you see the need for a file integrity checker, and makes it easy to setup, no matter what your user level is.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/security/configure-aide-advanced-intrusion-detection-environment-file-integrity-scanner-website.html" title="advanced intrusion detection environment">advanced intrusion detection environment</a> (1)</li><li><a href="http://thegioinguonmo.com/security/configure-aide-advanced-intrusion-detection-environment-file-integrity-scanner-website.html" title="aide conf example">aide conf example</a> (1)</li><li><a href="http://thegioinguonmo.com/security/configure-aide-advanced-intrusion-detection-environment-file-integrity-scanner-website.html" title="centos aide config">centos aide config</a> (1)</li><li><a href="http://thegioinguonmo.com/security/configure-aide-advanced-intrusion-detection-environment-file-integrity-scanner-website.html" title="configure aide in shell script">configure aide in shell script</a> (1)</li><li><a href="http://thegioinguonmo.com/security/configure-aide-advanced-intrusion-detection-environment-file-integrity-scanner-website.html" title="htdocs centos 5 5 location">htdocs centos 5 5 location</a> (1)</li><li><a href="http://thegioinguonmo.com/security/configure-aide-advanced-intrusion-detection-environment-file-integrity-scanner-website.html" title="nice 19 aide --check">nice 19 aide --check</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/security/configure-aide-advanced-intrusion-detection-environment-file-integrity-scanner-website.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intrusion Detection: Snort (IDS), OSSEC (HbIDS) And Prelude (HIDS) On Ubuntu Gutsy Gibbon</title>
		<link>http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html</link>
		<comments>http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html#comments</comments>
		<pubDate>Sat, 03 Mar 2012 06:27:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[HIDS]]></category>
		<category><![CDATA[ids]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[monitoring-tools]]></category>
		<category><![CDATA[OSSEC]]></category>
		<category><![CDATA[snort]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=2429</guid>
		<description><![CDATA[Everybody knows the problem, you have a IDS tool(s) installed and every tool has his own interface. Prelude will allow to log all of the events to the prelude database and be consulted using one interface (prewikka). This howto will describe how to install and configure the different tools that will make up the complete [...]]]></description>
			<content:encoded><![CDATA[<p>Everybody knows the problem, you have a IDS tool(s) installed and every tool has his own interface.</p>
<p>Prelude will allow to log all of the events to the prelude database and be consulted using one interface (prewikka). This howto will describe how to install and configure the different tools that will make up the complete solution.</p>
<p>This howto is based on bits and scraps I found in order to resolve some issues, parts from the manuals and my own experiance with installing the complete solution.</p>
<p>For more information on snort visit: <a rel="nofollow" target="_blank" href="http://www.snort.org/" target="_blank">www.snort.org</a></p>
<p>For more information on ossec visit: <a rel="nofollow" target="_blank" title="www.ossec.net" href="http://www.ossec.net/" target="_blank">www.ossec.net</a></p>
<p>For more information on prelude visit: <a rel="nofollow" target="_blank" title="http://www.prelude-ids.org/" href="http://www.prelude-ids.org/" target="_blank">www.prelude-ids.org</a></p>
<p>&nbsp;</p>
<h3>Prerequisites:</h3>
<p>Let&#8217;s just assume you followed the The Perfect Server &#8211; Ubuntu Gutsy Gibbon (Ubuntu 7.10). If not follow that howto and only install / add those part&#8217;s you havent got installed on your system.</p>
<p>The following packages are useful, so please check that they are installed correctly:</p>
<p>apt-get install ntpdate<br />
apt-get install dbconfig-common</p>
<p>&nbsp;</p>
<h3>Installing And Configuring Prelude</h3>
<p>Normally, we would have to compile and install <em>libprelude</em>, <em>libpreludedb</em>, and then create the databases. Luckely enough the packages are provide by the Ubuntu repositories.</p>
<p>&nbsp;</p>
<h4>Prelude Manager</h4>
<p>apt-get install prelude-manager</p>
<p>- Using default TLS settings from /etc/prelude/default/tls.conf:<br />
- Generated key size: 1024 bits.<br />
- Authority certificate lifetime: unlimited.<br />
- Generated certificate lifetime: unlimited.</p>
<p>- Creating analyzer prelude-manager.<br />
- Creating /etc/prelude/profile/prelude-manager&#8230;<br />
- Allocated ident for prelude-manager: 4232957740008155.<br />
- Generating RSA private key&#8230; This might take a very long time.<br />
[Increasing system activity will speed-up the process.]</p>
<p>- Generating 1024 bits RSA private key&#8230;</p>
<p>During the installation, the manager will create the profile for the <em>prelude</em> user. It can take a (very) long time, since GnuTLS tries to access <em>/dev/random</em> instead of <em>/dev/urandom</em> (for security reasons). This may change in the future (maybe using an option to have a faster generation, but crytographically less secure).</p>
<p>dbconfig will then ask you if you want it to configure the database automatically. If you don&#8217;t want to, just say no, and configure everything manually (the sql scripts are in directory <em>/usr/share/libpreludedb/</em>). Let&#8217;s suppose the answer is yes.</p>
<p><em>Note</em>: the number of questions may change, depending on debconf verbosity (set using <em>dpkg-reconfigure debconf</em>), and dbconfig parameters, in file <em>/etc/dbconfig-common/config.</em></p>
<p>configure database with dbconfig-common: yes<br />
database type:</p>
<p>Set the type to the database you previously installed. In this case mysql.</p>
<p>Database admin password: ******</p>
<p>dbconfig-common will ask for a password for the &#8216;prelude&#8217; user. If you don&#8217;t provide any (just pressing enter), it will generate a random one. Don&#8217;t worry, the configuration file will be update automatically.</p>
<p>dbconfig-common: writing config to /etc/dbconfig-common/prelude-manager.conf</p>
<p>Creating config file /etc/dbconfig-common/prelude-manager.conf with new version<br />
granting access to database prelude for prelude@localhost: success.<br />
verifying access for prelude@localhost: success.<br />
creating database prelude: success.<br />
verifying database prelude exists: success.<br />
populating database via sql&#8230; done.<br />
dbconfig-common: flushing administrative password<br />
Starting Prelude Manager: prelude-manager.</p>
<p>The Ubunty package automatically creates the user and the database for prelude. If you want to change the password, do so first in mysql and after in<em> /etc/prelude-manager/prelude-manager.conf</em>.</p>
<p>Prelude-Manager should now be running:</p>
<p>ps auxw | grep manager</p>
<p>prelude 28530 0.0 0.1 59384 4480 ? Ssl 13:49 0:00 /usr/sbin/prelude-manager</p>
<p>The first part is over, you now have a manager up and running.</p>
<p>Listen address:</p>
<p>The default listen address is localhost (127.0.0.1). This means that you have to change this to add sensors on different hosts in order for the agents to be able to reach the prelude-manager.</p>
<p>Edit  <em>/etc/prelude-manager/prelude-manager.conf</em>:</p>
<pre>listen = xxx.xxx.xxx.xxx</pre>
<p>Restart the server, and check the address (if you changed the address):</p>
<p># /etc/init.d/prelude-manager stop</p>
<p>Stopping Prelude Manager: prelude-manager.</p>
<p># /etc/init.d/prelude-manager start</p>
<p>Starting Prelude Manager: prelude-manager.</p>
<p># netstat -pantu | grep prelude</p>
<p>tcp 0 0 192.168.66.1:4690 0.0.0.0:* LISTEN 30544/prelude-manager</p>
<p>&nbsp;</p>
<h4>Prelude-LML</h4>
<p>You need to install <em>prelude-lml</em> on every host you want to monitor. Prelude-LML will analyze your logs and reports event to the managers.</p>
<p># apt-get install prelude-lml</p>
<p>&#8230;<br />
Starting Prelude LML: prelude-lml.</p>
<p>Before it can be used, two things needs to be done:</p>
<ul>
<li>The address of the manager must be configured on the lml</li>
<li>The manager won&#8217;t trust sensors, until they are registered</li>
</ul>
<p><em>Manager address</em></p>
<p>If you changed the address the manager is listening on, you need to change the address in the client config on every machine you install <em>prelude-lml</em> .</p>
<p>The adress of the manager is stored in file <em>/etc/prelude/default/client.conf</em>:</p>
<pre>[prelude]
server-addr = 127.0.0.1</pre>
<p><em>Registering the sensor</em></p>
<p>Registering the sensor is a four-step process, which requires to run commands on both the sensor and the manager:</p>
<p>On the LML client, run the register command:</p>
<p>prelude-adduser register prelude-lml &#8220;idmef:w&#8221; &lt;manager address&gt; &#8211;uid 0 &#8211;gid 0</p>
<p><em>Tip</em>: if you don&#8217;t remember the command, just run <em>prelude-lml</em>. Since it is not registered, it will fail, but is smart enough to display the help:</p>
<p># prelude-lml<br />
- Subscribing plugin pcre[default]<br />
- pcre plugin loaded 394 rules.<br />
- Monitoring /var/log/messages through pcre[default]<br />
* WARNING: /var/log/everything/current does not exist.<br />
prelude-client: error starting prelude-client: could not open &#8216;/etc/prelude/profile/prelude-lml/analyzerid&#8217; for reading</p>
<p>Profile &#8216;prelude-lml&#8217; does not exist. In order to create it, please run:<br />
prelude-adduser register prelude-lml &#8220;idmef:w&#8221; &lt;manager address&gt; &#8211;uid 0 &#8211;gid 0.</p>
<p>LML must be registered with uid and gid 0, since the process will be executed as root (to be able to analyze logs).</p>
<p>LML will then one for the One-Time Password(OTP), which will be provided by the manager:</p>
<p>Enter the one-shot password provided by the &#8220;prelude-adduser&#8221; program:<br />
- enter registration one-shot password:</p>
<p>On the manager, run the following:</p>
<p>prelude-adduser registration-server prelude-manager</p>
<p>&#8230;<br />
- Starting registration server.<br />
- generated one-shot password is &#8220;dummypass&#8221;.<br />
&#8230;</p>
<p>Enter the password to the LML prompt:</p>
<p>- enter registration one-shot password:<br />
- confirm registration one-shot password:<br />
- connecting to registration server (127.0.0.1:5553)&#8230;<br />
- Anonymous authentication to registration-server successful.<br />
- Sending certificate request.</p>
<p>The LML is now waiting for the Manager to sign the certificate.</p>
<p>On the manager, validate the certificate signing request:</p>
<p>- Anonymous authentication one-shot password check successful.<br />
- Waiting for client certificate request.<br />
- Analyzer with ID=&#8221;3559090256170900&#8243; ask for registration with permission=&#8221;idmef:w&#8221;.<br />
Approve registration [y/n]: y<br />
The certificate is generated and sent to the client:<br />
- Registering analyzer &#8220;3559090256170900&#8243; with permission &#8220;idmef:w&#8221;.<br />
- Generating signed certificate for client.<br />
- Sending server certificate to client.<br />
- ::ffff:127.0.0.1:47054 successfully registered.</p>
<p>On the client you will see:</p>
<p>LML registration is successful<br />
- Receiving signed certificate.<br />
- Receiving CA certificate.<br />
- prelude-lml registration to 127.0.0.1 successful.</p>
<p>Now, the manager and the sensor have a trust relation, and can send messages to each other.</p>
<p>This process takes some time, but it increases security and th communication between the sensor and the manager is encrypted.</p>
<p>Finally, the LML sensor should be up too:</p>
<p>/etc/init.d/prelude-lml start</p>
<p>Starting Prelude LML: prelude-lml.<br />
ps auxw | grep lml<br />
root 1946 0.3 0.0 20856 3424 ? Ss 14:35 0:00 /usr/bin/prelude-lml -d -q -P /var/run/prelude-lml.pid</p>
<p>This concludes the first part.</p>
<h3>Install Prewikka</h3>
<div></div>
<p>Prewikka is the graphical frontend to Prelude, using a web server.</p>
<p>&nbsp;</p>
<h4>Installation</h4>
<p>Prewikka requires two databases: one to get the Prelude alerts (which is the same as configured before), and one to store its own data (prewikka). Actually, the Ubuntu packages does only create the <em>prewikka</em> database, and does not configure access to Prelude alerts, so alert installation needs to be done manually.</p>
<p>&nbsp;</p>
<h4>Install Prewikka</h4>
<p>apt-get install prewikka</p>
<p>The package will install required dependencies (python, for ex), and will ask for the database configuration. As for Prelude, we choose to use dbconfig-common, give the administrator password and press enter for the DB password to let dbconfig-common generate one for us.</p>
<p>&nbsp;</p>
<h4>Configure Prelude-Manager Access</h4>
<p>Get the password from prelude-manager configuration file <em>/etc/prelude-manager/prelude-manager.conf </em>and edit prewikka configuration file <em>/etc/prewikka/prewikka.conf</em>:</p>
<p>vi /etc/prewikka/prewikka.conf</p>
<pre>[idmef_database]
type: mysql
host: localhost
user: prelude
pass: **********
name: prelude</pre>
<p>The [database] section is automatically configured by dbconfig-common, so do not modify it.</p>
<p>&nbsp;</p>
<h4>Web Server Configuration:</h4>
<p>The configuration is explained in file <em>/usr/share/doc/prewikka/README.Debian</em>. You can choose between 3 configurations:</p>
<ul>
<li>Apache / CGI setup with VirtualHost</li>
<li>Apache / mod_python setup with VirtualHost</li>
<li>Prewikka from the command line tool</li>
</ul>
<p>As an example I&#8217;ll use the <em>mod_python</em> setup.</p>
<p>apt-get install libapache2-mod-python</p>
<p>Add a VirtualServer to your apache configuration with the following content:</p>
<pre>NameVirtualHost *
&lt;VirtualHost *&gt;
        ServerAdmin admin@domain.com
        &lt;Location /&gt;
                SetHandler mod_python
                PythonHandler prewikka.ModPythonHandler
                PythonOption PrewikkaConfig /etc/prewikka/prewikka.conf
        &lt;/Location&gt;

        &lt;Location /prewikka&gt;
                SetHandler None
        &lt;/Location&gt;

        Alias /prewikka /usr/share/prewikka/htdocs
        Alias /htdocs /usr/share/prewikka/htdocs
&lt;/VirtualHost&gt;</pre>
<p>Restart you apache webserver and you can login to the prewikka interface.</p>
<p>Note: you can of course always us a setting for apache like:</p>
<pre>NameVirtualHost xxx.xxx.xxx.xxx:80
&lt;VirtualHost prewikka.yourdomain.tld:80&gt;</pre>
<p>This is usefull when you have other services running on your apache server.</p>
<p>&nbsp;</p>
<h3>Part 2: Installing And Configuring Snort</h3>
<p>I will not write the complete howto for this since there is a hwto for snort: <a rel="nofollow" target="_blank" href="http://howtoforge.org/intrusion-detection-with-snort-mysql-apache2-on-ubuntu-7.10-updated" target="_blank">Intrusion Detection: Snort, Base, MySQL, and Apache2 On Ubuntu 7.10 (Gutsy Gibbon) (Updated)</a>.</p>
<p>I&#8217;ll describe here the steps necessary to have <em>snort</em> logging to <em>prelude</em>. In this setup you also don&#8217;t need to install a <em>mysql</em> database and the base webinterface since <em>snort</em> will log to <em>prelude</em> and you can use the <em>prewikka</em> interface to see the <em>snort</em> alerts.</p>
<p>Follow all of the steps described in the howto above and replace the entry below with the new one:</p>
<p><em>Replace</em></p>
<p>./configure -enable-dynamicplugin &#8211;with-mysql<br />
make<br />
make install</p>
<p><em>With</em></p>
<p>./configure -enable-dynamicplugin &#8211;eanble-prelude<br />
make<br />
make install</p>
<p>Instead of doing:</p>
<p><em>Scroll down the list to the section with &#8220;<strong># output database: log, mysql, user=</strong>&#8220;, remove the &#8220;<strong>#</strong>&#8221; from in front of this line.<br />
Change the &#8220;<strong>user=root</strong>&#8221; to &#8220;<strong>user=snort&#8221;</strong>, change the &#8220;<strong>password=password</strong>&#8221; to &#8220;<strong>password=snort_password</strong>&#8220;, &#8220;<strong>dbname=snort</strong>&#8221;<br />
Make note of the username, password, and dbname. You will need this information when we set up the Mysql db.<br />
Save and quit.</em></p>
<p>Do:</p>
<p><em>Scroll down the list to the section with &#8220;# <strong>output alert_prelude: profile=snort</strong>&#8220;, remove the &#8220;#é in front of this line and that&#8217;s it.</em></p>
<p>From step 5 on (<strong>5. Set up the Mysql database.</strong>) everything can be skipped.</p>
<p>Now we have to register the snort agent to the <em>prelude manager</em>:</p>
<p>prelude-adduser register snort &#8220;idmef:w&#8221; &lt;manager address&gt; &#8211;uid snort &#8211;gid snort</p>
<p>On the <em>prelude manager</em> server:</p>
<p>prelude-adduser registration-server prelude-manager</p>
<p>This will register the snort agent to the prelude manager, as you did above for the prelude-lml.</p>
<p>Once the registration process is complete run:</p>
<p>snort -c /etc/snort/snort.conf</p>
<p>If everything goes right than you will see:</p>
<p>Initializing Network Interface eth0<br />
Decoding Ethernet on interface eth0<br />
- Connecting to 127.0.0.1:4690 prelude Manager server.<br />
- TLS authentication succeed with Prelude Manager.</p>
<p>The entry eth0 depends on the ethernet adapter you specified. Important is that you see that snort is connecting to the prelude manager server and tls authentication was successfull.</p>
<p>If the agent is connecting, and you see <em>snort</em> in the agent list of <em>prewikka</em> than you can stop the process with ctrl-c and issue:</p>
<p>snort -c /snort/snort.conf -D</p>
<p>to start <em>snort</em> as a daemon. In the line above you can always add -i ethX if you don&#8217;t listen on all network interfaces and want to specify a specific interface.</p>
<h3>Part 3 : Installing And Configuring Ossec</h3>
<div></div>
<p>First of all we will download and unpack the <em>ossec source</em>:</p>
<p>cd /src<br />
wget http://www.ossec.net/files/ossec-hids-1.4.tar.gz<br />
tar xvzf ossec-hids-1.4.tar.gz</p>
<p>Now do the following to add <em>prelude</em> support:</p>
<p>cd ossec-hids-xx<br />
cd src<br />
make setprelude</p>
<p>Then edit <em>Config.OS</em> and add <strong>-lgcc_s</strong> in all lines ahead <strong>-lpthread</strong> like this:</p>
<pre>CPRELUDE=-DPRELUDE -lprelude -pthread <strong>-lgcc_s</strong> -L/usr/lib -lprelude -lgnutls -lgcrypt -lrt -ldl</pre>
<p>The majority of this HOWTO is taken directly from the <a rel="nofollow" target="_blank" href="http://www.ossec.net/en/manual.html" target="_blank">Installation Manual</a> for OSSEC-HID which is a very easy to follow manual. If you run into trouble please look at the manual first as it will always have the most up to date information.</p>
<p>Now the easy part. Ossec comes with an install script <em>install.sh</em> which does all of the hard work for us.</p>
<p>cd ..<br />
./install.sh</p>
<p>Pick what language you want to read everything in and hit enter.</p>
<p>** Para instalação em português, escolha [br].<br />
** Fur eine deutsche Installation wohlen Sie [de].<br />
** For installation in English, choose [en].<br />
** Per l&#8217;installazione in Italiano, scegli [it].<br />
** Aby instalować w języku Polskim, wybierz [pl].<br />
** Türkçe kurulum için seçin [tr].<br />
(en/br/de/it/pl/tr) [en]: <strong> en &lt;enter&gt;</strong></p>
<p>Next it is going to warn us that we need a C compiler on the machine, and give you some general information about your computer (kernel version, user and host).</p>
<p>Go ahead and hit enter likes it says.</p>
<p>You are about to start the installation process of the OSSEC HIDS.<br />
You must have a C compiler pre-installed in your system.<br />
If you have any questions or comments, please send an e-mail<br />
to dcid@ossec.net (or daniel.cid@gmail.com).<br />
- System: Linux some information<br />
- User: root<br />
- Host: your hostname<br />
&#8211; Press ENTER to continue or Ctrl-C to abort. &#8211;</p>
<p>Next select a local install:</p>
<p>1- What kind of installation do you want (server, agent, local or help)? <strong>local &lt;enter&gt; </strong></p>
<p>Now choose were you want to install it. Use the default or change it if you want to. This howto however will assume the default location.</p>
<p>Choose where to install the OSSEC HIDS [/var/ossec]: <strong> &lt;enter&gt; </strong></p>
<p>Now select you notification options. You can choose answers used in this howto or different ones. I would recommend setting &#8220;Y&#8221; to everything. Active responses are really nice. It will set some default configuration variables based on your answers and certian things it finds on your system.</p>
<p>3- Configuring the OSSEC HIDS.</p>
<p>3.1- Do you want e-mail notification? (y/n) [y]: <strong>y</strong><br />
- What&#8217;s your e-mail address? <strong>youremail@yourdomain.com</strong><br />
- What&#8217;s your SMTP server ip/host? <strong>your smtp server address (localhost)</strong></p>
<p>3.2- Do you want to run the integrity check daemon? (y/n) [y]: <strong>y</strong></p>
<p>- Running syscheck (integrity check daemon).</p>
<p>3.3- Do you want to run the rootkit detection engine? (y/n) [y]: <strong>y</strong></p>
<p>- Running rootcheck (rootkit detection).</p>
<p>3.4- Active response allows you to execute a specific<br />
command based on the events received. For example,<br />
you can block an IP address or disable access for<br />
a specific user.<br />
More information at:</p>
<p>http://www.ossec.net/en/manual.html#active-response</p>
<p>- Do you want to enable active response? (y/n) [y]: <strong>y</strong></p>
<p>- Active response enabled.</p>
<p>- By default, we can enable the host-deny and the<br />
firewall-drop responses. The first one will add<br />
a host to the /etc/hosts.deny and the second one<br />
will block the host on iptables (if linux) or on<br />
ipfilter (if Solaris, FreeBSD or NetBSD).<br />
- They can be used to stop SSHD brute force scans,<br />
portscans and some other forms of attacks. You can<br />
also add them to block on snort events, for example.</p>
<p>- Do you want to enable the firewall-drop response? (y/n) [y]: <strong>y</strong></p>
<p>- firewall-drop enabled (local) for levels &gt;= 6</p>
<p>- Default white list for the active response:<br />
- 192.168.2.1</p>
<p>- Do you want to add more IPs to the white list? (y/n)? [n]: <strong>n</strong></p>
<p>3.6- Setting the configuration to analyze the following logs:<br />
&#8211; /var/log/messages<br />
&#8211; /var/log/auth.log<br />
&#8211; /var/log/syslog<br />
&#8211; /var/log/mail.info<br />
&#8211; /var/log/apache2/error.log (apache log)<br />
&#8211; /var/log/apache2/access.log (apache log)</p>
<p>- If you want to monitor any other file, just change<br />
the ossec.conf and add a new localfile entry.<br />
Any questions about the configuration can be answered<br />
by visiting us online at http://www.ossec.net .</p>
<p>&#8212; Press ENTER to continue &#8212;</p>
<p>Now it will compile everything. This shouldn&#8217;t take too long to complete. It only took around 1-2 minutes for my box. After it is completed press enter to finish.</p>
<p>- Unknown system. No init script added.<br />
- Configuration finished properly.<br />
- To start OSSEC HIDS:/var/ossec/bin/ossec-control start<br />
- To stop OSSEC HIDS:/var/ossec/bin/ossec-control stop<br />
- The configuration can be viewed or modified at /var/ossec/etc/ossec.conf<br />
Thanks for using the OSSEC HIDS.If you have any question, suggestion or if you find any bug,contact us at contact@ossec.net or using our public maill it atossec-list@ossec.net(http://mailman.underlinux.com.br/mailman/listinfo/ossec-list). More information can be found at http://www.ossec.net<br />
&#8212; Press ENTER to finish (maybe more information below). &#8212;</p>
<p>Now unfortunately it doesn&#8217;t detect Ubuntu so it will not create an init script. This is simple enough to take care of. (Yes, its basic. If you want to improve it please feel free to do so) Copy and paste the following into /etc/init.d/ossec:</p>
<pre>#!/bin/sh

case "$1" in
start)
  /var/ossec/bin/ossec-control start
;;
stop)
  /var/ossec/bin/ossec-control stop
;;
restart)
  $0 stop &amp;&amp; sleep 3
  $0 start
;;
reload)
  $0 stop
  $0 start
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac</pre>
<p>Now make it executable:</p>
<p>chmod +x /etc/init.d/ossec</p>
<p>Add it to our runlevels so it starts on boot:</p>
<p>update-rc.d ossec defaults</p>
<p><em>ossec.conf</em><em>/var/ossec/etc/ossec.conf</em><em>ossec</em><em>prelude:</em></p>
<pre>&lt;global&gt;
 ...
&lt;prelude_output&gt;yes&lt;/prelude_output&gt;
&lt;/global&gt;</pre>
<p>Finally we&#8217;ll add <em>ossec</em> as an agent in <em>prelude</em>:</p>
<p>prelude-adduser registration-server prelude-manager</p>
<p>On the management server do:</p>
<p>prelude-adduser register OSSEC &#8220;idmef:w&#8221; localhost &#8211;uid ossec &#8211;gid ossec</p>
<p>Note: The sensor name MUST be in uppercase &gt; OSSEC.</p>
<p>Start the ossec with init.d script powered by OSSEC (1.4 version should now detect ubuntu/debian OS and the init script will work!) or RShadow script.</p>
<p>If you see this you&#8217;r up and running.</p>
<p>Starting OSSEC HIDS v1.4 (by Daniel B. Cid)&#8230;<br />
Connecting to 127.0.0.1:4690 prelude Manager server.<br />
TLS authentication succeed with Prelude Manager.</p>
<p>Now go to the url where you installed <em>prewikka</em>, and login with the user admin and password admin. Change this password immediately in order to prevent unauthorized access.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html" title="ubuntu intrusion detection">ubuntu intrusion detection</a> (3)</li><li><a href="http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html" title="prelude ids debian">prelude ids debian</a> (2)</li><li><a href="http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html" title="ossec prelude centos ids">ossec prelude centos ids</a> (2)</li><li><a href="http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html" title="ubuntu install prelude-manager tar gz">ubuntu install prelude-manager tar gz</a> (2)</li><li><a href="http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html" title="apt-get install prelude-manager">apt-get install prelude-manager</a> (2)</li><li><a href="http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html" title="ubuntu ossec eth disabled">ubuntu ossec eth disabled</a> (2)</li><li><a href="http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html" title="prelude tar gz">prelude tar gz</a> (1)</li><li><a href="http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html" title="prelude prewikka database management">prelude prewikka database management</a> (1)</li><li><a href="http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html" title="prelude tar gz ids ubuntu">prelude tar gz ids ubuntu</a> (1)</li><li><a href="http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.html" title="prelude ossec ubuntu">prelude ossec ubuntu</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/security/intrusion-detection-snort-ids-ossec-hbids-prelude-hids-ubuntu-gutsy-gibbon.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-05-20 18:37:52 -->
