Cyber risk and advisory programs that identify security gaps and build strategies to address them.
MDR that provides improved detection, 24/7 threat hunting, end-to-end coverage and most of all, complete Response.
Our team delivers the fastest response time in the industry. Threat suppression within just 4 hours of being engaged.
Be protected by the best from Day 1.
24/7 Threat Investigation and Response.
Expert hunting, research and content.
Defend brute force attacks, active intrusions and unauthorized scans.
Protect assets from ransomware, trojans, rootkits and more.
Intelligence and visibility across AWS, O365, DevOps and more.
Configuration escalations, policy and posture management.
Detects malicious insider behavior leveraging Machine Learning models.
The file encryption and MBR infection code of NotPetya has now been carefully scrutinized and found lacking in many respects, sparking debate among researchers as to the true intent of the threat actors.
Here we take a closer look at the network spreading code, and how it finds new victims to infect.
The gathering of potential new infection targets is done in a separate thread that is created by the malware after the MBR is infected and the shutdown task scheduled:
NotPetya maintains a global list of infection targets that it collects from multiple sources. These include command-line parameters, connected subnets, DHCP servers, DHCP clients, ARP table entries, active TCP connections, and servers on the domain found via the network browser service.
IP addresses or hostnames to infect can be passed in via the -h command-line switch:
NotPetya enumerates all local network interfaces and scans the directly connected subnets for hosts that accept TCP connections on port 139 or 445. Any host that answers is added to the target list.
For any DHCP-enabled interface, the address of the DHCP server is added to the target list.
NotPetya uses the NetServerGetInfo API to determine if it is running on a server or domain controller. If so, it will then use the DhcpEnumSubnets, DhcpGetSubnetInfo and DhcpEnumSubnetClients API to enumerate all clients for which this server is acting as a DHCP server. It will then try to make a TCP connection to the SMB ports of each DHCP client. Any host that answers is added to the target list.
Every 3 minutes, NotPetya fetches a list of active TCP connections via the GetExtendedTcpTable API and adds the remote IP addresses of these connections to the target list. This is one way for hosts outside of the victim’s local Windows network can be selected as propagation targets.
IP addresses found in the local ARP cache are also added to the target list. The contents of the ARP cache are fetched every 3 minutes via the GetIpNetTable API.
Finally, NotPetya uses the browser service to list all servers visible in the Active Directory domain (NetServerEnum API). Any that are running on Windows 2000 or later are added to the target list.
Once the list of targets is gathered, the malware creates a network propagation thread that attempts to connect to the admin$ share of each target (using dumped credentials if available) and upload a copy of itself to it:
It will then try to remotely execute its copy, first via PsExec, and failing that, via WMIC:
A separate thread is responsible for SMB exploitation via ETERNALBLUE and ETERNALROMANCE.
As we can see, the network propagation code in NotPetya is optimized to efficiently enumerate and attack targets on a typical Active Directory domain. It is not limited to scanning just the local subnet, and is able to traverse entire enterprise networks with ease, especially when it is able to infect a DHCP server or domain controller. By enumerating active TCP connections present on the victim machine, NotPetya is capable of spreading to external/Internet targets as well, although stolen credentials are unlikely to work there, and SMB exploitation becomes the likelier infection mechanim to be effective against these targets.
Jacob is principal cybersecurity researcher at eSentire, with a focus on intrusion detection, malware analysis, threat intelligence, measurement and metrics.