NotPetya via M.E.Doc Update
Malware posing as ransomware spread from a hijacked Ukrainian accounting software update and wiped computers worldwide.
- Severity
- History books
- Difficulty
- intermediate
- Companies
- Intellect Service (M.E.Doc), Maersk, Merck, Mondelez, FedEx/TNT
- Tech
- Software updates, EternalBlue, Mimikatz, SMB, Windows
- Root cause
- poisoned dependency, unpatched flaw, stolen credentials
The story
Quick (1 min)
On 27 June 2017, the day before a Ukrainian public holiday, computers at Ukrainian banks, ministries, airports and power companies started showing a ransom note. Within hours it spread to global companies like shipping giant Maersk, Merck and Mondelez.
Investigators traced it to M.E.Doc, accounting software used by most Ukrainian businesses. Attackers had taken over its update system, so customers' computers automatically downloaded and ran the malware, believing it was a normal update.
The malware, called NotPetya, looked like ransomware asking for $300 in Bitcoin, but researchers found the data couldn't be recovered even if you paid. It was effectively a wiper. It then spread inside company networks using stolen passwords and the EternalBlue exploit. The US White House put total damage at over $10 billion.
The lesson: trusted software updates are a powerful attack route, and one compromised vendor can take down companies worldwide.
Keep reading to the end to earn XP.Read. XP earned.
Engineer (2 min)
Initial vector. M.E.Doc, from Intellect Service, had about 400,000 customers, around 90% of Ukrainian firms (Wikipedia). On 27 June 2017, an update distributed from M.E.Doc's update server was followed by infections. Marcus Hutchins: "It looks like the software's automatic update system was compromised and used to download and run malware rather than updates for the software." Investigators later found the infected M.E.Doc code contained a backdoor.
Spreading inside networks. Once on one machine, NotPetya moved laterally:
- EternalBlue (SMB exploit, as used by WannaCry) against unpatched Windows.
- Mimikatz-style credential theft from memory, then using those credentials to run on other machines with admin rights. That reached even patched systems.
Destruction, not ransom. It encrypted the master boot record and files and showed a $300 Bitcoin demand, but "researchers found that data recovery was not possible." In some cases it acted as a wiper, irreversibly destroying data. The payment wallet collected only about $10,000.
Global spread through corporate networks. More than 80% of affected companies were in Ukraine, but multinationals with offices or network links there were hit, including Maersk's APM Terminals, FedEx's TNT Express, Mondelez and Reckitt Benckiser.
Attribution. The US (CIA reports, January 2018) and UK (February 2018) blamed Russia's GRU; Wired attributed it to the group "Sandworm." In October 2020 a US grand jury indicted six GRU officers. Russia denied involvement.
Interview takeaway: secure your update pipeline end to end (code signing, build integrity, server hardening), and for customers, segment networks and limit credential reuse so one infected machine can't take down the whole company.
Keep reading to the end to earn XP.Read. XP earned.
Deep dive (2 min)
Timeline (Wikipedia)
- Early 2017: attackers allegedly gain access to M.E.Doc's update servers (per Wired's Andy Greenberg, cited by Wikipedia).
- 27 June 2017: a malicious update is distributed through M.E.Doc's update server, the eve of Ukraine's Constitution Day, when government offices are empty. Infections spread across Ukraine, then globally. Chernobyl's radiation monitoring system goes offline.
- 28 June 2017: ESET estimates 80% of infections are in Ukraine and about 9% in Germany. Ukraine's government says the attack is halted.
- 30 June 2017: ESET attributes it to the TeleBots group, linked to BlackEnergy. Ukraine's SBU blames Russian agents.
- 4 July 2017: Ukrainian police raid M.E.Doc and seize servers after signs of another attack via the backdoor.
- January–February 2018: US and UK attribute NotPetya to Russia's GRU.
- October 2020: a US grand jury indicts six GRU members for attacks including NotPetya.
Impact
- Over 1,500 legal entities and individuals reported to Ukraine's National Police as victims.
- Ukrainian targets included ministries, banks, Kyiv Metro, Boryspil and Zhuliany airports, Ukrtelecom, Ukrposhta and Ukrainian Railways.
- International: Maersk (APM Terminals), Mondelez, FedEx's TNT Express, Reckitt Benckiser (sales estimate lowered about $130M) and others.
- US Homeland Security adviser Tom Bossert put total damage at over US$10 billion.
Why it was a supply chain attack
The victims did nothing unusual: they ran routine updates from a vendor they trusted. The attackers' real target was the update mechanism, which gave them code execution inside hundreds of thousands of businesses at once.
Ransomware as a disguise
Many analysts saw the ransom note as cover: the attack was "more likely aimed at crippling the Ukrainian state rather than for monetary reasons" (Wikipedia).
Keep reading to the end to earn XP.Read. XP earned.
Failure replay
Step by step, what broke and what it hit next. Showing the key steps. Switch to Engineer or Deep dive for every step.
- Early 2017M.E.Doc update servercompromised
Attackers allegedly gain access to the update servers of Ukraine's most widely used accounting software.
Affects: M.E.Doc customers
- Jun 27, 2017M.E.Doc customerscompromised
A malicious update is pushed. Customers' machines install it automatically, trusting the vendor.
Affects: Corporate networks
- Jun 27Corporate networkscompromised
NotPetya steals credentials from memory and uses EternalBlue to spread to other machines, even patched ones.
Affects: Windows machines
- Jun 27Windows machinesdown
It encrypts the boot record and files and shows a $300 ransom, but data can't be recovered.
Affects: Global companies
- Jun 27–28Global companiesdown
Through links to Ukrainian offices it hits Maersk, Merck, Mondelez, FedEx's TNT and many more.
- Jul 4, 2017M.E.Doc update serverrecovering
Ukrainian police seize M.E.Doc's servers after finding a backdoor in the update code.
- Weeks–monthsGlobal companiesrecovering
Companies rebuild systems from scratch. The White House estimates over $10 billion in damage.
Impact
- Who was affected
- Thousands of organisations, over 80% in Ukraine (government, banks, transport, energy), plus multinationals including Maersk, Merck, Mondelez, FedEx/TNT and Reckitt Benckiser.
- How long
- Spread within hours on 27 June 2017; recovery took weeks to months for many companies.
- Cost
- Over US$10 billion total, according to the White House's Tom Bossert.
Lessons
- Software update channels are prime targets; protect build and update infrastructure like production.
- Customers should treat vendor software as potentially compromised and segment it.
- Credential theft lets malware spread even to fully patched machines; limit admin credential reuse.
- Ransomware notes can disguise destructive attacks; backups and rebuild plans matter more than decryptors.
Quiz
How did NotPetya first get onto victims' computers?
The answer is A compromised update of M.E.Doc, a Ukrainian accounting program. Malware was distributed through M.E.Doc's update server on 27 June 2017.
Check answer
A compromised update of M.E.Doc, a Ukrainian accounting program. Malware was distributed through M.E.Doc's update server on 27 June 2017.
Why couldn't victims get their data back by paying the $300 ransom?
The answer is Researchers found recovery wasn't possible; it acted as a wiper. NotPetya in some cases irreversibly destroyed data.
Check answer
Researchers found recovery wasn't possible; it acted as a wiper. NotPetya in some cases irreversibly destroyed data.
How did NotPetya infect even patched Windows machines?
The answer is By stealing credentials from memory and using them to run on other machines. Credential theft let it spread laterally regardless of EternalBlue patches.
Check answer
By stealing credentials from memory and using them to run on other machines. Credential theft let it spread laterally regardless of EternalBlue patches.
Roughly how much total damage did the White House estimate?
The answer is Over $10 billion. Tom Bossert put the total at over US$10 billion.
Check answer
Over $10 billion. Tom Bossert put the total at over US$10 billion.
Interview prep
Try answering out loud before you open the model answer.
- security
How did NotPetya spread from one accounting software update to companies around the world?
Show model answer
Attackers compromised M.E.Doc's update server, so a malicious update was delivered and executed automatically on customer machines across Ukraine. Inside each network, NotPetya stole credentials from memory (Mimikatz-style) and used them, plus the EternalBlue SMB exploit, to move laterally, reaching even patched machines through stolen admin credentials. Multinationals whose global networks were connected to Ukrainian offices were infected next. It encrypted boot records and files with no real recovery possible, acting as a wiper.
A strong answer hits:
- Compromised update server
- Credential theft plus EternalBlue for lateral movement
- Global spread via connected corporate networks
- Wiper disguised as ransomware
How did your answer compare? - system design
You build software that auto-updates on customers' machines. How do you secure the update pipeline?
Show model answer
Sign updates with keys kept in HSMs, separate from the update server, and have clients verify signatures before installing. Harden and monitor build systems, require reproducible builds where possible, and enforce two-person review for release. Treat the update server as untrusted distribution: even if compromised, it can't produce validly signed packages. Stage rollouts to small percentages with telemetry. Have a way to revoke a bad release quickly and an incident plan to notify customers.
A strong answer hits:
- Code signing with protected keys
- Clients verify signatures
- Build system integrity and review
- Staged rollout and fast revocation
How did your answer compare? - behavioural
After NotPetya, should companies stop auto-updating third-party software? Discuss the trade-off.
Show model answer
Disabling updates leaves you exposed to known vulnerabilities, which is how WannaCry spread, so that's usually worse. A better approach: keep updating, but assess vendor security, stage updates through a test group first, run vendor software with least privilege, segment it, and monitor for unusual behaviour after updates. Balance speed against verification based on how critical and privileged the software is.
A strong answer hits:
- Not updating creates its own risk
- Stage updates and monitor
- Least privilege and segmentation for vendor software
How did your answer compare?
Go deeper
- Article2017 Ukraine ransomware attacksWikipedia, link checked 2026-11-25