Home / Work / Ransomware Recovery
CASE STUDY · INCIDENT RESPONSE · FORENSICS

The server was reinstalled.
The data was still on the disk.

At 10:36 on a Monday, ransomware encrypted the main database server of a UAE trading company with 26 branches. Invoicing stopped at every branch. The newest clean backup was four and a half trading days old, and the server had been reformatted before recovery began. We rebuilt the ERP to the minute of the attack.

Client
UAE trading company, 26 branches
System
ERP on SQL Server, Windows Server 2022
Attack
Mimic ransomware via exposed Remote Desktop
Backup gap
4.5 trading days
Complication
Server reinstalled before recovery
Result
ERP rebuilt to 10:36 within 48 hours
A server rack in a dark server room at dawn, most lights green, one red
99.4%
Missing-day invoices recovered
48h
Attack to rebuilt ERP
7.17M
Database pages carved from disk
29h
Attacker inside before encryption
/ 01
The Problem

The company’s ERP runs on SQL Server on its main database server, a Windows Server 2022 machine. At 10:36 on a Monday, Mimic ransomware encrypted it. Every branch stopped invoicing at once.

The newest clean backup had been taken at midnight going into Thursday, so four and a half trading days of records existed nowhere else. By the time we were called, the server had been reformatted and Windows reinstalled — the usual first move to get trading again, and normally the end of any hope for the missing days.

The way in was ordinary. Remote Desktop was open to the internet with Network Level Authentication switched off and no account lockout; 35,738 failed Administrator logons were on record. The built-in Administrator password had not changed since the server was built in 2023.

The attackers first logged in at 05:04 on the Sunday. At 05:08 they created their own administrator account, and within about four minutes the antivirus and the backup agent had been uninstalled. Overnight there were brief logins from a second country — the pattern of access being checked and passed on. At 10:23 on Monday an operator logged in from a third country, ran password-dumping tools and a network scan, and started the encryption at 10:36. The logs were cleared at 12:28. They had been inside for 29 hours before anything was encrypted.

/ 02
The Approach

Evidence first, the same day: a live collection, including a 138 GB memory image. From the surviving logs, the registry and memory we built the timeline above, minute by minute.

The business went back onto the clean backup so the branches could trade the next morning. In parallel, we scanned the reinstalled server’s entire 1.92 TB disk read-only, while it kept working. Reinstalling Windows replaces the file system, not every sector beneath it. The scan found 7.17 million database pages newer than the backup, each one verified by SQL Server’s own page checksum.

We merged 6.36 million of those pages over the clean backup — 99.98% of them checksum-valid — and applied 262,775 new rows and 694,764 updated ones. The rebuilt database passes DBCC CHECKDB with no errors and no constraint violations.

/ 03
The Hard Parts
  1. Reading an attack from logs the attacker cleared The event logs were wiped at 12:28. The timeline had to be assembled from what survived — the remaining logs, the registry and memory.
  2. Telling the old database from the new one The reinstalled server had already created a fresh database on the same disk. Its pages and the pre-attack pages look alike. We separated them by their position on the disk and by their log sequence numbers, so nothing written after the reinstall was mistaken for recovered data.
  3. Invoices that had lost their header 2,241 invoices came back with their lines and ledger postings but without the header row. We rebuilt the headers from the surviving data, but first tested the rules on 5,290 intact invoices: customer and dates came out 100% correct, totals 98.5% exact and the rest within fils. Every rebuilt invoice is flagged as rebuilt.
  4. Encrypted files that were not fully encrypted The ransomware encrypted only the first and last megabyte of large files and about 0.18 MB in every 7 MB between. Four further databases were rebuilt directly from their encrypted files, with 97–98% of rows.
  5. Knowing exactly what is still missing Recovery figures are measured, not estimated: documents carry serial numbers, so every gap is countable. The 48 invoices that could not be recovered were each identified by who created them, when, and on which PC, from the ERP’s own activity log.
/ 04
The Outcome

The branches were trading again the next morning on the clean backup. Within 48 hours of the attack the ERP was rebuilt to 10:36, the minute the encryption started.

Of the 7,683 invoices raised in the missing days, 7,635 were recovered — 99.4%. At least 85% of every other numbered record from those days came back, measured exactly by serial number. The attackers’ attempts to move to office PCs all failed, and none of the other PCs we examined had been encrypted.

The client received an investigation report, a forensic technical report, a data recovery report and a rebuild checklist: no inbound port forwards, VPN with two-factor authentication, account lockout, tamper-protected endpoint protection, offline or immutable backups with monthly restore tests, central logging and network segmentation.

Stack Incident response Digital forensics Memory acquisition Windows log & registry analysis SQL Server page carving Log sequence analysis DBCC CHECKDB Data reconciliation Hardening

Wiped describes the file system,
not the data.

BEFORE YOU REBUILD

Encrypted, or already reinstalled?
Call before anything more is written to the disk.

Contact Us →