Skip to content
Pwnversity
DEF-BACKUPintermediate · 8 min · upd. 2026-11

Backups & recovery

T1486T1490restic

Backups decide whether ransomware (T1486) is a bad week or the end of the company. But the attacker knows it: before encrypting, they look for the backups, delete or encrypt them too, and remove the system’s snapshots (T1490, Inhibit System Recovery). A backup only counts if it meets two conditions: the attacker can’t destroy it even with control of the domain, and it has actually been restored recently.

  • Getting back to a clean point after encryption, deletion, sabotage or failure.
  • Not negotiating: with intact, tested backups, the ransom stops being the only way out (although it doesn’t prevent extortion over stolen data).
  • Meeting recovery objectives agreed with the business, instead of discovering them on the day of the disaster.
Digit Meaning Why
3 Three copies of the data (production plus two) One failure doesn’t take everything
2 On two types of media or platform A technology failure doesn’t either
1 One off-site Fire, flood, theft
1 One immutable or offline Privileged ransomware can’t reach it
0 Zero errors in the last verified restore An untested backup is a hypothesis

An architecture that resists a privileged attacker

Section titled “An architecture that resists a privileged attacker”
flowchart LR
    P["Production<br/>(domain)"] -->|"agent sends<br/>append-only"| R[("Append-only<br/>repository")]
    R --> O[("Off-site copy<br/>immutable / object<br/>lock")]
    M["Backup administration<br/>outside the domain,<br/>strong MFA"] -->|"prune and retention"| R
    M --> O
    A(("Attacker with<br/>domain admin")) -.->|"delete backups"| R
    A -.-x|"no credentials"| M
    O --> T["Tested<br/>restore<br/>(measured RTO)"]
  • Separate credentials: the backup server and console aren’t joined to the production domain or, at minimum, use accounts that don’t exist in it, with phishing-resistant MFA (IAM). Taking Active Directory must not hand over the backups.
  • Append-only: machines sending backups can add data but not delete or overwrite it. Pruning is done by another system with other credentials.
  • Immutable: object lock (WORM, object lock in compliance mode) with a retention not even the administrator can shorten, or a physically disconnected copy.
  • Enough retention: modern ransomware waits days or weeks before encrypting. If retention is 7 days and the intrusion started 10 days ago, every backup contains the backdoor.

In practice: a repository the attacker can’t empty

Section titled “In practice: a repository the attacker can’t empty”

With restic 0.16.4 and rest-server 0.14.0 in --append-only mode (lab on a single machine; in production the backup server is another machine):

Ventana de terminal
rest-server --path /srv/restic --listen 127.0.0.1:8000 --append-only --no-auth # --no-auth only in the lab
export RESTIC_REPOSITORY=rest:http://127.0.0.1:8000/ RESTIC_PASSWORD='...'
restic init
restic backup /datos --tag diario
created restic repository 47fba55c33 at rest:http://127.0.0.1:8000/
processed 21 files, 527.732 KiB in 0:00
snapshot 5165de88 saved

Ransomware is simulated: the 20 files in /datos/facturas are encrypted with OpenSSL and the originals deleted. Then, with the client’s own credentials (the ones the attacker would have), an attempt is made to delete the backup:

Ventana de terminal
restic forget 5165de88 --prune
Remove(<snapshot/5165de8800>) returned error, retrying after 275.660871ms: blob not removed, server response: 403 Forbidden (403)
Remove(<snapshot/5165de8800>) returned error, retrying after 671.153816ms: blob not removed, server response: 403 Forbidden (403)
...

The server refuses the deletion. Restore and check:

Ventana de terminal
restic restore latest --target /restaurado
sha256sum -c hashes.orig # hashes computed before the "attack"
restic check --read-data
Summary: Restored 25 files/dirs (527.732 KiB) in 0:00
facturas/factura_8.txt: OK
facturas/factura_9.txt: OK
resumen.txt: OK
[0:00] 100.00% 2 / 2 packs
no errors were found

All 21 files match their original hashes, and check --read-data reads and verifies every block in the repository, not just the index.

Concept Question Determined by
RPO (recovery point) How much data can be lost? Backup frequency
RTO (recovery time) How long can the service be down? Restore speed and order
Recovery order What’s needed before what? Dependencies: identity, DNS and network before applications

Restoring the business after ransomware isn’t restoring files: Active Directory or the IdP must be rebuilt from a clean point, then the network and DNS, then each application in order. Without a documented and rehearsed order, the real RTO is far longer than the planned one (business continuity).

  • Periodic and timed: the measured time is the real RTO.
  • Full service, not a single file: a virtual machine that boots, a database that opens, an application that works.
  • From the immutable copy, which is the one used in the worst case.
  • In an isolated environment: restoring an infected backup into production reinfects it. Analyzing it first (scanning, the incident’s indicators) is part of incident response.
  • Failed backup jobs and sudden drops in backed-up volume.
  • Snapshot deletion: vssadmin delete shadows, wmic shadowcopy delete, wbadmin delete catalog, bcdedit disabling recovery; there are Sigma rules for all of them (detection).
  • Access to the backup console outside business hours or from non-administration machines.
  • Retention changes, deleted jobs or rejected deletion attempts on the repository (the 403s above make an excellent alert).
  • A backup server joined to the domain and administered with the same domain admin account.
  • One week of retention against an attacker who’s been inside for three.
  • An “off-site” copy synchronized in real time: it replicates the encryption too.
  • Never having tested a full restore.
  • Backing up the data but not the configuration needed to use it (encryption keys, secrets, the recovery order documentation).
  • Veeam Backup & Replication (CVE-2023-27532): the vulnerability allows obtaining credentials stored in the configuration; it’s in CISA’s KEV with known use in ransomware campaigns. Backup software is a top-priority target and gets patched first (patch management).
  • Backup and virtualization infrastructure: the M-Trends 2026 report notes that in 2025 attackers targeted backup and virtualization infrastructure with greater precision. Destroying backups and hypervisors before encrypting is now part of the usual playbook.
  • 3-2-1-1-0 met, with at least one immutable or offline copy
  • Backup administration outside the domain, with phishing-resistant MFA
  • Clients with append-only permissions; pruning from another system
  • Retention matched to how long an intrusion can go undetected
  • RPO, RTO and recovery order per service, approved by the business
  • Full, timed restores from the immutable copy
  • Alerts for snapshot deletion, backup failures and retention changes
  • Backup software patched as a critical system