{"id":3381,"date":"2015-11-08T19:19:26","date_gmt":"2015-11-08T19:19:26","guid":{"rendered":"http:\/\/www.hexacorn.com\/blog\/?p=3381"},"modified":"2015-11-16T13:35:40","modified_gmt":"2015-11-16T13:35:40","slug":"decrypting-malwarebytes-quar-files","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2015\/11\/08\/decrypting-malwarebytes-quar-files\/","title":{"rendered":"Decrypting MalwareBytes .quar files"},"content":{"rendered":"<p>A few years ago I developed script to decrypt .quar files created by MalwareBytes. Since the decryption routine was different from a typical xor I was not sure how the MalwareBytes will react &#8211; I asked them for a permission to release the code publicly for the benefit of the DFIR\/RCE community, but unfortunately, they refused at that time.<\/p>\n<p>Since I posted info about my script on one of the DFIR forums I have been asked many times by many researchers to share the script with them privately.<\/p>\n<p>Today I noticed that the cat is out of the bag and the code for decrypting .quar files was already made public by someone else <a href=\"https:\/\/github.com\/brad-accuvant\/cuckoo-modified\/blob\/master\/lib\/cuckoo\/common\/quarantine.py\">here<\/a>.<\/p>\n<p>The script is actually covering many other quarantine files as well which is awesome.<\/p>\n<p>Great work by the Optiv guys.<\/p>\n<p>Let&#8217;s hope that code for all types of Quarantine files will eventually be made public.<\/p>\n<p><strong>Update<\/strong><\/p>\n<p>Since some people asked, here is a short perl script for decrypting .quar files:<\/p>\n<pre>use strict;\r\nuse warnings;\r\nuse Crypt::RC4;\r\nuse Digest::MD5 qw (md5 );\r\n\r\nmy $f=shift || die (\"Gimme a file name!\\n\");\r\nopen F,\"&lt;$f\";\r\nbinmode F;\r\nread F,my $data,-s $f;\r\nclose F;\r\n\r\nmy $rc4 = Crypt::RC4-&gt;new( md5 ('XBXM8362QIXD9+637HCB02\/VN0JF6Z3)cB9UFZMdF3I.*c.,c5SbO7)WNZ8CY1(XMUDb') );\r\nmy $newdata = $rc4-&gt;RC4( $data );\r\n\r\nopen F,\"&gt;$f.out\";\r\nbinmode F;\r\nprint F $newdata;\r\nclose F;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A few years ago I developed script to decrypt .quar files created by MalwareBytes. Since the decryption routine was different from a typical xor I was not sure how the MalwareBytes will react &#8211; I asked them for a permission &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2015\/11\/08\/decrypting-malwarebytes-quar-files\/\">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":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/3381"}],"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=3381"}],"version-history":[{"count":8,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/3381\/revisions"}],"predecessor-version":[{"id":3396,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/3381\/revisions\/3396"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=3381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=3381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=3381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}