Advertisement
Guest User

Untitled

a guest
Mar 11th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. #!/bin/sh
  2. echo '..::reset password wp-admin::..'
  3. ls /var/cpanel/users > /root/paneluser.txt
  4. IFS=$'\n' read -d '' -r -a lines < /root/paneluser.txt
  5. paneluser=${lines[@]}
  6. #ngelist panel cpanel dan masuk ke directory home user
  7. for i in "${lines[@]}"
  8. do
  9. cd /home/$i/
  10. #mulai cari parameter wp-config masing
  11. rm -rf /root/db_$i.txt
  12. find -name 'wp-config.php' > /root/db_$i.txt
  13. configuser=$(cat /root/db_$i.txt)
  14. #tentuin database,prefix
  15. for a in $configuser
  16. do
  17. cat $a | grep DB_NAME | cut -d \' -f 4 > /root/db_name_$i.txt
  18. cat $a | grep DB_PASSWORD | cut -d \' -f 4 > /root/db_pass_$i.txt
  19. cat $a | grep "\$table_prefix" | cut -d \' -f 2 > /root/db_prefix_$i.txt
  20. pass=$(cat /root/db_pass_$i.txt)
  21. sed -i -e 's/_/_users/g' /root/db_prefix_$i.txt
  22. db=$(cat /root/db_name_$i.txt)
  23. prefix=$(cat /root/db_prefix_$i.txt)
  24. #echo 'nama database :'$db
  25. #echo 'wp-user :'$prefix
  26. #echo 'password db : '$pass
  27.  
  28. #reset password wp-admin
  29. mysql << EOF
  30. use $db ;
  31. UPDATE $prefix SET user_pass = MD5('qwe123') WHERE $prefix.ID = 1;
  32. EOF
  33.  
  34. #mencari nama domain
  35. cat $a | grep "\$table_prefix" | cut -d \' -f 2 > /root/db_options_$i.txt
  36. sed -i -e 's/_/_options/g' /root/db_options_$i.txt
  37. option=$(cat /root/db_options_$i.txt)
  38. mysql -Ne "select option_value from $option where option_id = 1" $db > /root/domain_$i.txt
  39. domain=$(cat /root/domain_$i.txt)
  40. echo 'nama domain :' $domain
  41.  
  42. #mencari user wp-admin
  43. mysql -Ne "select user_login from $prefix where ID = 1" $db > /root/useradmin_$i.txt
  44. useradmin=$(cat /root/useradmin_$i.txt)
  45. echo 'user wp-admin : ' $useradmin
  46. echo 'pass wp-admin : qwe123'
  47. echo 'selesai'
  48. rm -rf /root/useradmin_$i.txt
  49. rm -rf /root/domain_$i.txt
  50. rm -rf /root/db_options_$i.txt
  51. rm -rf /root/db_prefix_$i.txt
  52. rm -rf /root/db_pass_$i.txt
  53. rm -rf /root/db_name_$i.txt
  54. rm -rf /root/laporan-reset-wp-admin.txt
  55. echo '================================================'
  56. done
  57. #laporan bisa dilihat di /root/laporan_admin.txt
  58. echo 'Nama Domain Anda : '$domain ' | username wp-admin : '$useradmin ' |password wp-admin : qwe123 ' >> /root/laporan_admin.txt
  59. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement