<?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>El Paso, TX, iPad and iPhone Development, Android Development, and Mobile Web Design and Development &#187; security</title>
	<atom:link href="http://phidevinc.com/tag/security/feed" rel="self" type="application/rss+xml" />
	<link>http://phidevinc.com</link>
	<description>iPhone App Development and Mobile Web Design and Development Experts</description>
	<lastBuildDate>Wed, 18 Apr 2012 15:29:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Hiding, Securing &amp; Changing WP-Admin</title>
		<link>http://phidevinc.com/changing-conceailing-and-securing-wp-admin/tech-tips</link>
		<comments>http://phidevinc.com/changing-conceailing-and-securing-wp-admin/tech-tips#comments</comments>
		<pubDate>Sat, 29 Aug 2009 01:05:40 +0000</pubDate>
		<dc:creator>Ares</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-admin]]></category>

		<guid isPermaLink="false">http://docs.phidevinc.com/?p=252</guid>
		<description><![CDATA[Once an open source system becomes so popular as wordpress very often it becomes vulnerable to attacks. I wonder why the folks at wordpress have not done anything to enhance the security of the admin site, which, by default, you &#8230; <a href="http://phidevinc.com/changing-conceailing-and-securing-wp-admin/tech-tips">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div id="attachment_258" class="wp-caption alignright" style="width: 310px"><a title="Not completely a joke" rel="images" href="http://docs.phidevinc.com/media/2009/08/wordpress-installation-is-not-secure.jpg"><img class="size-medium wp-image-258 " title="wordpress-installation-is-not-secure" src="http://docs.phidevinc.com/media/2009/08/wordpress-installation-is-not-secure-300x205.jpg" alt="Your wordpress installation may not be secure" width="300" height="205" /></a><p class="wp-caption-text">Your wordpress installation may not be secure</p></div>
<p>Once an open source system becomes so popular as wordpress very often it becomes vulnerable to attacks. I wonder why the folks at wordpress have not done anything to enhance the security of the admin site, which, by default, you can access by going to /wp-admin.</p>
<div class="clear">&nbsp;</div>
<p><span id="more-252"></span></p>
<p>The problem is that if you rename the directory then your wordpress installation becomes broken. I&#8217;ve looked and I could not find a plug-in that would let you change the wp-admin folder to something else, or at least conceal it. The only result that I found about how to do this is by <a href="http://www.michiknows.com/2007/02/12/who-else-wants-to-hide-their-wordpress-admin-folder/" target="_blank">Michi Kono</a>. However the solution proposed has a few drawbacks like some links no longer working. Of course you have the option of restricting access to selected IP addresses via .htaccess but if you are like most non-commercial internet subscribers you don&#8217;t have a static IP, which makes things more complicated.</p>
<p>So here is another solution to make wordpress more secure while keeping all wordpress functionality.</p>
<div style="float: left;"><script type="text/javascript">// <![CDATA[
  google_ad_client = "pub-8598892091172834"; google_ad_slot = "3691821190"; google_ad_width = 250; google_ad_height = 250;
// ]]&gt;</script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></div>
<p>The first thing we need to do is to pick what &#8220;name&#8221; we want for your admin section. For purposes of this &#8220;tutorial&#8221; we will call it &#8220;secure-login&#8221;.</p>
<p><strong><em>Note: You are about to modify crucial files in your wordpress installation. So do this at your own risk, and please, please backup your files before you do this. </em></strong></p>
<p>Now, open your .htaccess file and add the following line after the &#8220;RewriteBase &#8221; line.</p>
<p><strong>RewriteRule ^secure-login$     wp-login.php [L,NC,QSA]</strong></p>
<p>so your .htaccess should look something like this.</p>
<p># BEGIN WordPress<br />
&lt;IfModule mod_rewrite.c&gt;</p>
<p>RewriteEngine On<br />
RewriteBase /<br />
<strong> RewriteRule ^secure-login$ wp-login.php [L,NC,QSA]</strong></p>
<p>RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteRule . /index.php [L]</p>
<p>&lt;/IfModule&gt;</p>
<p># END WordPress</p>
<p>This tells your server that when you ask for &#8220;secure-login&#8221; you should be taken to wp-login.php</p>
<p>Now we need to edit wp-login.php which is located at the root of your installation. Add this before anything else.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #990000;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//See what file is being requested by the web client, also store the arguments just in case.</span>
<span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span><span style="color: #000088;">$arguments</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;?&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//if the user just logged out, destroy this session and redirect them to root</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/wp-login.php?loggedout=true&quot;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$file</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;?&quot;</span> <span style="color: #339933;">.</span><span style="color: #000088;">$arguments</span> <span style="color: #339933;">||</span> <span style="color: #0000ff;">&quot;action=logout&quot;</span> <span style="color: #339933;">==</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arguments</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">13</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span> <span style="color: #990000;">session_destroy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;location: /&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//If our sentinel variable is set and true do nothing, allow normal script execution</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'valid_entrance'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'valid_entrance'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">/* As they say, &quot;Silence is golden&quot; */</span> <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Now if the user is requesting wp-login.php and our sentinel is not true, redirect the &quot;attacker&quot; to root.</span>
<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">stripos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp-login'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'valid_entrance'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>  <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: /&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//If the user is requesting the right login entrance set the sentinel to true</span>
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;/secure-login&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>  <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'valid_entrance'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></div></div>

<p>That&#8217;s all you need to do. Your wordpress installation just became more secure. Don&#8217;t forget to upload your updated files to your server.</p>
<p>I may do a plug-in whenever I find the time.</p>
<p>I would also recommend using <a href="http://wordpress.org/extend/plugins/login-lockdown/">Login Lockdown</a> by Michael VanDeMar.</p>
<p>Let me know if you have any questions or recommendations for this</p>
]]></content:encoded>
			<wfw:commentRss>http://phidevinc.com/changing-conceailing-and-securing-wp-admin/tech-tips/feed</wfw:commentRss>
		<slash:comments>81</slash:comments>
		</item>
	</channel>
</rss>

