{"id":85242,"date":"2017-11-29T18:53:03","date_gmt":"2017-11-29T13:23:03","guid":{"rendered":"https:\/\/blogs_admin.quickheal.com\/?p=85242"},"modified":"2017-11-30T21:13:07","modified_gmt":"2017-11-30T15:43:07","slug":"technical-analysis-icedid-new-sophisticated-banking-trojan-analysis-quick-heal-security-labs","status":"publish","type":"post","link":"https:\/\/www.quickheal.com\/blogs\/technical-analysis-icedid-new-sophisticated-banking-trojan-analysis-quick-heal-security-labs\/","title":{"rendered":"IcedID &#8211; a new sophisticated banking Trojan: a technical analysis by Quick Heal Security Labs"},"content":{"rendered":"<p>IcedID is a new player in the banking Trojan family. It has a modular architecture and capable of stealing banking credentials of the user by performing a man-in-the-middle attack (MITM). IcedID sets up a local proxy and redirects all Internet traffic through it. Additionally, it can download and execute components required for stealth.<\/p>\n<p><strong>Infection vector<\/strong><\/p>\n<p>Normally, IcedID spreads through spam email or dropped by other malware families. In our analysis, we found the family to be Emotet. In early 2017, Emotet was widely used to spread other banking Trojans such as Qkabot and Dridex.<\/p>\n<p>IcedID contains a network spreading module which is rarely observed in other banking Trojans. Looking at the API sequence in IcedID, it has adopted similar techniques which were successfully used by malware such as BadRabit, Petya\/Not-Petya.<\/p>\n<p><strong>Analysis of sample <\/strong><\/p>\n<p>On execution, the sample drops a copy of itself on to the folder<strong> %LOCAL_APPDATA% <\/strong>with a random name in a randomly named folder. The name of the dropped file and folder is the same and contains 9 characters. The name of the dropped file is generated using a security identifier (SID) of the current user. Below is the code that generates the SID for the current logged on user.<\/p>\n<figure id=\"attachment_85243\" aria-describedby=\"caption-attachment-85243\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-85243\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/11\/Fig1-650x90.png\" alt=\"Fig 1. Generating SID\" width=\"650\" height=\"90\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig1-650x90.png 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig1-300x41.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig1-768x106.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig1-789x109.png 789w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig1.png 900w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><figcaption id=\"caption-attachment-85243\" class=\"wp-caption-text\">Fig 1. Generating SID<\/figcaption><\/figure>\n<p>The name of the dropped file with a random name in a randomly named folder.<\/p>\n<p>\u201c%LOCALAPPDATA%\\[a-z]{9}\\[a-z]{9}.exe\u201d<\/p>\n<p>Example: &#8211;<\/p>\n<p>\u201cC:\\Documents and Settings\\Administrator\\Local Settings\\Application Data\\<strong>homatluna<\/strong>\\<strong>homatluna.exe<\/strong>\u201d<\/p>\n<p>It maintains its persistence by creating a registry entry in \u201cRun\u201d.<\/p>\n<p>\u201cHKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\<strong>homatluna<\/strong>\u201d<\/p>\n<p>Next IcedID writes a RSA crypto-key to the system into the AppData folder. It then writes a certificate file in %TEMP% folder.<\/p>\n<p>Example &#8211; \u201cC:\\Documents and Settings\\Administrator\\Local Settings\\Temp\\<strong>0137194B.tmp<\/strong>\u201d<\/p>\n<p><strong>Network activity<\/strong><\/p>\n<p>It creates two socket connections. One for local proxy and another to serve as a backdoor for CnC communication. In our analysis, the port with the local proxy bind is <strong>49158<\/strong> and the backdoor is created on port number <strong>49161<\/strong>.<\/p>\n<p>It creates a local proxy. Using certificates of different banks and custom module, it implements its own SSL layer. Using this it performs MITM. IcedID can intercept all traffic and extract user credentials from it.<\/p>\n<p>Once the malware enters the system, it sends the bot ID and basic system information to the CnC server through the POST request as seen in Fig 1 and Fig 2.<\/p>\n<figure id=\"attachment_85244\" aria-describedby=\"caption-attachment-85244\" style=\"width: 571px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-85244\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/11\/Fig2-571x390.png\" alt=\"Fig 2. Code to get basic system information\" width=\"571\" height=\"390\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig2-571x390.png 571w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig2-300x205.png 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig2-768x524.png 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig2-789x539.png 789w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig2.png 861w\" sizes=\"(max-width: 571px) 100vw, 571px\" \/><figcaption id=\"caption-attachment-85244\" class=\"wp-caption-text\">Fig 2. Code to get basic system information<\/figcaption><\/figure>\n<figure id=\"attachment_85245\" aria-describedby=\"caption-attachment-85245\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-85245\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/11\/Fig3-650x141.jpg\" alt=\"Fig 3. Post basic system info\" width=\"650\" height=\"141\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig3-650x141.jpg 650w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig3-300x65.jpg 300w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig3-768x166.jpg 768w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig3-789x171.jpg 789w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig3.jpg 873w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><figcaption id=\"caption-attachment-85245\" class=\"wp-caption-text\">Fig 3. Post basic system info<\/figcaption><\/figure>\n<p>Following is the decoded post request details to be sent:<\/p>\n<p><em>K &#8211; System Name<\/em><\/p>\n<p><em>B &#8211; BOT ID<\/em><\/p>\n<p><em>L &#8211; Work Group<\/em><\/p>\n<p><em>M &#8211; OS Version<\/em><\/p>\n<p>IcedID\u2019s communication with CnC takes place over an encrypted SSL whose certificate is decided by the malware itself from the certificate store. The temp file which is dropped by the malware is used to store the certificate. The below code is used for certificate enumeration.<\/p>\n<figure id=\"attachment_85246\" aria-describedby=\"caption-attachment-85246\" style=\"width: 516px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-85246\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/11\/Fig4.png\" alt=\"Fig 4. Code to enumerate certificate\" width=\"516\" height=\"258\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig4.png 516w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig4-300x150.png 300w\" sizes=\"(max-width: 516px) 100vw, 516px\" \/><figcaption id=\"caption-attachment-85246\" class=\"wp-caption-text\">Fig 4. Code to enumerate certificate<\/figcaption><\/figure>\n<figure id=\"attachment_85247\" aria-describedby=\"caption-attachment-85247\" style=\"width: 593px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-85247\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/11\/Fig5.png\" alt=\"Fig 5. Certificate stored in the tmp file\" width=\"593\" height=\"184\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig5.png 593w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig5-300x93.png 300w\" sizes=\"(max-width: 593px) 100vw, 593px\" \/><figcaption id=\"caption-attachment-85247\" class=\"wp-caption-text\">Fig 5. Certificate stored in the tmp file<\/figcaption><\/figure>\n<p><strong>Spreading in the network<\/strong><\/p>\n<p>IcedID is different from other banking Trojans because it can spread within the network. It first finds the live system on the local network and copies itself on to the new system.<\/p>\n<figure id=\"attachment_85248\" aria-describedby=\"caption-attachment-85248\" style=\"width: 593px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-85248\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/11\/Fig6.png\" alt=\"Fig 6. Connects to other machines\" width=\"593\" height=\"202\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig6.png 593w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig6-300x102.png 300w\" sizes=\"(max-width: 593px) 100vw, 593px\" \/><figcaption id=\"caption-attachment-85248\" class=\"wp-caption-text\">Fig 6. Connects to other machines<\/figcaption><\/figure>\n<figure id=\"attachment_85249\" aria-describedby=\"caption-attachment-85249\" style=\"width: 629px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-85249\" src=\"https:\/\/blogs_admin.quickheal.com\/wp-content\/uploads\/2017\/11\/Fig7.png\" alt=\"Fig 7. Drop a copy on the other system on the network\" width=\"629\" height=\"242\" srcset=\"https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig7.png 629w, https:\/\/www.quickheal.com\/blogs\/wp-content\/uploads\/2017\/11\/Fig7-300x115.png 300w\" sizes=\"(max-width: 629px) 100vw, 629px\" \/><figcaption id=\"caption-attachment-85249\" class=\"wp-caption-text\">Fig 7. Drop a copy on the other system on the network<\/figcaption><\/figure>\n<p><strong>Indicator of compromises<\/strong><\/p>\n<p>csuwbru[.]net<br \/>\ncomeontrk[.]com<br \/>\nmedicalciferol[.]com<br \/>\n38921f28bb74fea2cab6e70039ee65f3<br \/>\nd982c6de627441765c89da5cfeb04d6f<br \/>\n82d6e69df2277073d4aaacd6994ee033<\/p>\n<p><a href=\"https:\/\/bit.ly\/2ncPU26\"><strong>Quick Heal<\/strong><\/a><strong> successfully detects IcedID as Trojan.IcedID.<\/strong><\/p>\n<p>The malware\u2019s spreading behavior makes it more aggressive than the previously seen banking Trojans.<\/p>\n<p><strong>Prevention tips<\/strong><\/p>\n<ol>\n<li>Install an antivirus and keep it updated.<\/li>\n<li>Keep your Operating System and software up-to-date.<\/li>\n<li>Do not click on links or download attachments from unknown, unexpected or unwanted sources.<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><strong>Subject Matter Expert<\/strong><br \/>\nPiyush Bansal | Ghanshyam More, Quick Heal Security Labs<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IcedID is a new player in the banking Trojan family. It has a modular architecture and capable of stealing banking credentials of the user by performing a man-in-the-middle attack (MITM). IcedID sets up a local proxy and redirects all Internet traffic through it. Additionally, it can download and execute components required for stealth. Infection vector [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":85252,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,5],"tags":[1139,1540,49,1539],"class_list":["post-85242","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-malware","category-security","tag-banking-trojan","tag-icedid","tag-malware","tag-mitm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/85242"}],"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\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/comments?post=85242"}],"version-history":[{"count":5,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/85242\/revisions"}],"predecessor-version":[{"id":85255,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/posts\/85242\/revisions\/85255"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media\/85252"}],"wp:attachment":[{"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/media?parent=85242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/categories?post=85242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickheal.com\/blogs\/wp-json\/wp\/v2\/tags?post=85242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}