{"id":2140,"date":"2018-01-24T21:29:56","date_gmt":"2018-01-25T05:29:56","guid":{"rendered":"https:\/\/new.acalvio.com\/?p=2140"},"modified":"2018-01-24T21:29:56","modified_gmt":"2018-01-25T05:29:56","slug":"technical-analysis-of-samsam-ransomware","status":"publish","type":"post","link":"https:\/\/acalvio.p2staging.us\/index.php\/2018\/01\/24\/technical-analysis-of-samsam-ransomware\/","title":{"rendered":"Technical Analysis of Samsam Ransomware."},"content":{"rendered":"<p>Ransomware continues to represent the most critical threat facing organizations in 2018. In the latest breaches at Hancock Memorial Hospital, Adams Memorial Hospital, and Allscripts, SamSam ransomware was used to encrypt the files. In this blog, we dive into the technical details of the SamSam ransomware [1]. The blog then shares how the Samsam ransomware can be detected using a deception-based architecture.<br \/>\n<strong>Technical Details:<\/strong><br \/>\nFor the Samsam ransomware to execute, it will require input text file as the command line argument. The input text file will have the base64 encoded public keys in the XML format shown in figure 1.0<br \/>\nWhen the ransomware code is executed, it drops two files selfdel.exe and del.exe. Selfdel.exe and del.exe are in the resource section of the ransomware file. The dropped file selfdel.exe as shown in figure 2.0 will get the process name Samsam,B  andB sleep for 3000 milliseconds, after which it will delete the Samsam ransomware process.<br \/>\n<img loading=\"lazy\" class=\"aligncenter size-full wp-image-1806\" src=\"https:\/\/new.acalvio.com\/wp-content\/uploads\/2018\/03\/samsam.png\" alt=\"\" width=\"320\" height=\"202\" srcset=\"https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/samsam.png 320w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/samsam-300x189.png 300w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/p>\n<p style=\"text-align: center;\">Figure 1.0 code of the selfdel.exe<\/p>\n<p>The ransomware encrypts 328 file extensions.the list of file extensions are shown in figure 3.0 .Since the ransomware encrypts files with extensionB &#8220;.sql&#8221;,B &#8220;.sqlite&#8221;,B &#8220;.sqlite3&#8221;,B &#8220;.sqlitedb&#8221;B it will encrypt databases.<br \/>\n<img loading=\"lazy\" class=\"aligncenter size-full wp-image-1807\" src=\"https:\/\/new.acalvio.com\/wp-content\/uploads\/2018\/03\/extensions.png\" alt=\"\" width=\"1621\" height=\"1084\" srcset=\"https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/extensions.png 1621w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/extensions-300x201.png 300w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/extensions-1024x685.png 1024w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/extensions-768x514.png 768w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/extensions-1536x1027.png 1536w\" sizes=\"(max-width: 1621px) 100vw, 1621px\" \/><\/p>\n<p style=\"text-align: center;\"><strong>Figure 2.0 File extension targeted by Samsam ransomware.B <\/strong><\/p>\n<p>The ransomware code makes the call to the API DriveInfo.GetDrives() to get a list of all the logical drives in the computer and will encrypt the files in these drives. The ransomware will encrypt the files in shared mapped SMB drives, CD drives, attached removable drives to the computer.B Backups from the endpoint can often be configured to access the database via the mapped logical drive. In such configuration, database files which can be accessed via the logical drives will also get encrypted.<br \/>\n<img loading=\"lazy\" class=\"aligncenter size-full wp-image-1808\" src=\"https:\/\/new.acalvio.com\/wp-content\/uploads\/2018\/03\/drives.jpg\" alt=\"\" width=\"320\" height=\"121\" srcset=\"https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/drives.jpg 320w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/drives-300x113.jpg 300w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/p>\n<p style=\"text-align: center;\">Figure 3.0 showing call to get the logical drives to the computer.<\/p>\n<p>If the path of the directory contains &#8220;Windows&#8221;, &#8220;Reference Assemblies\\\\Microsoft&#8221;,B\u001d &#8220;Recycle.Bin&#8221;B\u001d the files in these folders will be skipped and will not be encrypted.<br \/>\n<img loading=\"lazy\" class=\"aligncenter size-full wp-image-1809\" src=\"https:\/\/new.acalvio.com\/wp-content\/uploads\/2018\/03\/windows.png\" alt=\"\" width=\"1645\" height=\"85\" srcset=\"https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/windows.png 1645w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/windows-300x16.png 300w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/windows-1024x53.png 1024w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/windows-768x40.png 768w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/windows-1536x79.png 1536w\" sizes=\"(max-width: 1645px) 100vw, 1645px\" \/><\/p>\n<p style=\"text-align: center;\">Figure 4.0 code showing ransomware skipping file in specific folders.<\/p>\n<p>To create the encrypted file, ransomware creates a new file, writes encrypted data to it and deletes the original file. The new encrypted file will have file extension .encryptedRSA appended to the original file name. HTML file titled &#8220;HELP_DECRYPT_YOUR_FILES&#8221; having the ransomware note gets dropped to the directory.<br \/>\n<img loading=\"lazy\" class=\"aligncenter size-full wp-image-1810\" src=\"https:\/\/new.acalvio.com\/wp-content\/uploads\/2018\/03\/rasnomware.jpg\" alt=\"\" width=\"1177\" height=\"757\" srcset=\"https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/rasnomware.jpg 1177w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/rasnomware-300x193.jpg 300w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/rasnomware-1024x659.jpg 1024w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/rasnomware-768x494.jpg 768w\" sizes=\"(max-width: 1177px) 100vw, 1177px\" \/><\/p>\n<p style=\"text-align: center;\">Figure 5.0 showing ransomware note<\/p>\n<p><strong>Deception based detection:<\/strong><br \/>\nDeception-based architecture involves distributing breadcrumbs and lures on endpoints. When these breadcrumbs and lures are accessed, alerts from the breadcrumbs and lures will be generated and get validated by the proprietary algorithm for ransomware infection. The version of Samsam used in the breach will get detected by Shadowplex-R. Once the infected endpoint gets identified, it get isolated from the network to prevent the spread of infection.<br \/>\n<img loading=\"lazy\" class=\"aligncenter size-full wp-image-1811\" src=\"https:\/\/new.acalvio.com\/wp-content\/uploads\/2018\/03\/Detection-screenshot.png\" alt=\"\" width=\"320\" height=\"279\" srcset=\"https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/Detection-screenshot.png 320w, https:\/\/acalvio.p2staging.us\/wp-content\/uploads\/2018\/03\/Detection-screenshot-300x262.png 300w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/p>\n<p style=\"text-align: center;\">Detection of Samsam in Shadowplex-R<\/p>\n<div class=\"section post-body\">\nFor further details about deception based architecture to prevent infection,B  IB  would encourage readers to read my blogB <a href=\"https:\/\/www.acalvio.com\/deception-centric-defense-against-ransomware\/\">Deception Centric Defense Against Ransomware<\/a>. The blog details the advantages of deception based architecture over the traditional architecture to detect ransomware.<br \/>\n<strong>Conclusion:<\/strong><br \/>\nSamsam ransomware gets activated by the threat actor after they have breached an organization, it becomes a challenge for the inline monitoring architecture to detect them. As discussed in the blog to execute samsam ransomware it requires the public key in a specific format from the command line argument.B Detection architecture which relies on detonation in a virtualized environment to classify the file as malicious or benign, will not be able to provide public keys in the format which is required for samsam to execute and hence malware will not show its behavior when detonated in a virtualized environment. It will be a challenge for the detection architectures which relies on capturing the behavior in the virtualized environment to classify Samsam as malicious. Deception-based architecture detects and remediates during the execution of malware,B  hence it is a recommended architecture to prevent breaches and ransomware.<br \/>\n<strong>SHA256 of the analyzed file:<\/strong><br \/>\n0f2c5c39494f15b7ee637ad5b6b5d00a3e2f407b4f27d140cd5a821ff08acfac<br \/>\n710a45e007502b8f42a27ee05dcd2fba<br \/>\n<strong>References:<\/strong><strong><br \/>\n<\/strong><br \/>\n[1]B  Allscripts recovering from ransomware attack that has kept key tools offline,B <a href=\"https:\/\/www.csoonline.com\/article\/3250246\/security\/allscripts-recovering-from-ransomware-attack-that-has-kept-key-tools-offline.html\">https:\/\/www.csoonline.com\/article\/3250246\/security\/allscripts-recovering-from-ransomware-attack-that-has-kept-key-tools-offline.html<\/a>.\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Ransomware continues to represent the most critical threat facing organizations in 2018. In the latest breaches at Hancock Memorial Hospital, Adams Memorial Hospital, and Allscripts, SamSam ransomware was used to encrypt the files. In this blog, we dive into the technical details of the SamSam ransomware [1]. The blog then shares how the Samsam ransomware [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1810,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[92,119,131],"_links":{"self":[{"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/posts\/2140"}],"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=2140"}],"version-history":[{"count":0,"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/posts\/2140\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/media\/1810"}],"wp:attachment":[{"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/media?parent=2140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/categories?post=2140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/acalvio.p2staging.us\/index.php\/wp-json\/wp\/v2\/tags?post=2140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}