{"id":7626,"date":"2017-05-12T15:10:39","date_gmt":"2017-05-12T23:10:39","guid":{"rendered":"http:\/\/www.palada.net\/index.php\/2017\/05\/12\/news-1411\/"},"modified":"2017-05-12T15:10:39","modified_gmt":"2017-05-12T23:10:39","slug":"news-1411","status":"publish","type":"post","link":"http:\/\/www.palada.net\/index.php\/2017\/05\/12\/news-1411\/","title":{"rendered":"The worm that spreads WanaCrypt0r"},"content":{"rendered":"<p><strong>Credit to Author: Zammis Clark| Date: Fri, 12 May 2017 22:02:24 +0000<\/strong><\/p>\n<p>Something that many security researchers have feared has indeed come true. Threat actors have integrated a critical exploit taking advantage of a popular communication protocol used by Windows systems, crippling thousands of computers worldwide with ransomware.<\/p>\n<p>Within hours of being leveraged, a\u00a0flaw that\u00a0had been recently patched by Microsoft has been used to distribute\u00a0the WanaCrypt0r ransomware and <a href=\"https:\/\/blog.malwarebytes.com\/cybercrime\/2017\/05\/wanacrypt0r-ransomware-hits-it-big-just-before-the-weekend\/\" target=\"_blank\" rel=\"noopener noreferrer\">wreak havoc worldwide<\/a>.<\/p>\n<p>In this blog post, we will describe the worm responsible for spreading\u00a0this ransomware by looking at its capabilities and what has made this threat so successful.<\/p>\n<h3>Main functionality<\/h3>\n<p>WanaCrypt0r has been most effective\u2014not only does the ransomware loop through every open RDP session on a system and run the ransomware as that user, but the initial component that gets dropped on systems appears to be a worm that contains and runs the ransomware, spreading itself using the <code>ETERNALBLUE<\/code> SMB vulnerability (<a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/security\/ms17-010.aspx\" target=\"_blank\" rel=\"noopener noreferrer\">MS17-010<\/a>).<\/p>\n<p>The <code>WinMain<\/code> of this <a href=\"https:\/\/virustotal.com\/en\/file\/24d004a104d4d54034dbcffc2a4b19a11f39008a575aa614ea04703480b1022c\/analysis\/\" target=\"_blank\" rel=\"noopener noreferrer\">executable<\/a> first tries to connect to the website <code>www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com.<\/code>\u00a0It doesn&#8217;t actually download anything there, just tries to connect. If the connection succeeds, the binary exits.<\/p>\n<p>This was probably some kind of kill switch or anti-sandbox technique. Whichever it is, it has backfired on the authors of the worm, as the domain has been sinkholed and the host in question now resolves to an IP address that hosts a website. Therefore,\u00a0nothing will happen on any new systems that runs the executable. This only applies to the binary with the hash listed above; there may well be new versions released in the future.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17903\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_winmain.png\" alt=\"\" width=\"788\" height=\"572\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_winmain.png 788w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_winmain-300x218.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_winmain-600x436.png 600w\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" \/><\/p>\n<p>After this check passes, the first thing the worm does is check the number of arguments it was launched with. If it was run with less than two arguments passed, it installs a service called <code>mssecsvc2.0<\/code> with display name <code>Microsoft Security Center (2.0) Service<\/code> (where the binary ran is itself with two arguments), starts that service, drops the ransomware binary located in the resources of the worm, and runs it.<\/p>\n<p>If it was run with two arguments or more\u2014in other words, if it was run as a service\u2014execution eventually falls through to the worm function.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17905\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_the_worm_function.png\" alt=\"\" width=\"586\" height=\"411\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_the_worm_function.png 586w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_the_worm_function-300x210.png 300w\" sizes=\"auto, (max-width: 586px) 100vw, 586px\" \/><\/p>\n<p>The initialization function called first calls <code>WSAStartup()<\/code> to initialize networking, then <code>CryptAcquireContext()<\/code> to initialize the crypto API so it can use a cryptographically-secure pseudo-random number generator. It then calls a function that initializes two buffers used for storing the worm payload DLLs, one x86 and one x64. It copies the payload DLLs from the <code>.data<\/code> section of the worm and then copies the entire worm binary after it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17906\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_payload_init.png\" alt=\"\" width=\"733\" height=\"511\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_payload_init.png 733w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_payload_init-300x209.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_payload_init-600x418.png 600w\" sizes=\"auto, (max-width: 733px) 100vw, 733px\" \/><\/p>\n<p>The code of each payload DLL is very small, just getting the resource content (i.e. the worm binary), dropping to disk as <code>C:WINDOWSmssecsvc.exe<\/code> (this path is actually hardcoded) and executing it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17908\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_payload_code.png\" alt=\"\" width=\"718\" height=\"198\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_payload_code.png 718w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_payload_code-300x83.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_payload_code-600x165.png 600w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\" \/><\/p>\n<h3>SMB vulnerability leveraged to spread ransomware\u00a0worldwide<\/h3>\n<p>After initializing the functionality used by the worm, two threads are created. The first thread scans hosts on the LAN. The second thread gets created 128 times and scans hosts on the wider Internet.<\/p>\n<p>The first thread (in charge of scanning LAN) uses <code>GetAdaptersInfo()<\/code> to get a list of IP ranges on the local network, then creates an array of every IP in those ranges to scan.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17910\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_getadaptorinfo.png\" alt=\"\" width=\"553\" height=\"217\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_getadaptorinfo.png 553w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_getadaptorinfo-300x118.png 300w\" sizes=\"auto, (max-width: 553px) 100vw, 553px\" \/><\/p>\n<p>The LAN scanning is multithreaded itself, and there is code to prevent scanning more than 10 IP addresses on the LAN at a time.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17911\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_lan.png\" alt=\"\" width=\"481\" height=\"302\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_lan.png 481w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_lan-300x188.png 300w\" sizes=\"auto, (max-width: 481px) 100vw, 481px\" \/><\/p>\n<p>The scanning thread tries to connect to port 445, and if so creates a new thread to try to exploit the system using MS17-010\/EternalBlue. If the exploitation attempts take over 10 minutes, then the exploitation thread is stopped.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17912\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_lan_thread.png\" alt=\"\" width=\"614\" height=\"303\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_lan_thread.png 614w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_lan_thread-300x148.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_lan_thread-600x296.png 600w\" sizes=\"auto, (max-width: 614px) 100vw, 614px\" \/><\/p>\n<p>The threads that scan the Internet generate a random IP address, using either the OS&#8217;s cryptographically secure pseudo-random number generator initialized earlier, or a weaker pseudo-random number generator if the CSPRNG failed to initialize. If connection to port 445 on that random IP address succeeds, the entire <code>\/24<\/code> range is scanned, and if port 445 is open, exploit attempts are made. This time, exploitation timeout for each IP happens not after 10 minutes but after one hour.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17913\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_inet_part1.png\" alt=\"\" width=\"876\" height=\"499\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_inet_part1.png 876w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_inet_part1-300x171.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_inet_part1-600x342.png 600w\" sizes=\"auto, (max-width: 876px) 100vw, 876px\" \/><br \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17914\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_inet_part2.png\" alt=\"\" width=\"632\" height=\"364\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_inet_part2.png 632w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_inet_part2-300x173.png 300w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_scan_inet_part2-600x346.png 600w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\" \/><\/p>\n<p>The exploitation thread tries several times to exploit, with two different sets of buffers used (perhaps one for x86 and one for x64). If it detects the presence of <code>DOUBLEPULSAR<\/code> after any exploitation attempt, it uses <code>DOUBLEPULSAR<\/code> to load the relevant payload DLL.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17915\" src=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_exploitation_thread.png\" alt=\"\" width=\"468\" height=\"532\" srcset=\"https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_exploitation_thread.png 468w, https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/worm_exploitation_thread-264x300.png 264w\" sizes=\"auto, (max-width: 468px) 100vw, 468px\" \/><\/p>\n<h3>Protection<\/h3>\n<p>It is <b>critical<\/b> that you install all available OS updates to prevent getting exploited by the MS17-010 vulnerability. Any systems running a Windows version that did not receive a patch for this vulnerability should be removed from all networks. If your systems have been affected, <code>DOUBLEPULSAR<\/code> will have also been installed, so this will need to also be removed. <a href=\"https:\/\/github.com\/countercept\/doublepulsar-detection-script\" target=\"_blank\" rel=\"noopener noreferrer\">A script is available<\/a> that can remotely detect and remove the <code>DOUBLEPULSAR<\/code> backdoor. Consumer and business customers of Malwarebytes are protected from this ransomware by the premium version of <a href=\"http:\/\/www.malwarebytes.com\/premium\" target=\"_blank\" rel=\"noopener noreferrer\">Malwarebytes<\/a> and <a href=\"http:\/\/www.malwarebytes.com\/business\/endpointsecurity\" target=\"_blank\" rel=\"noopener noreferrer\">Malwarebytes Endpoint Security<\/a>, respectively.<\/p>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2017\/05\/the-worm-that-spreads-wanacrypt0r\/\">The worm that spreads WanaCrypt0r<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\">Malwarebytes Labs<\/a>.<\/p>\n<p><a href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2017\/05\/the-worm-that-spreads-wanacrypt0r\/\" target=\"bwo\" >https:\/\/blog.malwarebytes.com\/feed\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><strong>Credit to Author: Zammis Clark| Date: Fri, 12 May 2017 22:02:24 +0000<\/strong><\/p>\n<table cellpadding='10'>\n<tr>\n<td valign='top' align='center'><a href='https:\/\/blog.malwarebytes.com\/threat-analysis\/2017\/05\/the-worm-that-spreads-wanacrypt0r\/' title='The worm that spreads WanaCrypt0r'><img src='https:\/\/blog.malwarebytes.com\/wp-content\/uploads\/2017\/05\/shutterstock_584007028.jpg' border='0'  width='300px'  \/><\/a><\/td>\n<\/tr>\n<tr>\n<td valign='top' align='left'>WanaCrypt0r is a ransomware infection that has spread through many corporate networks. Read a technical analysis of the worm that allowed it to do this.<\/p>\n<p>Categories: <\/p>\n<ul class=\"post-categories\">\n<li><a href=\"https:\/\/blog.malwarebytes.com\/category\/threat-analysis\/malware-threat-analysis\/\" rel=\"category tag\">Malware<\/a><\/li>\n<li><a href=\"https:\/\/blog.malwarebytes.com\/category\/threat-analysis\/\" rel=\"category tag\">Threat analysis<\/a><\/li>\n<\/ul>\n<p>Tags: <a href=\"https:\/\/blog.malwarebytes.com\/tag\/microsoft\/\" rel=\"tag\">microsoft<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/nhs\/\" rel=\"tag\">NHS<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/nhs-wanacryptor\/\" rel=\"tag\">NHS WanaCryptor<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/nhs-wannacryptor\/\" rel=\"tag\">nhs wannacryptor<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/ransomware\/\" rel=\"tag\">ransomware<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/wana-decrptor\/\" rel=\"tag\">Wana Decrptor<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/wanacrypt0r\/\" rel=\"tag\">WanaCrypt0r<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/wcry\/\" rel=\"tag\">Wcry<\/a><a href=\"https:\/\/blog.malwarebytes.com\/tag\/windows\/\" rel=\"tag\">windows<\/a><\/p>\n<table width='100%'>\n<tr>\n<td align=right>\n<p><b>(<a href='https:\/\/blog.malwarebytes.com\/threat-analysis\/2017\/05\/the-worm-that-spreads-wanacrypt0r\/' title='The worm that spreads WanaCrypt0r'>Read more&#8230;<\/a>)<\/b><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<\/table>\n<p>The post <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\/threat-analysis\/2017\/05\/the-worm-that-spreads-wanacrypt0r\/\">The worm that spreads WanaCrypt0r<\/a> appeared first on <a rel=\"nofollow\" href=\"https:\/\/blog.malwarebytes.com\">Malwarebytes Labs<\/a>.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10488,10378],"tags":[3764,10516,9574,12253,12254,3765,10494,12257,12255,12256,10525],"class_list":["post-7626","post","type-post","status-publish","format-standard","hentry","category-malwarebytes","category-security","tag-malware","tag-microsoft","tag-nhs","tag-nhs-wanacryptor","tag-nhs-wannacryptor","tag-ransomware","tag-threat-analysis","tag-wana-decrptor","tag-wanacrypt0r","tag-wcry","tag-windows"],"_links":{"self":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/7626","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=7626"}],"version-history":[{"count":0,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/7626\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=7626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=7626"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=7626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}