{"id":2309,"date":"2017-06-30T14:31:33","date_gmt":"2017-06-30T21:31:33","guid":{"rendered":"https:\/\/www.acalvio.com\/?p=2309"},"modified":"2017-06-30T14:31:33","modified_gmt":"2017-06-30T21:31:33","slug":"technical-analysis-of-petya","status":"publish","type":"post","link":"https:\/\/acalvio.p2staging.us\/index.php\/2017\/06\/30\/technical-analysis-of-petya\/","title":{"rendered":"Technical Analysis of Petya"},"content":{"rendered":"<p><b>Acalvio Threat Research Labs<\/b><br \/>\n&nbsp;<br \/>\n<span style=\"font-weight: 400;\">Petya is the most recent ransomware strain. It originated in Ukraine [1] and is spreading across Europe. This blog summarizes our technical analysis of Petya. <\/span><br \/>\n<b>Technical Analysis<\/b><br \/>\n<span style=\"font-weight: 400;\">In addition to the encryption and ransomware functionality, the Petya malware has very B aggressive spreading capabilities. The dropper analyzed was a VB6 packed binary which contains the malicious DLL. All of the functionality is executed from the DLLb\u0000\u0019s unnamed and only B exported function.<\/span><br \/>\n<span style=\"font-weight: 400;\">All of the file encryption is located in the MBR code. The MBR is overwritten and the old MBR is saved on the physical disk at location 0x4400 (xorb\u0000\u0019ed with 0x07).<\/span><br \/>\n<span style=\"font-weight: 400;\">A fixtool could easily clean up the overwritten MBR on any Petya infected machine.<\/span><br \/>\n<span style=\"font-weight: 400;\">The ransomwareb\u0000\u0019s aggressive spreading behavior is performed via the ETERNALBLUE smb exploit. The binary uses a global object containing dynamically populated entries for attackable targets. This global object is populated by several methods and is used by a thread which enumerates the object attacking each entry in the object\/array synchronously.<\/span><br \/>\n<span style=\"font-weight: 400;\">The malware also attempts to propagate via WMI (presumably network share copy\/execute remote task) to adjacent network hosts.<\/span><br \/>\n<span style=\"font-weight: 400;\">Credentials for spreading via WMI are obtained via CredEnumerate calls which are stored in a global object, accessed by the spreading WMI function<\/span><br \/>\n<span style=\"font-weight: 400;\">The targets are chosen exhaustively:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">All IP addresses in the current systemb\u0000\u0019s subnet are checked for Smb (port 139, 445)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If the system is a domain controller, then for every DHCP subnet in the DC, every current DHCP client from the subnet is target for spreading.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Every 3 minutes, the network is enumerated for additional targets:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">All connected TCP endpoints in the Windows extended TCP table<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">All entries in the Address Resolution Protocol (ARP) mapping table<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">All network adjacent workstations, servers, and primary domain servers visible to the current host becomes target for spreading. <\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">The malware sets a shutdown task with a timer counting down and after an interval, shutting down the system after attempting to spread, encrypting filtered files in the filesystem, and overwriting the MBR.<\/span><br \/>\n<span style=\"font-weight: 400;\">The malware cleans up the event log via a CLI command<\/span><br \/>\n<i><span style=\"font-weight: 400;\"> wevtutil cl Setup &amp; wevtutil cl System &amp; wevtutil cl Security &amp; wevtutil cl Application &amp; fsutil usn deletejournal \/D %c<\/span><\/i><br \/>\n<b>Conclusion<\/b><span style=\"font-weight: 400;\">:<br \/>\n<\/span><span style=\"font-weight: 400;\">The severity of the infection gets multiplied due to the lateral movement techniques. Petya is not a new ransomware. However, it could increase the damage caused by using spreading techniques. Deception based detection are designed for timely, accurate and cost-effective detection of ransomware like Petya. To prevent worms like Petya, we would recommend not only to keep machines updated with the latest patches but also to deploy deception based detection solutions so that effective remediation steps can be taken in a timely fashion.<\/span><br \/>\n<span style=\"font-weight: 400;\">Reference:<\/span><br \/>\n<span style=\"font-weight: 400;\">[1] Petya Cyber attack: Ransomware spreads across Europe with firms in Ukraine, Britain and Spain shutdown.<\/span> <a href=\"http:\/\/www.telegraph.co.uk\/news\/2017\/06\/27\/ukraine-hit-massive-cyber-attack1\/\"><span style=\"font-weight: 400;\">http:\/\/www.telegraph.co.uk\/news\/2017\/06\/27\/ukraine-hit-massive-cyber-attack1\/<\/span><\/a><br \/>\n<span style=\"font-weight: 400;\">IOC B of the Analyzed Samples<\/span><br \/>\n<i><span style=\"font-weight: 400;\">MD5 af2379cc4d607a45ac44d62135fb7015<\/span><\/i><br \/>\n<i><span style=\"font-weight: 400;\">SHA-256<\/span><\/i> <i><span style=\"font-weight: 400;\">26b4699a7b9eeb16e76305d843d4ab05e94d43f3201436927e13b3ebafa90739<\/span><\/i><br \/>\n<i><span style=\"font-weight: 400;\">MD5 17c25c8a7c141195ee887de905f33d7b<\/span><\/i><br \/>\n<i><span style=\"font-weight: 400;\">SHA-256<\/span><\/i> <i><span style=\"font-weight: 400;\">e079fa28ea51fa98644164caf585ae3231d25372fccca1245902fb57488d4660<\/span><\/i><br \/>\n<i><span style=\"font-weight: 400;\">MD5 d0a0e16f1f85db5dfac6969562923576<\/span><\/i><br \/>\n<i><span style=\"font-weight: 400;\">SHA-256<\/span><\/i> <i><span style=\"font-weight: 400;\">03da4e05d9d8c0c28d1acbb4056d041fa6fc740bacb47d46083c9da469237404<\/span><\/i><br \/>\n<i><span style=\"font-weight: 400;\">MD5 71b6a493388e7d0b40c83ce903bc6b04<\/span><\/i><br \/>\n<i><span style=\"font-weight: 400;\">SHA-256<\/span><\/i> <i><span style=\"font-weight: 400;\">027cc450ef5f8c5f653329641ec1fed91f694e0d229928963b30f6b0d7d3a745<\/span><\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Acalvio Threat Research Labs &nbsp; Petya is the most recent ransomware strain. It originated in Ukraine [1] and is spreading across Europe. This blog summarizes our technical analysis of Petya. Technical Analysis In addition to the encryption and ransomware functionality, the Petya malware has very B aggressive spreading capabilities. The dropper analyzed was a VB6 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/posts\/2309"}],"collection":[{"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/comments?post=2309"}],"version-history":[{"count":0,"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/posts\/2309\/revisions"}],"wp:attachment":[{"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/media?parent=2309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/categories?post=2309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/tags?post=2309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}