SMB Remote Code Execution (MS17-010, EternalBlue)

The host is missing the MS17-010 update for its SMBv1 server, which unauthenticated attackers can exploit with public tools to run code with SYSTEM privileges.

SeverityCritical
CVSS 3.19.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Open in the calculator
CVSS 4.09.3 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Open in the calculator
CWECWE-787: Out-of-bounds Write
MITRE ATT&CKT1210 Exploitation of Remote Services
CVECVE-2017-0143, CVE-2017-0144, CVE-2017-0145, CVE-2017-0146, CVE-2017-0147, CVE-2017-0148
CategoryOutdated Components

Description

The host's SMBv1 server is missing the security update in Microsoft security bulletin MS17-010, released in March 2017, which fixed several flaws in the way the server handles specially crafted requests (CVE-2017-0143 to CVE-2017-0148). Using freely available and reliable exploits, an unauthenticated attacker who can reach TCP port 445 can run code on the host with SYSTEM privileges, the highest level on Windows, which gives complete control of the host, its data, its stored credentials and any access it has to other systems.

The best known exploit for these flaws, EternalBlue, was published in April 2017 in a leak of tools widely attributed to the United States National Security Agency, and within weeks was used by the WannaCry ransomware, and later by NotPetya, to spread between networks automatically. Because no user interaction or credentials are needed, the flaws are wormable: one vulnerable host can be used to compromise every other vulnerable host it can reach. Related exploits from the same leak, such as EternalRomance and EternalSynergy, target the same flaws. Exposure is greatest where port 445 is reachable across internal network boundaries or from the internet.

Every Windows release of that time with the SMBv1 server was affected, from Windows Vista and Windows Server 2008 to Windows 10 and Windows Server 2016, and Microsoft also issued updates for Windows XP, Windows Server 2003 and Windows 8 although they were out of support. The issue can be identified without credentials with the Nmap smb-vuln-ms17-010 script or the corresponding Metasploit scanner module, which check for the vulnerable behaviour without exploiting it. Exploitation, including a failed attempt, can crash the target with a stop error, so confirmation on a live engagement normally relies on these checks.

Remediation

Patch the host and remove SMBv1:

  • Install the updates listed in Microsoft security bulletin MS17-010 (KB4013389), or any later cumulative update or monthly rollup for the operating system, which include the fix.
  • Disable or remove SMBv1, where the flaws are, on every system that does not need it.
  • Replace or upgrade unsupported operating systems. Where a system cannot be patched or replaced at once, isolate it on a network segment that blocks TCP port 445 from other systems.
  • Block TCP port 445 at the internet boundary and between network segments where SMB is not needed.
  • Because exploits for these flaws remain in use, check vulnerable hosts for signs of earlier compromise, such as the DoublePulsar implant that EternalBlue was used to install.

Confirm the fix by repeating the smb-vuln-ms17-010 check and by confirming the installed update level on the host.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Network Services Findings

Every Network Services finding