Analysis by: Rheniel Rhay Ramos

ALIASES:

Trojan.JS.Agent.dzu (Kaspersky); JS.Retefe (Symantec)

 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: Dropped by other malware

This Trojan may be dropped by other malware.

It takes advantage of certain vulnerabilities.

  TECHNICAL DETAILS

File Size: 533,966 bytes
File Type: JS
Memory Resident: No
Initial Samples Received Date: 23 Sep 2017
Payload: Connects to URLs/IPs, Drops files, Terminates processes

Arrival Details

This Trojan may be dropped by the following malware:

Installation

This Trojan drops the following files:

  • %User Temp%\{8 random characters}.ps1 -> 4 different files,
  • %User Temp%\{6 random characters}.zip -> TOR Browser files
  • %User Temp%\{Computer Name}.log -> contains logs of the malware's installation and information of the infected system

(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.)

It drops and executes the following files:

  • %User Temp%\7za.exe -> 7zip(Normal File)

(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.)

It adds the following processes:

  • powershell.exe -ep Unrestricted -f "%User Temp%\{8 random characters}.ps1" -> used to run other processes

(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.)

Other System Modifications

This Trojan modifies the following registry entries:

HKCU\Software\Microsoft\
Windows\CurrentVersion\Internet Settings
AutoConfigURL = "http://127.0.0.1:5555/{8 random characters}.js?ip={Victim's IP Address}"
4 instances

Process Termination

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

  • iexplore.exe
  • firefox.exe
  • chrome.exe

Other Details

This Trojan connects to the following URL(s) to get the affected system's IP address:

  • http://api.ipify.org/
  • http://icanhazip.com/

It does the following:

  • It downloads TOR Browser and 7zip
  • It uses the following domains for the TOR Browser
    • {BLOCKED}3sciyy5jd2.onion
    • {BLOCKED}4byx66pus7.onion
    • {BLOCKED}t4niyqgf7g.onion
    • {BLOCKED}mdsawhd2jf.onion
  • It installs fake certificates for Internet Explorer and Firefox
  • It modifies the file "%Application Data%\Mozilla\Firefox\Profiles\prefs.js" and adds the following lines:
    • "user_pref(\"network.dns.blockDotOnion\", false);"
    • "user_pref(\"security.enterprise_roots.enabled\", true);"
  • It uses the Eternal Blue Exploit to upload logs containing the victim's details to the following ftp server:
    • ftp://{BLOCKED}itner:hausleitner045923@{BLOCKED}.{BLOCKED}.85.236/in/logs

It takes advantage of the following vulnerabilities:

  • EternalBlue

  SOLUTION

Minimum Scan Engine: 9.850
FIRST VSAPI PATTERN FILE: 13.686.03
FIRST VSAPI PATTERN DATE: 28 Sep 2017
VSAPI OPR PATTERN File: 13.687.00
VSAPI OPR PATTERN Date: 29 Sep 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

Delete this registry key

[ 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\Internet Settings
    • AutoConfigURL

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.  
  • %User Temp%\{8 random characters}.ps1
  • %User Temp%\{Computer Name}.log

Step 5

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