Trojan.PS1.POWTRAN.A

 Analysis by: Joshua John Bantayan

 ALIASES:

PowerShell/Agent.MA trojan (NOD32)

 PLATFORM:

Windows

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

  • Threat Type: Trojan

  • Destructiveness: No

  • Encrypted: Yes

  • In the wild: Yes

  OVERVIEW


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:

9,134,997 bytes

File Type:

PS1

Memory Resident:

Yes

Initial Samples Received Date:

20 Feb 2020

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:

  • %System%\WindowsPowerShell\v1.0\WinRing0x64.sys ->Allows XMRig to boost mining capability
  • %System%\mue.exe -> Detected as Coinminer.Win64.MALXMR.TDI

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

It adds the following processes:

  • powercfg /CHANGE -standby-timeout-ac 0
  • powercfg /CHANGE -hibernate-timeout-ac 0
  • powercfg -SetAcValueIndex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 000
  • powershell -NoP -NonI -W Hidden -exec bypass `"`$fun={base-64 encoded script};`$defun=[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(`$fun));iex `$defun;iex ([System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String('$EncodedScript'))) - For Windows 10
  • powershell -NoP -NonI -W Hidden -exec bypass -E {base-64 encoded script} - For Windows 7
  • netstat -anop tcp
  • %System%\schtasks.exe

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

It injects codes into the following process(es):

  • %System%\schtasks.exe

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

Other System Modifications

This Trojan deletes the following files:

  • %Temp%\gpt.ps1

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

Process Termination

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

  • Processes that have an ESTABLISHED network connection via port 3333, 5555, 7777
  • Processes that have an ESTABLISHED network connection via port 49636, 14444, 14433, 80, 443

Download Routine

This Trojan accesses the following websites to download files:

  • http://{BLOCKED}.net/bannerl
  • http://{BLOCKED}.net/sync
  • https://raw.{BLOCKED}.com/{BLOCKED}up/master/domtar

Other Details

This Trojan does the following:

  • It may connect to the following mining pool:
    • xmr-{BLOCKED}.org:14444
    • xmr-asia1.{BLOCKED}.org:14444
    • xmr-us-west1.{BLOCKED}.org:14444
    • xmr-us-east1.{BLOCKED}.org:14444
    • xmr-eu2.{BLOCKED}.org:14444
    • mine.{BLOCKED}.net:80
    • pool.{BLOCKED}.com:80
  • It is capable of propagating in the local network via the following means:
    • Mimikatz

It uses Windows Management Instrumentation (WMI) to do the following:

  • WMI Event Subscription:
      For Windows 10:
      • It creates the following WMI Classes under ROOT\subscription to achieve persistence in the system:
        • __FilterToConsumerBinding
          • Filter: SCM Event6 Log Filter
          • Consumer: SCM Event6 Log Consumer
        • __EventFilter
          • Name: SCM Event6 Log Filter
          • QueryLanguage: WQL
          • Query: SELECT * FROM __InstanceModificationEvent WITHIN 13600 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System'
        • __CommandLineEventConsumer:
          • Name: SCM Event6 Log Consumer
          • CommandLineTemplate: powershell -NoP -NonI -W Hidden -exec bypass `"`$fun={base64 encoded command};`$defun=[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(`$fun));iex `$defun;`$mon = ([WmiClass] 'root\default:systemcore_Updater6').Properties['mon'].Value;`$funs = ([WmiClass] 'root\default:systemcore_Updater6').Properties['funs'].Value ;iex ([System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(`$funs)));Invoke-Command -ScriptBlock `$RemoteScriptBlock -ArgumentList @(`$mon, `$mon, 'Void', 0, '', '')`"

        • __FilterToConsumerBinding
          • Filter: SCM Event6 Log Filter2
          • Consumer: SCM Event6 Log Consumer2
        • __EventFilter
          • Name: SCM Event6 Log Filter2
          • QueryLanguage: WQL
          • Query: SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System' AND TargetInstance.SystemUpTime >= 240 AND TargetInstance.SystemUpTime < 301
        • __CommandLineEventConsumer:
          • Name: SCM Event6 Log Consumer2
          • CommandLineTemplate: : powershell -NoP -NonI -W Hidden -exec bypass `"`$fun='{base64 encoded command}';`$defun=[System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(`$fun));iex `$defun;`$mon = ([WmiClass] 'root\default:systemcore_Updater6').Properties['mon'].Value;`$funs = ([WmiClass] 'root\default:systemcore_Updater6').Properties['funs'].Value ;iex ([System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String(`$funs)));Invoke-Command -ScriptBlock `$RemoteScriptBlock -ArgumentList @(`$mon, `$mon, 'Void', 0, '', '')`"
      For Windows 7:
      • It creates the following WMI Classes under ROOT\subscription to achieve persistence in the system:
        • __FilterToConsumerBinding
          • Filter: SCM Event6 Log Filter
          • Consumer: SCM Event6 Log Consumer
        • __EventFilter
          • Name: SCM Event6 Log Filter
          • QueryLanguage: WQL
          • Query: SELECT * FROM __InstanceModificationEvent WITHIN 13600 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System'
        • __CommandLineEventConsumer:
          • Name: SCM Event6 Log Consumer
          • CommandLineTemplate: powershell -NoP -NonI -W Hidden -exec bypass -E {base-64 encoded script}"

        • __FilterToConsumerBinding
          • Filter: SCM Event6 Log Filter2
          • Consumer: SCM Event6 Log Consumer2
        • __EventFilter
          • Name: SCM Event6 Log Filter2
          • QueryLanguage: WQL
          • Query: SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System' AND TargetInstance.SystemUpTime >= 240 AND TargetInstance.SystemUpTime < 301"
        • __CommandLineEventConsumer:
          • Name: SCM Event6 Log Consumer2
          • CommandLineTemplate: powershell -NoP -NonI -W Hidden -exec bypass -E {base-64 encoded script}
  • It creates the following WMI Class under ROOT\default:
    • systemcore_Updater6
      • WMI objects:
        • mon - base-64 encoded Monero Executable
        • mons – base-64 encoded Monero Executable
        • ring – base-64 encoded Monero module
        • funs -{base64-encoded script}

  •   SOLUTION

    Minimum Scan Engine:

    9.850

    FIRST VSAPI PATTERN FILE:

    15.706.05

    FIRST VSAPI PATTERN DATE:

    25 Feb 2020

    VSAPI OPR PATTERN File:

    15.707.00

    VSAPI OPR PATTERN Date:

    26 Feb 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

    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.  
    • %System%\WindowsPowerShell\v1.0\WinRing0x64.sys
    • %System%\mue.exe

    Step 5

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

    NOTES:
    Do this after step 3:

    Cleaning WMI Objects


    1. Run the command prompt (cmd.exe) as administrator.
    2. Remove the WMI objects mentioned above found in root\default namespace by typing the following commands:
    3. powershell.exe -noprofile -executionpolicy bypass -command "if(Get-WMIObject -namespace root\default -query \"SELECT * FROM meta_class WHERE __class ='systemcore_Updater6'\"|Select-Object -Property Properties -ExpandProperty properties|Where{$_.Name -match \"funs\" -or $_.Name -match \"mons\"}){Get-WMIObject -namespace root\default -query \"SELECT * FROM meta_class WHERE __class ='systemcore_Updater6'\"|Remove-WMIObject -Verbose}"
    4. Remove the WMI objects mentioned above found in root\Subscription namespace by typing and executing the following commands:
      • powershell.exe -noprofile -executionpolicy bypass -command "Get-WMIObject -Namespace root\Subscription -Class __FilterToConsumerBinding -Filter \""__Path LIKE '%SCM Event6 Log Filter%'\"" | remove-WMIObject -Verbose"
      • powershell.exe -noprofile -executionpolicy bypass -command "Get-WMIObject -Namespace root\Subscription -Class __EventFilter -Filter \""Name= 'SCM Event6 Log Filter'\"" |remove-WMIObject -Verbose"
      • powershell.exe -noprofile -executionpolicy bypass -command "Get-WMIObject -Namespace root\Subscription -Class __EventFilter -Filter \""Name= 'SCM Event6 Log Filter2'\"" |remove-WMIObject -Verbose"
      • powershell.exe -noprofile -executionpolicy bypass -command "Get-WMIObject -Namespace root\Subscription -Class CommandLineEventConsumer -Filter \""CommandLineTemplate LIKE '%powershell -NoP -NonI -W Hidden -exec bypass -E %'\"" | Remove-WMIObject -Verbose"


    Did this description help? Tell us how we did.