<?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>Sekiur My Thoughts &#187; attack</title>
	<atom:link href="http://blog.sekiur.com/tag/attack/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sekiur.com</link>
	<description>VoIP, Mobility, Security, Open Source, Science, Politics, and Technology.</description>
	<lastBuildDate>Wed, 24 Aug 2011 19:46:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Safeguard Against Random Password Hacks</title>
		<link>http://blog.sekiur.com/2009/02/safeguard-against-random-password-hacks/</link>
		<comments>http://blog.sekiur.com/2009/02/safeguard-against-random-password-hacks/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 21:08:55 +0000</pubDate>
		<dc:creator>Jose Vicente Ortega</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[attack]]></category>
		<category><![CDATA[fail2ban]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[ids]]></category>
		<category><![CDATA[Intrusion Prevention System]]></category>
		<category><![CDATA[ips]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.sekiur.com/?p=735</guid>
		<description><![CDATA[<a href="http://commons.wikipedia.org/wiki/Image:Internet_map_1024.jpg"></a> Image via <a href="http://commons.wikipedia.org/wiki/Image:Internet_map_1024.jpg">Wikipedia</a> <p>A great tool I ran across to protect your server from random password attacks which I have been receiving recently from China.</p> <p><a class="zem_slink" title="Fail2ban" rel="homepage" href="http://www.fail2ban.org/">Fail2ban</a> scans log files and bans IP addresses that make repeated, unsuccessful attempts to access the server and then it updates the IPtables [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignleft" style="width: 212px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Internet_map_1024.jpg"><img title="Partial map of the Internet based on the Janua..." src="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Internet_map_1024.jpg/202px-Internet_map_1024.jpg" alt="Partial map of the Internet based on the Janua..." height="202" width="202"></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Internet_map_1024.jpg">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>A great tool I ran across to protect your server from random password attacks which I have been receiving recently from China.</p>
<p><a class="zem_slink" title="Fail2ban" rel="homepage" href="http://www.fail2ban.org/">Fail2ban</a> scans log files and bans IP addresses that make repeated, unsuccessful attempts to access the server and then it updates the IPtables rules to reject those IP addresses for a period of time which is defined by you. It can also be configured to notify you if once these events occur.</p>
<p>Its no high-end <a class="zem_slink" title="Intrusion-prevention system" rel="wikipedia" href="http://en.wikipedia.org/wiki/Intrusion-prevention_system">Intrusion Prevention System</a>, but it does the job.</p>
<p>Fail2ban comes preconfigured to detect and block attacks to ports 22 (ssh), 25 (SMTP) and 80 (http). Instructions on installing on <a class="zem_slink" title="CentOS" rel="homepage" href="http://www.centos.org/">CentOS</a> are detailed below as well as adding functionality for ProFTPD.</p>
<p>I love package management as opposed to compiling because its clean and easy to maintain, so we will need to subscribe to repositories to install Fail2ban.</p>
<p><strong>* </strong><strong>Update the system </strong></p>
<p>yum update</p>
<p><strong>* </strong><strong>Install DAG’s GPG key </strong></p>
<p>rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt</p>
<p><strong>* </strong><strong>Verify the package you have downloaded</strong></p>
<p>rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm</p>
<p>Security warning: The rpmforge-release package imports GPG keys into your RPM database. As long as you have verified the package and trust Dag then it should be safe.</p>
<p><strong>* </strong><strong>Download and Install the package </strong></p>
<p>wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm<br />
rpm -ivh rpmforge-release-0.3.6-1.el5.rf.*.rpm</p>
<p>This will add a yum repository config file and import the appropriate GPG keys. At this point, you can set the priority of the RPMForge repository, and also of the CentOS repositories if you have not done so yet.</p>
<p><strong>* </strong><strong>Test with this command: </strong></p>
<p>yum check-update</p>
<p><strong>* </strong><strong>Update the system </strong></p>
<p>yum update</p>
<p><strong>* Install Fail2ban</strong></p>
<p>yum install fail2ban</p>
<p><strong>* Configure Fail2ban</strong> by editing and adding to /etc/fail2ban.conf</p>
<p>maxfailures = 3 (the default is 5)</p>
<p>ignoreip = 127.0.0.1 &lt;the_server_IP&gt; &lt;network_you_want_excluded/24&gt;</p>
<p><strong>* Enable E-Mail Notification</strong></p>
<p>[MAIL]<br />
# Option:&nbsp; enabled<br />
# Notes.:&nbsp; enable mail notification when banning an IP address.<br />
# Values:&nbsp; [true | false]&nbsp; Default:&nbsp; false<br />
#<br />
enabled = true</p>
<p>to = &lt;your_email_address&gt;</p>
<p><strong>* Add ProFTPD functionality</strong></p>
<p>[proftpd]<br />
enabled = true<br />
logfile = /var/log/secure<br />
fwstart = <a class="zem_slink" title="Iptables" rel="homepage" href="http://www.netfilter.org/">iptables</a> -N fail2ban-proftpd<br />
iptables -I INPUT -p tcp &#8211;dport ftp -j fail2ban-proftpd<br />
iptables -A fail2ban-proftpd -j RETURN<br />
fwend = iptables -D INPUT -p tcp &#8211;dport ftp -j fail2ban-proftpd<br />
iptables -F fail2ban-proftpd<br />
iptables -X fail2ban-proftpd<br />
fwcheck = iptables -L INPUT | grep -q fail2ban-proftpd<br />
fwban = iptables -I fail2ban-proftpd 1 -s &lt;ip&gt; -j DROP<br />
fwunban = iptables -D fail2ban-proftpd -s &lt;ip&gt; -j DROP<br />
timeregex = \S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}<br />
timepattern = %%b %%d %%H:%%M:%%S<br />
failregex = Maximum login attempts|no such user found|Failed password</p>
<p><strong>* Set it to startup automatically with the system</strong></p>
<p>chkconfig &#8211;levels 235 fail2ban on</p>
<p><strong>* Start Fail2ban and walk away</strong></p>
<p>/etc/init.d/fail2ban start</p>
<p style="text-align: center;"><script type="text/javascript"><!--
google_ad_client = "pub-3340920433757461";
google_ui_features = "rc:10";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";

//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.linux.com/feature/149492">Security scans with OpenVAS</a> (linux.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.linux.com/feature/149491">Monitor your network with GroundWork Monitor Community Edition</a> (linux.com)</li>
<li class="zemanta-article-ul-li"><a href="http://arnoldit.com/wordpress/2008/12/17/logrhythm-analysis-and-search-of-log-files/">LogRhythm: Analysis and Search of Log Files</a> (arnoldit.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.channelweb.co.uk/crn/news/2231802/security-market-growing">IT security market still growing</a> (channelweb.co.uk)</li>
<li class="zemanta-article-ul-li"><a href="http://www.linux.com/feature/152460">Access remote network services with SSH tools</a> (linux.com)</li>
<li class="zemanta-article-ul-li"><a href="http://britg.com/2008/10/23/getting-rid-of-ssh-or-sftp-delay/">Getting Rid of SSH or SFTP Delay</a> (britg.com)</li>
</ul>
<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/028ed8ed-982f-489c-91c0-83d91bf007f3/" title="Zemified by Zemanta"><img style="border: medium none ; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=028ed8ed-982f-489c-91c0-83d91bf007f3" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.sekiur.com/2009/02/safeguard-against-random-password-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

