<?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>R James Taylor<title>&#187; Web</title>
</title>
	<atom:link href="http://www.rjamestaylor.com/category/howto/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rjamestaylor.com</link>
	<description>Unboxed: technology, customer service, satire, opinion</description>
	<lastBuildDate>Wed, 08 Sep 2010 18:17:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<script type="text/javascript">
if (typeof Meebo == "undefined") {
Meebo=function(){(Meebo._=Meebo._||[]).push(arguments)};
(function(q){

	var args = arguments;
	if (!document.body) { return setTimeout(function(){ args.callee.apply(this, args) }, 100); }
	var d=document, b=d.body, m=b.insertBefore(d.createElement('div'), b.firstChild); s=d.createElement('script');
	m.id='meebo'; m.style.display='none'; m.innerHTML='<iframe id="meebo-iframe"></iframe>';
	s.src='http'+(q.https?'s':'')+'://'+(q.stage?'stage-':'')+'cim.meebo.com/cim/cim.php?network='+q.network;
	b.insertBefore(s, b.firstChild);

})({network:'rjamestaylor_fu01he'});	}</script>	<item>
		<title>Summarizing Apache Activity on an Unfamiliar Server</title>
		<link>http://www.rjamestaylor.com/summarizing-apache-activity-on-an-unfamiliar-server/</link>
		<comments>http://www.rjamestaylor.com/summarizing-apache-activity-on-an-unfamiliar-server/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 22:53:27 +0000</pubDate>
		<dc:creator>rjamestaylor</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[BASH]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[lsof]]></category>

		<guid isPermaLink="false">http://www.rjamestaylor.com/?p=447</guid>
		<description><![CDATA[Ever log into a UNIX-like system and need to find what&#8217;s happening with Apache or lighttpd? Sure, on a server you&#8217;ve set up you can use apache-top or mod_status, but on a server needing attention NOW and one you&#8217;ve never logged into what can you do? Well, I wrote a simple one-liner to help. This [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fsummarizing-apache-activity-on-an-unfamiliar-server%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fsummarizing-apache-activity-on-an-unfamiliar-server%2F&amp;source=rjamestaylor&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Ever log into a UNIX-like system and need to find what&#8217;s happening with Apache or lighttpd? Sure, on a server you&#8217;ve set up you can use apache-top or mod_status, but on a server needing attention <strong>NOW</strong> and one you&#8217;ve never logged into what can you do? Well, I wrote a simple one-liner to help.</p>
<p><script src='http://pastie.org/680723.js'></script></p>
<p>This is one ugly one-liner. It&#8217;s also useful on an unfamiliar server (UNIX-y) to find popular virtual hosts and scripts without knowing too much about the implementation details of Apache or lighttpd for that server. To try it log into a system running Apache or lighttpd with superuser privileges (due to the <code>netstat -ltpn</code> and <code>lsof</code> dependencies) and then Copy/Paste on the command line.</p>
<p>Here&#8217;s output on a dev machine with almost no traffic (a busy server is much more interesting):</p>
<pre>
-------/var/log/apache2/this-access.log------02.Nov.2009:

1	02	03.10 - 03.19	00K
1	02	04.00 - 04.09	00K
1	02	08.40 - 08.49	00K
103	02	11.00 - 11.09	26K
1	02	11.30 - 11.39	00K
1	02	15.40 - 15.49	00K
1	02	16.30 - 16.39	00K
1	02	17.20 - 17.29	00K
-------/var/log/apache2/other_vhosts_access.log------02.Nov.2009:

-------/var/www/sites/other.otr/logs/ins.pect.me-access.log------02.Nov.2009:
</pre>
<p>The output line shows the number of hits, day of the month, time in 10 min increments and kilobytes of transfer. If an IP had triggered the limits for TOPFILES or TOPIPS there would be a list of those IPs and popular request targets by number of occurrences for the given timeframe.</p>
<img style='display:none' id="post-447-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.rjamestaylor.com/summarizing-apache-activity-on-an-unfamiliar-server/',title:'Summarizing Apache Activity on an Unfamiliar Server',tweet:' 			 				 			 		 Ever log into a UNIX-like system and need to find what&#8217;s happening with Apach',description:' 			 				 			 		 Ever log into a UNIX-like system and need to find what&#8217;s happening with Apach'})"><script type='text/javascript'>document.getElementById("post-447-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.rjamestaylor.com/summarizing-apache-activity-on-an-unfamiliar-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Once Tweeted, Never Deleted: Your Reputation Online</title>
		<link>http://www.rjamestaylor.com/once-tweeted-never-deleted-your-reputation-online/</link>
		<comments>http://www.rjamestaylor.com/once-tweeted-never-deleted-your-reputation-online/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 21:48:27 +0000</pubDate>
		<dc:creator>rjamestaylor</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[emerging media]]></category>

		<guid isPermaLink="false">http://www.rjamestaylor.com/?p=391</guid>
		<description><![CDATA[Recently The Official Google Blog posted an article entitled Managing Your Online Reputation Through Search Results. The bullet points are worth repeating: Think twice Tackle it at the source Proactively publish information While the second and third points are helpful to remove or hide (read: &#8220;bury&#8221;) already published information, the first point, if followed, will [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fonce-tweeted-never-deleted-your-reputation-online%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fonce-tweeted-never-deleted-your-reputation-online%2F&amp;source=rjamestaylor&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Recently The Official Google Blog posted an article entitled <a href="http://googleblog.blogspot.com/2009/10/managing-your-reputation-through-search.html" target="_blank">Managing Your Online Reputation Through Search Results</a>. The bullet points are worth repeating:</p>
<ul>
<li>Think twice</li>
<li>Tackle it at the source</li>
<li>Proactively publish information</li>
</ul>
<p>While the second and third points are helpful to remove or hide (read: &#8220;bury&#8221;) already published information, the first point, if followed, will go a long way to avoiding ever needing the other two.</p>
<p>That is, for the main part, your online reputation is up to you. Think twice before posting or replying online.</p>
<p>But, what should one consider prior to making a comment, uploading a picture, giving a shout-out to a buddy, etc., online? First and foremost always remember this maxim:</p>
<h3 style="text-align: center;">The Internet Never Forgets</h3>
<p>Indexing engines, content scrapers, RSS/ATOM feed readers, etc., mean that once something is available online it generally remains available even if the original source of the posting is removed. In fact, sometimes removing a questionable posting from the source creates more attention to the item than leaving it alone. Ever seen an Outlook user request a recall on an errant email? The resulting &#8220;so@so.com wants to recall&#8221; message usually guarantees more people will review the original message itself (few email clients respect this &#8220;recall&#8221; feature). The same attention is garnered by removing posts or entire threads to forums, etc.</p>
<p>One example in particular is Twitter. Posting to Twitter is easy &#8211; so easy a person unable to drive due to substance abuse can still &#8220;tweet.&#8221; Sure, going back the next day and deleting the post may appear to remove the evidence of a wild night from one&#8217;s Twitter page, but simply using the http://search.twitter.com page will reveal the errant posts for anyone who is interested. While deleting posts is still recommended on occasions the sad fact is; &#8220;Once Tweeted, Never Deleted.&#8221; There are even services that will &#8220;recover&#8221; deleted tweets from any Twitter user &#8211; example: <a href="http://tweleted.com/" target="_blank">http://tweleted.com/</a> <em><strong>[rjt: now defunct, see below]</strong></em>.</p>
<h4 style="padding-left: 30px;">Update: According to <a href="http://www.techcrunch.com/2009/10/24/twitter-finally-removing-deleted-tweets-from-search-results/" target="_blank">TechCrunch</a> as of 10/24/2009 Twitter now removes deleted tweets from the search results as well as a users tweet stream. However, the fact remains that any service that automatically collects tweets and stores them outside of Twitter&#8217;s control *may* still be able to reproduce &#8220;deleted&#8221; tweets. ALWAYS act under the assumption that what you post in a public forum will remain publicly available.</h4>
<p>Before posting, keeping the above in mind, there are two other questions you should ask yourself. These two were suggested to me by <a href="http://twitter.com/kr8tr" target="_blank">Rob La Gesse</a> and I&#8217;ve come to treasure their simplicity and profundity:</p>
<h3>Q: Is it hurtful?</h3>
<p>We&#8217;ve all seen it &#8211; flamewars over operating systems, programming languages  or other religious matters. Debates that spin wildly out of control enhanced by the apparent anonymity of the Internet. But this is only one obvious form of &#8220;hurtful.&#8217; Other more serious hurtful examples include:</p>
<ul>
<li>violations of SEC disclosure/insider trading regulations,</li>
<li>corporate trade secrets,</li>
<li>items under NDA,</li>
<li>violations of employee privacy (such as compensation, HR issues, health information)</li>
</ul>
<p>But moreover there are hurtful things that may be less obvious. For example, when a competitor is experiencing a service failure there&#8217;s a tendency to say, &#8220;Woo hoo! XYZ Co. blew it!&#8221; Sometimes co-workers even say something about this to each other, privately. But posted publicly it hurts. First, it creates a negative reaction from third party observers: it&#8217;s just flat-out ugly. Like cheering when an opposing team loses a player due to injury: revolting. Second, &#8220;Pride comes before a fall&#8221;: cheer when XZY Co. suffers failure *only* if you&#8217;re positive you&#8217;ll never suffer a failure yourself. People will remember the hubris and use it against you when the stars misalign over you.</p>
<p>For a real-world case study showing the harm that can come from gloating over a competitor&#8217;s misstep read this blog post by Shel Israel regarding <a href="http://redcouch.typepad.com/weblog/2009/07/rackspace-downtime-competitive-response-lethal-generosity.html" target="_blank">Rackspace, OnlineTech and ServInt</a>. As a bonus it shows what can be gained by correctly maneuvering these two questions for one&#8217;s own benefit.</p>
<p>Other examples include mixing personal opinions with official company positions. Now, not many of us think we might do this, but by announcing publicly one is an employee of ABC Company that one takes on added scrutiny of his or her online activities. Have a <a href="http://www.rjamestaylor.com/unintended-consequences-or-how-i-accidentally-started-a-twibbon-campaign/" target="_blank">company twibbon</a>? Your 2 AM tweets about being inebriated are branded with your company. That&#8217;s hurtful to more than just you: now your reputation is tied to your company&#8217;s as well. Unfair? Sure! But this is an opt-in problem: when in doubt, don&#8217;t link personal life and work.</p>
<p>Bottom line: if it&#8217;s hurtful, it&#8217;s not helpful and should probably not be posted publicly.</p>
<h3>Q: Is it helpful?</h3>
<p>This question goes to the heart of managing your online reputation. If others find you as a resource of helpful information, whether technical, inspirational, educational, or even entertainment, your reputation online will grow in positive ways. Think in this way: what reputation do I want to have online? Then work towards creating that reputation with your actions.</p>
<p>A great example of one creating a helpful reputation is Major Hayden, AKA <a href="http://twitter.com/rackerhacker" target="_blank">RackerHacker</a>. Sure, he, I and others get into silly <a href="http://search.twitter.com/search?q=%23YELLING+rackerhacker" target="_blank">#YELLING</a> fits at times on Twitter, but generally Major&#8217;s reputation is set by the excellent work he does with his blog, <a href="http://rackerhacker.com" target="_blank">RackerHacker.com</a>, and his frequent linking to helpful information via his Twitter account. He manages to be himself (<a href="http://search.twitter.com/search?q=chinchillas+rackerhacker" target="_blank">Chinchillas</a>!) yet present information people technically inclined tend to respect. His work on <a href="http://blog.mysqltuner.com/" target="_blank">mysqltuner.pl</a> helps to give credence to his helpful persona. It&#8217;s who he is and what he does.</p>
<p>So, avoid the call from a lawyer demanding you to remove a public disclosure <em>faux pax</em> by remembering: Is it hurtful? Is it helpful? We&#8217;ll all be the better for it.</p>
<p style="margin-left: 40px;">
<img style='display:none' id="post-391-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.rjamestaylor.com/once-tweeted-never-deleted-your-reputation-online/',title:'Once Tweeted, Never Deleted: Your Reputation Online',tweet:' 			 				 			 		 Recently The Official Google Blog posted an article entitled Managing Your Online R',description:' 			 				 			 		 Recently The Official Google Blog posted an article entitled Managing Your Online R'})"><script type='text/javascript'>document.getElementById("post-391-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.rjamestaylor.com/once-tweeted-never-deleted-your-reputation-online/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WP: Blocking PHP scripts from illegitimate locations</title>
		<link>http://www.rjamestaylor.com/wp-blocking-php-scripts-from-illegitimate-locations/</link>
		<comments>http://www.rjamestaylor.com/wp-blocking-php-scripts-from-illegitimate-locations/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 18:55:52 +0000</pubDate>
		<dc:creator>rjamestaylor</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[How-to]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.rjamestaylor.com/?p=302</guid>
		<description><![CDATA[Continuing from my last post on using mod_rewrite to block certain actions against a WordPress blog, this brief article decribes how to block PHP script execution from directories where such are not expected to exist. Note that this is needed only on a platform that does not allow full system level access by the WordPress [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fwp-blocking-php-scripts-from-illegitimate-locations%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fwp-blocking-php-scripts-from-illegitimate-locations%2F&amp;source=rjamestaylor&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Continuing from my <a href="http://www.rjamestaylor.com/wp-stopping-password-recovery-attacks-with-mod_rewrite/" target="_blank">last post</a> on using <code>mod_rewrite</code> to block certain actions against a WordPress blog, this brief article decribes how to block PHP script execution from directories where such are not expected to exist. </p>
<p>Note that this is needed only on a platform that does not allow full system level access by the WordPress admin/maintainer. The blog I am dealing with in this example is not mine and I do not have full access to that system. While waiting on the proper system admin on that particular blog, I have made temporary stop-gap changes to block things I don&#8217;t like with only <code>.htaccess</code> and mod_rewrite rules. Had I full system admin access I would implement much more elegant protections. Alas, many WordPress blogs are on similar type platforms and this may be useful to stop bad behavior between patches and proper system administration.</p>
<h4>Problem: Executable PHP scripts in illegitimate locations</h4>
<p>I found a hacker-friendly PHP script in <code>{DOCUMENT_ROOT}/wp-admin/css/{filename}.php</code>. That a file beneath the <code>wp-admin</code> directory can be accessed and executed by anonymous users is baffling to me as a (currently burned out) web application developer, but I&#8217;m not trying to second guess the architecture of the WordPress platform itself. In any event, I definitely want to prevent:</p>
<ul>
<li>Unauthorized file uploads to sensitive directories</li>
<li>Execution of scripts in unexpected locations</li>
</ul>
<p>Since I&#8217;m not the system admin of the system this particular blog resides, my ability to limit file uploads is limited. But, using <code>.htaccess</code> and mod_rewrite I can prevent script access and execution in locations I don&#8217;t believe there should be such activity.</p>
<p>With this in mind, I set out to stop PHP execution and access of anything other than a CSS <code>(regex: /^.*.css$/)</code> file in the particular directory where the aforementioned hacker-friendly script existed. I will use two techniques to accomplish this:
<ul>
<li>Turn off PHP for this directory and any subdirectories</li>
<li>Disallow access to anything other than a CSS file</li>
</ul>
<p>I only expect CSS files to be accessed from this directory &#8212; and in case someone tries to embed PHP within a CSS file I&#8217;m disabling the PHP engine itself from within this directory, thus rendering PHP script as a plain text file (usually a Bad Thing™) and therefore harmless. I added the following <code>.htaccess</code> file to <code>{DOCUMENT_ROOT}/wp-admin/css</code>:</p>
<blockquote><p><code><br />
&lt;IfModule mod_php4.c&gt;<br />
php_flag engine off<br />
&lt;/IfModule&gt;<br />
&lt;IfModule mod_php5.c&gt;<br />
php_flag engine off<br />
&lt;/IfModule&gt;</p>
<p>&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /<br />
AddDefaultCharset UTF-8</p>
<p>RewriteCond %{REQUEST_FILENAME} !^(.+)\.css$<br />
RewriteRule ^(.*)$ / [R=301,NC,L]<br />
&lt;/IfModule&gt;<br />
</code></p></blockquote>
<p>Once again, please direct comments to this post or to me directly: rjamestaylor {at} gmail {dot} com. </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><small>By the way, the hacker-friendly script I found is the same one found using <a href='http://www.google.com/search?q="(c)oded+by+F4T!H"' target="_blank">this Google search</a>.</small></p>
<img style='display:none' id="post-302-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.rjamestaylor.com/wp-blocking-php-scripts-from-illegitimate-locations/',title:'WP: Blocking PHP scripts from illegitimate locations',tweet:' 			 				 			 		 Continuing from my last post on using mod_rewrite to block certain actions against ',description:' 			 				 			 		 Continuing from my last post on using mod_rewrite to block certain actions against '})"><script type='text/javascript'>document.getElementById("post-302-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.rjamestaylor.com/wp-blocking-php-scripts-from-illegitimate-locations/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>WP: Stopping Password Recovery Attacks with Mod_Rewrite</title>
		<link>http://www.rjamestaylor.com/wp-stopping-password-recovery-attacks-with-mod_rewrite/</link>
		<comments>http://www.rjamestaylor.com/wp-stopping-password-recovery-attacks-with-mod_rewrite/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 19:08:26 +0000</pubDate>
		<dc:creator>rjamestaylor</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.rjamestaylor.com/?p=280</guid>
		<description><![CDATA[I don&#8217;t fully know why, yet, but a cleanly installed WordPress 2.8.4 blog I have familiarity with is still being hacked with a password recovery attack. As a stop-gap until we find the actual vector of compromise I threw together the following Apache mod_rewrite rules to thwart these attacks. The downside of these rules is [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fwp-stopping-password-recovery-attacks-with-mod_rewrite%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fwp-stopping-password-recovery-attacks-with-mod_rewrite%2F&amp;source=rjamestaylor&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I don&#8217;t fully know why, yet, but a cleanly installed WordPress 2.8.4 blog I have familiarity with is still being hacked with a password recovery attack. As a stop-gap until we find the actual vector of compromise I threw together the following Apache mod_rewrite rules to thwart these attacks. The downside of these rules is that now if I forget my password I&#8217;ll have to change it via direct database manipulation (which is fine with me).
</p>
<p>
I added the following snippet to the .htaccess file in my webroot (DOCUMENT_ROOT) before any other mod_rewrite sections. Warning: this is not authoritatively guaranteed to do anything, it&#8217;s just done out of frustration while the real vulnerability is identified and fixed (and it could be social engineering, plugin, system or WordPress vulnerability &#8212; I really can&#8217;t say for sure where the problem lies at this time). Without further disclaimer, here&#8217;s the snippet:
</p>
<blockquote><p>
<code><br />
# BEGIN Block recover password<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /</p>
<p>RewriteCond %{QUERY_STRING} ^.*action=lostpassword.*$<br />
RewriteCond %{REQUEST_METHOD} =GET<br />
RewriteRule ^(.*)$ /index.php? [R=301,L]</p>
<p>RewriteCond %{REQUEST_URI} ^/wp-login.php.*$<br />
RewriteCond %{REQUEST_METHOD} !=GET<br />
RewriteRule ^(.*)$ http://lmgtfy.com/?q=get+a+clue [R=301,L]                                      </p>
<p>&lt;/IfModule&gt;<br />
# END Block recover password<br />
</code>
</p></blockquote>
<p>You may notice I do one of two things: if you simply request the &#8220;action=lostpassword&#8221;  function you&#8217;re silently redirected to my front page. But if you forcibly POST a request to recover a lost password (say using your own self-made form&#8230;it&#8217;s damn easy to do so) I insult your intelligence by sending you to Let Me Google That For You for the phrase &#8220;get a clue&#8221;. I seriously do not recommend taunting attackers, automated or not. If you just want the silent action, use this instead (RECOMMENDED):</p>
<blockquote><p>
<code><br />
# BEGIN Block recover password<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /</p>
<p>RewriteCond %{QUERY_STRING} ^.*action=lostpassword.*$<br />
RewriteRule ^(.*)$ /index.php? [R=301,L]</p>
<p>&lt;/IfModule&gt;<br />
# END Block recover password<br />
</code>
</p></blockquote>
<p>That should hold me over until I find out what the heck is responsible for allowing turkeys to get admin control of blogs they really aren&#8217;t committed to maintaining.</p>
<p>Oh, send criticisms, suggestions, corrections and opinions to rjamestaylor {at} gmail {dot} com.</p>
<p>&nbsp;</p>
<p>Ok&#8230; If you want to test the POST, use this form (it&#8217;s one of those &#8220;damn easy&#8221; to make forms I was talking about):</p>
<blockquote>
<form name="lostpasswordform" id="lostpasswordform" action="http://www.rjamestaylor.com/wp-login.php?action=lostpassword" method="post">
<p>
		<label>Username or E-mail:</p>
<input type="text" name="user_login" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
	</p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" value="Get New Password" tabindex="100" /></p>
</form>
</blockquote>
<img style='display:none' id="post-280-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.rjamestaylor.com/wp-stopping-password-recovery-attacks-with-mod_rewrite/',title:'WP: Stopping Password Recovery Attacks with Mod_Rewrite',tweet:' 			 				 			 		 I don&#8217;t fully know why, yet, but a cleanly installed WordPress 2.8.4 blog I h',description:' 			 				 			 		 I don&#8217;t fully know why, yet, but a cleanly installed WordPress 2.8.4 blog I h'})"><script type='text/javascript'>document.getElementById("post-280-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.rjamestaylor.com/wp-stopping-password-recovery-attacks-with-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Vuln: MySQL MyISAM Table Privileges Secuity Bypass Vulnerability</title>
		<link>http://www.rjamestaylor.com/vuln-mysql-myisam-table-privileges-secuity-bypass-vulnerability/</link>
		<comments>http://www.rjamestaylor.com/vuln-mysql-myisam-table-privileges-secuity-bypass-vulnerability/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 12:54:13 +0000</pubDate>
		<dc:creator>rjamestaylor</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[robotterror.com]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Vuln: MySQL MyISAM Table Privileges Secuity Bypass Vulnerability (source: SecurityFocus Vulnerabilities) In all modern versions of MySQL (that is, beginning early in MySQL 4&#039;s development history) the use of the &#34;CREATE TABLE ( ) DATA DIRECTORY &#8230; INDEX DIRECTORY &#8230;&#34; command can be used to escalate privileges to access and change data created by other [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fvuln-mysql-myisam-table-privileges-secuity-bypass-vulnerability%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fvuln-mysql-myisam-table-privileges-secuity-bypass-vulnerability%2F&amp;source=rjamestaylor&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.securityfocus.com/bid/29106">Vuln: MySQL MyISAM Table Privileges Secuity Bypass Vulnerability</a>  (source: <a href="http://www.securityfocus.com">SecurityFocus Vulnerabilities</a>)</p>
<p>In all modern versions of MySQL (that is, beginning early in MySQL 4&#039;s development history) the use of the &quot;CREATE TABLE ( ) DATA DIRECTORY &#8230; INDEX DIRECTORY &#8230;&quot; command can be used to escalate privileges to access and change data created by other MySQL users. MySQL AB has changed <a href="http://dev.mysql.com/doc/refman/4.1/en/news-4-1-24.html">MySQL 4</a> and <a href="http://dev.mysql.com/doc/refman/5.0/en/releasenotes-es-5-0-60.html">MySQL 5</a> behavior to remedy this problem.</p>
<p>However, this is also a case to point out restricting direct RDBMS access to any untrusted system user or application and instead forcing all access to be made through the application layer. That is, of course, as long as one locks down the application layer&#039;s access to the RDBMS, too! Besides controlling access for security purposes, managing access at the application layer improves chance of enforcing business rules with the database (without resorting to stored procedures and triggers).</p>
<p>&#8211; Robot Terror</p>
<img style='display:none' id="post-82-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.rjamestaylor.com/vuln-mysql-myisam-table-privileges-secuity-bypass-vulnerability/',title:'Vuln: MySQL MyISAM Table Privileges Secuity Bypass Vulnerability',tweet:' 			 				 			 		 Vuln: MySQL MyISAM Table Privileges Secuity Bypass Vulnerability  (source: Security',description:' 			 				 			 		 Vuln: MySQL MyISAM Table Privileges Secuity Bypass Vulnerability  (source: Security'})"><script type='text/javascript'>document.getElementById("post-82-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.rjamestaylor.com/vuln-mysql-myisam-table-privileges-secuity-bypass-vulnerability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vector of compromise: mosConfig_absolute_path</title>
		<link>http://www.rjamestaylor.com/vector-of-compromise-mosconfig_absolute_path/</link>
		<comments>http://www.rjamestaylor.com/vector-of-compromise-mosconfig_absolute_path/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 10:20:43 +0000</pubDate>
		<dc:creator>rjamestaylor</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[robotterror.com]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[While reviewing my logs for recent hits on my blog I came across the following request:   URL: /mosConfig_absolute_path%3Dhttp%3A/[...]/f1.txt Date: Monday, January 28, 2008 - 05:59 Remote Host: 69.57.148.17   Fortunately I am not using Mambo or Joomla (though the blog-ware I am using has its own troubles) or I would have been infected with [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fvector-of-compromise-mosconfig_absolute_path%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.rjamestaylor.com%2Fvector-of-compromise-mosconfig_absolute_path%2F&amp;source=rjamestaylor&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>While reviewing my logs for recent hits on my blog I came across the following request:</p>
<p> </p>
<pre> URL: /mosConfig_absolute_path%3Dhttp%3A/[...]/f1.txt
 Date: Monday, January 28, 2008 - 05:59
 Remote Host: 69.57.148.17</pre>
<p> </p>
<p>Fortunately I am not using Mambo or Joomla (though the blog-ware I am using has its own troubles) or I would have been infected with malware that would turn my server into an attack platform for DDoS attacks, spam, IRC, phishing scams and a host of illegal content of all kinds.</p>
<p>So, let me ask you: is your server able to survive such an automated attack as this? Is it already serving illegal purposes?</p>
<img style='display:none' id="post-91-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.rjamestaylor.com/vector-of-compromise-mosconfig_absolute_path/',title:'Vector of compromise: mosConfig_absolute_path',tweet:' 			 				 			 		 While reviewing my logs for recent hits on my blog I came across the following requ',description:' 			 				 			 		 While reviewing my logs for recent hits on my blog I came across the following requ'})"><script type='text/javascript'>document.getElementById("post-91-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.rjamestaylor.com/vector-of-compromise-mosconfig_absolute_path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aggressive Spam and Zombie blocking via spamhaus.org/drop and IPTables</title>
		<link>http://www.rjamestaylor.com/aggressive-spam-and-zombie-blocking-via-spamhausorgdrop-and-iptables/</link>
		<comments>http://www.rjamestaylor.com/aggressive-spam-and-zombie-blocking-via-spamhausorgdrop-and-iptables/#comments</comments>
		<pubDate>Mon, 09 Jul 2007 17:29:31 +0000</pubDate>
		<dc:creator>rjamestaylor</dc:creator>
				<category><![CDATA[How-to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[robotterror.com]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[If there is no end to spam and automated attacks against a server and you do not (or cannot) invest in a high-quality firewall, this technique may offer a respite. The idea is to pro-actively block all &#8220;well-known&#8221; malicious net-blocks (according to spamhaus.org&#8217;s definition, of course). The source for these net-blocks is the Spamhaus DROP [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.rjamestaylor.com%2Faggressive-spam-and-zombie-blocking-via-spamhausorgdrop-and-iptables%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.rjamestaylor.com%2Faggressive-spam-and-zombie-blocking-via-spamhausorgdrop-and-iptables%2F&amp;source=rjamestaylor&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>If there is no end to spam and automated attacks against a server and you do not (or cannot) invest in a high-quality firewall, this technique may offer a respite.</p>
<p>The idea is to pro-actively block all &#8220;well-known&#8221; malicious net-blocks (according to spamhaus.org&#8217;s definition, of course). The source for these net-blocks is the <a href="http://www.spamhaus.org/drop">Spamhaus DROP list</a>, which is described as:</p>
<p> </p>
<pre>DROP (Don't Route Or Peer) is an advisory "drop all traffic" list, consisting of stolen 'zombie'
netblocks and netblocks controlled entirely by professional spammers. DROP is a tiny sub-set of
the SBL designed for useby firewalls and routing equipment.</pre>
<p> </p>
<p>Spamhaus promises:</p>
<p> </p>
<pre> The DROP list will NEVER include any IP space "owned" by any legitimate network and reassigned -
 even if reassigned to the "spammers from hell". It will ONLY include IP space totally controlled
 by spammers or 100% spam hosting operations. These are "direct allocations" from ARIN, RIPE,
 APNIC, LACNIC, and others to known spammers, and the troubling run of "hijacked zombie" IP blocks
 that have been snatched away from their original owners (which in most cases are long dead corporations)
 and are now controlled by spammers or netblock thieves who resell the space to spammers.

 When implemented at a network or ISP's 'core routers', DROP will protect all the network's users from
 spamming, scanning, harvesting and dDoS attacks originating on rogue netblocks.</pre>
<p> </p>
<p>I combine this list with Portsentry (customizing /etc/cron.hourly/portflush and the killroute BASH script) to release and renew these blocks each hour. This is not really necessary, but it&#8217;s my way. As an added benefit, however, using Portsentry to block routes will make those routes subject to the portsentry.ignore routes you have configured, which will likely prevent you from blocking yourself or close associates if the DROP list somehow includes your netblock one day!</p>
<p>Here&#8217;s the one-liner to grab the DROP list and run it through killroute:</p>
<p> </p>
<pre> curl -s http://www.spamhaus.org/drop/drop.lasso |grep ^[1-9]|cut -f 1 -d ' ' | \
 xargs -iX -n 1 killroute  X "source: spamhaus.org/drop"</pre>
<p> </p>
<p>This can also be run as &#8220;<tt>xargs -iX -n 1 iptables -A INPUT -s X -i eth0 -j DROP</tt>&#8220;, instead.</p>
<p>In /etc/cron.hourly/portflush I add the above one-liner before the &#8220;exit&#8221; statement so that the now-flushed iptables entries are replaced with the (possibly) updated list of net blocks from the DROP list.</p>
<p>A minor edit to portsentry&#8217;s killroute (vi `which killroute`) allows a custom &#8220;source&#8221; comment. Here&#8217;s my edited killroute:</p>
<p> </p>
<pre> #!/bin/sh

 source /etc/sysconfig/portsentry

 # Make sure we have a target
 if [ "x$1" = "x" ]
 then
        echo "$(basename $0):  Error no target specified."
        exit 1
 #else
        #echo "Arg 1: $1"
 fi

 if [ "y$2" = "y" ]
 then
        PREFIX="portsentry attack alert"
 else
        PREFIX="$2"
        #echo "Arg 2: $2"
 fi

 # Figure out which firewall tool to run... backwards compat blows chunks.
 case "$(basename $IPTOOL)" in
        ipchains)
                ipchains -I $PORTSENTRY_CHAIN -s $1 -j DENY -l
                ;;
        iptables)
                iptables -I $PORTSENTRY_CHAIN -s $1 -j LOG --log-prefix "$PREFIX"
                iptables -I $PORTSENTRY_CHAIN -s $1 -j DROP
        ;;
        *)
                echo "Unrecognized option.... no action taken against $1"
                exit 1
        ;;
 esac

 exit 0</pre>
<p> </p>
<p>I also use this technique in conjunction with <a href="http://robotterror.com/site/wiki/mitigating_brute_force_password_attacks_with_pam_abl">Mitigating brute-force password attacks with pam_abl</a> to help protect against brute-force password attacks. Fun, fun, fun.</p>
<img style='display:none' id="post-95-blankimage" onload="Meebo('discoverSharable', {element: ((this.parentNode.className.match('post')) ? this.parentNode : this.parentNode.parentNode) ,url:'http://www.rjamestaylor.com/aggressive-spam-and-zombie-blocking-via-spamhausorgdrop-and-iptables/',title:'Aggressive Spam and Zombie blocking via spamhaus.org/drop and IPTables',tweet:' 			 				 			 		 If there is no end to spam and automated attacks against a server and you do not (o',description:' 			 				 			 		 If there is no end to spam and automated attacks against a server and you do not (o'})"><script type='text/javascript'>document.getElementById("post-95-blankimage").onload();</script>]]></content:encoded>
			<wfw:commentRss>http://www.rjamestaylor.com/aggressive-spam-and-zombie-blocking-via-spamhausorgdrop-and-iptables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
