<?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>Attack of the Gamer &#187; Linux</title>
	<atom:link href="http://www.attackofthegamer.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.attackofthegamer.com</link>
	<description>When a gamer attacks</description>
	<lastBuildDate>Wed, 05 May 2010 13:16:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>HOWTO: Slow down and log bruteforce attacks on your Debian system</title>
		<link>http://www.attackofthegamer.com/2007/06/03/howto-slow-down-and-log-bruteforce-attacks-on-your-debian-system/</link>
		<comments>http://www.attackofthegamer.com/2007/06/03/howto-slow-down-and-log-bruteforce-attacks-on-your-debian-system/#comments</comments>
		<pubDate>Sun, 03 Jun 2007 18:30:18 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[bruteforce]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fail2ban]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.attackofthegamer.com/2007/06/03/howto-slow-down-and-log-bruteforce-attacks-on-your-debian-system/</guid>
		<description><![CDATA[This howto is going to assume you have a working Debian or Debian based system currently running. It is also intended to be copied and pasted directly into your telnet/ssh window. The package I am going to be using is called fail2ban. Fail2ban scans log files and bans IP addresses that produce too many failed [...]]]></description>
			<content:encoded><![CDATA[<p>This howto is going to assume you have a working Debian or Debian based system currently running.  It is also intended to be copied and pasted directly into your telnet/ssh window.</p>
<p>The package I am going to be using is called fail2ban.  Fail2ban scans log files and bans IP addresses that produce too many failed login attempts. It then updates firewall rules to reject the attackers IP address.</p>
<p><strong>Step 1</strong>:  Installing the fail2ban package</p>
<p>Type or copy and paste the following into your server.</p>
<blockquote><p>apt-get install fail2ban</p></blockquote>
<p>Once this is done, you are now setup and now you have to setup the configuration files.</p>
<p><strong>Step 2</strong>:</p>
<p>Edit /etc/fail2ban/fail2ban.conf</p>
<blockquote><p>nano -w /etc/fail2ban/fail2ban.conf</p></blockquote>
<p>Your fail2ban.conf should look something like this (the commented lines have been removed)</p>
<blockquote><p>[Definition]<br />
loglevel = 3<br />
logtarget = /var/log/fail2ban.log<br />
socket = /tmp/fail2ban.sock</p></blockquote>
<p><strong>Step 3</strong>:</p>
<p>Edit /etc/fail2ban/jail.conf</p>
<blockquote><p>nano -w /etc/fail2ban/jail.conf</p></blockquote>
<p>Your jail.conf should look something like this (again comments have been removed)</p>
<blockquote><p>[DEFAULT]<br />
ignoreip = 127.0.0.1<br />
bantime  = 18000<br />
maxretry = 3</p>
<p>backend = polling<br />
destemail = youremail@domain.com<br />
action = iptables[name=%(__name__)s, port=%(port)s]<br />
         mail-whois-lines[name=%(__name__)s, dest=%(destemail)s, logpath=%(logpath)s]</p>
<p>[ssh]</p>
<p>enabled = true<br />
port    = ssh<br />
filter  = sshd<br />
logpath  = /var/log/auth.log<br />
maxretry = 6</p>
<p>[apache]</p>
<p>enabled = false<br />
port    = http<br />
filter  = apache-auth<br />
logpath = /var/log/apache*/*access.log<br />
maxretry = 6</p>
<p>[apache-noscript]</p>
<p>enabled = false<br />
port    = http<br />
filter  = apache-noscript<br />
logpath = /var/log/apache*/*error.log<br />
maxretry = 6</p>
<p>[vsftpd]</p>
<p>enabled  = false<br />
port     = ftp<br />
filter   = vsftpd<br />
logpath  = /var/log/auth.log<br />
maxretry = 6</p>
<p>[proftpd]</p>
<p>enabled  = false<br />
port     = ftp<br />
filter   = proftpd<br />
logpath  = /var/log/proftpd/proftpd.log<br />
maxretry = 6</p>
<p>[wuftpd]</p>
<p>enabled  = false<br />
port     = ftp<br />
filter   = wuftpd<br />
logpath  = /var/log/auth.log<br />
maxretry = 6</p>
<p>[postfix]</p>
<p>enabled  = false<br />
port     = smtp<br />
filter   = postfix<br />
logpath  = /var/log/mail.log</p>
<p>[couriersmtp]</p>
<p>enabled  = true<br />
port     = smtp<br />
filter   = couriersmtp<br />
logpath  = /var/log/mail.log</p>
<p>[courierimap]</p>
<p>enabled  = true<br />
port     = imap2<br />
filter   = courierlogin<br />
failregex = imapd: LOGIN FAILED.*ip=\[.*:<HOST>\]<br />
logpath  = /var/log/mail.log<br />
maxretry = 5</p>
<p>[courierpop3]</p>
<p>enabled  = true<br />
port     = pop3<br />
filter   = courierlogin<br />
failregex = courierpop3login: LOGIN FAILED.*ip=\[.*:<HOST>\]<br />
logpath  = /var/log/mail.log<br />
maxretry = 5</p>
<p>[sasl]</p>
<p>enabled  = true<br />
port     = smtp<br />
filter   = sasl<br />
failregex = warning: [-._\w]+\[<HOST>\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed<br />
logpath  = /var/log/mail.log</p></blockquote>
<p>Please change the email section if you are going to directly copy and paste this config.  Right now, when someone attempts a bruteforce attack, fail2ban will firewall the ip address, and send an email to that email address with the whois information, and the log information from the attack.</p>
<p>You can now start/restart fail2ban,  I recommend using a restart just in case fail2ban is already running.</p>
<blockquote><p>/etc/init.d/fail2ban restart</p></blockquote>
<p>Please don&#8217;t use this as your only security measure.  This is just one step you can take to protecting your servers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.attackofthegamer.com/2007/06/03/howto-slow-down-and-log-bruteforce-attacks-on-your-debian-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: Prevent website bandwidth theft with .htaccess</title>
		<link>http://www.attackofthegamer.com/2007/05/08/howto-prevent-website-bandwidth-theft-with-htaccess/</link>
		<comments>http://www.attackofthegamer.com/2007/05/08/howto-prevent-website-bandwidth-theft-with-htaccess/#comments</comments>
		<pubDate>Wed, 09 May 2007 04:39:06 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[badwidth theft]]></category>
		<category><![CDATA[hotlinking]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://www.attackofthegamer.com/2007/05/08/howto-prevent-website-bandwidth-theft-with-htaccess/</guid>
		<description><![CDATA[Some people can be so ignorant. Nothing aggravates me more than a forum user who hotlinks an image or file from your site on a popular forum, but when webmasters create file repositories, and all of the files are linked from other peoples servers. Without permission. I&#8217;m sure there are many ways to prevent these [...]]]></description>
			<content:encoded><![CDATA[<p>Some people can be so ignorant.  Nothing aggravates me more than a forum user who hotlinks an image or file from your site on a popular forum, but when webmasters create file repositories, and all of the files are linked from other peoples servers.  Without permission.</p>
<p>I&#8217;m sure there are many ways to prevent these people from harvesting your bandwidth, if you use apache with mod_rewrite, just by adding a couple lines of text to a file called .htaccess will do wonders.</p>
<p><strong>What is Hotlinking?</strong></p>
<p>Straight from <a href="http://en.wikipedia.org/wiki/Hotlinking" target="_blank">Wikipedia</a>:</p>
<p><strong>Hotlinking</strong> aka. <strong>Inline linking</strong> is the placing of a linked object, often an image, from one site into a web page belonging to a second site. The second site is said to have an inline link to the site where the object is located. Inline linking is also known as <strong>leeching</strong>, <strong>direct linking</strong> or <strong>bandwidth theft</strong>.</p>
<p>Let&#8217;s start by opening up a text editor and creating a file called .htaccess  In this file you want to put something like this:</p>
<p><code><IfModule mod_rewrite.c><br />
RewriteEngine On<br />
RewriteCond %{HTTP_REFERER} !^$<br />
RewriteCond %{HTTP_REFERER} !^http://(www\.)?attackofthegamer.com/.*$ [NC]<br />
RewriteRule \.(gz|zip|rar|gif|jpg|js|css)$ - [F]<br />
</IfModule></code></p>
<p>Basically what this does is check if a request to any file with a .gz .zip .rar .gif .jpg .js .css extension comes from the referring URL http://www.attackofthegamer.com  If the request comes from a referral that isn&#8217;t http://www.attackofthegamer.com it&#8217;s rejected.  You will want to swap the domain for your own to make it work.</p>
<p>If you are just protecting images. You can mess with the culprit and change the image on them to something of your choice, with a comical outcome.  Just create a .htaccess file that looks like this.</p>
<p><code>RewriteEngine on<br />
RewriteCond %{HTTP_REFERER} !^$<br />
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]<br />
RewriteRule \.(png|gif|jpg)$ http://www.mydomain.com/badimage.gif [R,L]</code></p>
<p>Just change the domain name, and the url to the image you want to swap with and you are set.  Once you have the .htaccess file created use your FTP program and upload it to each directory you want to protect.</p>
<p>Voila, you should now be protecting against bandwidth pirates.  Happy Hunting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.attackofthegamer.com/2007/05/08/howto-prevent-website-bandwidth-theft-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
