Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Script to automate hacked account cleanup
- # UH-Cerrie 2017
- # Capture cPanel username
- echo -e "Enter the hacked cPanel account username:"
- read cpuser
- # Generate new cPanel account password
- cppass=$(openssl rand -base64 8)
- # Enable change of cPanel account password via shell
- export ALLOW_PASSWORD_CHANGE=1
- # Change the password and sync FTP password for cPanel user
- /scripts/chpass $cpuser $cppass
- /scripts/ftpupdate
- # Reset change password perms
- export ALLOW_PASSWORD_CHANGE=0
- # Clear out any hacked files before restore
- # dont enable yet
- rm -rf /home/$cpuserx/public_html/
- # dont ebale yet
- # Clear any hacked cron for pulling remote content etc.
- > /var/spool/cron/$cpuser
- # CXlear any hacked contact email address for password reset etc.
- > /home/$cpuser/.contactemail
- # All done
- echo -e "The new password $cpuser is $cppass"
- echo -e "Please restore the users public_html/ folder from a CLEAN backup"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement