Vulnerabilities > CVE-2017-0148 - Improper Input Validation vulnerability in multiple products
Attack vector
NETWORK Attack complexity
HIGH Privileges required
NONE Confidentiality impact
HIGH Integrity impact
HIGH Availability impact
HIGH Summary
The SMBv1 server in Microsoft Windows Vista SP2; Windows Server 2008 SP2 and R2 SP1; Windows 7 SP1; Windows 8.1; Windows Server 2012 Gold and R2; Windows RT 8.1; and Windows 10 Gold, 1511, and 1607; and Windows Server 2016 allows remote attackers to execute arbitrary code via crafted packets, aka "Windows SMB Remote Code Execution Vulnerability." This vulnerability is different from those described in CVE-2017-0143, CVE-2017-0144, CVE-2017-0145, and CVE-2017-0146.
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Buffer Overflow via Environment Variables This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
- Server Side Include (SSI) Injection An attacker can use Server Side Include (SSI) Injection to send code to a web application that then gets executed by the web server. Doing so enables the attacker to achieve similar results to Cross Site Scripting, viz., arbitrary code execution and information disclosure, albeit on a more limited scale, since the SSI directives are nowhere near as powerful as a full-fledged scripting language. Nonetheless, the attacker can conveniently gain access to sensitive files, such as password files, and execute shell commands.
- Cross Zone Scripting An attacker is able to cause a victim to load content into their web-browser that bypasses security zone controls and gain access to increased privileges to execute scripting code or other web objects such as unsigned ActiveX controls or applets. This is a privilege elevation attack targeted at zone-based web-browser security. In a zone-based model, pages belong to one of a set of zones corresponding to the level of privilege assigned to that page. Pages in an untrusted zone would have a lesser level of access to the system and/or be restricted in the types of executable content it was allowed to invoke. In a cross-zone scripting attack, a page that should be assigned to a less privileged zone is granted the privileges of a more trusted zone. This can be accomplished by exploiting bugs in the browser, exploiting incorrect configuration in the zone controls, through a cross-site scripting attack that causes the attackers' content to be treated as coming from a more trusted page, or by leveraging some piece of system functionality that is accessible from both the trusted and less trusted zone. This attack differs from "Restful Privilege Escalation" in that the latter correlates to the inadequate securing of RESTful access methods (such as HTTP DELETE) on the server, while cross-zone scripting attacks the concept of security zones as implemented by a browser.
- Cross Site Scripting through Log Files An attacker may leverage a system weakness where logs are susceptible to log injection to insert scripts into the system's logs. If these logs are later viewed by an administrator through a thin administrative interface and the log data is not properly HTML encoded before being written to the page, the attackers' scripts stored in the log will be executed in the administrative interface with potentially serious consequences. This attack pattern is really a combination of two other attack patterns: log injection and stored cross site scripting.
- Command Line Execution through SQL Injection An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.
Exploit-Db
id EDB-ID:47456 last seen 2019-10-02 modified 2019-10-02 published 2019-10-02 reporter Exploit-DB source https://www.exploit-db.com/download/47456 title DOUBLEPULSAR - Payload Execution and Neutralization (Metasploit) description Microsoft Windows - SrvOs2FeaToNt SMB Remote Code Execution (MS17-010). CVE-2017-0143,CVE-2017-0144,CVE-2017-0145,CVE-2017-0146,CVE-2017-0147,CVE-2017-0148. ... file exploits/windows_x86-64/remote/41987.py id EDB-ID:41987 last seen 2017-05-10 modified 2017-05-10 platform windows_x86-64 port published 2017-05-10 reporter Exploit-DB source https://www.exploit-db.com/download/41987/ title Microsoft Windows - SrvOs2FeaToNt SMB Remote Code Execution (MS17-010) type remote description Microsoft Windows - Unauthenticated SMB Remote Code Execution (MS17-010) (Metasploit). CVE-2017-0143,CVE-2017-0144,CVE-2017-0145,CVE-2017-0146,CVE-2017-0147,... file exploits/windows/dos/41891.rb id EDB-ID:41891 last seen 2017-04-18 modified 2017-04-17 platform windows port 445 published 2017-04-17 reporter Exploit-DB source https://www.exploit-db.com/download/41891/ title Microsoft Windows - Unauthenticated SMB Remote Code Execution (MS17-010) (Metasploit) type dos
Metasploit
description This module is a port of the Equation Group ETERNALBLUE exploit, part of the FuzzBunch toolkit released by Shadow Brokers. There is a buffer overflow memmove operation in Srv!SrvOs2FeaToNt. The size is calculated in Srv!SrvOs2FeaListSizeToNt, with mathematical error where a DWORD is subtracted into a WORD. The kernel pool is groomed so that overflow is well laid-out to overwrite an SMBv1 buffer. Actual RIP hijack is later completed in srvnet!SrvNetWskReceiveComplete. This exploit, like the original may not trigger 100% of the time, and should be run continuously until triggered. It seems like the pool will get hot streaks and need a cool down period before the shells rain in again. The module will attempt to use Anonymous login, by default, to authenticate to perform the exploit. If the user supplies credentials in the SMBUser, SMBPass, and SMBDomain options it will use those instead. On some systems, this module may cause system instability and crashes, such as a BSOD or a reboot. This may be more likely with some payloads. id MSF:EXPLOIT/WINDOWS/SMB/MS17_010_ETERNALBLUE last seen 2020-06-09 modified 2020-04-21 published 2017-12-14 references - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0144
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0145
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0146
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0147
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0148
- https://github.com/RiskSense-Ops/MS17-010
reporter Rapid7 source https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/windows/smb/ms17_010_eternalblue.rb title MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption description EternalBlue exploit for Windows 8, Windows 10, and 2012 by sleepya The exploit might FAIL and CRASH a target system (depended on what is overwritten) The exploit support only x64 target Tested on: \- Windows 2012 R2 x64 \- Windows 8.1 x64 \- Windows 10 Pro Build 10240 x64 \- Windows 10 Enterprise Evaluation Build 10586 x64 Default Windows 8 and later installation without additional service info: \- anonymous is not allowed to access any share (including IPC$) \- More info: https://support.microsoft.com/en-us/help/3034016/ipc-share-and-null-session-behavior-in-windows \- tcp port 445 is filtered by firewall Reference: \- http://blogs.360.cn/360safe/2017/04/17/nsa-eternalblue-smb/ \- "Bypassing Windows 10 kernel ASLR (remote) by Stefan Le Berre" https://drive.google.com/file/d/0B3P18M-shbwrNWZTa181ZWRCclk/edit Exploit info: \- If you do not know how exploit for Windows 7/2008 work. Please read my exploit for Windows 7/2008 at https://gist.github.com/worawit/bd04bad3cd231474763b873df081c09a because the trick for exploit is almost the same \- The exploit use heap of HAL for placing fake struct (address 0xffffffffffd00e00) and shellcode (address 0xffffffffffd01000). On Windows 8 and Wndows 2012, the NX bit is set on this memory page. Need to disable it before controlling RIP. \- The exploit is likely to crash a target when it failed \- The overflow is happened on nonpaged pool so we need to massage target nonpaged pool. \- If exploit failed but target does not crash, try increasing 'GroomAllocations' value (at least 5) \- See the code and comment for exploit detail. Disable NX method: \- The idea is from "Bypassing Windows 10 kernel ASLR (remote) by Stefan Le Berre" (see link in reference) \- The exploit is also the same but we need to trigger bug twice \- First trigger, set MDL.MappedSystemVa to target pte address \- Write '\x00' to disable the NX flag \- Second trigger, do the same as Windows 7 exploit \- From my test, if exploit disable NX successfully, I always get code execution id MSF:EXPLOIT/WINDOWS/SMB/MS17_010_ETERNALBLUE_WIN8 last seen 2020-06-04 modified 2019-11-02 published 2018-06-15 references - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0144
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0145
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0146
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0147
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0148
- https://github.com/worawit/MS17-010
reporter Rapid7 source https://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/windows/smb/ms17_010_eternalblue_win8.py title MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption for Win8+ description Uses information disclosure to determine if MS17-010 has been patched or not. Specifically, it connects to the IPC$ tree and attempts a transaction on FID 0. If the status returned is "STATUS_INSUFF_SERVER_RESOURCES", the machine does not have the MS17-010 patch. If the machine is missing the MS17-010 patch, the module will check for an existing DoublePulsar (ring 0 shellcode/malware) infection. This module does not require valid SMB credentials in default server configurations. It can log on as the user "\" and connect to IPC$. id MSF:AUXILIARY/SCANNER/SMB/SMB_MS17_010 last seen 2020-04-12 modified 2019-05-23 published 2017-03-29 references - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0144
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0145
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0146
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0147
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0148
- https://zerosum0x0.blogspot.com/2017/04/doublepulsar-initial-smb-backdoor-ring.html
- https://github.com/countercept/doublepulsar-detection-script
- https://technet.microsoft.com/en-us/library/security/ms17-010.aspx
reporter Rapid7 source https://github.com/rapid7/metasploit-framework/blob/master//modules/auxiliary/scanner/smb/smb_ms17_010.rb title MS17-010 SMB RCE Detection
Msbulletin
bulletin_id | ms17-010 |
bulletin_url | |
date | 2017-03-14T00:00:00 |
impact | Remote Code Execution |
knowledgebase_id | 4013389 |
knowledgebase_url | |
severity | Critical |
title | Security Update for Microsoft Windows SMB Server |
Nessus
NASL family Windows NASL id MS17-010.NASL description The remote Windows host is affected by the following vulnerabilities : - Multiple remote code execution vulnerabilities exist in Microsoft Server Message Block 1.0 (SMBv1) due to improper handling of certain requests. An unauthenticated, remote attacker can exploit these vulnerabilities, via a specially crafted packet, to execute arbitrary code. (CVE-2017-0143, CVE-2017-0144, CVE-2017-0145, CVE-2017-0146, CVE-2017-0148) - An information disclosure vulnerability exists in Microsoft Server Message Block 1.0 (SMBv1) due to improper handling of certain requests. An unauthenticated, remote attacker can exploit this, via a specially crafted packet, to disclose sensitive information. (CVE-2017-0147) ETERNALBLUE, ETERNALCHAMPION, ETERNALROMANCE, and ETERNALSYNERGY are four of multiple Equation Group vulnerabilities and exploits disclosed on 2017/04/14 by a group known as the Shadow Brokers. WannaCry / WannaCrypt is a ransomware program utilizing the ETERNALBLUE exploit, and EternalRocks is a worm that utilizes seven Equation Group vulnerabilities. Petya is a ransomware program that first utilizes CVE-2017-0199, a vulnerability in Microsoft Office, and then spreads via ETERNALBLUE. last seen 2020-06-01 modified 2020-06-02 plugin id 97833 published 2017-03-20 reporter This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/97833 title MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya) (uncredentialed check) code # # (C) Tenable Network Security, Inc. # include("compat.inc"); if (description) { script_id(97833); script_version("1.23"); script_cvs_date("Date: 2019/11/13"); script_cve_id( "CVE-2017-0143", "CVE-2017-0144", "CVE-2017-0145", "CVE-2017-0146", "CVE-2017-0147", "CVE-2017-0148" ); script_bugtraq_id( 96703, 96704, 96705, 96706, 96707, 96709 ); script_xref(name:"EDB-ID", value:"41891"); script_xref(name:"EDB-ID", value:"41987"); script_xref(name:"MSFT", value:"MS17-010"); script_xref(name:"IAVA", value:"2017-A-0065"); script_xref(name:"MSKB", value:"4012212"); script_xref(name:"MSKB", value:"4012213"); script_xref(name:"MSKB", value:"4012214"); script_xref(name:"MSKB", value:"4012215"); script_xref(name:"MSKB", value:"4012216"); script_xref(name:"MSKB", value:"4012217"); script_xref(name:"MSKB", value:"4012606"); script_xref(name:"MSKB", value:"4013198"); script_xref(name:"MSKB", value:"4013429"); script_xref(name:"MSKB", value:"4012598"); script_name(english:"MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya) (uncredentialed check)"); script_summary(english:"Checks the presence of MS17-010."); script_set_attribute(attribute:"synopsis", value: "The remote Windows host is affected by multiple vulnerabilities."); script_set_attribute(attribute:"description", value: "The remote Windows host is affected by the following vulnerabilities : - Multiple remote code execution vulnerabilities exist in Microsoft Server Message Block 1.0 (SMBv1) due to improper handling of certain requests. An unauthenticated, remote attacker can exploit these vulnerabilities, via a specially crafted packet, to execute arbitrary code. (CVE-2017-0143, CVE-2017-0144, CVE-2017-0145, CVE-2017-0146, CVE-2017-0148) - An information disclosure vulnerability exists in Microsoft Server Message Block 1.0 (SMBv1) due to improper handling of certain requests. An unauthenticated, remote attacker can exploit this, via a specially crafted packet, to disclose sensitive information. (CVE-2017-0147) ETERNALBLUE, ETERNALCHAMPION, ETERNALROMANCE, and ETERNALSYNERGY are four of multiple Equation Group vulnerabilities and exploits disclosed on 2017/04/14 by a group known as the Shadow Brokers. WannaCry / WannaCrypt is a ransomware program utilizing the ETERNALBLUE exploit, and EternalRocks is a worm that utilizes seven Equation Group vulnerabilities. Petya is a ransomware program that first utilizes CVE-2017-0199, a vulnerability in Microsoft Office, and then spreads via ETERNALBLUE."); # https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2017/ms17-010 script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?68fc8eff"); # https://blogs.technet.microsoft.com/msrc/2017/04/14/protecting-customers-and-evaluating-risk/ script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?321523eb"); # https://cloudblogs.microsoft.com/microsoftsecure/2017/05/12/wannacrypt-ransomware-worm-targets-out-of-date-systems/?source=mmpc script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?065561d0"); # https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/ script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?d9f569cf"); script_set_attribute(attribute:"see_also", value:"https://blogs.technet.microsoft.com/filecab/2016/09/16/stop-using-smb1/"); # https://support.microsoft.com/en-us/help/2696547/how-to-detect-enable-and-disable-smbv1-smbv2-and-smbv3-in-windows-and script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?b9d9ebf9"); # https://www.us-cert.gov/ncas/current-activity/2017/01/16/SMB-Security-Best-Practices script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?8dcab5e4"); # https://www.theregister.co.uk/2017/01/18/uscert_warns_admins_to_kill_smb_after_shadow_brokers_dump/ script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?234f8ef8"); # https://www.riskbasedsecurity.com/2016/08/the-shadow-brokers-lifting-the-shadows-of-the-nsas-equation-group/ script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?4c7e0cf3"); script_set_attribute(attribute:"see_also", value:"https://github.com/stamparm/EternalRocks/"); # https://www.tenable.com/blog/petyanotpetya-ransomware-detection-for-the-modern-enterprise script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?59db5b5b"); script_set_attribute(attribute:"solution", value: "Microsoft has released a set of patches for Windows Vista, 2008, 7, 2008 R2, 2012, 8.1, RT 8.1, 2012 R2, 10, and 2016. Microsoft has also released emergency patches for Windows operating systems that are no longer supported, including Windows XP, 2003, and 8. For unsupported Windows operating systems, e.g. Windows XP, Microsoft recommends that users discontinue the use of SMBv1. SMBv1 lacks security features that were included in later SMB versions. SMBv1 can be disabled by following the vendor instructions provided in Microsoft KB2696547. Additionally, US-CERT recommends that users block SMB directly by blocking TCP port 445 on all network boundary devices. For SMB over the NetBIOS API, block TCP ports 137 / 139 and UDP ports 137 / 138 on all network boundary devices."); script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:C/I:C/A:C"); script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C"); script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"); script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:C"); script_set_attribute(attribute:"cvss_score_source", value:"CVE-2017-0148"); script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available"); script_set_attribute(attribute:"exploit_available", value:"true"); script_set_attribute(attribute:"exploit_framework_core", value:"true"); script_set_attribute(attribute:"exploited_by_malware", value:"true"); script_set_attribute(attribute:"metasploit_name", value:'MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption'); script_set_attribute(attribute:"exploit_framework_metasploit", value:"true"); script_set_attribute(attribute:"exploit_framework_canvas", value:"true"); script_set_attribute(attribute:"canvas_package", value:'CANVAS'); script_set_attribute(attribute:"in_the_news", value:"true"); script_set_attribute(attribute:"vuln_publication_date", value:"2017/03/14"); script_set_attribute(attribute:"patch_publication_date", value:"2017/03/14"); script_set_attribute(attribute:"plugin_publication_date", value:"2017/03/20"); script_set_attribute(attribute:"plugin_type", value:"remote"); script_set_attribute(attribute:"cpe", value:"cpe:/o:microsoft:windows"); script_set_attribute(attribute:"stig_severity", value:"I"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_family(english:"Windows"); script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof."); script_dependencies("os_fingerprint.nasl", "smb_v1_enabled_remote.nasl"); script_require_keys("Host/OS", "SMB/SMBv1_is_supported"); script_require_ports(139, 445); exit(0); } include("audit.inc"); include("misc_func.inc"); include("byte_func.inc"); include("global_settings.inc"); include("smb_func.inc"); function smb_get_error_code (data) { local_var header, flags2, code; # Some checks in the header first header = get_smb_header (smbblob:data); if (!header) return NULL; flags2 = get_header_flags2 (header:header); if (flags2 & SMB_FLAGS2_32BIT_STATUS) { code = get_header_nt_error_code (header:header); } else { code = get_header_dos_error_code (header:header); } return code; } function my_smb_trans_and_x (setup, transname, param, data, max_pcount, max_dcount) { local_var header, parameters, dat, packet, ret, pad1, trans, p_offset, d_offset, plen, dlen, slen, pad2, npad; npad = pad1 = pad2 = NULL; if (session_is_unicode () == 1) trans = cstring (string:transname); else trans = transname; header = smb_header (Command: SMB_COM_TRANSACTION, Status: nt_status (Status: STATUS_SUCCESS)); p_offset = 32 + 1 + 28 + strlen(setup) + 2 + strlen(trans); # Unicode transname should be aligned to 2 byte if(session_is_unicode() == 1) { npad = crap(data:'\x00', length: (2 - p_offset % 2) % 2); p_offset += strlen(npad); } # Parameter is aligned to 4 byte pad1 = crap(data:'\x00', length: (4 - p_offset % 4) % 4); p_offset += strlen(pad1); # Data is aligned to 4 byte d_offset = p_offset + strlen (param); pad2 = crap(data:'\x00', length: (4 - d_offset % 4) % 4); d_offset += strlen(pad2); plen = strlen(param); dlen = strlen(data); slen = strlen(setup); if(isnull(max_pcount)) max_pcount =0xffff; if(isnull(max_dcount)) max_dcount =0xffff; parameters = raw_word (w:plen) + # total parameter count raw_word (w:dlen) + # total data count raw_word (w:max_pcount) + # Max parameter count raw_word (w:max_dcount) + # Max data count raw_byte (b:0) + # Max setup count raw_byte (b:0) + # Reserved raw_word (w:0) + # Flags raw_dword (d:0) + # Timeout raw_word (w:0) + # Reserved raw_word (w:plen) + # Parameter count raw_word (w:p_offset) + # Parameter offset raw_word (w:dlen) + # Data count raw_word (w:d_offset) + # Data offset raw_byte (b:slen/2) + # Setup count raw_byte (b:0); # Reserved parameters += setup; parameters = smb_parameters (data:parameters); dat = npad + trans + pad1 + param + pad2 + data; dat = smb_data (data:dat); packet = netbios_packet (header:header, parameters:parameters, data:dat); ret = smb_sendrecv (data:packet); if (!ret) return NULL; return smb_get_error_code (data:ret); } # # MAIN # # Make sure it's Windows os = get_kb_item_or_exit("Host/OS"); if ("Windows" >!< os) audit(AUDIT_HOST_NOT, "Windows"); # Make sure SMBv1 is enabled if (! get_kb_item("SMB/SMBv1_is_supported")) exit(0, "SMB version 1 does not appear to be enabled on the remote host."); if (!smb_session_init(smb2:FALSE)) audit(AUDIT_FN_FAIL, 'smb_session_init'); r = NetUseAdd(share:"IPC$"); if (r != 1) { exit(1, 'Failed to connect to the IPC$ share anonymously.'); } fid = 0; # Invalid FID setup = raw_word (w:0x23) + raw_word (w:fid); status = my_smb_trans_and_x (setup: setup, transname:"\PIPE\"); NetUseDel(); if(! isnull(status)) { if(status == STATUS_INVALID_HANDLE || status == STATUS_ACCESS_DENIED # Win 10 ) { audit(AUDIT_HOST_NOT , "affected"); } else if (status == STATUS_INSUFF_SERVER_RESOURCES) { port = kb_smb_transport(); security_report_v4(port: port, severity: SECURITY_HOLE); } else { status = "0x" + toupper(hexstr(mkdword(status))); audit(AUDIT_RESP_BAD, port, "an SMB_COM_TRANSACTION request. Status code: " + status); } } else { exit(1, "Failed to get response status for an SMB_COM_TRANSACTION request."); }
NASL family Windows : Microsoft Bulletins NASL id SMB_NT_MS17-010.NASL description The remote Windows host is missing a security update. It is, therefore, affected by the following vulnerabilities : - Multiple remote code execution vulnerabilities exist in Microsoft Server Message Block 1.0 (SMBv1) due to improper handling of certain requests. An unauthenticated, remote attacker can exploit these vulnerabilities, via a specially crafted packet, to execute arbitrary code. (CVE-2017-0143, CVE-2017-0144, CVE-2017-0145, CVE-2017-0146, CVE-2017-0148) - An information disclosure vulnerability exists in Microsoft Server Message Block 1.0 (SMBv1) due to improper handling of certain requests. An unauthenticated, remote attacker can exploit this, via a specially crafted packet, to disclose sensitive information. (CVE-2017-0147) ETERNALBLUE, ETERNALCHAMPION, ETERNALROMANCE, and ETERNALSYNERGY are four of multiple Equation Group vulnerabilities and exploits disclosed on 2017/04/14 by a group known as the Shadow Brokers. WannaCry / WannaCrypt is a ransomware program utilizing the ETERNALBLUE exploit, and EternalRocks is a worm that utilizes seven Equation Group vulnerabilities. Petya is a ransomware program that first utilizes CVE-2017-0199, a vulnerability in Microsoft Office, and then spreads via ETERNALBLUE. last seen 2020-06-01 modified 2020-06-02 plugin id 97737 published 2017-03-15 reporter This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/97737 title MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya) code # # (C) Tenable Network Security, Inc. # include("compat.inc"); if (description) { script_id(97737); script_version("1.24"); script_cvs_date("Date: 2019/11/13"); script_cve_id( "CVE-2017-0143", "CVE-2017-0144", "CVE-2017-0145", "CVE-2017-0146", "CVE-2017-0147", "CVE-2017-0148" ); script_bugtraq_id( 96703, 96704, 96705, 96706, 96707, 96709 ); script_xref(name:"MSFT", value:"MS17-010"); script_xref(name:"MSKB", value:"4012212"); script_xref(name:"MSKB", value:"4012213"); script_xref(name:"MSKB", value:"4012214"); script_xref(name:"MSKB", value:"4012215"); script_xref(name:"MSKB", value:"4012216"); script_xref(name:"MSKB", value:"4012217"); script_xref(name:"MSKB", value:"4012606"); script_xref(name:"MSKB", value:"4013198"); script_xref(name:"MSKB", value:"4013429"); script_xref(name:"MSKB", value:"4012598"); script_xref(name:"IAVA", value:"2017-A-0065"); script_xref(name:"EDB-ID", value:"41891"); script_xref(name:"EDB-ID", value:"41987"); script_name(english:"MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya)"); script_summary(english:"Checks the version of the SYS files."); script_set_attribute(attribute:"synopsis", value: "The remote Windows host is affected by multiple vulnerabilities."); script_set_attribute(attribute:"description", value: "The remote Windows host is missing a security update. It is, therefore, affected by the following vulnerabilities : - Multiple remote code execution vulnerabilities exist in Microsoft Server Message Block 1.0 (SMBv1) due to improper handling of certain requests. An unauthenticated, remote attacker can exploit these vulnerabilities, via a specially crafted packet, to execute arbitrary code. (CVE-2017-0143, CVE-2017-0144, CVE-2017-0145, CVE-2017-0146, CVE-2017-0148) - An information disclosure vulnerability exists in Microsoft Server Message Block 1.0 (SMBv1) due to improper handling of certain requests. An unauthenticated, remote attacker can exploit this, via a specially crafted packet, to disclose sensitive information. (CVE-2017-0147) ETERNALBLUE, ETERNALCHAMPION, ETERNALROMANCE, and ETERNALSYNERGY are four of multiple Equation Group vulnerabilities and exploits disclosed on 2017/04/14 by a group known as the Shadow Brokers. WannaCry / WannaCrypt is a ransomware program utilizing the ETERNALBLUE exploit, and EternalRocks is a worm that utilizes seven Equation Group vulnerabilities. Petya is a ransomware program that first utilizes CVE-2017-0199, a vulnerability in Microsoft Office, and then spreads via ETERNALBLUE."); script_set_attribute(attribute:"see_also", value:"https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2017/ms17-010"); # https://blogs.technet.microsoft.com/msrc/2017/04/14/protecting-customers-and-evaluating-risk/ script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?321523eb"); # https://cloudblogs.microsoft.com/microsoftsecure/2017/05/12/wannacrypt-ransomware-worm-targets-out-of-date-systems/?source=mmpc script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?065561d0"); # https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/ script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?d9f569cf"); script_set_attribute(attribute:"see_also", value:"https://github.com/stamparm/EternalRocks/"); # https://www.tenable.com/blog/petyanotpetya-ransomware-detection-for-the-modern-enterprise script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?59db5b5b"); script_set_attribute(attribute:"solution", value: "Microsoft has released a set of patches for Windows Vista, 2008, 7, 2008 R2, 2012, 8.1, RT 8.1, 2012 R2, 10, and 2016. Microsoft has also released emergency patches for Windows operating systems that are no longer supported, including Windows XP, 2003, and 8."); script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:C/I:C/A:C"); script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C"); script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"); script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:C"); script_set_attribute(attribute:"cvss_score_source", value:"CVE-2017-0148"); script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available"); script_set_attribute(attribute:"exploit_available", value:"true"); script_set_attribute(attribute:"exploit_framework_core", value:"true"); script_set_attribute(attribute:"exploited_by_malware", value:"true"); script_set_attribute(attribute:"metasploit_name", value:'MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption'); script_set_attribute(attribute:"exploit_framework_metasploit", value:"true"); script_set_attribute(attribute:"exploit_framework_canvas", value:"true"); script_set_attribute(attribute:"canvas_package", value:'CANVAS'); script_set_attribute(attribute:"in_the_news", value:"true"); script_set_attribute(attribute:"vuln_publication_date", value:"2017/03/14"); script_set_attribute(attribute:"patch_publication_date", value:"2017/03/14"); script_set_attribute(attribute:"plugin_publication_date", value:"2017/03/15"); script_set_attribute(attribute:"plugin_type", value:"local"); script_set_attribute(attribute:"cpe", value:"cpe:/o:microsoft:windows"); script_set_attribute(attribute:"stig_severity", value:"I"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_family(english:"Windows : Microsoft Bulletins"); script_copyright(english:"This script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof."); script_dependencies("smb_hotfixes.nasl", "ms_bulletin_checks_possible.nasl", "smb_check_rollup.nasl"); script_require_keys("SMB/MS_Bulletin_Checks/Possible"); script_require_ports(139, 445, "Host/patch_management_checks"); exit(0); } include("audit.inc"); include("smb_hotfixes_fcheck.inc"); include("smb_hotfixes.inc"); include("smb_func.inc"); include("misc_func.inc"); get_kb_item_or_exit("SMB/MS_Bulletin_Checks/Possible"); bulletin = 'MS17-010'; kbs = make_list( "4012212", "4012213", "4012214", "4012215", "4012216", "4012217", "4012606", "4013198", "4013429", "4012598" ); vuln = 0; if (get_kb_item("Host/patch_management_checks")) hotfix_check_3rd_party(bulletin:bulletin, kbs:kbs, severity:SECURITY_HOLE); get_kb_item_or_exit("SMB/Registry/Enumerated"); get_kb_item_or_exit("SMB/WindowsVersion", exit_code:1); if (hotfix_check_sp_range(xp:'3', win2003:'2',vista:'2', win7:'1', win8:'0', win81:'0', win10:'0') <= 0) audit(AUDIT_OS_SP_NOT_VULN); if (hotfix_check_server_nano() == 1) audit(AUDIT_OS_NOT, "a currently supported OS (Windows Nano Server)"); productname = get_kb_item_or_exit("SMB/ProductName", exit_code:1); if ("Windows Embedded" >< productname) exit(0, "Nessus does not support bulletin / patch checks for Windows Embedded."); share = hotfix_get_systemdrive(as_share:TRUE, exit_on_fail:TRUE); if (!is_accessible_share(share:share)) audit(AUDIT_SHARE_FAIL, share); if ( ############## ## MAY 2017 ## ############## # Windows XP SP2 hotfix_is_vulnerable(os:"5.2", sp:2, file:"srv.sys", version:"5.2.3790.6021", min_version:"5.2.3790.3000", dir:"\system32\drivers", bulletin:bulletin, kb:"4012598", arch:"x64") || # Windows XP SP3 hotfix_is_vulnerable(os:"5.1", sp:3, file:"srv.sys", version:"5.1.2600.7208", min_version:"5.1.2600.5000", dir:"\system32\drivers", bulletin:bulletin, kb:"4012598", arch:"x86") || # Windows Server 2003 SP2 hotfix_is_vulnerable(os:"5.2", sp:2, file:"srv.sys", version:"5.2.3790.6021", min_version:"5.2.3790.3000", dir:"\system32\drivers", bulletin:bulletin, kb:"4012598") || # Windows 8 ( ("Windows 8" >< productname && "Windows 8.1" >!< productname && "2012" >!< productname) && hotfix_is_vulnerable(os:"6.2", sp:0, file:"srv.sys", version:"6.2.9200.22099", min_version:"6.2.9200.16000", dir:"\system32\drivers", bulletin:bulletin, kb:"4012598") ) || # Windows Server 2012 ( "Windows 8" >!< productname && hotfix_is_vulnerable(os:"6.2", sp:0, file:"srv.sys", version:"6.2.9200.22099", min_version:"6.2.9200.16000", dir:"\system32\drivers", bulletin:bulletin, kb:"4019213") ) || # Windows 8.1 / Windows Server 2012 R2 hotfix_is_vulnerable(os:"6.3", sp:0, file:"srv.sys", version:"6.2.9200.22137", min_version:"6.2.9200.16000", dir:"\system32\drivers", bulletin:bulletin, kb:"4019213") || ############## ## MAR 2017 ## ############## # Windows Vista Service Pack 2 / Windows Server 2008 hotfix_is_vulnerable(os:"6.0", sp:2, file:"srv.sys", version:"6.0.6002.19743", min_version:"6.0.6002.18000", dir:"\system32\drivers", bulletin:bulletin, kb:"4012598") || hotfix_is_vulnerable(os:"6.0", sp:2, file:"srv.sys", version:"6.0.6002.24067", min_version:"6.0.6002.20000", dir:"\system32\drivers", bulletin:bulletin, kb:"4012598") || # Windows 7 / Windows Server 2008 R2 smb_check_rollup(os:"6.1", sp:1, rollup_date:"03_2017", bulletin:bulletin, rollup_kb_list:make_list(4012212, 4012215)) || # Windows Server 2012 ( "Windows 8" >!< productname && smb_check_rollup(os:"6.2", sp:0, rollup_date:"03_2017", bulletin:bulletin, rollup_kb_list:make_list(4012214, 4012217)) ) || # Windows 8.1 / Windows Server 2012 R2 smb_check_rollup(os:"6.3", sp:0, rollup_date:"03_2017", bulletin:bulletin, rollup_kb_list:make_list(4012213, 4012216)) || # Windows 10 smb_check_rollup(os:"10", sp:0, os_build:"10240", rollup_date:"03_2017", bulletin:bulletin, rollup_kb_list:make_list(4012606)) || # Windows 10 1511 smb_check_rollup(os:"10", sp:0, os_build:"10586", rollup_date:"03_2017", bulletin:bulletin, rollup_kb_list:make_list(4013198)) || # Windows 10 1607 / Windows Server 2016 smb_check_rollup(os:"10", sp:0, os_build:"14393", rollup_date:"03_2017", bulletin:bulletin, rollup_kb_list:make_list(4013429)) ) { set_kb_item(name:'SMB/Missing/'+bulletin, value:TRUE); hotfix_security_hole(); hotfix_check_fversion_end(); exit(0); } else { hotfix_check_fversion_end(); audit(AUDIT_HOST_NOT, hotfix_get_audit_report()); }
Packetstorm
data source https://packetstormsecurity.com/files/download/142181/mswinsmb-exec.rb.txt id PACKETSTORM:142181 last seen 2017-04-18 published 2017-04-17 reporter Sean Dillon source https://packetstormsecurity.com/files/142181/Microsoft-Windows-MS17-010-SMB-Remote-Code-Execution.html title Microsoft Windows MS17-010 SMB Remote Code Execution data source https://packetstormsecurity.com/files/download/154690/doublepulsar_rce.rb.txt id PACKETSTORM:154690 last seen 2019-10-02 published 2019-10-01 reporter Luke Jennings source https://packetstormsecurity.com/files/154690/DOUBLEPULSAR-Payload-Execution-Neutralization.html title DOUBLEPULSAR Payload Execution / Neutralization data source https://packetstormsecurity.com/files/download/156196/smb_doublepulsar_rce.rb.txt id PACKETSTORM:156196 last seen 2020-02-06 published 2020-02-04 reporter Luke Jennings source https://packetstormsecurity.com/files/156196/SMB-DOUBLEPULSAR-Remote-Code-Execution.html title SMB DOUBLEPULSAR Remote Code Execution data source https://packetstormsecurity.com/files/download/142548/ms17_010_eternalblue.rb.txt id PACKETSTORM:142548 last seen 2017-05-17 published 2017-05-17 reporter Sean Dillon source https://packetstormsecurity.com/files/142548/MS17-010-EternalBlue-SMB-Remote-Windows-Kernel-Pool-Corruption.html title MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption
Seebug
bulletinFamily | exploit |
description | From the shadowbroker, Windows XP to Windows 2012 SMB remote code execution vulnerability, corresponding to the number ETERNALBLUE it. * [CVE-2017-0143](<http://cvedetails.com/cve/cve-2017-0143>) * [CVE-2017-0144](<http://cvedetails.com/cve/cve-2017-0144>) * [CVE-2017-0145](<http://cvedetails.com/cve/cve-2017-0145>) * [CVE-2017-0146](<http://cvedetails.com/cve/cve-2017-0146>) * [CVE-2017-0147](<http://cvedetails.com/cve/cve-2017-0147>) * [CVE-2017-0148](<http://cvedetails.com/cve/cve-2017-0148>) Reference: https://github.com/misterch0c/shadowbroker/blob/master/windows/specials/ |
id | SSV:92952 |
last seen | 2017-11-19 |
modified | 2017-04-15 |
published | 2017-04-15 |
reporter | Root |
title | ETERNALBLUE - Remote RCE via SMB & NBT (Windows XP to Windows 2012) |
The Hacker News
id | THN:18A54BDD63D7DC2B3284D326E6510150 |
last seen | 2018-03-15 |
modified | 2018-03-15 |
published | 2017-05-15 |
reporter | Mohit Kumar |
source | https://thehackernews.com/2017/05/how-to-wannacry-ransomware.html |
title | WannaCry Ransomware: Everything You Need To Know Immediately |
References
- https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-0148
- http://www.securityfocus.com/bid/96706
- http://www.securitytracker.com/id/1037991
- https://www.exploit-db.com/exploits/41987/
- https://www.exploit-db.com/exploits/41891/
- https://ics-cert.us-cert.gov/advisories/ICSMA-18-058-02
- https://cert-portal.siemens.com/productcert/pdf/ssa-701903.pdf
- https://cert-portal.siemens.com/productcert/pdf/ssa-966341.pdf
- http://packetstormsecurity.com/files/154690/DOUBLEPULSAR-Payload-Execution-Neutralization.html
- http://packetstormsecurity.com/files/156196/SMB-DOUBLEPULSAR-Remote-Code-Execution.html