<?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>TechniTip.Net &#187; attacks</title> <atom:link href="http://technitip.net/tag/attacks/feed" rel="self" type="application/rss+xml" /><link>http://technitip.net</link> <description>TechniTip.Net - Useful tips regarding technical stuff for things like Linux, MySQL, Apache, PHP, Linux Server, iPhone and more.</description> <lastBuildDate>Sun, 05 Sep 2010 09:32:08 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <image><link>http://technitip.net</link> <url>http://technitip.net/wp-content/plugins/maxblogpress-favicon/icons/favicon-66.ico</url><title>TechniTip.Net</title> </image> <item><title>Continous SSH Attacks</title><link>http://technitip.net/continous-ssh-attacks</link> <comments>http://technitip.net/continous-ssh-attacks#comments</comments> <pubDate>Sun, 12 Apr 2009 21:02:17 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[Linux Server]]></category> <category><![CDATA[attack]]></category> <category><![CDATA[attacks]]></category> <category><![CDATA[brute]]></category> <category><![CDATA[continious]]></category> <category><![CDATA[force]]></category> <category><![CDATA[ssh]]></category><guid isPermaLink="false">http://technitip.net/?p=887</guid> <description><![CDATA[As written in a previous article Defending Againt SSH Attacks I think it&#8217;s really worth trying to install a tool like denyhosts. Since about 5 days denyhosts blocks IP addresses from all over the world every few minutes. In total now more than 550 different blocked IP addresses. The reason seems that the IP address of [...]<div style="clear: both;"> <strong>Related posts:</strong><ol><li><a href='http://technitip.net/defending-againt-ssh-attacks' rel='bookmark' title='Permanent Link: Defending Againt SSH Attacks'>Defending Againt SSH Attacks</a></li><li><a href='http://technitip.net/putty-ssh-login-without-password-prompt' rel='bookmark' title='Permanent Link: PuTTY SSH Login Without Password Prompt'>PuTTY SSH Login Without Password Prompt</a></li><li><a href='http://technitip.net/ssh-client-for-the-iphone' rel='bookmark' title='Permanent Link: SSH Client for the iPhone'>SSH Client for the iPhone</a></li></ol></div>]]></description> <content:encoded><![CDATA[<p>As written in a previous article <a href="http://technitip.net/defending-againt-ssh-attacks" title="Defending Againt SSH Attacks">Defending Againt SSH Attacks</a> I think it&#8217;s really worth trying to install a tool like <a title="denyhosts" href="http://denyhosts.sourceforge.net/" target="_blank">denyhosts</a>. Since about 5 days denyhosts blocks IP addresses from all over the world every few minutes. In total now more than 550 different blocked IP addresses.</p><p>The reason seems that the IP address of my server has been added to a bot network which tries to hack servers using SSH brute force attacks. As far as I know such bot networks are built up  with Viruses and Trojans. I think there is no reason why your server may have also been added to such a list, somehow IP addresses seem to added.</p><p>But the question is how to defend against such brute force attacks from bot networks?</p><p><strong>Known Methods</strong></p><ul><li>Install a tool like <a title="denyhosts" href="http://denyhosts.sourceforge.net/" target="_blank">denyhosts</a></li><li>Always keep the SSH daemon up to date!</li><li>Move the SSH port from 22 to some other port</li><li>Disable password authentication and use key authentication</li><li>Slow down the amount of connections from the same IP using iptables and module &#8220;recent&#8221;</li><li>Open the SSH port after a trigger on a different port using iptables</li></ul><p>I think there is one additional easy method to defend against such attacks. Why I think so? Read on..</p><p><strong>Another Simple Method<br /> </strong></p><p>When checking the auth.log we see that the user names of the attacks are taken from a dictionary:</p><p><code>Failed	keyboard-interactive/pam	for	invalid	user	aderes from 195.xxx.xxx.xx port 39566 ssh2<br /> Failed	keyboard-interactive/pam	for	invalid	user	aderyn from 203.xxx.xxx.xx port 44099 ssh2<br /> Failed	keyboard-interactive/pam	for	invalid	user	adi from 78.xxx.xxx.xx port 42748 ssh2<br /> Failed	keyboard-interactive/pam	for	invalid	user	adia from 89. port 51028 ssh2<br /> Failed	keyboard-interactive/pam	for	invalid	user	adiel from 217. port 33861 ssh2<br /> Failed	keyboard-interactive/pam	for	invalid	user	adila from 77. port 52867 ssh2<br /> </code>It seems that the bots are not adding digits to the user names. So I think one easy method to defend against such attacks is:</p><ul><li><strong>add at least one digit to user names</strong> on your server if you have the possibility</li></ul><p>And definitely <strong>never ever</strong> add a user &#8220;admin&#8221;. In my logs the user &#8220;admin&#8221; is always used for brute force attacks:</p><p><code>Failed	keyboard-interactive/pam	for	invalid	user	admin from 203.xxx.xxx.xx port 39711 ssh2<br /> Failed	keyboard-interactive/pam	for	invalid	user	admin from 203.xxx.xxx.xx port 55493 ssh2<br /> Failed	keyboard-interactive/pam	for	invalid	user	admin from 220.xxx.xxx.xx port 34502 ssh2<br /> Failed	keyboard-interactive/pam	for	invalid	user	admin from 80.xxx.xxx.xx port 51846 ssh2<br /> Failed	keyboard-interactive/pam	for	invalid	user	admin from 80.xxx.xxx.xx port 53934 ssh2</code></p><div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ftechnitip.net%2Fcontinous-ssh-attacks&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height: 50px;"></iframe></div><div style="clear: both;"><p><strong>Related posts:</strong><ol><li><a href='http://technitip.net/defending-againt-ssh-attacks' rel='bookmark' title='Permanent Link: Defending Againt SSH Attacks'>Defending Againt SSH Attacks</a></li><li><a href='http://technitip.net/putty-ssh-login-without-password-prompt' rel='bookmark' title='Permanent Link: PuTTY SSH Login Without Password Prompt'>PuTTY SSH Login Without Password Prompt</a></li><li><a href='http://technitip.net/ssh-client-for-the-iphone' rel='bookmark' title='Permanent Link: SSH Client for the iPhone'>SSH Client for the iPhone</a></li></ol></p></div>]]></content:encoded> <wfw:commentRss>http://technitip.net/continous-ssh-attacks/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Defending Againt SSH Attacks</title><link>http://technitip.net/defending-againt-ssh-attacks</link> <comments>http://technitip.net/defending-againt-ssh-attacks#comments</comments> <pubDate>Tue, 30 Dec 2008 11:39:58 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[Linux Server]]></category> <category><![CDATA[attacks]]></category> <category><![CDATA[defending]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[ssh]]></category><guid isPermaLink="false">http://planlos.org/~harry/php/?p=56</guid> <description><![CDATA[As soon as you put a server online you will recognize many many attempts accessing the SSH port like these one: Dec 28 06:48:11 hostname sshd[12258]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=somehost.somewhere Dec 28 06:48:12 hostname sshd[12256]: error: PAM: User not known to the underlying authentication module for illegal user saman from [...]<div style="clear: both;"> <strong>Related posts:</strong><ol><li><a href='http://technitip.net/continous-ssh-attacks' rel='bookmark' title='Permanent Link: Continous SSH Attacks'>Continous SSH Attacks</a></li><li><a href='http://technitip.net/putty-ssh-login-without-password-prompt' rel='bookmark' title='Permanent Link: PuTTY SSH Login Without Password Prompt'>PuTTY SSH Login Without Password Prompt</a></li><li><a href='http://technitip.net/network-bandwidth-performance-measurement-with-iperf' rel='bookmark' title='Permanent Link: Network Bandwidth Performance Measurement with Iperf'>Network Bandwidth Performance Measurement with Iperf</a></li></ol></div>]]></description> <content:encoded><![CDATA[<p>As soon as you put a server online you will recognize many many attempts accessing the SSH port like these one:<br /> <code>Dec 28 06:48:11 hostname sshd[12258]: (pam_unix) authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=somehost.somewhere<br /> Dec 28 06:48:12 hostname sshd[12256]: error: PAM: User not known to the underlying authentication module for illegal user saman from somehost.somewhere<br /> Dec 28 06:48:13 hostname sshd[12256]: Failed keyboard-interactive/pam for invalid user saman from xx.xxx.xx.xxx port 27751 ssh2</code><br /> Annoying script kids&#8230; An easy method to protect at least a little bit against such attacks is a tool called <a title="denyhosts" href="http://denyhosts.sourceforge.net/" target="_blank">denyhosts</a>. I use it on all my servers because it&#8217;s easy to install. <a title="denyhosts" href="http://denyhosts.sourceforge.net/" target="_blank">denyhosts</a> automatically blocks ssh attacks by adding entries to /etc/hosts.deny.</p><p>Using debian Etch installation is really simple:</p><pre>apt-get install denyhosts</pre><p>Next edit /etc/denyhosts.conf and change:</p><pre>PURGE_DENY = 1w
PURGE_THRESHOLD = 0</pre><p>and start the daemon:</p><pre>/etc/init.d/denyhosts start</pre><p>That&#8217;s all. Sure it&#8217;s not a perfect solution which helps for everything, but nevertheless it will increase your security.</p><p>All you have to to now is wait and check the /etc/hosts.deny Depending on your configuration <a title="denyhosts" href="http://denyhosts.sourceforge.net/" target="_blank">denyhosts</a> will automatically delete expired entries.<br /> <span id="sample-permalink"><span id="editable-post-name" title="Klicken Sie, um diesen Teil des Permalinks zu bearbeiten."></span></span></p><div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ftechnitip.net%2Fdefending-againt-ssh-attacks&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height: 50px;"></iframe></div><div style="clear: both;"><p><strong>Related posts:</strong><ol><li><a href='http://technitip.net/continous-ssh-attacks' rel='bookmark' title='Permanent Link: Continous SSH Attacks'>Continous SSH Attacks</a></li><li><a href='http://technitip.net/putty-ssh-login-without-password-prompt' rel='bookmark' title='Permanent Link: PuTTY SSH Login Without Password Prompt'>PuTTY SSH Login Without Password Prompt</a></li><li><a href='http://technitip.net/network-bandwidth-performance-measurement-with-iperf' rel='bookmark' title='Permanent Link: Network Bandwidth Performance Measurement with Iperf'>Network Bandwidth Performance Measurement with Iperf</a></li></ol></p></div>]]></content:encoded> <wfw:commentRss>http://technitip.net/defending-againt-ssh-attacks/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>