Last active
June 22, 2023 23:38
-
-
Save PabloWestphalen/9145fced21cce642a0e1e80b6ea86a28 to your computer and use it in GitHub Desktop.
Simple Wordpress Login Hack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Author: Pablo Westphalen | |
* | |
* http://www.github.com/PabloWestphalen | |
* | |
* | |
* Usage: place this file in wp root dir, alongside wp-config | |
* then access your WP_URL/wp-logmein.php?user=something | |
*/ | |
error_reporting(E_ALL|E_STRICT); | |
require_once('wp-config.php'); | |
function logUser($username) { | |
$user = get_user_by('login', $username ); | |
wp_clear_auth_cookie(); | |
wp_set_current_user ( $user->ID ); | |
wp_set_auth_cookie ( $user->ID ); | |
} | |
logUser($_GET['user']); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment