{"id":358,"date":"2022-12-21T00:39:25","date_gmt":"2022-12-21T00:39:25","guid":{"rendered":"https:\/\/blog.scilabs.mx\/en\/?p=358"},"modified":"2022-12-21T00:39:25","modified_gmt":"2022-12-21T00:39:25","slug":"new-blackbelen-malware-man-in-the-browser-malware-campaign-targeting-mexico","status":"publish","type":"post","link":"https:\/\/blog.scilabs.mx\/en\/2022\/12\/21\/new-blackbelen-malware-man-in-the-browser-malware-campaign-targeting-mexico\/","title":{"rendered":"New BlackBelen malware: Man-in-the-Browser malware campaign targeting Mexico"},"content":{"rendered":"<h1><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-399 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/Logo-BlackBelen.png\" alt=\"Logo BlackBelen\" width=\"501\" height=\"231\" \/><\/h1>\n<h1>Overview<\/h1>\n<p>This post aims to describe the TTPs and provide IoCs of a new malware campaign that SCILabs called BlackBelen. SCILabs observed this campaign during threat monitoring in Latin America during the last week of November. This malware aims to carry out a Man-in-the-Browser (MitB) attack by installing malicious extensions hosted on the official Chrome web browser store (<a href=\"https:\/\/chrome.google.com\/webstore\/category\/extensions\">Chrome Web Store<\/a>) to steal users&#8217; banking information in Mexico.<\/p>\n<p>The distribution method identified so far is <a href=\"https:\/\/www.redeszone.net\/2018\/10\/21\/que-es-malversting-como-protegernos\/\">malvertising<\/a> campaigns, which lead the victim to an apocryphal website of the <em>Secretar\u00eda de Administraci\u00f3n Tributaria<\/em> (SAT), inciting the user to install a malicious extension. Based on various investigations that the SCILabs team has carried out on banking trojans like <em>Mekotio<\/em> or <em>Ursa<\/em>, we do not rule out that phishing campaigns with hyperlinks or attached PDF-type documents are also being used, leading the victim to the malicious site.<\/p>\n<p>At SCILabs, we have carried out investigations about other malware campaigns related to the installation of extensions, like the <a href=\"https:\/\/blog.scilabs.mx\/en\/new-blackdog-malware-man-in-the-browser-malware-campaign-targeting-mexico\/\"><em>BlackDog<\/em><\/a> malware identified by SCILabs for the first time during the last week of June and the <a href=\"https:\/\/blog.scilabs.mx\/en\/new-threat-blackstink-man-in-the-browser-malware-campaign-targeting-mexico\/\"><em>BlackStink<\/em><\/a> campaign discovered by us in november, however, although these malware families have some overlaps in their TTPs, so far we have not found sufficient elements that allow us to demonstrate that this one is from the same family, for this reason, this new malware was named <strong><em>BlackBelen<\/em><\/strong>.<\/p>\n<p>It is essential to mention that the hashes of the scanned artifacts are not available on the VirusTotal platform.<\/p>\n<h1><a name=\"_Toc80194999\"><\/a>How could it affect an organization?<\/h1>\n<p>The main objective of this campaign is to carry out a MitB attack so that the attackers can steal information from all types of users, including corporate users. If an attack by this malware is successful, the cybercriminals could misuse the stolen data, leaking it or selling it on underground forums or the Darknet, causing financial and reputational losses to the organization.<\/p>\n<h1>Analysis<\/h1>\n<h1>Threat context<\/h1>\n<p>While monitoring threats in the region, the URL <strong>hxxps[:]\/\/portaldeconexionsegura[.]com\/portal-SAT-enlinea-extension-security\/<\/strong> was identified, which directs visitors to an apocryphal Mexican SAT site.<\/p>\n<p>Once a user enters the fake site, a <a href=\"https:\/\/blog.ida.cl\/diseno\/ldiferencia-modal-pop-up-pop-over-light-box\/\">modal<\/a> window is displayed, inciting the victim to install a malicious extension on the Chrome or Edge browser under the pretext of being a tool for the safe use of the SAT mailbox.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-381 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/sitioapocsat.png\" alt=\"\" width=\"842\" height=\"455\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 1 \u2013 Apocryphal SAT website<\/strong><\/p>\n<p>The victim is redirected to the Chrome Web Store if the user clicks the \u201c<em>Agregar Extensi\u00f3n Segura<\/em>\u201d button and uses the Chrome web browser. If the victim uses a different browser, for example, Edge, the button redirects to another apocryphal website.<\/p>\n<p>It is essential to mention that the Edge web browser allows installing extensions from the other browser stores if the user accepts the permissions.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-382 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/satextsite.png\" alt=\"\" width=\"1029\" height=\"517\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 2 \u2013 Malicious extension website<\/strong><\/p>\n<p>Once the extension is installed in a Chrome or Edge browser, it will have permission to read and modify all data on all websites. The extension has two features:<\/p>\n<ol>\n<li>Show a window with an &#8220;optimized and safe&#8221; browsing message<\/li>\n<li>Open a browser console pop-up window<\/li>\n<\/ol>\n<p>It is important to mention that unlike other malware campaigns such as <em>BlackDog<\/em> and <em>BlackStink<\/em>, this extension allows uninstallation by the user and does not use anti-debugging scripts as in the case of <em>BlackDog<\/em>. For these reasons, in addition to the fact that browser console usage is not typically targeted at end users, we hypothesize that the adversary is in the development phase of this malware. The attacker will likely use the browser console pop-up to debug the malware&#8217;s capabilities.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-383 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/satext.png\" alt=\"\" width=\"740\" height=\"394\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 3 \u2013 Google Chrome extension installed<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-384 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/funcext.png\" alt=\"\" width=\"701\" height=\"768\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 4 &#8211; Extension features<\/strong><\/p>\n<p>By analyzing the extension, we identified various files, including JavaScript-type scripts from some Plugins and libraries such as React, and the malicious code of the extension. Finally, the files are &#8220;<a href=\"http:\/\/www.etnassoft.com\/2011\/04\/26\/minificado-y-ofuscacion-de-codigo-en-javascript\/\">minified<\/a>&#8221; and slightly obfuscated.<\/p>\n<p>The most relevant files for this investigation are presented below:<\/p>\n<ol>\n<li><strong>popup.bundle.js<\/strong>: It contains the \u201cminified\u201d scripts of the <a href=\"https:\/\/reactjs.org\/docs\/cdn-links.html\">React<\/a> JavaScript library used by the adversary to manipulate the browser and perform JavaScript operations such as communication to C2 over <a href=\"https:\/\/developer.mozilla.org\/es\/docs\/Web\/API\/WebSockets_API\">Web Sockets<\/a>.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-385 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/popup.png\" alt=\"\" width=\"935\" height=\"185\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 5 &#8211; React library source code snippet<\/strong><\/p>\n<ol>\n<li><strong>00c0035238bc9aceb757.js<\/strong>: It contains JavaScript code that uses the <a href=\"https:\/\/developer.chrome.com\/docs\/extensions\/reference\/debugger\/\">chrome.debugger API<\/a> that serves as an alternative transport for the <a href=\"https:\/\/chromedevtools.github.io\/devtools-protocol\/\">remote debugging protocol<\/a> and can be used to mutate DOM and CSS code, among other things. This code is probably used by the attacker to monitor the operation of the malware or make modifications to the DOM.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-386 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/00.png\" alt=\"\" width=\"986\" height=\"148\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 6 &#8211; Source code snippet where the chrome.debugger API is used<\/strong><\/p>\n<ol>\n<li><strong>background.bundle.js:<\/strong> It contains modified code from the <a href=\"https:\/\/socket.io\/\">Socket.IO<\/a> library used by the attacker to perform two-way real-time communication with C2.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-387 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/back.png\" alt=\"\" width=\"926\" height=\"320\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 7 \u2013 Source code snippet<\/strong><\/p>\n<p>Once the malicious extension is successfully installed, when the victim browses the internet, the data will be sent to C2 in real time; if the page visited corresponds to a banking site, it will redirect to an apocryphal website to steal the victim&#8217;s banking credentials.<\/p>\n<p>It is important to mention that we could only emulate the attack with the Citibanamex banking institution during the dynamic analysis.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-388 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/cit.png\" alt=\"\" width=\"795\" height=\"372\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 8 \u2013 Apocryphal Citibanamex Website<\/strong><\/p>\n<p>An important point to mention is that during the analysis, we identified the use of Spanish words at different stages of the infection, such as <em>\u201cx-amor-es\u201d, \u201cbelen-y-draken\u201d, \u201cLa pongo en true\u201d, \u201cDistintos estados detectados\u201d, \u201cAparentemente cambio el pedo\u201d, \u201cLa regreso a false\u201d. <\/em>Therefore, we hypothesize that due to their knowledge of the relevant institutions in Mexico and the slang used, the adversary is originally from Mexico.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-389 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/fro.png\" alt=\"\" width=\"776\" height=\"229\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 9 &#8211; Slang used by the attacker in the browser console<\/strong><\/p>\n<p>Additionally, we identified that on one of the servers used by the attacker, there were phishing templates used to steal credentials from email providers such as Outlook, Gmail, and Yahoo, so it is likely that there are also active campaigns to steal access by part of the same attacker targeting users in Mexico.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-390 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/phish.png\" alt=\"\" width=\"776\" height=\"223\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 10 \u2013 Phishing Template<\/strong><\/p>\n<p>Finally, during the investigation, we identified that the template used to impersonate the SAT is very similar to the one used by <em>BlackDog<\/em>. In <a href=\"https:\/\/www.facebook.com\/solucionesfiscalescontablestm\/photos\/a.1173006786086168\/5601202723266530\/\">open sources<\/a>, we identified a template with a file download modal as <em>BlackDog<\/em> does; however, they do not share additional TTPs, and so far, they do not share infrastructure with <em>BlackDog<\/em> or another family of malware that uses malicious Google Chrome extensions.<\/p>\n<p>The similarity of the templates used could indicate that the threat actor behind <em>BlackDog<\/em> is the same one behind this threat; however, the trust level is low. Up to now, we have yet to find enough elements to demonstrate that it is from the same family; for this reason, this new malware was named <strong><em>BlackBelen<\/em><\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-391 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/sa.png\" alt=\"\" width=\"649\" height=\"371\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 11 &#8211; Template hosted in the SAT apocryphal domain identified in open sources<\/strong><\/p>\n<h1>Technical summary<\/h1>\n<ul>\n<li>The initial access vector is through search engine malvertising and probably phishing campaigns under the pretext of a secure browsing tool on the Mexican SAT portal.<\/li>\n<li>A user visits the apocryphal SAT website; and is incited to install a malicious extension in the Chrome or Edge browser by redirecting them to the Google Chrome extension store or a page with information about the extension, depending on the browser the user is using.<\/li>\n<li>If the victim installs the extension, the browser communicates with C2 via WebSockets to monitor user activity.<\/li>\n<li>If the user visits a banking site, the attacker sends a redirect request to a fake website of the visited bank to steal the victim&#8217;s credentials.<\/li>\n<\/ul>\n<p>It is important to mention that since the attacker uses WebSockets for the attack, this widens the possibility of attacks that the adversary can perform, like <a href=\"https:\/\/book.hacktricks.xyz\/pentesting-web\/cross-site-websocket-hijacking-cswsh\">XSS or SQLi<\/a>.<\/p>\n<h1>Attack Flow<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-393 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/flujo.png\" alt=\"\" width=\"913\" height=\"391\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 12 Attack Flow<\/strong><\/p>\n<h1>TTPs observed aligned to MITRE\u2019s ATT&amp;CK framework<\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-392 aligncenter\" src=\"https:\/\/blog.scilabs.mx\/en2\/wp-content\/uploads\/sites\/3\/2022\/12\/mitre.png\" alt=\"\" width=\"867\" height=\"231\" \/><\/p>\n<p style=\"text-align: center\"><strong>Table 1 &#8211; Mitre Table<\/strong><\/p>\n<h1>Assessment<\/h1>\n<p>The danger of this threat lies in the attacker&#8217;s control over the victim&#8217;s browser, through which they could manipulate or impersonate all kinds of websites to steal confidential information or corporate access that can put organizations at risk.<\/p>\n<p>At SCILabs, we have observed a growing trend of using malicious extensions as an access vector to carry out MitB attacks, as is the case of <em>BlackDog<\/em>, which uses JavaScript files to install extensions found outside of the official Google Chrome store or the recent <em>BlackStink<\/em> campaign that uses the Chrome Browser Cloud Management panel. This campaign uses the official Chrome store to distribute the malicious extensions.<\/p>\n<p>Because of this, organizations that do not have control and restrictions on the extensions or add-ons that are installed in EndPoint browsers are the ideal victims of these threats.<\/p>\n<p>Adversaries will continue campaigning to distribute malicious extensions or plug-ins for the remainder of the year and into the coming year due to the ease with which they can infect browsers with few security measures and no restrictions based on organizational policies.<\/p>\n<p>Based on our research, we make the following recommendations:<\/p>\n<ul>\n<li>Have strict policies regarding using and installing plug-ins or extensions in the organization&#8217;s web browsers.<\/li>\n<li>Conduct a threat hunt for malicious plug-ins or extensions in your organization&#8217;s browsers.<\/li>\n<li>Carry out awareness campaigns on properly using Internet access tools and disseminating social engineering techniques cybercriminals use to distribute the most recent malware campaigns.<\/li>\n<li>Look for Chrome browser shortcuts that use the &#8211;load-extension parameter to execute malicious code or extensions.<\/li>\n<li>Check the legitimacy of the extensions, even if they are in the official stores of the browsers.<\/li>\n<li>Add the indicators of compromise reflected in this research to your security solutions.<\/li>\n<\/ul>\n<h1 style=\"text-align: justify;line-height: 115%\">IOCs<\/h1>\n<p>65D45D3480703E5735FDC0BEAEA48120861DA5584CFA8625201AAA0868FE2C57<\/p>\n<p>BB54924E316AC062A8EE3E09215C7A060F6F6D2C0C6B31B7C12A58A7CB1C4ECD<\/p>\n<p>915091B1217F186A866A7E7FFABDA4F0ECB95908B511046362D3CE7F603397A3<\/p>\n<p>HXXPS[:]\/\/PORTALDECONEXIONSEGURA[.]COM\/PORTAL-SAT-ENLINEA-EXTENSION-DESEGURIDAD\/<\/p>\n<p>HXXP[:]\/\/5J7N[.]SHORT[.]GY\/<\/p>\n<p>HXXPS[:]\/\/CHROME[.]GOOGLE[.]COM\/WEBSTORE\/DETAIL\/%D1%95%D0%B0%D1%82-EXTENSION\/ILLMODHICFMDDHENOJNJKALLODNNFCFH?HL=ES&amp;AUTHUSER=0<\/p>\n<p>HXXP[:]\/\/SATEXTENSION[.]INFO\/<\/p>\n<p>HXXPS[:]\/\/CITIBANAMEX-COM-MX.TROPHY65.DIGITAL\/MXGCB\/JPS\/PORTAL\/LOCALESWITCH.DO.PHP<\/p>\n<p>HXXPS[:]\/\/CITIBANAMEX-COM-MX.TROPHY65.DIGITAL\/MXGCB\/CBOL\/CAM\/CARDREI\/FLOW.ACTION<\/p>\n<p>HXXPS[:]\/\/CITIBANAMEX-COM-MX.TROPHY65.DIGITAL\/DASHBOARDNEW.PHP<\/p>\n<p>HXXPS[:]\/\/CITIBANAMEX-COM-MX.TROPHY65.DIGITAL\/ASSETSAPPS\/PINGBACK.PHP<\/p>\n<p>HXXPS[:]\/\/CITIBANAMEX-COM-MX[.]28COLORADO[.]FUN<\/p>\n<p>HXXPS[:]\/\/CITIBANAMEX-COM-MX.TROPHY65.DIGITAL\/<\/p>\n<p>HXXPS:\/\/CITIBANAMEX-COM-MX[.]VOLANTE2[.]WORKS\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview This post aims to describe the TTPs and provide IoCs of a new malware campaign that SCILabs called BlackBelen.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-358","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.scilabs.mx\/en\/wp-json\/wp\/v2\/posts\/358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.scilabs.mx\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.scilabs.mx\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.scilabs.mx\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.scilabs.mx\/en\/wp-json\/wp\/v2\/comments?post=358"}],"version-history":[{"count":0,"href":"https:\/\/blog.scilabs.mx\/en\/wp-json\/wp\/v2\/posts\/358\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.scilabs.mx\/en\/wp-json\/wp\/v2\/media?parent=358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.scilabs.mx\/en\/wp-json\/wp\/v2\/categories?post=358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.scilabs.mx\/en\/wp-json\/wp\/v2\/tags?post=358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}