Changing Passwords and Access After a Hack
Cleaning files isn't enough if the hacker still holds a working login. One of the ways in is a leaked or guessed password, and another is an administrator page with no proper login at all.1 So you remove what they added, then change what they might have learned.
Check who has access
Start with a list of every user on the site. Look for accounts you didn't create. Google's guide says to write the unwanted names down for later, then delete the accounts so the hacker can't log in again.2 To do this you need permission to view all users, delete users and change all passwords related to your account.2
Check ownership in Google's Search Console as well. Google asks you to confirm that you own the site there and that no new, suspicious owners have been added.3
Which passwords to change
Google lists logins for FTP, database access, system administrators and the content management system (CMS).2 Here's what each one is.
- FTP. A way of copying files to and from your server. Its login can let someone change your site's files.
- Database. The login your site uses to read and write its stored content.
- System administrator. The login for running the server itself, if you manage one.
- CMS. The login for your site's dashboard, such as the page where you edit content.
Your hosting account sits above all of these, and so does the email address that receives its password resets. Neither is on Google's list, but if an attacker held them, the other changes could be undone. Change them too if there's any doubt.
Choose a strong password and don't include personal details or share it with anyone.4
Change them again after the clean-up
Google's guide asks for passwords to be changed early on, while the site is quarantined.2 It then asks you to change them one more time for all accounts related to the site once the clean-up is done.5 Its no-backup route has a further change after the clean installation, so there can be more than two changes in all.5
Our own reasoning, not Google's, is that the later changes come after the clean-up, so they cover anything that was still exposed during the first.
Make a stolen password less useful
Turn on multi-factor authentication (MFA) for every account with administration rights.4 MFA means proving who you are in two or more ways, such as a password plus a code from an app.4 A password alone then isn't enough to get in.
If MFA isn't offered for your CMS, the cyber agency of the Australian government says to use a strong password instead.4
Trim who can get in
Give each person only what their job needs. A person who writes pages might only need to publish them, while a developer needs wider access.4
Review access often and remove it when it's no longer needed, because staff who change roles or leave can put the site at risk.4
Keep passwords out of emails and chats. Use a password manager from the official source if you need help keeping track.
Once access is locked down, the next job is putting back good files from a backup.
Where the facts come from
- FAQ for hacked sites, web.dev (Google)
- Quarantine your site, web.dev (Google)
- Social Engineering (Phishing and Deceptive Sites), Google Search Central
- Secure your website, Australian Signals Directorate (cyber.gov.au)
- Clean and maintain your site, web.dev (Google)