<?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>BernadSatriani.NET &#124; Catatan Perjalanan &#187; ssh</title>
	<atom:link href="http://www.bernadsatriani.net/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bernadsatriani.net</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 11:28:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Antisipasi SSH Brute Force Attack</title>
		<link>http://www.bernadsatriani.net/2010/02/05/antisipasi-ssh-brute-force-attack/</link>
		<comments>http://www.bernadsatriani.net/2010/02/05/antisipasi-ssh-brute-force-attack/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 00:03:22 +0000</pubDate>
		<dc:creator>bernadsatriani</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[brute force]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.bernadsatriani.net/?p=302</guid>
		<description><![CDATA[Sebenarnya saya sudah malas menulis tutorial dan sejenisnya, tapi karena belakangan ini ada report dari temen temen masalah sering muncul log failed login ke ssh, yang kebanyakan dari IP luar. Ya, ini pasti brute force attack. Setelah googling kesana kesini, akhrinya dapat cara sederhana untuk mengantisipasi serangan brute force SSH #!/bin/bash #This script will monitor [...]]]></description>
			<content:encoded><![CDATA[<p>Sebenarnya saya sudah malas menulis tutorial dan sejenisnya, tapi karena belakangan ini ada report dari temen temen masalah sering muncul log failed login ke ssh, yang kebanyakan dari IP luar. Ya, ini pasti brute force attack.</p>
<p>Setelah googling kesana kesini, akhrinya dapat cara sederhana untuk mengantisipasi serangan brute force SSH</p>
<blockquote><p>#!/bin/bash<br />
#This script will monitor for failed login attempts and after a specified number of times add the ip to a deny list<br />
#Chad<br />
LOGFILE=”/var/log/secure”<br />
HOSTSDENY=”/etc/hosts.deny”<br />
BADCOUNT=”5″<br />
# read logfile and look for invalid login attemps<br />
grep sshd $LOGFILE |grep “Invalid user”| awk ‘{print $NF}’|sort|uniq -c|sort -n|sed “s/[[:space:]]*//” | while<br />
read i<br />
do<br />
# read number of failed attempts<br />
count=`echo $i | cut -d” ” -f1`<br />
# read ip address from failed attempt<br />
ip=`echo $i | cut -d” ” -f2`<br />
#check hostdeny file to see if IP already exist<br />
already=`grep $ip $HOSTSDENY | grep sshd`<br />
#if IP does not exist add it to hostdeny file<br />
if [ -z "$already"  ]<br />
then<br />
if [ "$count" -ge "$BADCOUNT" ]<br />
then<br />
echo “sshd: “$ip &gt;&gt; $HOSTSDENY<br />
fi<br />
fi<br />
done</p></blockquote>
<p><span id="more-302"></span>Simpan script di atas dan jalankan dengan cron. Disini kita memanfaatkan hosts.deny , sehingga untuk 5 kali failed login SSH, secara otomatis IP nya akan di masukkan ke dalam hosts.deny server</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bernadsatriani.net/2010/02/05/antisipasi-ssh-brute-force-attack/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>
