Skip to content

Instantly share code, notes, and snippets.

@nazarmak
Created October 19, 2015 08:55
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save nazarmak/818051f83668103eb535 to your computer and use it in GitHub Desktop.
Save nazarmak/818051f83668103eb535 to your computer and use it in GitHub Desktop.
Decrypt the WordPress password
$username = '';
$password = '';
$strSql = "SELECT user_pass FROM wp_users WHERE user_login = '$username'";
$result = mysql_query($strSql);
$row = mysql_fetch_array($result);
$encpass = $row['user_pass'];
if(!is_null($encpass)) {
include('wp-includes/class-phpass.php');
$wp_hasher = new PasswordHash(8, TRUE);
$password_hashed = $encpass;
$plain_password = $password;
if($wp_hasher->CheckPassword($plain_password, $password_hashed)) {
echo "Success";
}
else {
echo "Failed";
}
}
else {
echo "Not found.";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment