27 June 2017 · Shipping and manufacturing · Global (from Ukraine)

NotPetya at Maersk 2017

A poisoned update of a Ukrainian tax package released a self-spreading wiper that took down the whole Windows estate of companies worldwide within hours. Maersk’s terminals and bookings stopped and Merck’s factories went idle; Maersk reinstalled 45,000 PCs and 4,000 servers in ten days and put its losses at USD 250 to 300 million.

Allegedly state-backedWay in: Supply chain or vendorProduction stoppedStructured site

What happened

The short version

On 27 June 2017 a destructive worm later named NotPetya was pushed to businesses in Ukraine through the update mechanism of M.E.Doc, a tax accounting package used, by Cisco Talos’s estimate, by about 80 percent of the companies operating there. It looked like ransomwareMalware that encrypts files or whole computers and demands payment, usually in cryptocurrency, for the key to unlock them., with a ransom note and a bitcoin address, but it was built to destroy: it overwrote the boot recordMaster boot record: the first part of a hard disk that tells the computer how to start, which wipers overwrite so the machine cannot boot at all. and left no working way to recover files. Within hours it had spread from Ukrainian offices into the global networks of multinationals, and Microsoft, writing on 27 June, counted more than 12,500 machines in Ukraine that encountered the threat and infections in 64 other countries.

A.P. Møller-Maersk, the container line and terminal operator, lost its IT systems across multiple sites: terminals in a number of ports were hit, bookings stopped, and the company ran on paper and improvisation while it reinstalled its entire infrastructure. Merck’s worldwide operations, including manufacturing, were disrupted for weeks. TNT Express, the FedEx subsidiary, and a Pennsylvania hospital group were among the three victims the US indictment names, with losses the Department of Justice put at nearly USD 1 billion for those three alone. In February 2018 the White House alleged that a foreign military was behind the attack, and in October 2020 six military intelligence officers were charged; the charges are allegations.

Key dates

  1. Way in14 April 2017First backdoored M.E.Doc update; two more follow on 15 May and 22 June (the US indictment says about 21 June)
  2. Impact27 June 2017The M.E.Doc updater releases NotPetya, which spreads worldwide within hours
  3. Response28 June 2017Maersk reports IT down across multiple sites; bookings reopen through an outside platform
  4. ResponseEarly July 2017Maersk reinstalls about 4,000 servers and 45,000 PCs in ten days
  5. Aftermath15 February 2018The White House alleges a foreign military was behind NotPetya
  6. AftermathOctober 2020The US Department of Justice charges six military intelligence officers over the attack; the charges are allegations

How did that happen

The way in, and the way through

The attackers stole the credentials of an administrator at M.E.Doc’s developer, Intellect Service, took root on the update server and reconfigured its web server to proxy update traffic through a host they controlled. Three M.E.Doc updates, released on 14 April, 15 May and 22 June 2017, carried a backdoorA hidden way into a system that an attacker leaves behind so they can return without going through the normal login. inside a modified program library that reported every customer’s EDRPOU registration number, Ukraine’s company identifier, and could download and run arbitrary code. On 27 June that backdoor delivered the wiperMalware whose only purpose is to destroy data or make computers unbootable, with no ransom and no way back except restoring from backup., so the first infections started from the legitimate M.E.Doc updater process on finance PCs.

From there the malware needed no further help from the attackers. It dumped credentialsPulling passwords or login tokens out of a computer’s memory or files once an attacker controls it, to reuse them on other machines. from memory with a tool that shares code with MimikatzA freely available tool that pulls passwords and login tokens out of a Windows computer’s memory once an attacker has administrator rights on it. and used PsExecA legitimate Microsoft tool for running programs on other Windows computers over the network, which attackers use to spread because it is already trusted. and WMICA built-in Windows command-line tool for managing computers remotely, which attackers use to run commands on other machines without installing anything. to run itself on every machine those credentials could open; against unpatched machines it also used the EternalBlueA leaked exploit for a flaw in old Windows file sharing (SMB) that lets malware spread to unpatched machines on its own, used by WannaCry and NotPetya in 2017. and EternalRomance exploits for two flaws in the Windows file-sharing service that Microsoft had patched in March. In flat global domains, where users logged in with local administrator rights and the same accounts worked on many machines, that was enough to reach tens of thousands of machines before anyone could react. Then it overwrote the master boot recordMaster boot record: the first part of a hard disk that tells the computer how to start, which wipers overwrite so the machine cannot boot at all., scheduled a reboot and showed a fake disk-check screen while the damage was done.

