{"id":3539,"date":"2016-03-11T01:21:23","date_gmt":"2016-03-11T01:21:23","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=3539"},"modified":"2016-03-28T23:18:21","modified_gmt":"2016-03-28T23:18:21","slug":"dexray","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2016\/03\/11\/dexray\/","title":{"rendered":"DeXRAY"},"content":{"rendered":"<p>DeXRAY is a private tool that turned public a few years ago. Back in a day it helped me to decrypt some Quarantine files from forensic cases I worked on. Over time I expanded it to cover more engines and file formats. Not all the decryptions work perfectly, but as usual &#8211; this is a work in progress. Also, because I add stuff ad hoc, it&#8217;s not a beautiful code either. But it works \ud83d\ude42<\/p>\n<p>At the moment Dexray supports quarantine files and logs from a number of AVs, and data files storing PE files in an encrypted form (XOR with a single byte key). The full list of supported or recognized file formats is listed below:<\/p>\n<ul>\n<li>ASquared (EQF)<\/li>\n<li>ESET (NQF)<\/li>\n<li>Kaspersky (KLQ) &#8211; based on the code by Optiv<\/li>\n<li>MalwareBytes Data files (DATA)<\/li>\n<li>MalwareBytes Quarantine files (QUAR)<\/li>\n<li>McAfee Quarantine files (BUP) &#8211; not perfect, but it should still help<\/li>\n<li>Microsoft Forefront (Magic@0=0B AD) &#8211; not handled yet; only recognized<\/li>\n<li>SUPERAntiSpyware (SDB)<\/li>\n<li>Symantec Quarantine Data files (QBD)<\/li>\n<li>Symantec Quarantine files (VBN) &#8211; not perfect, but it should still help<\/li>\n<li>Symantec Quarantine Index files (QBI)<\/li>\n<li>TrendMicro (Magic@0=A9 AC BD A7 which is &#8216;VSBX&#8217; string ^ 0xFF) &#8211; based on the code by Optiv<\/li>\n<li>Any binary file (using X-RAY scanning)<\/li>\n<\/ul>\n<p>Now, it is a buggy program. I know of it so please bear with me. If you find something not working, or stupid, please tell me \ud83d\ude42<\/p>\n<p>Also, if you have any Quarantine files that you can share, from any AV, please send them over. I will appreciate it as it will help me to add new engines and test the support for already implemented ones. Thanks!<\/p>\n<p>Note: I used the code from Optiv to implement decryption of Kaspersky and Trend. This is a good stuff. Thanks to that &#8211; apart from decryption of the malware &#8211; DeXRAY now dumps additional metadata extracted from these two Quarantine file types. The metadata is stored in dedicated files with the .met extension, and is also printed to STDERR.<\/p>\n<p>Here is an example for Kaspersky:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2016\/03\/kav.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-3540\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2016\/03\/kav-246x300.png\" alt=\"kav\" width=\"360\" height=\"440\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2016\/03\/kav-246x300.png 246w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2016\/03\/kav.png 622w\" sizes=\"(max-width: 360px) 100vw, 360px\" \/><\/a><\/p>\n<p>And for Trend:<\/p>\n<p><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2016\/03\/trend.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-3541\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2016\/03\/trend-300x195.png\" alt=\"trend\" width=\"360\" height=\"234\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2016\/03\/trend-300x195.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2016\/03\/trend.png 536w\" sizes=\"(max-width: 360px) 100vw, 360px\" \/><\/a><\/p>\n<p>The output files are saved into the following files:<\/p>\n<ul>\n<li>.out &#8211; the decrypted data<\/li>\n<li>.met &#8211; metadata (Trend&amp;Kaspersky only)<\/li>\n<\/ul>\n<p>In some cases you may find more than one .out file created for a given input files. This is the case with Trend Micro Quarantine files.<\/p>\n<ul>\n<li>The first is:\n<ul>\n<li>&lt;filename&gt;.TREND1.out file<br \/>\nand contains a decrypted input file which includes both metadata and the file content<\/li>\n<\/ul>\n<\/li>\n<li>The second is:\n<ul>\n<li>&lt;filename&gt;TREND2.out<br \/>\nthat contains the actual file you want to analyze.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Another case like that is if the binary blob contains more than one encrypted PE file which is decrypted using X-Rays algorithm (basically, a number of PE files encrypted using a single byte XOR key inside one blob\/file).<\/p>\n<p>The script can be downloaded <a href=\"https:\/\/hexacorn.com\/download.php?f=DeXRAY.pl\">here<\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DeXRAY is a private tool that turned public a few years ago. Back in a day it helped me to decrypt some Quarantine files from forensic cases I worked on. Over time I expanded it to cover more engines and &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2016\/03\/11\/dexray\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[28,15,12,21,19,46,9,44,5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/3539"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=3539"}],"version-history":[{"count":7,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/3539\/revisions"}],"predecessor-version":[{"id":3577,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/3539\/revisions\/3577"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=3539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=3539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=3539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}