{"id":361,"date":"2016-02-10T10:37:33","date_gmt":"2016-02-10T10:37:33","guid":{"rendered":"http:\/\/www.herbiez.com\/?p=361"},"modified":"2016-02-23T21:55:13","modified_gmt":"2016-02-23T21:55:13","slug":"2016-02-02-malicious-jar-attachment","status":"publish","type":"post","link":"https:\/\/www.herbiez.com\/?p=361","title":{"rendered":"2016-02-02 Malicious Jar Attachment"},"content":{"rendered":"<p>IoC from this investigation:<br \/>\n============================<br \/>\nmyson123456[.]ddns[.]net<br \/>\n178.32.72.136:2550<\/p>\n<p>Here is another example of an email that most users get claiming that they (the user) has something that they need to action on. In this case it is a malicious Java file. Thankfully most email gateways block these types of files from every reaching the user base. Let&#8217;s dig in.<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/02\/IMG1-1.png\" rel=\"attachment wp-att-366\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/02\/IMG1-1.png\" alt=\"Email\" width=\"919\" height=\"478\" class=\"aligncenter size-full wp-image-366\" \/><\/a><\/p>\n<p>The Java file has the following characteristics:<\/p>\n<blockquote><p>\n\tFile Name: payment..jar<br \/>\n\tSize: 118KB<br \/>\n\tMD5: f4b463e4df4ef274a198bfb07ed3e6cd<br \/>\n\tSHA256: f4c93ab532e53274bd97c00fccba3b231de0832e743879380f7af7bf81aef60f<\/p>\n<p>\tVirustotal Link: <a href=\"http:\/\/www.virustotal.com\/en\/file\/f4c93ab532e53274bd97c00fccba3b231de0832e743879380f7af7bf81aef60f\/analysis\/\" target=\"_blank\">http:\/\/www.virustotal.com\/en\/file\/f4c93ab532e53274bd97c00fccba3b231de0832e743879380f7af7bf81aef60f\/analysis\/<\/a><br \/>\n\tDetection Ratio: 25 \/ 54<br \/>\n\tFirst Submitted: 2016-02-07 21:28:02 UTC<\/p>\n<p>\tMalwr link: http:\/\/malwr.com\/analysis\/Y2FmYjEwNGM0MjM5NDBmYWI3YTdjYjJkOTRjY2M5OWY\/<\/p><\/blockquote>\n<p>Since this is a Java file, I usually like to try and open these up using Java Decomplier to see if there is anything that I can gather or understand. Unfortunately in this case there was nothing that was coming back as you can see:<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/02\/IMG2-1.png\" rel=\"attachment wp-att-363\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/02\/IMG2-1.png\" alt=\"JD-GUI\" width=\"1280\" height=\"800\" class=\"aligncenter size-full wp-image-363\" \/><\/a><\/p>\n<p>So after some Googling around looking for a Java deobfucation tool I came across this one: <a href=\"http:\/\/bytecodeviewer.com\/\" target=\"_blank\">http:\/\/bytecodeviewer.com\/<\/a>. I did not really play around much with this tool (or any other RE suite for that matter), but this one did give me some more information about the JAR file that JD-GUI did not:<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/02\/IMG3-1.png\" rel=\"attachment wp-att-362\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/02\/IMG3-1.png\" alt=\"ByteCode Viewer example\" width=\"2552\" height=\"1460\" class=\"aligncenter size-full wp-image-362\" \/><\/a><\/p>\n<p>Just skimming thorugh the file I am not seeing alot that I understand, but some that I do. Using one of the plugins from Bytecode Viewer (the Malicious Code Scanner plugin), I did get back these two lines (which I did see while looking through all the parts of the JAR file):<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\n\tFound Method call to java\/net\/URLClassLoader.&lt;init&gt;((&#x5B;Ljava\/net\/URL;)V) at compos\/__?????????????????l.&lt;init&gt;((&#x5B;Ljava\/net\/URL;)V)\r\n\tFound Method call to java\/lang\/reflect\/Method.invoke((Ljava\/lang\/Object;&#x5B;Ljava\/lang\/Object;)Ljava\/lang\/Object;) at compos\/__?????????????????y.i((Ljava\/lang\/reflect\/Method;)V)<\/pre>\n<p>Since I did not see any URL&#8217;s or anything of that sort, it is time to run this in my VM and see what the traffic looks like. Initially there is a DNS lookup for the domain of &#8216;myson123456[.]ddns[.]net&#8217; which points to the IP address of &#8216;178.32.72.136.&#8217; That IP is registered for the OVH ISP in France:<\/p>\n<pre class=\"brush: plain; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\n\thttp:\/\/www.robtex.com\/en\/advisory\/ip\/178\/32\/72\/136\/\r\n\tinetnum:\t178.32.72.128 - 178.32.72.159\r\n\tnetname:\tOVH_45490887\r\n\tdescr:\tOVH\r\n\tcountry:\tFR\r\n\torg:\tORG-JD14-RIPE\r\n\tadmin-c:\tOTC2-RIPE\r\n\ttech-c:\tOTC2-RIPE\r\n\tstatus:\tASSIGNED PA\r\n\tmnt-by:\tOVH-MNT\r\n\tcreated:\t2013-07-01T15:35:19Z\r\n\tlast-modified:\t2013-07-01T15:35:19Z\r\n\tsource:\tRIPE # Filtered<\/pre>\n<p>I looked around to see if there was anything more on the web for this IP address and I did managed to find some hits over at Malwr &#8211; unfortunately nothing that shared the same hash was found. Moving on, once the DNS query had completed, it then tried to connect the malicious site on port 2550 which it looks like may have been fixed since the callback is never fully realized as you can see below:<\/p>\n<p><a href=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/02\/IMG4-1.png\" rel=\"attachment wp-att-364\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.herbiez.com\/wp-content\/uploads\/2016\/02\/IMG4-1.png\" alt=\"Wireshark\" width=\"1280\" height=\"800\" class=\"aligncenter size-full wp-image-364\" \/><\/a><\/p>\n<p>Now even though my system never made contact with the malicious server from above, I did get some interesting artifacts left on the system. As you can see from the results of the RegShot run, some files\/folders\/regkeys were created. The ones that stood out to me are:<\/p>\n<pre class=\"brush: vb; light: false; title: Click here to expand...; toolbar: true; notranslate\" title=\"Click here to expand...\">\r\n\tHKU\\S-1-5-21-3862639240-4259269860-3308957193-500\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\ASHBmwvDjsJ: &quot;&quot;C:\\Users\\Administrator\\AppData\\Roaming\\Oracle\\bin\\javaw.exe&quot; -jar &quot;C:\\Users\\Administrator\\zHOYGzgpAKk\\FkJvAfWLwXQ.STRnwH&quot;&quot;\r\n\r\n\tC:\\Users\\Administrator\\zHOYGzgpAKk\\FkJvAfWLwXQ.STRnwH\r\n\t\r\n\tC:\\Users\\Administrator\\zHOYGzgpAKk\\ID.txt<\/pre>\n<p>The file &#8220;ID.txt&#8221; only has the following in it: &#8220;{&#8220;UUID&#8221;:&#8221;24f3cf4e-c2d9-4194-9251-4a3dc3cfe709&#8243;}.&#8221; Looking around I was not able to figure out what exactly this ID means. Maybe something to do when the whole infection chain is up and running. <\/p>\n<p>The other file (FkJvAfWLwXQ.STRnwH) that was created under the &#8220;zHOYGzgpAKk&#8221; folder looks to be the same Java file as the &#8220;payment..jar&#8221; file just named differently. The size of both files and the hashes are identical. Once again, why the Java file would be pulled out like it has is beyond me at this time. <\/p>\n<p>Also, when running the Java file, the only process that seemed to kick off was &#8220;C:\\Users\\Administrator\\AppData\\Roaming\\Oracle\\bin\\javaw.exe -jar C:\\Users\\Administrator\\zHOYGzgpAKk\\FkJvAfWLwXQ.STRnwH&#8221; as you can see below in the video.<\/p>\n<p>To check out the Java file to see if you can de-obfuscate it and the PCAP for this example please click <a href=\"http:\/\/github.com\/bloomer1016\/Malicious-Email-2016-02-02\" target=\"_blank\">here<\/a>. The password for the zip archive is &#8220;herbiegoesbananas.&#8221; Enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IoC from this investigation: ============================ myson123456[.]ddns[.]net 178.32.72.136:2550 Here is another example of an email that most users get claiming that they (the user) has something that they need to action on. In this case it is a malicious Java file. Thankfully most email gateways block these types of files from every reaching the user base. Let&#8217;s dig in. The Java file has the following characteristics: File Name: payment..jar Size: 118KB MD5: f4b463e4df4ef274a198bfb07ed3e6cd SHA256: f4c93ab532e53274bd97c00fccba3b231de0832e743879380f7af7bf81aef60f Virustotal Link: http:\/\/www.virustotal.com\/en\/file\/f4c93ab532e53274bd97c00fccba3b231de0832e743879380f7af7bf81aef60f\/analysis\/ Detection Ratio: 25 \/ 54 First Submitted: 2016-02-07 21:28:02 UTC Malwr link: http:\/\/malwr.com\/analysis\/Y2FmYjEwNGM0MjM5NDBmYWI3YTdjYjJkOTRjY2M5OWY\/ Since this is a Java file, I usually like to&#8230;<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/www.herbiez.com\/?p=361\"><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-361","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\/361","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=361"}],"version-history":[{"count":6,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/posts\/361\/revisions"}],"predecessor-version":[{"id":372,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=\/wp\/v2\/posts\/361\/revisions\/372"}],"wp:attachment":[{"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.herbiez.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}