Analysis by: Byron Jon Gelera

ALIASES:

Worm:Win32/Gamarue!rfn (Microsoft)

 THREAT SUBTYPE:

Fileless

 PLATFORM:

Windows

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

  • Threat Type: Backdoor

  • Destructiveness: No

  • Encrypted: Yes

  • In the wild: Yes

  OVERVIEW

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

This malware is the filelessly-installed backdoor malware discovered on early August 2017. Users whose systems are affected by this particular malware may find the security of their systems compromised.

This Backdoor may be downloaded by other malware/grayware from remote sites.

It deletes registry entries, causing some applications and programs to not function properly.

It does not have any propagation routine.

It executes commands from a remote malicious user, effectively compromising the affected system. It connects to a website to send and receive information.

  TECHNICAL DETAILS

File Size: 257,024 bytes
File Type: DLL
Memory Resident: Yes
Initial Samples Received Date: 20 Jul 2017
Payload: Connects to URLs/IPs, Terminates processes, Collects system information

Arrival Details

This Backdoor may be downloaded by the following malware/grayware from remote sites:

It may be downloaded from the following remote sites:

  • https://{BLOCKED}ndo.ru/favicon

Installation

This Backdoor adds the following processes:

  • WerFault.exe (Windows Vista and above) / ctfmon.exe (Windows XP and below)
  • msiexec.exe

It adds the following mutexes to ensure that only one of its copies runs at any one time:

  • Global\Mutex_4e1c16d7187ac191a832a41f7192645425dad5c792b76ed1dd7071926289ac66

It injects codes into the following process(es):

  • created WerFault.exe/ctfmon.exe
  • created msiexec.exe

Autostart Technique

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

HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Run
{UID} = "%System%\WindowsPowerShell\v1.0\powershell.exe -WindowStyle hidden -NoLogo -NonInteractive -ep bypass -nop iex ([Text.Encoding]::ASCII.GetString([Convert]::FromBase64String((gp 'HKCU:\Software\Classes\{random character}').{random character})));"

Other System Modifications

This Backdoor adds the following registry entries:

HKEY_CURRENT_USER\Software\Classes\
{random characters}
{random characters} = {base 64 encoded powershell command}

HKEY_CURRENT_USER\Software\Classes\
{random characters}
{UID} = {encrypted binary data}

HKEY_CURRENT_USER\Console\%SystemRoot%\
_system32_WIndowsPowerShell_v1.0_powershell.exe
WindowPosition = 4294905760

HKEY_CURRENT_USER\Console\%SystemRoot%\
_system32_WIndowsPowerShell_v1.0_powershell.exe
ScreenBufferSize = 65616

HKEY_CURRENT_USER\Console\%SystemRoot%\
_system32_WIndowsPowerShell_v1.0_powershell.exe
WindowSize = 65616

It deletes the following registry entries:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
Windows NT\CurrentVersion\Image File Execution Options\
taskmgr.exe
Debugger = "taskmgr.exe"

HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Run
{UID} = {where the data has the following strings}:

  • "powershell"
  • "-windowstyle hidden"
  • "[Text.Encoding]::ASCII.GetString([Convert]::FromBase64String"

HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Run
COM+ = {current value}

Propagation

This Backdoor does not have any propagation routine.

Backdoor Routine

This Backdoor executes the following commands from a remote malicious user:

  • Start a Process
  • Download a file directed by C&C server, save it as %User Temp%\KB{8 random numbers}.exe and execute it
  • Copy %System%\cdosys.dll to %User Temp%\cdo{random number}.dll and load it
  • Uninstall itself

(Note: %User Temp% is the user's temporary folder, where it usually is C:\Documents and Settings\{user name}\Local Settings\Temp on Windows 2000, Windows Server 2003, and Windows XP (32- and 64-bit); C:\Users\{user name}\AppData\Local\Temp on Windows Vista (32- and 64-bit), Windows 7 (32- and 64-bit), Windows 8 (32- and 64-bit), Windows 8.1 (32- and 64-bit), Windows Server 2008, and Windows Server 2012.. %System% is the Windows system folder, where it usually is C:\Windows\System32 on all Windows operating system versions.)

It connects to the following websites to send and receive information:

  • http://{Random Generated Domain}/nonc.so
  • http://{BLOCKED}an.ru/q.php
  • http://{BLOCKED}ano.ru/q.php

Process Termination

This Backdoor terminates the following processes if found running in the affected system's memory:

  • powershell.exe

Information Theft

This Backdoor gathers the following data:

  • Root Volume Serial Number
  • Operating System Version
  • Local IP Address
  • Administrator privileges

Other Details

This Backdoor connects to the following URL(s) to check for an Internet connection:

  • microsoft.com

It does the following:

  • It uses the following powershell command to decrypt and execute the base64 encoded powershell command in the registry:
    "%System%\WindowsPowerShell\v1.0\powershell.exe -WindowStyle hidden -NoLogo -NonInteractive -ep bypass -nop iex ([Text.Encoding]::ASCII.GetString([Convert]::FromBase64String((gp 'HKCU:\Software\Classes\{random characters}').{random character})));"
  • It checks for the following requirements to proceed with its routine:
    • No existing "Global\Mutex_4e1c16d7187ac191a832a41f7192645425dad5c792b76ed1dd7071926289ac66" mutex
    • No existing "C:\Python27" folder
    • Presence of "%System%\WindowsPowerShell\v1.0\powershell.exe"
  • It connects to the following Network Time Protocol (NTP) servers:
    • africa.pool.ntp.org
    • oceania.pool.ntp.org
    • asia.pool.ntp.org
    • south-america.pool.ntp.org
    • north-america.pool.ntp.org
    • europe.pool.ntp.org

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

  SOLUTION

Minimum Scan Engine: 9.850
FIRST VSAPI PATTERN FILE: 13.546.04
FIRST VSAPI PATTERN DATE: 21 Jul 2017
VSAPI OPR PATTERN File: 13.547.00
VSAPI OPR PATTERN Date: 22 Jul 2017

Step 1

Before doing any scans, Windows XP, Windows Vista, and Windows 7 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

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
    • {UID} = "%System%\WindowsPowerShell\v1.0\powershell.exe -WindowStyle hidden -NoLogo -NonInteractive -ep bypass -nop iex ([Text.Encoding]::ASCII.GetString([Convert]::FromBase64String((gp 'HKCU:\Software\Classes\{random character}').{random character})));"
  • In HKEY_CURRENT_USER\Software\Classes\{random characters}
    • {random characters} = {base 64 encoded powershell command}
  • In HKEY_CURRENT_USER\Software\Classes\{random characters}
    • {UID} = {encrypted binary data}
  • In HKEY_CURRENT_USER\Console\%SystemRoot%\_system32_WIndowsPowerShell_v1.0_powershell.exe
    • WindowPosition = 4294905760
  • In HKEY_CURRENT_USER\Console\%SystemRoot%\_system32_WIndowsPowerShell_v1.0_powershell.exe
    • ScreenBufferSize = 65616
  • In HKEY_CURRENT_USER\Console\%SystemRoot%\_system32_WIndowsPowerShell_v1.0_powershell.exe
    • WindowSize = 65616

Step 5

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

Step 6

Scan your computer with your Trend Micro product to delete files detected as BKDR_ANDROM.ETIN. 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.

Related Malware