The path through the plant, step by step (the numbers are the steps told below)

Attribution: Alleged to be state-backed: on 15 February 2018 the White House blamed a foreign military for NotPetya, and in October 2020 the US Department of Justice charged six military intelligence officers over this attack among others. These are allegations, not tested in court

The sequence of events

How it unfolded, step by step

The record in order, from the first foothold to the recovery. Each step says what was done, how it worked, what it looked like from inside the plant, and where the attacker was in the plant at that moment. Read this first; the game that follows asks what would have stopped each step.

  1. Stage 1 · WeaponisationVendors and supply chainApril to June 2017

    A backdoor planted in the tax software’s updates

    NotPetya did not begin at the companies it ruined. It began at a software vendor. Attackers stole the password of an administrator at Intellect Service, the Ukrainian maker of M.E.Doc, a tax package that Cisco Talos estimates about 80 percent of businesses in Ukraine use. They logged in, took full control of the update server and re-pointed its web traffic through a server of their own.

    With that foothold they hid a backdoorA hidden way into a system that an attacker leaves behind so they can return without going through the normal login. inside one of M.E.Doc’s own program files and shipped it as part of normal updates on 14 April, 15 May and 22 June 2017 (the US indictment dates the third update on or about 21 June). Nothing at the vendor caught the change, and nothing at the customers thought to question a trusted supplier’s update arriving the way it always did.

    The backdoorA hidden way into a system that an attacker leaves behind so they can return without going through the normal login. quietly reported each company’s tax registration number and could download and run whatever the attackers sent next. The trap was set and waiting.

    “An unknown actor had stolen the credentials of an administrator at M.E.Doc.”

    Source 6: The MeDoc Connection
    1. 1Stolen admin credentials open the software maker’s update server.
    2. 2They steal it and hide a backdoor in a trusted update.
    3. 3The poisoned update ships to businesses across the country.
  2. Stage 1 · DeliveryEnterprise IT27 June 2017

    The trusted updater runs the wiper on finance PCs

    On 27 June, around midday in Kyiv, the backdoorA hidden way into a system that an attacker leaves behind so they can return without going through the normal login. was told to act. The legitimate M.E.Doc updater process on finance PCs in Ukrainian offices fetched and ran the payload, so the attack began from software every machine already trusted. Microsoft traced early infections to that updater running a malicious command, and Talos concluded every infection came in through the M.E.Doc update system.

    There was nothing to click and nothing obviously wrong. A trusted accounting tool ran code on the machine, and in a company with one global Windows domainThe Microsoft system that holds every user account, password and computer in a Windows domain, so whoever controls it controls every machine in it. those ordinary finance PCs reached as far into the network as any other machine. Nothing was watching for a tax program’s updater to start up system tools and load code nobody had seen before.

    From those first machines, the worm now needed only the network.

    “Microsoft now has evidence that a few active infections of the ransomware initially started from the legitimate MEDoc updater process.”

    Source 7: New ransomware, old techniques: Petya adds worm capabilities
    1. 1A trusted updater can run any code, and nothing watches it.
    2. 2The tax updater fetches and runs the hidden payload.
    3. 3The attack begins from software every machine already trusts.
  3. Stage 1 · Lateral movementEnterprise IT27 June 2017, within the first hours

    Stolen credentials carry the worm across the flat domain

    Once running, the worm pulled the passwords of everyone logged on to the machine straight from memory, using a tool that shares code with the well-known MimikatzA freely available tool that pulls passwords and login tokens out of a Windows computer’s memory once an attacker has administrator rights on it.. It then used PsExecA legitimate Microsoft tool for running programs on other Windows computers over the network, which attackers use to spread because it is already trusted. and WMICA built-in Windows command-line tool for managing computers remotely, which attackers use to run commands on other machines without installing anything., two normal Windows administration tools, to copy and run itself on every other machine those passwords could open.

    This needed no exploit and no missing patch, only the way large Windows networks are usually run. In such networks users often logged in with local administrator rights and the same accounts worked on many machines, so one set of stolen passwords opened thousands of doors. With no internal zones and no separation keeping privileged accounts off ordinary PCs, the worm reached across the whole estate within hours.

    Patched and unpatched machines alike fell to this path.

    “It then tries to execute remotely the malware using either PSEXEC or WMIC tools.”

    Source 7: New ransomware, old techniques: Petya adds worm capabilities
    1. 1One admin password opens thousands of machines.
    2. 2The worm lifts passwords and copies itself machine to machine.
    3. 3It reaches the whole estate within hours.
  4. Stage 1 · ExploitationEnterprise IT27 June 2017

    EternalBlue and EternalRomance against unpatched Windows

    Against machines it could not reach with stolen passwords, the worm had a second way in. It used two exploits, EternalBlueA leaked exploit for a flaw in old Windows file sharing (SMB) that lets malware spread to unpatched machines on its own, used by WannaCry and NotPetya in 2017. and EternalRomance, for flaws in an old version of the Windows file-sharing service. A machine that was unpatched and still running that old protocol could be taken over with no password at all.

    Microsoft had fixed both flaws in March 2017, three months earlier, and the WannaCrypt outbreak in May, better known as WannaCry, had already shown the world what the first one could do. Where the patch was applied, or the old protocol switched off, this path did nothing. Where it was not, those machines became stepping stones that carried the worm even into corners credential theftPulling passwords or login tokens out of a computer’s memory or files once an attacker controls it, to reuse them on other machines. could not reach.

    “However, it is important to note that both of these vulnerabilities have been fixed by Microsoft in security update MS17-010 on March 14, 2017.”

    Source 7: New ransomware, old techniques: Petya adds worm capabilities
    1. 1A known wormable flaw sits unpatched for three months.
    2. 2The worm breaks into unpatched machines with no password.
    3. 3Those machines become stepping stones across the network.
  5. Stage 2 · ImpactEnterprise IT27 June 2017, minutes after each infection

    A wiper wearing a ransom note

    On each machine, after it had spread, the malware overwrote the master boot recordMaster boot record: the first part of a hard disk that tells the computer how to start, which wipers overwrite so the machine cannot boot at all., the small piece of disk a computer needs to start, and scheduled a reboot at least ten minutes later. When the machine restarted it showed a fake disk-repair screen while it finished scrambling the files, then displayed a ransom note demanding bitcoin.

    The ransom was a disguise. Talos judged the intent destructive, not economic, with no way to decrypt what it had done, and the US Department of Justice calls it destructive malware. By later press accounts the company directory lived only on servers the worm could reach, and there was no rehearsed way to halt a company-wide wave that finished within hours.

    What had looked like an IT problem was now a company that had lost its computers.

    Inside the plant: Maersk said the next day that it had shut down a number of systems across the business to try to contain the spread.

    “Based on the findings, Talos remains confident that the attack was destructive in nature.”

    Source 6: The MeDoc Connection
    1. 1No safe copy of the servers, and no way to halt the wave.
    2. 2It overwrites the boot record behind a fake repair screen.
    3. 3The files are gone; a company has lost its computers.
  6. Stage 2 · ImpactPhysical process27 June to mid-July 2017

    Terminal gates close, bookings stop, factories idle

    The terminals, gates and plant systems ran on the same corporate Windows network, so when it went down they went down with it. At the ports APM Terminals runs, the systems that process trucks and plan the cranes stopped, so cargo handling slowed or halted even though the ships themselves kept sailing. Maersk Line could not take new bookings for a time, then reopened them through an outside platform with slower confirmations.

    Maersk’s statement of 28 June said IT was down across multiple sites and that APM Terminals was hit in a number of ports, while its vessels stayed manoeuvrable and crews were safe. Merck told investors a month later that the attack had disrupted its worldwide operations, including manufacturing, and that it was not yet making bulk product. No public account describes any of these systems having a way to keep running once corporate IT was gone.

    A tax-software update in Ukraine had stopped container gates and pharmaceutical lines on other continents.

    Inside the plant: By Maersk’s account, cargo handling was disrupted at a number of ports while its ships stayed manoeuvrable and crews were safe.

    “IT systems are down across multiple sites and select business units. ... APM Terminals is impacted in a number of ports.”

    Source 3: Cyber attack update, 28 June 2017
    1. 1Terminals and plants hang entirely off the corporate network.
    2. 2The network falls, and gates, cranes and plants fall too.
    3. 3Gates and factory lines stand idle across continents.
  7. Stage 2 · Response and recoveryEnterprise IT27 June to early July 2017; residual effects through July

    Ten days to rebuild everything from one surviving domain controller

    Maersk rebuilt almost everything. Its chairman later told a World Economic Forum panel that the company reinstalled about 4,000 servers, 45,000 PCs and 2,500 applications in ten days, work he said would normally take six months, while staff ran the business on manual processes with volumes down about 20 percent.

    The rebuild was possible because one domain controllerThe server that runs Active Directory for a Windows domain and checks every login, which is why attackers aim for it first. had survived. By later press accounts a server in Ghana had been offline during a power cut, and its copy of the company directory seeded the restoration. By the same accounts the directory the whole company depended on had no copy anywhere the worm could not reach, and nobody had rehearsed a rebuild at this scale, so a chance power cut and ten days of hard work stood in for a plan.

    Maersk put its losses at USD 250 to 300 million, bought cyber insurance and began a programme to strengthen its IT platform and its service and business continuity plans.

    Inside the plant: Staff ran the business on paper and manual processes for about ten days while IT was rebuilt, keeping volumes within about 20 percent of normal.

    1. 1No offline copy of the directory, and no rehearsed rebuild.
    2. 2Staff reinstall the whole estate from one surviving server.
    3. 3Ten days to rebuild, at a cost of hundreds of millions.

