{"id":84844,"date":"2017-10-03T18:08:25","date_gmt":"2017-10-03T12:38:25","guid":{"rendered":"https:\/\/blogs_admin.quickheal.com\/?p=84844"},"modified":"2017-10-03T19:37:08","modified_gmt":"2017-10-03T14:07:08","slug":"evolution-jrat-java-malware-analysis-quick-heal-security-labs","status":"publish","type":"post","link":"https:\/\/www.quickheal.com\/blogs\/evolution-jrat-java-malware-analysis-quick-heal-security-labs\/","title":{"rendered":"Evolution of jRAT JAVA Malware &#8211; An analysis by Quick Heal Security Labs"},"content":{"rendered":"<p>jRAT (Java Based Remote Access Trojans) malware is not new but its activity has increased recently in the last few months and they are targeting various organizations. Per day, Quick Heal Security Labs identifies thousands of spam emails carrying weaponized JAR as attachments targeting users. These malicious JAR i.e., jRAT malware upon execution, result in infecting users. Let\u2019s take a look at a detailed analysis of this malware.<\/p>\n<p><strong>Infection chain<\/strong><\/p>\n<figure id=\"attachment_84847\" aria-describedby=\"caption-attachment-84847\" style=\"width: 750px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84847\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture1.png\" alt=\"Fig 1: jRat Infection Chain\" width=\"750\" height=\"442\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture1.png 750w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture1-300x177.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture1-650x383.png 650w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><figcaption id=\"caption-attachment-84847\" class=\"wp-caption-text\">Fig 1: jRat Infection Chain<\/figcaption><\/figure>\n<p>Here is an initial infection vector which is a spam email. As it looks legitimate, the user is tempted to download and open the attachment.<\/p>\n<figure id=\"attachment_84848\" aria-describedby=\"caption-attachment-84848\" style=\"width: 781px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84848\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture2.png\" alt=\"Fig 2: Spam Email\" width=\"781\" height=\"324\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture2.png 781w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture2-300x124.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture2-768x319.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture2-650x270.png 650w\" sizes=\"(max-width: 781px) 100vw, 781px\" \/><figcaption id=\"caption-attachment-84848\" class=\"wp-caption-text\">Fig 2: Spam Email<\/figcaption><\/figure>\n<p>Below is a list of attachment names observed in these spam emails:<\/p>\n<ul>\n<li>ITD_EFILING_FORM15CB_PR3.2.jar<\/li>\n<li>MVD_SHPMNT_VSL_0004048_pdf.jar<\/li>\n<li>Payment Swift Scan Copy 682017.pdf.jar<\/li>\n<li>SHIPPING DOCUMENTS PDF.jar<\/li>\n<li>SCAN DOC- 53862100.jar<\/li>\n<li>FINAL COMPLETE SET OF SHIPPING DOCS.jar<\/li>\n<li>PAYMENT_ADVISE_PDF.jar<\/li>\n<li>PAYMENT_APLICATION_PDF.jar<\/li>\n<\/ul>\n<p>After extracting the parent JAR file, it shows some java packages containing some long random filenames which contain raw data and class files. We have observed that malware actors are evolving malicious JARs with numerous obfuscations patterns. Some of the patterns are as follows:<\/p>\n<figure id=\"attachment_84865\" aria-describedby=\"caption-attachment-84865\" style=\"width: 582px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84865\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Fig_3.png\" alt=\"Fig 3: Different Obfuscation Patterns\" width=\"582\" height=\"293\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Fig_3.png 582w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Fig_3-300x151.png 300w\" sizes=\"(max-width: 582px) 100vw, 582px\" \/><figcaption id=\"caption-attachment-84865\" class=\"wp-caption-text\">Fig 3: Different Obfuscation Patterns<\/figcaption><\/figure>\n<p>Well-known decompilers failed to decompile the parent JAR file. Due to variation in obfuscation and encryption, (RSA, AES) makes static analysis more complex. Let\u2019s see how malware behaves when it gets executed.<\/p>\n<p>Execution of the parent JAR file drops two \u201c.vbs\u201d, two \u201c.Class\u201d, one \u201c.Reg\u201d and one \u201c.dll\u201d file at \u201c%TEMP%\u201d location. Every dropped file has a unique role in the infection cycle. Also, the parent JAR checks for a virtual machine using <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa366589(v=vs.85).aspx\">GlobalMemoryStatusEx<\/a>() api which checks for the total physical and virtual memory available.<\/p>\n<p>The parent JAR drops VBS files at %Temp% location with some random names. Also, it drops a JAR file with extension \u2018.class\u2019 at %Temp%. The parent JAR executes dropped the JAR file. The dropped JAR file is a jRAT malware.<\/p>\n<p>Below images shows dropped vbs files:<\/p>\n<figure id=\"attachment_84856\" aria-describedby=\"caption-attachment-84856\" style=\"width: 834px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84856\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture4.png\" alt=\"Fig 4: VBS File to list down AV\u2019s\" width=\"834\" height=\"177\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture4.png 834w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture4-300x64.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture4-768x163.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture4-650x138.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture4-789x167.png 789w\" sizes=\"(max-width: 834px) 100vw, 834px\" \/><figcaption id=\"caption-attachment-84856\" class=\"wp-caption-text\">Fig 4: VBS File to list down AV\u2019s<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_84857\" aria-describedby=\"caption-attachment-84857\" style=\"width: 831px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84857\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture5.png\" alt=\"Fig 5: VBS File to list down Firewall Products\" width=\"831\" height=\"161\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture5.png 831w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture5-300x58.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture5-768x149.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture5-650x126.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture5-789x153.png 789w\" sizes=\"(max-width: 831px) 100vw, 831px\" \/><figcaption id=\"caption-attachment-84857\" class=\"wp-caption-text\">Fig 5: VBS File to list down Firewall Products<\/figcaption><\/figure>\n<p>Then jRAT malware executes VBS files using <strong>cscript.exe. <\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-84859\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture6.1.png\" alt=\"Fig 6-1\" width=\"1225\" height=\"133\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture6.1.png 1225w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture6.1-300x33.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture6.1-768x83.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture6.1-650x71.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture6.1-789x86.png 789w\" sizes=\"(max-width: 1225px) 100vw, 1225px\" \/><\/p>\n<figure id=\"attachment_84861\" aria-describedby=\"caption-attachment-84861\" style=\"width: 1187px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84861\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture6-1.png\" alt=\"Fig 6: VBS File Execution by JAR\" width=\"1187\" height=\"109\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture6-1.png 1187w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture6-1-300x28.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture6-1-768x71.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture6-1-650x60.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture6-1-789x72.png 789w\" sizes=\"(max-width: 1187px) 100vw, 1187px\" \/><figcaption id=\"caption-attachment-84861\" class=\"wp-caption-text\">Fig 6: VBS File Execution by JAR<\/figcaption><\/figure>\n<p>One of the VBS files enumerates a list of different firewall installed using <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/aa394582(v=vs.85).aspx\">WMI <\/a>(Windows Management Instrumentation) functionality and the other one enumerates a list of third-party antivirus products using the same functionality upon execution.<\/p>\n<p>The parent JAR also drops the \u201c.Reg File\u201d at %Temp% location and executes it using \u2018reg.exe\u2019. It creates registry entries of frequently used analysis tools such as \u2018Procexp.exe\u2019 ,\u2019wireshark.exe\u2019, \u2018dumppcap.exe\u2019 and some security products processes under \u201c<strong>Image File Execution\u201d<\/strong>. So, if any process gets started and if it has an entry under that key then the process gets killed.<\/p>\n<p>Some registry entries are shown below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-84862\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture7.1.png\" alt=\"Fig 7-1\" width=\"951\" height=\"180\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture7.1.png 951w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture7.1-300x57.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture7.1-768x145.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture7.1-650x123.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture7.1-789x149.png 789w\" sizes=\"(max-width: 951px) 100vw, 951px\" \/><\/p>\n<figure id=\"attachment_84863\" aria-describedby=\"caption-attachment-84863\" style=\"width: 953px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84863\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture7.png\" alt=\"Fig 7: Registry Entry under Image File Execution\" width=\"953\" height=\"219\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture7.png 953w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture7-300x69.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture7-768x176.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture7-650x149.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture7-789x181.png 789w\" sizes=\"(max-width: 953px) 100vw, 953px\" \/><figcaption id=\"caption-attachment-84863\" class=\"wp-caption-text\">Fig 7: Registry Entry under Image File Execution<\/figcaption><\/figure>\n<p>The parent JAR executes actual jRat JAR file using java.exe. This jRat file is capable of communicating with a C&amp;C server and can download executable payload.<\/p>\n<p>To achieve persistence, it makes an entry into an auto-run registry so that it can launch itself when the system reboots.<\/p>\n<figure id=\"attachment_84864\" aria-describedby=\"caption-attachment-84864\" style=\"width: 1055px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84864\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture8.png\" alt=\"Fig 8: Persistence Entry in Registry\" width=\"1055\" height=\"147\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture8.png 1055w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture8-300x42.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture8-768x107.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture8-650x91.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture8-789x110.png 789w\" sizes=\"(max-width: 1055px) 100vw, 1055px\" \/><figcaption id=\"caption-attachment-84864\" class=\"wp-caption-text\">Fig 8: Persistence Entry in Registry<\/figcaption><\/figure>\n<p>jRat connects with CnC IP \u201c<a href=\"https:\/\/www.virustotal.com\/#\/ip-address\/213.183.58.42\">213.183.58[.]42<\/a> \u201d. The below image shows the TLS-encrypted SSL traffic after infection. After decoding the TCP stream on port 3012, we found the blacklisted certificate which is associated with jRAT JAR.<\/p>\n<figure id=\"attachment_84867\" aria-describedby=\"caption-attachment-84867\" style=\"width: 774px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84867\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture9.png\" alt=\"Fig 9: TLS-Encrypted SSL Traffic\" width=\"774\" height=\"241\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture9.png 774w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture9-300x93.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture9-768x239.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture9-650x202.png 650w\" sizes=\"(max-width: 774px) 100vw, 774px\" \/><figcaption id=\"caption-attachment-84867\" class=\"wp-caption-text\">Fig 9: TLS-Encrypted SSL Traffic<\/figcaption><\/figure>\n<p>the below image shows the SSL certificate information and it has an entry in the <a href=\"https:\/\/sslbl.abuse.ch\/intel\/d62e065311dffcecad9f8e92c316aafb6019394b\">SSL Blacklist<\/a>:<\/p>\n<figure id=\"attachment_84868\" aria-describedby=\"caption-attachment-84868\" style=\"width: 1091px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-84868\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture10.png\" alt=\"Fig 10: SSL Certificate Information\" width=\"1091\" height=\"431\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture10.png 1091w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture10-300x119.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture10-768x303.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture10-650x257.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture10-789x312.png 789w\" sizes=\"(max-width: 1091px) 100vw, 1091px\" \/><figcaption id=\"caption-attachment-84868\" class=\"wp-caption-text\">Fig 10: SSL Certificate Information<\/figcaption><\/figure>\n<p><strong>Quick heal detection stats<\/strong><\/p>\n<p>Quick Heal Email Security generically detects such malicious attachments.<\/p>\n<p>Detection Name: <strong>JAR.Suspicious.A<\/strong><\/p>\n<figure id=\"attachment_84869\" aria-describedby=\"caption-attachment-84869\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-84869 size-large\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/10\/Picture11-650x384.png\" alt=\"Fig 11: Quick Heal Lab detection stats\" width=\"650\" height=\"384\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture11-650x384.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture11-300x177.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/10\/Picture11.png 768w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><figcaption id=\"caption-attachment-84869\" class=\"wp-caption-text\">Fig 11: Quick Heal Lab detection stats<\/figcaption><\/figure>\n<p>After analysing the entire jRAT JAR infection chain, we noticed that the malware authors have been consistently changing the obfuscators to evade signature-based detection and using anti-debugging and anti-VM\u2019s techniques. Furthermore, finding and disabling security solutions using numerous ways show how it got evolved.<\/p>\n<p><strong>Indicators of compromise<\/strong><\/p>\n<ul>\n<li>213.183.58.42<\/li>\n<li>781FB531354D6F291F1CCAB48DA6D39F<\/li>\n<li>0B7B52302C8C5DF59D960DD97E3ABDAF<\/li>\n<li>938CF1BA5F8BDB516B5617826E0B08A1<\/li>\n<li>76985223E94342D0FAB80D8A4DB1707C<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Subject Matter Expert<\/strong><\/p>\n<p>Prashant Kadam, Pawan Chaudhari | Quick Heal Security Labs<\/p>\n","protected":false},"excerpt":{"rendered":"<p>jRAT (Java Based Remote Access Trojans) malware is not new but its activity has increased recently in the last few months and they are targeting various organizations. Per day, Quick Heal Security Labs identifies thousands of spam emails carrying weaponized JAR as attachments targeting users. These malicious JAR i.e., jRAT malware upon execution, result in [&hellip;]<\/p>\n","protected":false},"author":33,"featured_media":84881,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,304,293,968,142],"tags":[1504,1502,1503],"class_list":["post-84844","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-email","category-social-engineering-2","category-spam","category-spyware","category-ssl-certificate","tag-adwind","tag-jrat","tag-malspam"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/84844"}],"collection":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/comments?post=84844"}],"version-history":[{"count":15,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/84844\/revisions"}],"predecessor-version":[{"id":84877,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/84844\/revisions\/84877"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media\/84881"}],"wp:attachment":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media?parent=84844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/categories?post=84844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/tags?post=84844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}