<?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>Surplus words &#187; wordpress</title>
	<atom:link href="http://www.fridnet.com/slava/blog/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fridnet.com/slava/blog</link>
	<description>Because something like World Wide Web does not have enough content.</description>
	<lastBuildDate>Fri, 06 Jan 2012 20:33:22 +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>forgot my password, so&#8230;</title>
		<link>http://www.fridnet.com/slava/blog/2009/01/10/forgot-my-password/</link>
		<comments>http://www.fridnet.com/slava/blog/2009/01/10/forgot-my-password/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 23:57:22 +0000</pubDate>
		<dc:creator>Slava</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.fridnet.com/slava/blog/?p=111</guid>
		<description><![CDATA[I forgot my admin password on wordpress. I know, it is silly, but I reset it to something and then promptly forgot.What followed, was a sad comedy of errors and a small ode to open source. For long version, see &#8230; <a href="http://www.fridnet.com/slava/blog/2009/01/10/forgot-my-password/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I forgot my admin password on wordpress. I know, it is silly, but I reset it to something and then promptly forgot.What followed, was a sad comedy of errors and a small ode to open source. For long version, see below:</p>
<p>No matter, I thought, surely wordpress uses the database password() function and I could just get a new password hash, insert it into the DB, and be good again. To PhpMyAdmin we go&#8230; and Wrong! WordPress does not use the function, probably with good reason.</p>
<p>Ok&#8230; what now? How about I reverse-engineer the hash function, include a call to it in one of theme designs and get a new hash in whatever way the hash <strong>is</strong> computed. Then, I can insert it into the database&#8230; Yeah &#8211; in what other ways could I try to scratch my left ear with my right foot?</p>
<p>Finally I remember something painfully obvious &#8211; I do not need to hash anything, just return &#8220;true&#8221; from some function called checkPassword or VerifyPassword &#8211; there is always one somewhere. Indeed, CheckPassword() function does this:<br />
<code>function CheckPassword($password, $stored_hash)<br />
{<br />
$hash = $this-&gt;crypt_private($password, $stored_hash);<br />
if ($hash[0] == '*')<br />
$hash = crypt($password, $stored_hash);</code></p>
<p>return $hash == $stored_hash;<br />
}</p>
<p>comment out the last line and replace it with <code>return true;</code></p>
<p>Now, just save the file, reload the page, andÂ  login with a random password. Change the password to something I think I will remember, and change the code back&#8230;</p>
<p>And this is why I host my own instance of wordpress :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fridnet.com/slava/blog/2009/01/10/forgot-my-password/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

