<?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>Webmasters Blog - Salem-News.com &#187; Security</title>
	<atom:link href="http://designs.salem-news.com/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://designs.salem-news.com</link>
	<description>Matts Design Blog Salem-News.com</description>
	<lastBuildDate>Mon, 10 Aug 2009 02:26:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Responsiblity</title>
		<link>http://designs.salem-news.com/2007/11/13/responsiblity/</link>
		<comments>http://designs.salem-news.com/2007/11/13/responsiblity/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 04:44:29 +0000</pubDate>
		<dc:creator>matt.lintz</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://designs.salem-news.com/2007/11/13/responsiblity/</guid>
		<description><![CDATA[Over the last few months I have come to the realization that the only way to reduce spam and other cyber crimes is to not only do what I can to keep them from using my services for those purposes but to do what I can to keep them from using others.

Deleting spam in my [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last few months I have come to the realization that the only way to reduce spam and other cyber crimes is to not only do what I can to keep them from using my services for those purposes but to do what I can to keep them from using others.<br />
<span id="more-24"></span><br />
Deleting spam in my inbox or bulk folder does nothing to stop future spam or those that profit from it. Finding ways to stop abusers from using my site should include ways to stop them from using anyones resources for criminal purposes.</p>
<p>Currently many <em>(More than one is to many)</em> US Government websites are under the control of criminals. <a href="http://blog.wired.com/27bstroke6/2007/11/finding-hacked-.html">Finding Hacked Goverment and School Web Sites</a> Try a Google Search for <em>site:*.gov porn</em> or swap the words for other terms and you will most likely turn up sites that redirect to obviously not Government sites for pornography or Malware downloads.</p>
<p>Now it is understandable that sometimes hackers win a battle and gain control over something they shouldn&#8217;t. But it has been days since I first read of this and began finding sites owned by hackers. This should not be and the agencies involved should be far quicker at fixing the problem or lose their right to be responsible for maintaining a public website.<br />
<b>My email to one of the websites hacked.</b></p>
<blockquote><p>
I understand that sometimes sites become hacked but you should be far<br />
quicker at shutting down or correcting the problem. Or you should not<br />
be allowed on the Internet.
</p></blockquote>
<p>Now I receive from multiple sources spam emails and blog postings. I could just quickly delete them and move on but that does little to fight the problem. By contacting the sources and eventual domain name destinations of these attacks far more can be accomplished.</p>
<p>Most of my spam both email and blog spam comes from commen peoples computer or advertises sites that are quick and easy to put up or hide behind a URL redirection services. At least one of them <a href="http://110mb.com">110mb.com</a> a free hosting site quickly responds and removes the offending site.: </p>
<blockquote><p>Site has been removed.</p>
<p>Thank you for reporting it.</p>
<p>Best Regards,<br />
110mb.com Abuse
</p></blockquote>
<p>Or on the opposite end a supposedly well intentioned URL redirection service offers no contact to report abusers. <em>(Approximatly 25% of Salem-News.com comment spam uses RubyURL services to mask themselves)</em></p>
<blockquote><p>
The team behind RubyURL hates spam just as much as you do.</p>
<p>Unfortunately, we cannot prevent people from using the RubyURL service and pasting links into spam emails, wiki pages, and blog comments. If you found your way to RubyURL due to spamming, please to report the offending RubyURL and we&#8217;ll flag it for review.</p>
<p>Thanks!<br />
-The RubyURL team
</p></blockquote>
<p>In order to ever keep the Internet somewhat secure people must do more than just ignore or delete problems they must join the fight against it or criminals will always win.</p>
<p><strong>The least you can do</strong></p>
<ul>
<li>Install up to date anti virus software <em>(A large amount of spam and malware distribution comes from zombied computers)</em></li>
<li>Install and configure a firewall</li>
</ul>
<p><strong>The better you can do</strong></p>
<ul>
<li>Learn to track spam sources(<a href="http://www.rahul.net/falk/mailtrack.html">Spam Tracking</a>)</li>
<li>If you can not keep yourself secure do not connect to the Internet until you can</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://designs.salem-news.com/2007/11/13/responsiblity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Denial of Service Day Three</title>
		<link>http://designs.salem-news.com/2007/11/08/denial-of-service-day-three/</link>
		<comments>http://designs.salem-news.com/2007/11/08/denial-of-service-day-three/#comments</comments>
		<pubDate>Fri, 09 Nov 2007 06:23:11 +0000</pubDate>
		<dc:creator>matt.lintz</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://designs.salem-news.com/2007/11/08/denial-of-service-day-three/</guid>
		<description><![CDATA[On Monday November 5th I realized we were undergoing a Denial of Service attack aimed at draining bandwidth. I believe it started rather weak in October but I began to notice the Kilobytes of traffic had grown far higher then it should based on other traffic statistics. See: Day 1 Analyzing and adjusting on day [...]]]></description>
			<content:encoded><![CDATA[<p>On Monday November 5<sup>th</sup> I realized we were undergoing a Denial of Service attack aimed at draining bandwidth. I believe it started rather weak in October but I began to notice the Kilobytes of traffic had grown far higher then it should based on other traffic statistics. See: <a href="http://designs.salem-news.com/2007/11/07/bandwidth-ddos-attack/" title="Bandwidth DDOS Attack">Day 1</a> Analyzing and adjusting on day two: <a href="http://designs.salem-news.com/2007/11/07/the-denial-of-service-attack-continues/" title="The Denial of Service Attack Continues">Day Two</a></p>
<p><span id="more-23"></span></p>
<p>The flow of hits from this attack continues peaking during the day and slowing down quite a bit at night. Bandwidth is back to normal range with the 403 redirects but they are still getting at new images so someone or bot with a different signature is picking the images for the rest.</p>
<p>Today I just focused on monitoring the logs to see if there were any changes in their pattern, and hopefully finding out how they were getting new images into their que. </p>
<p>I put a large chunk of the Java1.* user agents suspected of being bots into a database for easier searching: <a href="http://designs.salem-news.com/ddos_hits.php">Suspected DDOS hits Page</a> containing 9,735 unique IPs with 91966 requests (most of them 403&#8242;d).</p>
<p>Because my mod_rewrite to block user agents that match ^Java/1.* the user agent must begin with J this one <a href="http://designs.salem-news.com/ddos_hits.php?showthis=ip&#038;ip=70.81.196.195">70.81.196.195</a><br />
<strong>Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_02</strong> which matched the pattern of nothing but continual image loading made it through.</p>
<p>Now I want to be real careful not to block legitimate traffic so I added a redirect for exactly that user agent as I do not believe it is real.<br />
<code>RewriteCond %{HTTP_USER_AGENT} ^Mozilla/4\.0\ \(Windows\ XP\ 5\.1\)\ Java/1 [NC,OR]</code></p>
<p>While still nothing near a <a href="http://www.scmagazineus.com/Al-Qaeda-cyber-jihad-threat-dismissed-by-researchers/article/96294/" title="Al Qaeda cyber-jihad threat dismissed by researchers">serious threat</a> it would be for a site with a lower monthly bandwidth allowance.</p>
<p><strong>Lessons Learned So Far</strong></p>
<p><b>(1)</b> Keep more than 5 logs. I&#8217;ve always browsed over my logs and let them disappear. I didn&#8217;t see a need to have them. Now I wish I could look over last months logs to see when this actually began. I will keep for an indefinite time now as space is not an issue. Perhaps work on the quick script I wrote to import the suspected bot hits and routinely insert the newest available logs as the ability to do some quick sql to find patterns would be quite nice.</p>
<p><b>(2)</b> Some IP&#8217;s and User Agents are no good, traffic will not be hurt by shutting them down. While looking for information on this attack noticed how many spam bots and content scrapers were activly abusing the site and added these three even though I&#8217;m sure some legitimate people may use them.<br />
<code><br />
RewriteCond %{HTTP_USER_AGENT} ^Jakarta [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^libwww-perl [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^Wget<br />
</code></p>
<p>I might later change the 403 redirect to a custom page alerting the actual user that their user agent is not acceptable because of abuses by others, but I&#8217;m assuming very few actual visitors use that form to access the site.</p>
<p><b>(3)</b> Better understanding of the Linux command line. I&#8217;ve always just spit out my log files with cat and occassionally <a href="http://www.gnu.org/software/grep/doc/">grep</a>ed that to narrow what comes back, but still not fully using all of the available tools to show me exactly what I wanted.</p>
<p>Show me all the 403 hits in the current log<br />
>cat /var/log/httpd/access_log | grep \ 403\<br />
69.108.125.30 &#8211; - [08/Nov/2007:21:54:48 -0800] &#8220;GET /stimg/november082007/simpson_oj_350.jpg HTTP/1.1&#8243; 403 241 &#8220;-&#8221; &#8220;Java/1.5.0_12&#8243;<br />
I had tried this before but woudl get every hit that had the number 403 in it. Escaping the space before and after the 403 requires that 403 be seperated like a real 403 line would.<br />
Without escapes this one and lots of other lines match because 4034 (size in bytes) counts as a match.</p>
<p>66.249.66.199 &#8211; - [08/Nov/2007:22:14:33 -0800] &#8220;GET /index.php HTTP/1.1&#8243; 200 4034 &#8220;-&#8221; &#8220;Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)&#8221;</p>
<p>Show me every hit with no referer and no user agent. (first &#8220;-&#8221; is user agent second is referer)<br />
>cat /var/log/httpd/access_log | grep \&#8221;\-\&#8221;\ \&#8221;\-\&#8221;<br />
Everything must be \escaped<br />
I have noticed a few requests for RSS feeds and favicons with no useragent or referer but as a percentage of total hits quite low and not worth the costs of allowing the attackers to succeed in using up bandwidth.</p>
<p><b>(4)</b> The writers of Salem-News.com upload one or more pictures for each article they post. I have warned in the past that they should optimize the file size before uploading. Of course they do not and a look at the size of the images these bots were aiming for were all 3 to 5 times the needed file size. I manually optimized and re-uploaded some of these reducing most from 80 to 120k to 20 to 30k.</p>
<p>Instead of hoping they follow my <em>suggestions</em> I will recode the image uploader to put it through an <a href="http://www.ebrueggeman.com/article_php_image_optimization.php">optimization</a> step right after upload. This will not only reduce the damage that can be done by this type of attack but will reduce download times for all.</p>
<p>I will continue monitoring this and updating the Suspected DDOS hits Page and writing again if the attack pattern changes or stops.</p>
]]></content:encoded>
			<wfw:commentRss>http://designs.salem-news.com/2007/11/08/denial-of-service-day-three/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The Denial of Service Attack Continues</title>
		<link>http://designs.salem-news.com/2007/11/07/the-denial-of-service-attack-continues/</link>
		<comments>http://designs.salem-news.com/2007/11/07/the-denial-of-service-attack-continues/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 03:22:46 +0000</pubDate>
		<dc:creator>matt.lintz</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://designs.salem-news.com/2007/11/07/the-denial-of-service-attack-continues/</guid>
		<description><![CDATA[Yester day I noticed that Salem-News.com was under a Distributed Denial of Service Attack (DDOS) that seemed to be aimed at using up bandwidth as at its highest rate was no more than 60 per minute and averaging less than 30 per minute, all aimed at images. See: Bandwidth DDOS Attack.  
After stopping the [...]]]></description>
			<content:encoded><![CDATA[<p>Yester day I noticed that Salem-News.com was under a Distributed Denial of Service Attack (DDOS) that seemed to be aimed at using up bandwidth as at its highest rate was no more than 60 per minute and averaging less than 30 per minute, all aimed at images. See: <a href="http://designs.salem-news.com/2007/11/07/bandwidth-ddos-attack/">Bandwidth DDOS Attack</a>.  </p>
<p>After stopping the bandwidth waste with mod_rewrite it was time to poor through the log files to try and get some more information on how this was happening.<br />
<span id="more-22"></span><br />
This morning  Wednesday November 7<sup>th</sup> the hits from the bots where about the same even though they had been receiving  <b>403 Forbidden</b> pages for more than 12 hours.</p>
<p>Rarely did one single bot hit more than 4 or 5 times an hour which I&#8217;m assuming must be on purpose to keep the owners of infected PCs from noticing and actually doing anything to keep them free from viruses and trojans.</p>
<p>I noticed however that they had added new images to their list of files being downloaded. This meant that something other than the bots doing the downloading was selecting the images on their behalf.</p>
<p>I had uploaded a set of images for the comic <a href="http://salem-news.com/notabene/index.php">Nota Bene</a> and noticed within 20 minutes one of them was in the rotation of images being downloaded. In order for these bots to have the address of this image someone or other bot without a user agent of Java/1.(various) and must have visited within 20 minutes of the image being uploaded.</p>
<p>(image uploaded at about 8:05 IP&#8217;s not shown for possible privacy reasons)<br />
<code><br />
cat /var/log/httpd/access_log | grep nota_bene-67.jpg<br />
***.**.**.*** - - [07/Nov/2007:08:18:05 -0800] "GET /stimg/november072007/nota_bene-67.jpg HTTP/1.1" 200 23919 "-" "-"<br />
***.**.**.*** - - [07/Nov/2007:08:22:56 -0800] "GET /stimg/november072007/nota_bene-67.jpg HTTP/1.1" 403 239 "-" "Java/1.6.0_03"<br />
</code></p>
<p>All of the hits for the image seemed normal but two, one of the Java bots that got a 403 error as expected and one 4 minutes prior to the first bot hit on that image. It contained no referrer and no user agent. </p>
<p>I parsed all of the log files for instances of that IP and it was scattered about and was only found to have accessed image directories and images not one page or non image hit. A whois of that IP showed it to be an AOL IP address.</p>
<p>I firewall blocked the IP wich I knew wouldn&#8217;t last too long as AOL IPs are quite dynamic and within 15 minutes it was back with a slightly different IP. So I added to my mod_rewrite block of the Java/1. to no longer allow an empty user agent as well.</p>
<p><code><br />
RewriteCond %{HTTP_USER_AGENT} ^-?$ [OR]<br />
RewriteCond %{HTTP_USER_AGENT} ^Java/1.*<br />
RewriteRule ^.* - [F,L]<br />
</code></p>
<p>Now this may block some legitimate traffic but it should be minimum and I may write a custom page for those without a proper user agent set to be redirected to explaining why they can not view the site.</p>
<p>Commands I run from time to time to see how many are being blocked. First line shows someones RSS reader getting a 403<br />
<code><br />
cat /var/log/httpd/access_log | grep \ 403\ </p>
<p>***.**.**.*** - - [07/Nov/2007:18:58:59 -0800] "GET /index.rss HTTP/1.0" 403 211 "-" "-"<br />
***.**.**.*** - - [07/Nov/2007:18:59:01 -0800] "GET /stimg/november072007/dow_jones.jpg HTTP/1.1" 403 236 "-" "Java/1.6.0-oem"<br />
***.***.**.*** - - [07/Nov/2007:18:59:2 -0800] "GET /stimg/november072007/cheney310.jpg HTTP/1.1" 403 236 "-" "Java/1.5.0_10"<br />
</code></p>
<p>I have not yet had time to fully analyze the log files to see how many unique bots are involved but I roughly estimate at more than 1500 hitting approximatly 400,000 times over the last 3 days.  Todays Bandwidth usage was 1/3<sup>rd</sup> that of yesterday and 1/8<sup>th</sup> of Mondays even though the real visitor and page count is higher.</p>
<p>Now I&#8217;m going to have to assume if they want to continue and actually do some damage they will have to alter their user agent string. I&#8217;m hoping this won&#8217;t be easily done as it would be much harder to stop.</p>
<p><img src="/images/11041107_traffic.png" alt="Traffic Chart for november 4 though november 7" /><br />
(The last spike was from Digg on a news story)</p>
]]></content:encoded>
			<wfw:commentRss>http://designs.salem-news.com/2007/11/07/the-denial-of-service-attack-continues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bandwidth DDOS Attack</title>
		<link>http://designs.salem-news.com/2007/11/07/bandwidth-ddos-attack/</link>
		<comments>http://designs.salem-news.com/2007/11/07/bandwidth-ddos-attack/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 08:08:38 +0000</pubDate>
		<dc:creator>matt.lintz</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://designs.salem-news.com/2007/11/07/bandwidth-ddos-attack/</guid>
		<description><![CDATA[Sunday(Nov. 4th) while reviewing the stats for Salem-News I noticed the KiloBytes of traffic for the day had more than doubled without a corresponding doubling of the page views.
An investigation began into what could be causing this to happen. Some possible reasons that came to mind:

Large image files used in heavy hitting stories
Heavy spider / [...]]]></description>
			<content:encoded><![CDATA[<p>Sunday(Nov. 4<sup>th</sup>) while reviewing the stats for Salem-News I noticed the KiloBytes of traffic for the day had more than doubled without a corresponding doubling of the page views.</p>
<p>An investigation began into what could be causing this to happen. Some possible reasons that came to mind:
<ul>
<li>Large image files used in heavy hitting stories</li>
<li>Heavy spider / bot traffic</li>
<li>Corrupted log file / analyzer</li>
</ul>
<p>It ended up being what I believe to be a large scale bandwidth sapping DDOS<sup><a href="http://www.answers.com/DDOS" title="DDOS definition">?</a></sup><br />
<span id="more-21"></span><br />
The log files looked normal with visits up so I wrote it off a paranoia. But by Monday I knew something was up. The bandwidth for the day was five times that of Sunday with only a 10% increase in other visitors and page views.</p>
<p>A heavy review of log files showed lots of traffic with variations of the following User-Agents: &#8220;Java/1.6.0_03&#8243;,&#8221;Java/1.6.0_02&#8243;,&#8221;Java/1.5.0_06&#8243;,&#8221;Java/1.5.0_02&#8243;,&#8221;Java/1.5.0_07&#8243;, And about 30 other variations of these.</p>
<p>Searching through forums and blogs turned up nothing but information on spam harvesters but all of the hits I was seeing were for the same small set of images and coming from an unbelievable amount of IP addresses all of them hitting on a slow but regular basis. </p>
<p>I tried the robots.txt but within a few hours noticed if anything an increase in the traffic.</p>
<p>I tried to find a pattern to these IPs but they were global and non that I tested were another webserver, leading me to believe a large group of zombie PC&#8217;s are loaded with DDOS software and a controller somewhere had sent them a list of images to download. None of the IPs showed up as ever visiting anywhere else on the site, only the small set of images.</p>
<p>So then I began to look for a way to stop them. Because the IP&#8217;s were to varied to firewall that was not an option. While the user agent was varied it was quite possible to block them with 2 additional lines to my Rewrite rules<br />
<code><br />
RewriteCond %{HTTP_USER_AGENT} ^Java/1.*<br />
RewriteRule ^.* - [F,L]<br />
</code><br />
Another option would have been using the SetEnvIfNoCase User-Agent ^$ bad_bot way but the Rewrite way worked.<br />
<a href="http://www.askapache.com/htaccess/fight-blog-spam-with-apache.html" title="Fight Blog Spam with Apache">Fight Blog Spam with Apache</a></p>
<p>Now about 8 hours later the hit count continues at about the same rate but they are just  receiving a 403 Forbidden instead of a 100k image on each request.</p>
<p>I pulled all of the hits from apaches log files for later analysis.<br />
<code><br />
cat access_log | grep Java >> DDOS.1107.log<br />
</code></p>
<p>I wonder how many of these hits where from some unsuspecting person sitting on their PC unaware their computer is at the control of someone somewhere far away. </p>
<p>Day two of defending against this has been posted: <a href="http://designs.salem-news.com/2007/11/07/the-denial-of-service-attack-continues/">The Denial of Service Attack Continues</a></p>
]]></content:encoded>
			<wfw:commentRss>http://designs.salem-news.com/2007/11/07/bandwidth-ddos-attack/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
