When owners discover a hack, most change the admin password and consider the job done. In reality an attacker who gets into a site collects several secrets at once: the database password in the config file, keys for payment and SMS services, mail settings, and sometimes the hosting account itself. If even one stays unchanged, the cleaned site gets breached again, or the damage continues elsewhere, in email or a payment system. Below is everything that should be rotated after a compromise and the order that makes sense.
Check your own device first
Before changing anything, ask whether the password was stolen from your own computer. Most site breaches go through a CMS vulnerability, but sometimes malware on the owner's PC harvests passwords saved in an FTP client, and new passwords would leak just as quickly. Rotate credentials from a trusted, scanned device and do not let FTP programs store passwords in plain text.
Work from the top down
Order matters. If you change the CMS password first and the hosting panel second, the attacker can watch your changes through the panel in between. Start with the highest level of access:
- The sayt.uz cabinet or whichever account controls the domain and hosting, with two-factor authentication where possible.
- The hosting control panel.
- FTP, SFTP and SSH access, including SSH keys.
- The database user.
- CMS administrators and other privileged users.
- CMS secret keys (salts) and sessions.
- Third-party API keys and tokens.
- Mailboxes connected to the site.
Hosting panel, FTP and SSH
Through the hosting panel an attacker can edit files, add FTP users and create cron jobs, so this password matters most. After changing it, remove any FTP users you did not create. With SSH, check the authorised keys as well as the password: an attacker who added their public key keeps access regardless of the password.
cat ~/.ssh/authorized_keys
ssh-keygen -t ed25519 -C "admin@example.uz" # new key pair on your PC
Database password
The config file is one of the first things an intruder reads, because it holds the database user and password in plain text. On shared hosting change it in the panel's databases section; on your own server use SQL. Update the site config immediately, or the site will fail with a database connection error.
openssl rand -base64 24
ALTER USER 'misol_user'@'localhost' IDENTIFIED BY 'NEW_PASSWORD';
wp config set DB_PASSWORD 'NEW_PASSWORD'
CMS users, salts and sessions
Review every administrator and editor account, delete the ones you do not recognise and reset the rest. A new password alone may not end an attacker's open session, so in WordPress regenerate the secret keys, which logs everyone out instantly. Laravel apps have APP_KEY; read the docs before rotating it, since changing it can make previously encrypted data unreadable.
wp user list --fields=ID,user_login,roles,user_email
wp user reset-password admin
wp config shuffle-salts
API keys and tokens: the part people forget
A modern site talks to payment systems, SMS gateways, Telegram bots, maps, mail delivery services and analytics. Their keys usually sit in .env or a config file and leave with the rest of your files. A stolen SMS key can send thousands of messages at your expense; a mail service key can send spam in your domain's name. Revoke each old key in the provider's dashboard, issue a new one and update the site.
A training centre in Tashkent learned this the hard way. The site was cleaned and the admin password changed, but a week later the SMS balance unexpectedly ran out: the gateway token had been stolen from the config and used to send other people's messages. Rotating the token stopped it. Search the code for every secret before you build your list:
grep -rnE "(api_key|apikey|secret|token|password)\s*[=:]" \
--include=*.php --include=*.env --include=*.json . | grep -v vendor
Mailboxes and the new passwords themselves
If contact forms send mail through a mailbox, its password is in the config too, and the attacker can use it to send mail as you or intercept password-reset links. Change those passwords and look for forwarding rules you did not create. Finally, use a unique, long, random password for every service, keep them in a password manager, enable two-factor authentication wherever it is offered, and note what you changed and when.