Skip to content

Ransomware-Encrypted Dynamics NAV and Business Central Database Recovery

By Srinivasan Krishnappa · Ransomware & database recovery engineer · 656+ ransomware recoveries
7 min read
Need this solved now? We have already solved 656+ ransomware and data recovery cases. Call +91 74187 05822, WhatsApp us or email info [at] asittech.com. Free assessment; no data, no charge.

Microsoft Dynamics NAV, and Business Central installed on your own server, run a large number of mid-sized manufacturers, distributors and retailers. When ransomware hits that server, the SQL Server data files (.mdf, .ndf, .ldf) are encrypted along with the rest, the NAV service tier cannot connect, and the backups on the same machine or share are often encrypted too.

The data is not necessarily lost. NAV and Business Central store everything in ordinary SQL Server tables, so recovery works at the level of SQL Server's own 8 KB pages, without the attackers' key. This guide explains how that works and what decides the result.

How NAV and Business Central store a company

In NAV on SQL Server (the only option since NAV 2013) and in Business Central, every company in the database gets its own copy of each table, named with the company name and a dollar sign in front: for example CRONUS$G_L Entry, CRONUS$Cust_ Ledger Entry or CRONUS$Item Ledger Entry. Business Central 15 and later add the ID of the extension that owns the table to the end of the name. Dots and some other characters in table names are replaced with underscores.

The ledgers that matter most after an attack (general ledger, customer and vendor ledgers, item and value entries, posted documents) are therefore just large SQL Server tables, stored in data pages across the whole data file. Older NAV versions with the native C/SIDE database (.fdb files) store data differently and are assessed separately.

What ransomware leaves in the data file

Encrypting a database file of tens or hundreds of gigabytes completely takes time, so most ransomware families encrypt only the start of the file, or blocks at intervals. In the SQL Server cases we have measured, the encrypted parts were often only a few percent of the file. But the start of the file holds exactly what SQL Server needs to open it: the file header, the boot page, the allocation maps and the start of the system catalog that describes every table and column.

That is why SQL Server refuses to attach the file even when almost all of the ledger pages are intact. The recovery reads the surviving data pages directly, checks each one, and rebuilds the tables row by row into a new database.

Rebuilding the table definitions from a reference database

When the encrypted part of the file includes the system catalog, the data pages survive but the description of their columns does not. For NAV and Business Central this is very solvable: the table structure comes from the application, not from the customer's data. Another database on the same NAV or Business Central version and with the same customisations, such as a test copy, an older backup, or the database of a sister company, supplies the column definitions, and the surviving pages are read against them.

The reference database is used only for structure, never for data. In one SQL Server case we used exactly this method with a sister company's database and recovered 98.8% of the rows in 354 tables from LockBit-encrypted backups, with no table mislabelled.

Checking the recovered data

An accounting database has a built-in way to check itself. After the tables are rebuilt, the general ledger should balance, customer and vendor ledger totals should match their control accounts, and the last entry numbers in each ledger show how far the recovered data reaches. We report a row count for every table and point out any ledger where entries are missing, so your finance team knows exactly which period, if any, has to be re-entered from documents or bank statements.

What to do in the first hours

Disconnect the affected servers from the network but do not switch them off, reinstall them or restore over them. Stop the NAV or Business Central service tier and the SQL Server service, then copy the encrypted .mdf, .ndf and .ldf files and any encrypted .bak files, exactly as they are, to a separate drive.

Do not rename the files back, do not try to attach them, and do not run DBCC CHECKDB with REPAIR_ALLOW_DATA_LOSS on them: none of these can read encrypted pages, and repair deletes the pages it cannot read. Also find any copy of the database that is not encrypted, even an old test database, because it may be the reference that makes the recovery complete. Keep the ransom note, and in India report the incident to CERT-In within six hours.

Questions and answers

Can a ransomware-encrypted Dynamics NAV database be recovered without paying?

Often, yes. NAV and Business Central data lives in ordinary SQL Server tables, and ransomware usually encrypts only part of a large data file. The surviving pages are read directly and the tables rebuilt into a new database, without the attackers' key.

Which versions do you recover?

Dynamics NAV on SQL Server (any version that used the SQL Server option, including NAV 2013 to NAV 2018) and Business Central on-premises. Older NAV native databases (.fdb) are assessed case by case.

Our backups were encrypted too. Is there still a chance?

Yes. Encrypted .bak files can be read the same way as encrypted data files, because a SQL Server backup contains copies of the same 8 KB pages. A backup and the data file are often damaged in different places, so together they can give a more complete result.

Do we get a working NAV database back?

The recovered tables are delivered as a new SQL Server database with the same table names, which your NAV partner can attach to the service tier after checking it. We report row counts per table and any ledger where entries are missing.

SQL database recovery service →

Facing this problem? Contact us now.

We have already solved 656+ ransomware and data recovery cases: encrypted and corrupted SQL Server, Oracle and MySQL databases, Tally, Busy and Marg ERP data, Veeam backups, VMware and Hyper-V virtual machines, RAID and NAS. Send us the details and we tell you what we can recover.

  • ✓ Free assessment before you pay anything
  • ✓ No data, no charge
  • ✓ NDA on request

Email: info [at] asittech.com · Mon–Fri, 9:00–18:00 IST

Call 24/7Emergency