{"id":854,"date":"2017-05-26T12:15:01","date_gmt":"2017-05-26T11:15:01","guid":{"rendered":"http:\/\/www.herbiez.com\/?p=854"},"modified":"2017-05-31T09:39:34","modified_gmt":"2017-05-31T08:39:34","slug":"2017-05-26-jaff-ransomware-from-malspam","status":"publish","type":"post","link":"https:\/\/www.herbiez.com\/?p=854","title":{"rendered":"2017-05-26 Jaff Ransomware From Malspam"},"content":{"rendered":"<p>So yesterday I came across some malspam that used a PDF with an embedded Word document in it that encrypted my test VM with the Jaff ransomeware. It looks like Brad (<a href=\"http:\/\/twitter.com\/malware_traffic\" target=\"_blank\">@Malware_Traffic<\/a>) received something very similar to me which you can read about <a href=\"http:\/\/malware-traffic-analysis.net\/2017\/05\/25\/index2.html\" target=\"_blank\">here<\/a>. As a side note, I did get the script from the Word doc via OfficeMalScanner, but I am still trying to go through it since it does not make complete sense to me. If I make any progress on that I will do another blog post about it. Thankfully the malicious URLs are not obfuscated and are pretty obvious. <\/p>\n<p>A couple of updates to this post:<br \/>\n &#8211; I have managed to clean up the script from the Word doc and for the most part it makes sense. You can find that post <a href=\"http:\/\/www.herbiez.com\/?p=867\" target=\"_blank\">here<\/a>.<br \/>\n &#8211; The pattern that I talk about below (6WLms4bGcHU5iDixvWv6Wmuql3ILxV8S) is the XOR key for the encoded binary. You can find that in packet 194 as per David Ledbetter\u200f <a href=\"http:\/\/twitter.com\/Ledtech3\" target=\"_blank\">@Ledtech3<\/a> in our <a href=\"http:\/\/twitter.com\/HerbieZimmerman\/status\/868063579613908993\" target=\"_blank\">Twitter conversation<\/a>. Thanks David!<\/p>\n<p>For the PCAP, Process Monitor, and artifacts from this writeup, check out my Github repo <a href=\"http:\/\/github.com\/bloomer1016\/2017-05-26-Jaff-Malspam\" target=\"_blank\">here<\/a>.<\/p>\n<p>Indicators of Compromise:<br \/>\n=========================<br \/>\n176.223.209.7 \/ bionorica[.]md (HTTP)<br \/>\n\t&#8211; <a href=\"http:\/\/virustotal.com\/en\/url\/1319e48ffff1f483c4417117b05adebf4332c2159f72a7c3f0298f63b9f40cdb\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/url\/1319e48ffff1f483c4417117b05adebf4332c2159f72a7c3f0298f63b9f40cdb\/analysis\/<\/a><br \/>\ndorobratiohdtyszxwk[.]com (DNS)<br \/>\n\t&#8211; <a href=\"http:\/\/virustotal.com\/en\/url\/f47f9aa274b58f3c9aa0372a1dd51852e94206a2564043bb9f45b3db4feed5bc\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/url\/f47f9aa274b58f3c9aa0372a1dd51852e94206a2564043bb9f45b3db4feed5bc\/analysis\/<\/a><br \/>\nbetter57toiuydof.net\/af\/TrfHn4 (Found in the script)<br \/>\n\t&#8211; <a href=\"http:\/\/virustotal.com\/en\/url\/ccc36efe7080f4639c4d335ce79db757abc6eda5a345dc34fa0231da1beec0b9\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/url\/ccc36efe7080f4639c4d335ce79db757abc6eda5a345dc34fa0231da1beec0b9\/analysis\/<\/a><br \/>\nyoutoolgrabeertorse[.]org (Found in the script)<br \/>\n\t&#8211; <a href=\"http:\/\/virustotal.com\/en\/url\/2c3b14b70ff8ebbca7a20efc0d1d62f03dca63bded81158a086ef336a16a6a05\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/url\/2c3b14b70ff8ebbca7a20efc0d1d62f03dca63bded81158a086ef336a16a6a05\/analysis\/<\/a><br \/>\nenseling-gmbh.de (Found in the script)<br \/>\n\t&#8211; <a href=\"http:\/\/virustotal.com\/en\/url\/4ee1064da2f5e6920221b280217456ff72e6186e88824ed7896067feee548c2c\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/url\/4ee1064da2f5e6920221b280217456ff72e6186e88824ed7896067feee548c2c\/analysis\/<\/a><\/p>\n<p>Artifacts:<br \/>\n==========<br \/>\nFile name: 73065.pdf<br \/>\nFile size: 66KB<br \/>\nFile location: NA<br \/>\nMD5: 1d4d609c84602287536954ad4d892f34<br \/>\nVirustotal: <a href=\"http:\/\/virustotal.com\/en\/file\/0ef771f2b212042dc718078b0b8a51df2e26056773ff81b499c5e716bbf2b351\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/file\/0ef771f2b212042dc718078b0b8a51df2e26056773ff81b499c5e716bbf2b351\/analysis\/<\/a><br \/>\nDetection ratio: 17 \/ 55<br \/>\nFirst submission: 2017-05-25 13:39:13 UTC<br \/>\nMalwr: NA<br \/>\nHybrid Analysis: NA <\/p>\n<p>File name: GXHK4ZU.doc<br \/>\nFile size: 104KB<br \/>\nFile location: NA<br \/>\nMD5: 7c6df429f3c306e48679341a63ebaa20<br \/>\nVirustotal: NA<br \/>\nMalwr: NA<br \/>\nHybrid Analysis: NA<\/p>\n<p>File name: TrfHn4[1].txt<br \/>\nFile size: 217 KB<br \/>\nFile location: C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Windows\\Temporary Internet Files\\Content.IE5\\1LABJKYH\\<br \/>\nMD5: 9585bc2d5d63b189bf8455d2e05cfb5e<br \/>\nVirustotal: <a href=\"http:\/\/virustotal.com\/en\/file\/ba7952ae07b41d049ad82674aeffbd43a5079f1db10a941db6545490c6c386bd\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/file\/ba7952ae07b41d049ad82674aeffbd43a5079f1db10a941db6545490c6c386bd\/analysis\/<\/a><br \/>\nDetection ratio: 2 \/ 56<br \/>\nFirst submission: 2017-05-25 11:47:44 UTC<br \/>\nMalwr: NA<br \/>\nHybrid Analysis: NA<\/p>\n<p>File name: fremsoho8<br \/>\nFile size: 217KB<br \/>\nFile location: C:\\Users\\%username%\\AppData\\Local\\Temp\\<br \/>\nMD5: 9585bc2d5d63b189bf8455d2e05cfb5e<br \/>\nVirustotal: <a href=\"http:\/\/virustotal.com\/en\/file\/ba7952ae07b41d049ad82674aeffbd43a5079f1db10a941db6545490c6c386bd\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/file\/ba7952ae07b41d049ad82674aeffbd43a5079f1db10a941db6545490c6c386bd\/analysis\/<\/a><br \/>\nDetection ratio: 2 \/ 56<br \/>\nFirst submission: 2017-05-25 11:47:44 UTC<br \/>\nMalwr: NA<br \/>\nHybrid Analysis: NA <\/p>\n<p>File name: bruhadson8.exe<br \/>\nFile size: 217KB<br \/>\nFile location: C:\\Users\\%username%\\AppData\\Local\\Temp\\<br \/>\nMD5: fc8c82354bbc40f2662d577863c6b20f<br \/>\nVirustotal: <a href=\"http:\/\/virustotal.com\/en\/file\/2cc1d8edc318e0e09aad6afbc48999980f8e39e54734bca4c1a95c7b5db39569\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/file\/2cc1d8edc318e0e09aad6afbc48999980f8e39e54734bca4c1a95c7b5db39569\/analysis\/<\/a><br \/>\nDetection ratio: 34 \/ 61<br \/>\nFirst submission: 2017-05-25 11:44:54 UTC<br \/>\nMalwr: NA<br \/>\nHybrid Analysis: <a href=\"http:\/\/www.hybrid-analysis.com\/sample\/2cc1d8edc318e0e09aad6afbc48999980f8e39e54734bca4c1a95c7b5db39569?environmentId=100\" target=\"_blank\">http:\/\/www.hybrid-analysis.com\/sample\/2cc1d8edc318e0e09aad6afbc48999980f8e39e54734bca4c1a95c7b5db39569?environmentId=100<\/a><\/p>\n<p>Analysis of Malware:<br \/>\n====================<br \/>\nThis looks to be a simple infection with not much complexity (outside of me not fully understanding the macro in the Word doc &#8211; different issue). <\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/Traffic.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/Traffic.png\" alt=\"\" width=\"1850\" height=\"169\" class=\"aligncenter size-full wp-image-863\" \/><\/a><\/p>\n<p>The infection started when the following email was opened and the PDF was executed, which in turn suggested opening the Word document. <\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/Email-3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/Email-3.png\" alt=\"\" width=\"789\" height=\"413\" class=\"aligncenter size-full wp-image-858\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/PDF.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/PDF.png\" alt=\"\" width=\"1018\" height=\"675\" class=\"aligncenter size-full wp-image-862\" \/><\/a><\/p>\n<p>Once the macro was run, there was a call from within the script to the domain &#8220;bionorica[.]md\/TrfHn4&#8221; (not sure why the others were not run as there was no DNS queries for them in my PCAP).<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\nShtefin = Replace(&quot;bionorica.md\/TrfHn4Vbetter57toiuydof.net\/af\/TrfHn4Vyoutoolgrabeertorse.org\/af\/TrfHn4Venseling-gmbh.de\/TrfHn4&quot;, &quot;RRDD&quot;, &quot;om&quot;)<\/pre>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/GET.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/GET.png\" alt=\"\" width=\"910\" height=\"697\" class=\"aligncenter size-full wp-image-860\" \/><\/a><\/p>\n<p>Interestingly enough, if you use &#8220;Follow &#8211;&gt; HTTP Stream&#8221; in Wireshark instead of &#8220;TCP Stream&#8221; (as I did in the above image) you will see a repeating pattern of &#8220;6WLms4bGcHU5iDixvWv6Wmuql3ILxV8S&#8221; within the traffic. I am not sure what this pattern is or if there is any significance to it but thought that I would mention it. ***See my update above as this is the XOR key.<\/p>\n<p>The request to the malicious site via the Word document saved the file to &#8220;C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Windows\\Temporary Internet Files\\Content.IE5\\1LABJKYH\\&#8221; as a file called &#8220;TrfHn4[1].txt.&#8221;<\/p>\n<p>I assume that once this has been downloaded to the system, the script copied the file over to the %TEMP% location (C:\\Users\\%username%\\AppData\\Local\\Temp\\) and renamed the file to &#8220;fremsoho8&#8221; since there is a reference to this in one of the functions in the script and since the hashes, the sizes, and content of both files are exactly same.<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\nPublic Function SignIn_ProjectSpeed()\r\n\r\nGoTo labelBabel2\r\n    Set FSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)\r\n\r\nSet oArgs = WScript.Arguments\r\nIf oArgs.Count = 1 Then\r\n        strComputer = CStr(oArgs(0))\r\nElse\r\n    strComputer = InputBox(&quot;Enter computer name&quot;)\r\nEnd If\r\n\r\nSet objWMIService = GetObject(&quot;winmgmts:\\\\&quot; &amp; strComputer &amp; &quot;\\root\\CIMV2&quot;)\r\n\r\nlabelBabel2:\r\n SignIn_Project = SignIn_LAKOPPC\r\n SignIn_PathTo2 = SignIn_Project + &quot;\\fremsoho&quot; + CStr(itemI)\r\n\r\n\r\nGoTo labelBabel3\r\n    \r\nlabelBabel3:\r\nSignIn_Project = SignIn_Project + Replace(MotoGP(12), &quot;.&quot;, CStr(itemI) + &quot;.&quot;)\r\n SubProperty.Type = 1\r\nEnd Function<\/pre>\n<p>Then the malicious binary called &#8220;bruhadson8.exe&#8221; is created from the Word document and then proceeded to run.<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/binary_prop.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/binary_prop.png\" alt=\"\" width=\"372\" height=\"506\" class=\"aligncenter size-full wp-image-857\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/binary-3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/binary-3.png\" alt=\"\" width=\"509\" height=\"336\" class=\"aligncenter size-full wp-image-855\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/binary-run.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/binary-run.png\" alt=\"\" width=\"1213\" height=\"601\" class=\"aligncenter size-full wp-image-856\" \/><\/a><\/p>\n<p>After it searched through the registry and made some adjustments to values there, it started writing out the instructions for decrypting files in the various folders and appending the extension &#8220;.wlu&#8221; to the end of files that it encrypted.<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/Jaff.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/Jaff.png\" alt=\"\" width=\"945\" height=\"342\" class=\"aligncenter size-full wp-image-861\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/extensions.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/05\/extensions.png\" alt=\"\" width=\"1015\" height=\"372\" class=\"aligncenter size-full wp-image-859\" \/><\/a><\/p>\n<p>Lastly, there was a DNS request to &#8220;dorobratiohdtyszxwk[.]com&#8221; but there was no such domain in my example. From what Brad was able to see in his example; this was a callback once the system was infected. I looked at the malicious binary using the STRINGS command and I could not see any reference to this domain, so I decided to run &#8220;bruhadson8.exe&#8221; again and suspend the process and use a tool called &#8220;Strings2&#8221; to look at the process while in memory and pipe that out to a log file. In the log I could see that there was a single line for &#8220;hxxp:\/\/dorobratiohdtyszxwk[.]com\/a5\/.&#8221; Looking up the domain in Virustotal and trying the IP addresses from the passive DNS results, I was able to reach the site this time, but nothing was pulled back or seen. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>So yesterday I came across some malspam that used a PDF with an embedded Word document in it that encrypted my test VM with the Jaff ransomeware. It looks like Brad (@Malware_Traffic) received something very similar to me which you can read about here. As a side note, I did get the script from the Word doc via OfficeMalScanner, but I am still trying to go through it since it does not make complete sense to me. If I make any progress on that I will do another blog post about it. Thankfully the malicious URLs are not obfuscated and&#8230;<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/www.herbiez.com\/?p=854\"><span>Continue reading<\/span><i class=\"crycon-right-dir\"><\/i><\/a> <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-854","post","type-post","status-publish","format-standard","hentry","category-packet-analysis"],"_links":{"self":[{"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/posts\/854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=854"}],"version-history":[{"count":4,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/posts\/854\/revisions"}],"predecessor-version":[{"id":876,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/posts\/854\/revisions\/876"}],"wp:attachment":[{"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}