That is the record. Now the question each step raises:

Could you have stopped it?

Now you decide

Could you have stopped it?

The same steps, as decisions. At most steps you pick the control that would have stopped the attack at a cost a structured site can carry; at some you place the attacker on the plant map first, or spot the one control that does not act. A nuclear-grade answer at a water utility scores less than the right-sized one, because the money and the people are not infinite. Round 2 hands you a budget. “Would have stopped” means in this exercise’s judgement, with the control in place and working; the record rarely says what the operator actually had, and no control is a guarantee.

Step 1 of 7
0 / 21 shield 0 / 2 insight
Structured site · the band this exercise judges by

A global container line and terminal operator, and the manufacturers alongside it here, run one corporate Windows estate across dozens of countries with terminal, gate and plant systems hanging off it. A structured programme is the reasonable expectation: a segmented global domain, tiered administration, prompt patching of wormable flaws, offline backups that include the directory, and terminals and plants that can run when corporate IT is down. Diodes and air gaps are for safety systems, not for a port that trades bookings and gate moves every minute.

Target security levels come from the site's own IEC 62443-3-2 risk assessment; these bands are how the game judges what is proportionate. The reasoning under each answer says why a control is the right weight for this site.
01
Stage 1 · WeaponisationApril to June 2017

A backdoor planted in the tax software’s updates

  1. 1Stolen admin credentials open the software maker’s update server.
  2. 2They steal it and hide a backdoor in a trusted update.
  3. 3The poisoned update ships to businesses across the country.

