<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>LINICKX.com</title><link>https://www.linickx.com/</link><description></description><lastBuildDate>Thu, 12 Apr 2007 18:12:00 +0100</lastBuildDate><item><title>DenyHosts - Protecting against SSH Brute Force Attacks</title><link>https://www.linickx.com/denyhosts-protecting-against-ssh-brute-force-attacks</link><description>&lt;p&gt;If you look after a remote linux box, the chances are you use SSH, in
order to connect to it you may even have to leave PORT 22 open to the
whole Internet !&lt;/p&gt;
&lt;p&gt;There are some basic security steps that you can do to protect SSH, such
as block the root user from logging in, and force users to use STRONG
authentication.&lt;/p&gt;
&lt;p&gt;Even after you've done all you can,
&lt;a href="http://freshmeat.net/projects/logwatch/"&gt;logwatch&lt;/a&gt; will report that
people are still wasting your time &amp;amp; resource by trying to break in !
This is where &lt;a href="http://denyhosts.sourceforge.net/"&gt;DenyHosts&lt;/a&gt; step in,
it's a small script (&lt;em&gt;daemon&lt;/em&gt;) that keeps an eye on your SSH log file,
if it spots someone trying to Brute Force Attack your SSH accounts, it
adds them to hosts.deny (&lt;em&gt;it's like a firewall for some applications&lt;/em&gt;)
and stops them from being able to connect.&lt;/p&gt;
&lt;p&gt;I'm using redhat, so a pre-built &lt;a href="http://dag.wieers.com/rpm/packages/denyhosts/"&gt;rpm is
available&lt;/a&gt;, if you
already have DAG setup, you can use...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;yum install denyhosts
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I then had to run through the following steps (&lt;em&gt;as root&lt;/em&gt;).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mkdir /usr/share/denyhosts
mkdir /usr/share/denyhosts/data/
echo '127.0.0.1' &amp;gt; /usr/share/denyhosts/data/allowed-hosts
cd /usr/share/denyhosts
cp /usr/share/doc/denyhosts-2.6/denyhosts.cfg-dist ./denyhosts.cfg
cp /usr/share/doc/denyhosts-2.6/daemon-control-dist ./daemon-control
chmod 700 /usr/share/denyhosts/daemon-control
ln -s /usr/share/denyhosts/daemon-control /etc/init.d/denyhosts
ln -s /usr/share/denyhosts/denyhosts.cfg /etc/denyhosts.cfg
/sbin/chkconfig denyhosts on
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;once you've charged through that marathon, in /etc/denyhosts.cfg you may
want to take a look (&lt;em&gt;and change&lt;/em&gt;) the following settings (&lt;em&gt;Variables&lt;/em&gt;)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;PURGE_DENY =
ADMIN_EMAIL =
SMTP_FROM = DenyHosts &amp;lt;nobody@localhost&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;finally once you're happy, start the DenyHosts service&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/etc/init.d/denyhosts start
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now you're logwatch report will show how may tries they had, and then
Denied !&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Refused incoming connections: 1.2.3.4  (some.name.com ): 2 Time(s)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Of course one option commonly suggested is to change the SSH port number
from 22 to something else, where as this will reduce the amount of
attacks on the service, it does absolutely nothing to protect it; of
course you could do both, it's all a matter of choice :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nick</dc:creator><pubDate>Thu, 12 Apr 2007 18:12:00 +0100</pubDate><guid isPermaLink="false">tag:www.linickx.com,2007-04-12:denyhosts-protecting-against-ssh-brute-force-attacks</guid><category>Fedora</category><category>ips</category><category>Linux</category><category>redhat</category><category>Security</category><category>ssh</category></item><item><title>IDS vs IPS</title><link>https://www.linickx.com/ids-vs-ips</link><description>&lt;p&gt;Network Intrusion detection systems (&lt;em&gt;NIDS&lt;/em&gt;) , and Network Intrusion
Prevention (&lt;em&gt;NIPS&lt;/em&gt;) systems are a common complement to a firewall
implementation; couple this with Host IDS (&lt;em&gt;HIDS&lt;/em&gt;) or Host IPS (&lt;em&gt;HIPS&lt;/em&gt;)
and you've made a good start at implementing an advanced security
infrastructure ;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What's the difference ?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Sadly there's no hard an fast rule, what's important is understanding
what you're buying. Traditional IDS systems used sniffers &amp;amp; signatures
to detect attacks very similar to how virus's are found with AV; the
problem with this kind of system is that it relies on a signature being
available to recognize the attack; there is also a margin of error with
sniffer technology, this means it's possible to flood a network with
"safe" traffic, and then slip the attack in under the radar.&lt;/p&gt;
&lt;p&gt;Some consider the difference between IDS and IPS is that IPS is
proactive, as such it doesn't require a signature to detect the attack,
it just recognizes unacceptable behavior, the problem with this is that
any technology that can do this is very difficult and expensive to
implement.&lt;/p&gt;
&lt;p&gt;Others consider the difference between IDS and IPS is that IPS
implements a protective "shim" between the system and the attack; thus
if the attack is recognised then it can be blocked.&lt;/p&gt;
&lt;p&gt;Suddenly you can see how the two phrases get &lt;em&gt;muddled up&lt;/em&gt;, those
inventing intelligent systems to detect unknown or &lt;em&gt;Zero Day&lt;/em&gt; attacks
wanted a way to differentiate their technology from the rest; but IDS
vendors were easily able to adopt the "P", buy making their exiting
product work &lt;em&gt;in line&lt;/em&gt;thus providing "protection" rather an "detection".&lt;/p&gt;
&lt;p&gt;So I go back to my point, what's the difference between "D" &amp;amp; "P", find
out if the product you're buying uses signatures, and you'll get an idea
whether it's a re-vamped IDS or a Zero Day protection system ;)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nick</dc:creator><pubDate>Tue, 25 Apr 2006 11:59:00 +0100</pubDate><guid isPermaLink="false">tag:www.linickx.com,2006-04-25:ids-vs-ips</guid><category>ids</category><category>ips</category><category>Security</category></item></channel></rss>