May 14, 2017
J. Gomez

WanaCry Observations: Big Worm = Big Problems

<p>NOTE: Anomali is continuing to investigate and monitor the WanaCry worm and will update this page as we have more information to share. Visit <a href="" target="_blank"></a> for the latest.</p><p>On the morning of Friday May 12th a new ransomware threat emerged infecting tens of thousands of computers across the globe at an alarming rate.</p><p style="text-align: center;"><img alt="" src=""/> <img alt="" src=""/></p><p style="text-align: center;"><em>Figure 1 - WanaDecrypt0r 2.0 Pop up window and splash screen.</em></p><p>Named “Wana Decrypt0r 2.0” (a.k.a “WannaCry”, "WCry"), the ransomware was unique in that it appeared to be one of the first to have the ability to spread to other (Windows) computers on its own, similar to malware of the past like <a href="" target="_blank">Conficker</a>. This was starting to look like the first case of worm functionality being integrated into ransomware and indeed it was, sort of.</p><p>It was later determined that the ransomware was spreading on its own by scanning for systems vulnerable to <a href="" target="_blank">MS17-010</a>, exploiting them and then using a <a href="" target="_blank">recently leaked NSA backdoor</a> to install the ransomware on the system.</p><p>A lot of the hype surrounding the spreading component of the ransomware was due to the fact it was using an exploit against MS17-010, a vulnerability in Microsoft’s SMB protocol that resulted in continued spread of the ransomware. It is also a big deal because the exploits used by the malware came from the recent <a href="" target="_blank">“Lost In Translation” dump</a> leaked by the infamous Shadow Brokers, which included cyber-attack tools developed by the NSA. In this case, ETERNALBLUE was the name of the exploit included in the dump by the Shadow Brokers.</p><p style="text-align: center;"><img alt="" src=""/> <img alt="" src=""/></p><p style="text-align: center;"><em>Figure 2 – FuzzBunch exploitation framework containing exploit targeting MS17-010, leaked by the Shadow Brokers.</em></p><p>While the security community at large is still investigating the worm, ransomware and the initial infection vector, details have begun to emerge giving us more insight into how the malware works and what can be done to stop it.</p><h2>Worm Gives Birth</h2><p>Although it was not clear at first, there were 2 malware components involved in the infections. The first being the main malware binary that drops the ransomware. The sample we looked at had md5 <a href="" target="_blank">DB349B97C37D22F5EA1D1841E3C89EB4</a>. Time stamp [4CE78ECC] - Nov 20, 2010 9:03:08</p><p>This is the malware binary that will call out to the domain “iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea[.]com” to see if it gets a response and determine if it should continue execution or not. Fortunately, the domain was sinkhole’d the same day it was discovered effectively stopping further ransomware infections since the malware would just exit as soon as it got a response from that domain. This was not the ransomware component, it was the dropper.</p><p>Using the tool ResourceHacker you can see actually see and extract the resource section containing the malware payload for closer analysis.</p><p>The first one is the actual WanaDecrypt0r 2.0 ransomware</p><p>MD5: <a href="" target="_blank">84C82835A5D21BBCF75A61706D8AB549</a><br/> Time stamp [4CE78F41] - Nov 20, 2010 9:05:05</p><p style="text-align: center;"><img alt="" src=""/></p><p style="text-align: center;"><em>Figure 4a – File header of the ransomware hidden inside the worm.</em></p><p>The next resource section of interest comes from the ransomware binary, it holds a password protected .zip containing additional files used by the ransomware. The zip file has md5 B576ADA3366908875E5CE4CB3DA6153A.</p><p style="text-align: center;"><img alt="" src=""/></p><p style="text-align: center;"><em>Figure 4b – “PK” File header visible in resource section of main malware binary.</em></p><p style="text-align: center;"><img alt="" src=""/></p><p style="text-align: center;"><img alt="" src=""/></p><p style="text-align: center;"><em>Figure 5 – Zip password “WNcry@2ol7” was clearly visible during analysis.</em></p><h2>Network</h2><p>The malware is designed so that once the system is infected, it will scan the local network and internet for systems that are listening on TCP port 445, these systems will then be checked to ensure the presence of the backdoor, known as DOUBLEPULSAR, through which it will actually send the ransomware to be installed, additional analysis is available <a href="" target="_blank">here</a> and <a href="" target="_blank">here</a>.</p><p style="text-align: center;"><img alt="" src=""/></p><p style="text-align: center;"><em>Figure 6 – An infected host scanning for IP’s on TCP 445.</em></p><p>Once the system gets infected with the ransomware, its business as usual with the ransomware pop-up windows and threats of data loss.</p><p style="text-align: center;"><img alt="" src=""/> <img alt="" src=""/></p><p style="text-align: center;"><em>Figure 7 – WanaDecrypt0r 2.0 on the desktop.</em></p><p>The ransomware will periodically check to see if payment was made, this communication is done using TOR. Since the ransomware uses TOR to communicate, network communication will be encrypted and potentially able to skirt by detection signatures unless specific detections for TOR network traffic are enabled.</p><p style="text-align: center;"><img alt="" src=""/></p><p style="text-align: center;"><em>Figure 8 – Ransomware communicating to TOR nodes on ports 9001, 443 &amp; 80.</em></p><table class="table table-striped" style="width: 250px;"><tbody><tr><td></td><td>9001</td></tr><tr><td></td><td>443</td></tr><tr><td></td><td>80</td></tr><tr><td></td><td>9001</td></tr><tr><td></td><td>443</td></tr><tr><td></td><td>9001</td></tr></tbody></table><p style="text-align: center;"><em>Figure 9 – Example TOR traffic observed</em></p><p>As you might have guessed, blocking TOR communication can help mitigate the threat and is also good hygiene for business networks. Lists of active TOR exit nodes are readily available on the internet as well as from most threat Intelligence platforms, including <a href="">Anomali ThreatStream</a>.</p><p>Checking your logs for activity to TOR nodes can be helpful in locating hosts that may be infected or using TOR to evade network policy, potentially putting your enterprise at risk.</p><h2>Conclusion</h2><p>If you want to stay one step ahead of threats like WanaCry, it is critical you gauge your exposure levels and put mitigations in place so that infections can be avoided. If not properly protected, these types of attacks can quickly grow out of control and overwhelm security teams, bringing business to a halt (as we saw this past Friday).</p><p>As has been said over and over, vulnerable systems must be patched in order to reduce risk.</p><p>Instead of waiting for infected systems to show up as security alerts, scanning for vulnerable systems on your network ahead of time can help identify potential targets, this can be done with tools like Nessus which will report if the system is vulnerable.</p><p style="text-align: center;"><img alt="" src=""/></p><p style="text-align: center;"><em>Figure 10 – Example of Nessus scan results indicating a potentially vulnerable host.</em></p><p>Additionally, ensuring that endpoints are not exposed directly to the Internet is an important general mitigation that would help avoid infection in the case of WanaCry.</p><h2>What's Next</h2><p>Now that weapons-grade cyber attack tools are in the wrong hands, it is clear that tools and techniques previously reserved for use by nation states are being integrated into crimeware for profit. This means you can expect to see more of these exploits and tools leveraged in future attacks, each one likely surpassing the previous in sophistication and stealth as threat actors build on lessons learned from previous attacks. Phishing, exploit kits, and watering holes are all common attack vectors that could potentially leverage these weapons-grade tools in order to continue delivering malicious payloads like WanaCry. There will be new versions of WanaCry that attempt to overcome the weaknesses in what has been observed so far. It will be up to organizations to learn from the security weaknesses that led to this attack and stay abreast of future developments to prevent infection in their environments.</p>

Get the Latest Anomali Updates and Cybersecurity News – Straight To Your Inbox

Become a subscriber to the Anomali Newsletter
Receive a monthly summary of our latest threat intelligence content, research, news, events, and more.