Stealing a vendor admin password to poison its updates

M.E.Doc is an accounting package from the Ukrainian company Intellect Service, used, by Cisco Talos’s estimate, by about 80 percent of businesses in Ukraine. Talos, which was given access to the vendor’s logs and code after the attack, found that someone had stolen an administrator’s credentials, logged into the update server, taken root and reconfigured its web server to proxy update traffic to a host of their own. Updates released on 14 April, 15 May and 22 June 2017 carried a backdoorA hidden way into a system that an attacker leaves behind so they can return without going through the normal login. in one of the product’s program libraries that reported each customer’s EDRPOU registration number, Ukraine’s company identifier, and could download and run arbitrary code. Re-read this step in the story

Before the control: where in the plant was the attacker at this step? 1 insight point

02
Stage 1 · Delivery27 June 2017
Answer the step above

The trusted updater runs the wiper on finance PCs

03
Stage 1 · Lateral movement27 June 2017, within the first hours
Answer the step above

Stolen credentials carry the worm across the flat domain

04
Stage 1 · Exploitation27 June 2017
Answer the step above

EternalBlue and EternalRomance against unpatched Windows

05
Stage 2 · Impact27 June 2017, minutes after each infection
Answer the step above

A wiper wearing a ransom note

06
Stage 2 · Impact27 June to mid-July 2017
Answer the step above

Terminal gates close, bookings stop, factories idle

07
Stage 2 · Response and recovery27 June to early July 2017; residual effects through July
Answer the step above

Ten days to rebuild everything from one surviving domain controller

Scoring: 3 points for the proportionate control, 2 for one that works but is heavier than this site needs, 1 for a control that helps, 0 for one that does not act at that step. In an odd-one-out step, 3 points for spotting the control that does not act. Plant-map questions earn insight points. Sources are listed at the end of the page. Jump to sources

Response and recovery

How they got back

