Analysis by: Warren Adam Sto. Tomas

ALIASES:

Win64/Bazar.W trojan(Nod32)

 PLATFORM:

Windows

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

  • Threat Type: Trojan

  • Destructiveness: No

  • Encrypted: Yes

  • 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.

However, as of this writing, the said sites are inaccessible.

  TECHNICAL DETAILS

File Size: 540,848 bytes
File Type: EXE
Memory Resident: Yes
Initial Samples Received Date: 23 Sep 2020
Payload: Connects to URLs/IPs, Downloads files, Deletes files, Terminates processes

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 adds the following mutexes to ensure that only one of its copies runs at any one time:

  • ld_201127
  • ms213716

Autostart Technique

This Trojan modifies the following registry entries to ensure it automatic execution at every system startup:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
Windows NT\CurrentVersion\Winlogon
Userinit = %System%\userinit.exe,{malware path}\{malware file}

(Note: The default value data of the said registry entry is %System%\userinit.exe.)

Other System Modifications

This Trojan deletes the following files:

  • {malware path}\{malware file name}_fgqw

Download Routine

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

  • https://{BLOCKED}.{BLOCKED}.129.173:443/api/v202
  • https://{BLOCKED}.{BLOCKED}.249.143:443/api/v202
  • https://{BLOCKED}.{BLOCKED}.241.241:443/api/v202
  • https://{BLOCKED}.{BLOCKED}.210.156:443/api/v202
  • https://{BLOCKED}.{BLOCKED}.194.38:443/api/v202
  • https://{BLOCKED}.{BLOCKED}.197.172:443/api/v202

Other Details

This Trojan does the following:

  • It checks for the system's computer layout and terminates itself if it is Russian
  • It injects the downloaded file in any of the following processes running in the affected system:
    • cmd
    • explorer
    • svchost
  • It checks and terminates itself if the following anti-virus is installed in the affected system:
    • Avast
    • Avastsvc
  • It will only create the following autostart or persistence techniques if it has successfully downloaded a file:
    • Scheduled tasks
    • Modified winlogon registry
  • It accepts the following parameters:
    • -p -> upon execution, deletes scheduled tasks with the task name:
      • StartUE
      • StartWQ
    • -b -> Skips creation/deletion of scheduled tasks

However, as of this writing, the said sites are inaccessible.

It adds the following scheduled tasks:

  • Task name: StartUE
    • Trigger: At log on, runs indefinitely
    • Action: {malware path}\{malware file}
  • Task name: StartWQ
    • Trigger: At log on, runs indefinitely
    • Action: {malware path}\{malware file}

It uses Domain Generation Algorithm (DGA) to generate the C&C server that it connects to using the following strings:

  • {12 characters}.bazar

  SOLUTION

Minimum Scan Engine: 9.800
FIRST VSAPI PATTERN FILE: 16.272.05
FIRST VSAPI PATTERN DATE: 07 Oct 2020
VSAPI OPR PATTERN File: 16.273.00
VSAPI OPR PATTERN Date: 08 Oct 2020

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

Restore this modified registry value

[ Learn More ]

Important: Editing the Windows Registry incorrectly can lead to irreversible system malfunction. Please do this step only if you know how or you can ask assistance from your system administrator. Else, check this Microsoft article first before modifying your computer's registry.

  • In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
    • Userinit = "%System%\userinit.exe,{malware path}\{malware file}"

Step 5

Deleting Scheduled Tasks

The following {Task Name} - {Task to be run} listed should be used in the steps identified below:

  • StartUE - {malware path}\{malware file}
  • StartWQ - {malware path}\{malware file}

For Windows 2000, Windows XP, and Windows Server 2003:

  1. Open the Windows Scheduled Tasks. Click Start>Programs>Accessories>
    System Tools>Scheduled Tasks.
  2. Locate each {Task Name} values listed above in the Name column.
  3. Right-click on the said file(s) with the aforementioned value.
  4. Click on Properties. In the Run field, check for the listed {Task to be run}.
  5. If the strings match the list above, delete the task.

For Windows Vista, Windows 7, Windows Server 2008, Windows 8, Windows 8.1, and Windows Server 2012:

  1. Open the Windows Task Scheduler. To do this:
    • On Windows Vista, Windows 7, and Windows Server 2008, click Start, type taskschd.msc in the Search input field, then press Enter.
    • On Windows 8, Windows 8.1, and Windows Server 2012, right-click on the lower left corner of the screen, click Run, type taskschd.msc, then press Enter.
  2. In the left panel, click Task Scheduler Library.
  3. In the upper-middle panel, locate each {Task Name} values listed above in the Name column.
  4. In the lower-middle panel, click the Actions tab. In the Details column, check for the {Task to be run} string.
  5. If the said string is found, delete the task.

Step 6

Restart in normal mode and scan your computer with your Trend Micro product for files detected as Trojan.Win64.BAZAR.YAHFDU. 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.