{"id":1312,"date":"2012-09-21T16:40:07","date_gmt":"2012-09-21T16:40:07","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=1312"},"modified":"2016-03-28T23:18:21","modified_gmt":"2016-03-28T23:18:21","slug":"dexray-decrypting-vbn-files-part-2","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2012\/09\/21\/dexray-decrypting-vbn-files-part-2\/","title":{"rendered":"DeXRAY &#8211; Decrypting VBN files, Part 2"},"content":{"rendered":"<p>A few months back I posted about <a title=\"DeXRAY \u2013 simple XORcarver\" href=\"https:\/\/www.hexacorn.com\/blog\/2012\/01\/05\/dexray-simple-xorcarver\/\">DeXRAY<\/a> &#8211;\u00a0 a generic script\/file carver that tries to decrypt various Quarantine files + PE files hidden inside other files under a simple layer of a single-byte xor encryption.<\/p>\n<p>Some time later, in one of my other <a title=\"Update\" href=\"https:\/\/www.hexacorn.com\/blog\/2012\/04\/15\/update\/\">posts<\/a> I mentioned that newer VBN files used by Symantec Quarantine use a different encryption scheme; instead of using well-known xor with a <strong>0x5A<\/strong> key, they now use <strong>0xA5<\/strong> key.<\/p>\n<p>Turns out that I was right about it, but only partially as there is a twist to it &#8211; not only these files are encrypted, but they are also divided into chunks separated by a 5 byte &#8216;chunk divider&#8217; in a form of <strong>0xF6 0x?? 0x?? 0xFF 0xFF. <\/strong>So, to reconstruct the encrypted Quarantine files, one needs to decrypt them with 0xA5 first and then remove the chunk dividers.<\/p>\n<p>Simple, isn&#8217;t?<\/p>\n<p>I updated DeXRAY.pl to handle this (quick &amp; dirty patch, but it should work). If you find some VBN files that don&#8217;t get decrypted at all or get corrupted after decryption, please let me know.<\/p>\n<p>I bet Symantec guys added this to prevent accidental detection of Quarantine files by theirs and other AV companies&#8217; scanners; the way I think it goes is that many AV companies use X-rays technique during scans (that is, they may find malware even if it is encrypted with a single byte xor) and they could potentially\/accidentally decrypt and detect the Quarantine file during scans. That could potentially lead to some &#8216;funny&#8217; results (recursive detection, etc.); introducing &#8216;chunk divider&#8217; breaks the file format of the encrypted file and AV scans no longer can &#8216;understand&#8217; the corrupted file structure (especially if it is an encrypted PE file).<\/p>\n<p>Download a new version from here:\u00a0 <a href=\"https:\/\/hexacorn.com\/download.php?f=DeXRAY.pl\">DeXRAY.pl<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few months back I posted about DeXRAY &#8211;\u00a0 a generic script\/file carver that tries to decrypt various Quarantine files + PE files hidden inside other files under a simple layer of a single-byte xor encryption. Some time later, in &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2012\/09\/21\/dexray-decrypting-vbn-files-part-2\/\">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,5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1312"}],"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=1312"}],"version-history":[{"count":8,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1312\/revisions"}],"predecessor-version":[{"id":3582,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/1312\/revisions\/3582"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=1312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=1312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=1312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}