Responding to unauthorised changes to a website
An attacker who can write to a website's files can replace its pages with a message of their own, to intimidate visitors or to mislead them. This is defacement, and the harm it does is to the site's integrity.1 The altered page can also infect visitors' devices, send them on to other sites or steal customer data,2 and it can prepare a later attack such as a drive-by compromise.1
How the change is made
The attacker overwrites the hosted HTML, JavaScript and CSS files, usually after planting a web shell, abusing credentials or exploiting a flaw in the web application.3 Other ways in are SQL injection, cross-site scripting and posing as an authorised user to reach remote files.2 On a Linux server the change can be an uploaded file, remote code execution, or a replaced index.html written over SSH or a web shell. On a cloud-hosted static site, such as one stored in AWS S3 or Azure Blob storage, it is an upload of altered files through the management console or the API.3
Take the site down first
If a vendor hosts the site, contact the host, then put a maintenance page in place of the site straight away. Inspect the site's contents and the latest backups for hidden malware and vulnerabilities before anything goes back up. Tell customers, suppliers and other third parties, and make a public statement. Restore from a backup, report the incident to the police, and have technical support work out how the site was defaced and how well the response went. Do not panic in public; the attackers are looking for a reaction.2
Find what changed
On a server that is a Git checkout, git status and git diff show tracked files that differ from the last commit, and git log -p -- <path> shows the commits that touched one file with their patches.45 A web shell uploaded as a new file shows in git status only as untracked.
git status
git diff
git log -p -- public/index.htmlA web shell keeps giving the attacker access to a server that is open to the internet,6 and the gap between its upload and the overwrite of the pages varies.3 Search the whole web directory for files that are new or changed since the last known good deploy, not only the defaced page.
Then check the accounts and records that give access:
- Deploy keys. A deploy key with write access can do what an organization member with admin access can do, so remove any key nobody recognises.7
- Registrar and DNS records for every domain.8
- Admin accounts. Limit their number and turn on multi-factor authentication (see Multi-factor authentication).2
- Audit logs. On GitHub, an organization owner opens the profile picture, Organizations, the organization, Settings, then Logs and Audit log in the sidebar's Archive section. It covers 180 days and shows three months by default.9 On Vercel, owners and users with the security role on an Enterprise plan use Team Settings, Security & Privacy, Audit Log, and can export the last 90 days with Export CSV.10
Restore
A backup kept on the same system can be destroyed by the same attacker, so store backups elsewhere and out of reach of the ways in.11 Keep older backups too, since the latest one may already contain the change.2
| Provider | Steps |
|---|---|
| Vercel | On the project overview, the Production Deployment tile, Instant Rollback, pick a deployment, Continue, Confirm Rollback. Vercel points the domains back to that deployment at once.12 Pro and Enterprise teams can roll back to any deployment that was aliased to a production domain; Hobby users only to the one before.12 Afterwards, auto-assignment of production domains is off, so new pushes do not replace the rolled-back deployment, and a changed environment variable is not applied. To undo, use Manage on the tile, or vercel promote.12 |
| Supabase | Database, Backups: restore to a backup made before the change. Pro projects keep 7 days of daily backups, Team 14 and Enterprise up to 30. Backups do not contain files stored through the Storage API, and passwords of custom roles must be reset after a restore.13 |
Close the way in
A restore leaves the cause in place. Replace the credentials the attacker could have reached (see Responding to a leaked API key), update plug-ins to fix bugs and security issues, and keep logs on a central log server.8
Subresource Integrity lets a page check that a script loaded from another site arrives unchanged: the tag carries a hash, and the browser refuses a file that does not match.14
<script src="https://cdn.example.com/lib.js"
integrity="sha384-..."
crossorigin="anonymous"></script>
# the hash
cat lib.js | openssl dgst -sha384 -binary | openssl base64 -ANotable incidents
Georgia (2019)
On 28 October 2019, large-scale attacks on Georgian web hosting providers defaced sites of the government, courts, non-government organisations, media and businesses and interrupted several national broadcasters. In February 2020 the UK National Cyber Security Centre assessed with 95% or higher probability that the GRU was responsible.15
The host Pro-Service said a large portion of its website servers were compromised. By 3 p.m. Georgian time on 29 October it reported that all affected sites were restored. Homepages carried a photograph of Mikheil Saakashvili with the caption "I'll be back."16 The reported size differs: BankInfoSecurity gives at least 2,000 sites,16 Engadget over 15,000,17 and MITRE approximately 15,000.1 The sources do not say how the intruders entered.
In SecFlash
SecFlash reports SF-CLD-104 on the Cloud page for a Hetzner server with backups off, and SF-CLD-106 when backups are off and the newest snapshot is more than 30 days old. SF-CLD-205 and SF-CLD-206 are the same two findings for a DigitalOcean Droplet. SF-CLD-525 appears on the same page for a Supabase project with point-in-time restore off and no finished backup in the last two days.
See also
- Website defacement
- Backup and restore
- Multi-factor authentication
- Responding to a leaked API key
- Category: Incident response
References
- a b c MITRE ATT&CK (last modified 24 October 2025). "Defacement: External Defacement, Sub-technique T1491.002". MITRE ATT&CK.
- a b c d e Canadian Centre for Cyber Security (February 2024). "Website defacement (ITSAP.00.060)". cyber.gc.ca.
- a b c "Behavioral Detection of External Website Defacement across Platforms, DET0590". MITRE ATT&CK.
- back "git-diff". Git documentation.
- back "git-log". Git documentation.
- back "Server Software Component: Web Shell, T1505.003". MITRE ATT&CK.
- back "Managing deploy keys". GitHub Docs. GitHub.
- a b CISA (1 February 2021). "Website Security". cisa.gov.
- back "Reviewing the audit log for your organization". GitHub Docs. GitHub.
- back "Audit Logs". Vercel Docs. Vercel.
- back "Data Backup, M1053". MITRE ATT&CK.
- a b c "Performing an Instant Rollback on a Deployment". Vercel Docs. Vercel.
- back "Database Backups". Supabase Docs. Supabase.
- back "Subresource Integrity". MDN Web Docs. Mozilla.
- back Foreign, Commonwealth & Development Office (20 February 2020). "UK condemns Russia's GRU over Georgia cyber-attacks". GOV.UK.
- a b "Massive Cyberattack Slams Country of Georgia". BankInfoSecurity. ISMG (October 2019).
- back Fingas, Jon (29 October 2019). "Huge cyberattack against country of Georgia knocks out 15,000 websites". Engadget.
External links
- Website defacement (ITSAP.00.060), Canadian Centre for Cyber Security
- External Defacement, T1491.002, MITRE ATT&CK