{"id":1321,"date":"2022-06-21T11:00:23","date_gmt":"2022-06-21T09:00:23","guid":{"rendered":"https:\/\/lab52.io\/blog\/?p=1321"},"modified":"2022-07-26T09:50:57","modified_gmt":"2022-07-26T07:50:57","slug":"muddywaters-light-first-stager-targetting-middle-east","status":"publish","type":"post","link":"https:\/\/lab52.io\/blog\/muddywaters-light-first-stager-targetting-middle-east\/","title":{"rendered":"MuddyWater&#8217;s &#8220;light&#8221; first-stager targeting Middle East"},"content":{"rendered":"\n<p>Since the last quarter of 2020 MuddyWater has maintained a &#8220;long-term&#8221; infection campaign targeting Middle East countries. We have gathered samples from November 2020 to January 2022, and due to the recent samples found, it seems that this campaign might still be currently active. The latest campaigns of the Muddy Water threat group, allegedly sponsored by the Iranian government and linked to the Iranian revolutionary guard (the main armed forces of the Iranian government), could be framed within the dynamics of maintaining Iran&#8217;s regional sovereignty.<\/p>\n\n\n\n<p>This infection campaign always starts with a compressed file wrapping a malicious Word document containing VBA macros.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/asdfads-1.png\" alt=\"\" class=\"wp-image-1323\" width=\"536\" height=\"444\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/asdfads-1.png 769w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/asdfads-1-300x249.png 300w\" sizes=\"(max-width: 536px) 100vw, 536px\" \/><figcaption>Malicious document sample<\/figcaption><\/figure><\/div>\n\n\n\n<p>While our oldest sample looks a little more sophisticated based on the content of the document, which seems more specifically crafted for Arabic speakers as shown in the previous image, the rest of them contain generic English message to enable macros.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-29-41-1.png\" alt=\"\" class=\"wp-image-1325\" width=\"479\" height=\"216\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-29-41-1.png 805w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-29-41-1-300x136.png 300w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-29-41-1-768x348.png 768w\" sizes=\"(max-width: 479px) 100vw, 479px\" \/><figcaption><em>Malicious document<\/em> sample<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-29-08.png\" alt=\"\" class=\"wp-image-1326\" width=\"570\" height=\"450\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-29-08.png 762w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-29-08-300x237.png 300w\" sizes=\"(max-width: 570px) 100vw, 570px\" \/><figcaption><em>Malicious document<\/em> sample<\/figcaption><\/figure><\/div>\n\n\n\n<p>Although it has not been possible to clearly identify their specific target, it has been observed that these campaigns have been directed against countries such as Pakistan, Kazahstan, Armenia, Syria, Israel, Bahrain, Turkey, South Africa, Sudan, etc. Many of these countries may be of interest to the alleged Iranian threat actor, as some of them have been involved in recent internal conflicts, or are implicated in nuclear energy improvement, or may serve as strategic footholds for the development and influence of Iranian interests in other parts of the world.<\/p>\n\n\n\n<p>The macros are very concise and their only purpose is to write a not-so-much obfuscated VBS script into a file located in C:\\ProgramData or the Windows Startup folder, with names such as Temp_[3-5 random chars].txt.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"823\" height=\"827\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-02-03-17-13-45.png\" alt=\"\" class=\"wp-image-1327\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-02-03-17-13-45.png 823w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-02-03-17-13-45-300x300.png 300w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-02-03-17-13-45-768x772.png 768w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-02-03-17-13-45-75x75.png 75w\" sizes=\"(max-width: 823px) 100vw, 823px\" \/><figcaption>Malicious VBA macro code<\/figcaption><\/figure><\/div>\n\n\n\n<p>The dropped script is a small RAT which allows to execute commands via cmd. It first calls a recon function which executes whoami, and sets a country code which is already present in the script. The result of this will then be part of the URI used for the C2 contact. The set of different country codes found in the gathered samples are the following, and might indeed reveal the targets for each campaign:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>PK &#8211;&gt; Pakistan<\/li><li>AR &#8211;&gt; Argentina<\/li><li>AM &#8211;&gt; Armenia<\/li><li>SY &#8211;&gt; Syria<\/li><li>IL &#8211;&gt; Israel<\/li><li>BH &#8211;&gt; Bahrain<\/li><li>TR &#8211;&gt; Turkey<\/li><li>SA &#8211;&gt; Saudi Arabia<\/li><li>SD &#8211;&gt; Sudan<\/li><li>KK &#8211;&gt; Kazakhstan<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-36-38.png\" alt=\"\" class=\"wp-image-1328\" width=\"713\" height=\"138\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-36-38.png 596w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-36-38-300x58.png 300w\" sizes=\"(max-width: 713px) 100vw, 713px\" \/><figcaption>Code snippet from dropped VB Script (Deobfuscated)<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-41-22.png\" alt=\"\" class=\"wp-image-1329\" width=\"692\" height=\"112\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-41-22.png 600w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-41-22-300x49.png 300w\" sizes=\"(max-width: 692px) 100vw, 692px\" \/><figcaption><em>Code snippet from dropped VB Script<\/em> (Obfuscated)<\/figcaption><\/figure><\/div>\n\n\n\n<p>After building the recon string, it will execute its main function. This function first executes explorer.exe (without apparent functional reason), and then calls a function to choose one IP from an array which will rotate in case of the chosen IP not replying to the subsequent C2 connection. This connection to the C2 server will use an HTTP GET request using the following structure:<br><br><em>http:\/\/{ <strong>IP_address<\/strong> }\/getCommand?guid={ <strong>recon_string<\/strong> }<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"482\" height=\"187\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-32-19.png\" alt=\"\" class=\"wp-image-1330\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-32-19.png 482w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-32-19-300x116.png 300w\" sizes=\"(max-width: 482px) 100vw, 482px\" \/><figcaption>HTTP GET communication from VBS sample<\/figcaption><\/figure><\/div>\n\n\n\n<p>As aforementioned, in the case of an empty reply, it will rotate the IP address and try again with the next. Otherwise it will deobfuscate the reply and call a function to execute it by creating a WScript.Shell object to call cmd:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-27-11-47-47.png\" alt=\"\" class=\"wp-image-1331\" width=\"601\" height=\"186\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-27-11-47-47.png 559w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-27-11-47-47-300x93.png 300w\" sizes=\"(max-width: 601px) 100vw, 601px\" \/><\/figure><\/div>\n\n\n\n<p>As also seen on the deobfuscated snippet, it will output the result into a txt file and immediately read its content to return it to the calling function in order to include the result and send it to the C2 server. The next contact will use the POST HTTP method and will follow a slightly different structure and the command output in the body:<br><br><em>http:\/\/{ <strong>IP_address<\/strong> }\/getTargetInfo?guid={ <strong>recon_string<\/strong> }&amp;status={ <strong>flag_value<\/strong> }<\/em><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"486\" height=\"246\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-32-57.png\" alt=\"\" class=\"wp-image-1332\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-32-57.png 486w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-11-32-57-300x152.png 300w\" sizes=\"(max-width: 486px) 100vw, 486px\" \/><figcaption><em>HTTP POST communication from VBS sample<\/em><\/figcaption><\/figure><\/div>\n\n\n\n<p>Interestingly, the value renamed by us as \u201cflag_value\u201d will be included as the \u201cstate\u201d value within the POST request. In the script file, it is a variable that is initialized to 0 in every collected sample, and is always set to 1 before executing the received command and sending the result in the POST request. Other than this, it is not modified or used in the script file. However, it is checked during the renamed \u201cwhoami_wrap\u201d for the initial host recon at the beginning of the script. It is compared with the value 126, and in case of resolving True, it will display the following message box.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-27-11-24-05.png\" alt=\"\" class=\"wp-image-1333\" width=\"517\" height=\"256\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-27-11-24-05.png 423w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-27-11-24-05-300x149.png 300w\" sizes=\"(max-width: 517px) 100vw, 517px\" \/><figcaption>Malicious VBS &#8220;alternative functionality&#8221; <\/figcaption><\/figure><\/div>\n\n\n\n<p>The only implemented functionality in every analyzed sample is the #1, which will use WMI to display the following information about the infected system:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-12-04-56.png\" alt=\"\" class=\"wp-image-1334\" width=\"680\" height=\"194\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-12-04-56.png 625w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/02\/Screenshot-from-2022-01-28-12-04-56-300x85.png 300w\" sizes=\"(max-width: 680px) 100vw, 680px\" \/><figcaption>Code snippet for the &#8220;alternative functionality&#8221;<\/figcaption><\/figure><\/div>\n\n\n\n<p>Such a small script with incomplete functionality, after almost two years being used for different campaigns could suggest that the attackers might modify its functionality in a later stage, based on the obtained information from the infected host or, at least, use it to download and drop the next infection stage.<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<p> <\/p>\n\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p><u>Indicators of compromise<\/u><\/p>\n\n\n\n<p><u><strong>2020<\/strong><\/u><\/p>\n\n\n\n<p>\u0648\u0631\u0634\u0629 \u0639\u0645\u0644 \u062a\u062f\u0631\u06cc\u0628\u06cc\u0629.zip<\/p>\n\n\n\n<p>4e8a2b592ed90ed13eb604ea2c29bfb3fbc771c799b3615ac84267b85dd26d1c<\/p>\n\n\n\n<p>egojt7.vbs<\/p>\n\n\n\n<p>ae6dba7da3c8b2787b274c660e0b522ce8ebda89b1864d8a2ac2c9bb2bd4afa6<\/p>\n\n\n\n<p>185.117.73.]52<\/p>\n\n\n\n<p><u><strong>2021<\/strong><\/u><\/p>\n\n\n\n<p>fbd2a9f400740610febd5a1ae7448536dd95f37b85dfd2ca746e11a51086bd4b<\/p>\n\n\n\n<p>Temp_UFNCR335.vbs<\/p>\n\n\n\n<p>2245fc9d9aea07b0ffdac792d4851ceed851a3bf1d528384e94306e59e3abd16<\/p>\n\n\n\n<p>84d523833db6cc74a079b12312da775d4281bf1034b2af0203c9d14c098e6f29<\/p>\n\n\n\n<p>Temp_WNJJ6.vbs<\/p>\n\n\n\n<p>cab75e26febd111dd5483666c215bb6b56059f806f83384f864c51ceddd0b1cf<\/p>\n\n\n\n<p>\u0645\u0634\u0631\u0648\u0639.zip<\/p>\n\n\n\n<p>faa6258d7bd355329a9ad69e15b2857d24f9ac11a9782d1a215149938460ac4b<\/p>\n\n\n\n<p>\u0645\u0634\u0631\u0648\u0639.doc<\/p>\n\n\n\n<p>2f2492b7bb55f7a12f7530c9973c9b81fdd5e24001e4a21528ff1d5b47e3446e<\/p>\n\n\n\n<p>Temp_K40.vbs<\/p>\n\n\n\n<p>ed4b523a0eecc5de172a97eb8acb357bc1f4807efec761ec2764f20ef028cc63<\/p>\n\n\n\n<p>projectvpn.doc<\/p>\n\n\n\n<p>ea24c5a8b976919d4c8c4779dc0b7ef887373f126c4732edf9023b827b4e4dc4<\/p>\n\n\n\n<p>Temp_WZW4.txt<\/p>\n\n\n\n<p>1d133cc388415592e2e2246e6fb1903690068577fc82e2ae682ba0a661cea0dd<\/p>\n\n\n\n<p>107.174.68.]60<\/p>\n\n\n\n<p>192.227.147.]152<\/p>\n\n\n\n<p><u><strong>2022<\/strong><\/u><\/p>\n\n\n\n<p>yeni y\u00f6nerge.doc<\/p>\n\n\n\n<p>dba90bd5fdf0321a28f21fccb3a77ee1ed5d73e863e4520ce8eb8fca670189c3<\/p>\n\n\n\n<p>Temp_FU4.txt<\/p>\n\n\n\n<p>0b4d660335b55d96ddf4c76664341ed52519639161a0a0a1aa0ae82951feba01<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Customers with Lab52\u2019s APT intelligence private feed service already have more tools and means of detection for this campaign.<br>In case of having threat hunting service or being client of S2Grupo CERT, this intelligence has already been applied.<\/p>\n\n\n\n<p>If you need more information about Lab52\u2019s private APT intelligence feed service, you can contact us through the<a href=\"https:\/\/lab52.io\/contact\"> following link<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since the last quarter of 2020 MuddyWater has maintained a &#8220;long-term&#8221; infection campaign targeting Middle East countries. We have gathered samples from November 2020 to January 2022, and due to the recent samples found, it seems that this campaign might still be currently active. The latest campaigns of the Muddy Water threat group, allegedly sponsored [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[21,1],"tags":[],"class_list":{"0":"post-1321","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-apt","7":"category-uncategorised","8":"entry","9":"has-post-thumbnail"},"featured_image_src":null,"featured_image_src_square":null,"author_info":{"display_name":"Dex","author_link":"https:\/\/lab52.io\/blog\/author\/dex\/"},"_links":{"self":[{"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/posts\/1321"}],"collection":[{"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/comments?post=1321"}],"version-history":[{"count":13,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/posts\/1321\/revisions"}],"predecessor-version":[{"id":1579,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/posts\/1321\/revisions\/1579"}],"wp:attachment":[{"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/media?parent=1321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/categories?post=1321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/tags?post=1321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}