Maersk shut down systems to contain the spread on the first day, kept its ships sailing and ran on manual processes while new bookings were taken through an alternative channel. Its IT staff and partners reinstalled the whole infrastructure in about ten days, seeded, by press accounts, from the one domain controllerThe server that runs Active Directory for a Windows domain and checks every login, which is why attackers aim for it first. that a power cut in Ghana had kept offline. Volumes were reduced for a period and the company put the loss at USD 250 to 300 million in its 2017 annual report, then bought cyber insurance and launched a programme to strengthen its IT platform and its service and business continuity plans. Merck was still restoring manufacturing a month later and not yet producing bulk product; TNT Express and the other two victims named by the US Department of Justice lost nearly USD 1 billion between them. The White House alleged in February 2018 that a foreign military was behind the attack, and the Department of Justice charged six military intelligence officers in October 2020; the charges are allegations.

Take this to your plant

  • 1You cannot audit every vendor’s build. Assume a trusted update will one day carry a payload, and make sure it cannot reach the whole estate: a segmented global domain and tiered administrationSplitting administrator accounts into levels so that the accounts that control the domain are never used on ordinary PCs, where a phishing email could steal them. are the structured answer.
  • 2The SMBServer Message Block: the Windows file and printer sharing protocol, whose old versions carried flaws that let worms jump from machine to machine. patch had been out for three months and WannaCrypt had already used the flaw. Wormable means patch in days, and switch off what you no longer need.
  • 3Maersk’s directory survived, by press accounts, because of a power cut in Ghana. Keep an offline copy of the domain controllersThe server that runs Active Directory for a Windows domain and checks every login, which is why attackers aim for it first. and the images the business runs on, and make sure the terminal or the plant can run when corporate IT is gone.

Sources

Where this record comes from

Government advisories, the victim's own statements, court and parliamentary records, and the technical reports of the teams that analysed the malware. Press is used only where no primary record exists, and is marked.

  1. 1
    Justice Department press release on the charges of 19 October 2020 US Department of Justice, 2020 · Government record
  2. 2
    Statement from the Press Secretary on NotPetya (15 February 2018) The White House, 2018 · Government statement
  3. 3
    Cyber attack update, 28 June 2017 A.P. Møller - Mærsk A/S, 2017 · Company statement
  4. 4
    Annual Report 2017, Risk management section A.P. Møller - Mærsk A/S, 2018 · Annual report
  5. 5
    Merck Announces Second-Quarter 2017 Financial Results (Form 8-K, Exhibit 99.1) Merck & Co., Inc., filed with the US SEC, 2017 · Company statement (SEC filing)
  6. 6
    The MeDoc Connection Cisco Talos, 2017 · Vendor technical report
  7. 7
    New ransomware, old techniques: Petya adds worm capabilities Microsoft Security, 2017 · Vendor technical report
  8. 8
  9. 9
  10. 10
  11. 11
    Indictment unsealed on 19 October 2020 (W.D. Pa.) US Department of Justice, 2020 · Court record
Where the record is uncertain
  • Cost: Maersk’s annual report puts its losses in the order of USD 250 to 300 million, covering lost revenue, IT restoration and extraordinary operating costs. The often quoted USD 10 billion global figure is a press estimate (Wired, quoting a former White House homeland security adviser), not an official tally.
  • The Ghana domain controller, the absence of an offline backup of the domain controllers, the Odessa office as Maersk’s entry point and the count of about 150 domain controllers come from Wired’s August 2018 reporting based on interviews with Maersk staff, not from Maersk. The rebuild figures (4,000 servers, 45,000 PCs, 2,500 applications, ten days) are the chairman’s remarks at Davos as reported by the press; Maersk has published no technical account of the incident.
  • Which Maersk machines, if any, were unpatched for MS17-010 is not public; the credential path does not depend on the SMB flaws, and the SMB step is included because Microsoft documents it as the worm’s second method. The M.E.Doc market share of about 80 percent is Talos’s estimate. The interruption of bookings and their resumption through INTTRA rest on Maersk Line’s customer updates as quoted by Reuters. The Department of Justice refers only to a large US pharmaceutical manufacturer; Merck is included on the strength of its own SEC filings.
  • Dwell time of 74 days is counted from the first backdoored M.E.Doc update (14 April 2017, per Talos) to 27 June; Talos dates the third backdoored update 22 June and the US indictment on or about 21 June; the attackers had access to the vendor earlier, on an unknown date, and inside the victims the spread took hours, not days.

Talk to RelyBlue

Which of these doors is open in your plant?

An assessment that starts from the attacks that actually happened, scoped to what a site like yours should carry.

  • You talk to a senior advisor, never a salesperson