Analysis by: Pearl Charlaine Espejo

ALIASES:

Ransom:Win32/Locky.A (Microsoft); Win32:Locky-Q [Trj] (Avast); Ransom.Locky (Malwarebytes); Trojan-Ransom.Win32.Locky.fn (Kaspersky)

 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 arrives on a system as a file dropped by other malware or as a file downloaded unknowingly by users when visiting malicious sites.

It does not have any propagation routine.

It does not have any backdoor routine.

It modifies the Internet Explorer Zone Settings.

It connects to certain websites to send and receive information. It gathers information and reports it to its servers.

  TECHNICAL DETAILS

File Size: 210,432 bytes
File Type: EXE
Memory Resident: No
Initial Samples Received Date: 15 Mar 2016
Payload: Drops files, Encrypts files, Connects to URLs/IPs, Steals information

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 component file(s):

  • %Desktop%\_Locky_recover_instructions.txt - ransom note
  • %Desktop%\_Locky_recover_instructions.bmp - image used as wallpaper
  • {Folders containing encrypted files}\_Locky_recover_instructions.txt - ransom note

(Note: %Desktop% is the desktop folder, where it usually is C:\Documents and Settings\{user name}\Desktop in Windows 2000, Windows Server 2003, and Windows XP (32- and 64-bit); C:\Users\{user name}\Desktop in 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 file(s):

  • It renames the encrypted files to {unique ID per victim}{identifier}.locky

It adds the following registry keys:

HKEY_CURRENT_USER\Software\Locky

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

HKEY_CURRENT_USER\Control Panel\Desktop
Wallpaper = "%Desktop%\_Locky_recover_instructions.bmp"

HKEY_CURRENT_USER\Software\Locky
id = "{unique ID per victim}"

HKEY_CURRENT_USER\Software\Locky
pubkey = "{publick key}"

HKEY_CURRENT_USER\Software\Locky
paytext = "{ransom note}"

HKEY_CURRENT_USER\Software\Locky
completed = "1"

Propagation

This Trojan does not have any propagation routine.

Backdoor Routine

This Trojan does not have any backdoor routine.

Web Browser Home Page and Search Page Modification

This Trojan modifies the Internet Explorer Zone Settings.

Other Details

This Trojan connects to the following website to send and receive information:

  • hxxp://{BLOCKED}.{BLOCKED}.107.8/main.php
  • hxxp://{BLOCKED}.{BLOCKED}.181.122/main.php
  • hxxp://{BLOCKED}.{BLOCKED}.231.116/main.php
  • hxxp://{BLOCKED}.{BLOCKED}.108.39/main.php
  • hxxp://{BLOCKED}.{BLOCKED}.107.10/main.php
  • hxxp://{pseudo-random domain}/main.php

It encrypts files with the following extensions:

  • .ARC
  • .CSV
  • .DOC
  • .DOT
  • .MYD
  • .MYI
  • .NEF
  • .PAQ
  • .PPT
  • .RTF
  • .SQLITE3
  • .SQLITEDB
  • .XLS
  • .aes
  • .asc
  • .asf
  • .asm
  • .asp
  • .avi
  • .bak
  • .bat
  • .bmp
  • .brd
  • .cgm
  • .class
  • .cmd
  • .cpp
  • .crt
  • .csr
  • .dbf
  • .dch
  • .dif
  • .dip
  • .djv
  • .djvu
  • .docb
  • .docm
  • .docx
  • .dotm
  • .dotx
  • .fla
  • .flv
  • .frm
  • .gif
  • .gpg
  • .hwp
  • .ibd
  • .jar
  • .java
  • .jpeg
  • .jpg
  • .key
  • .lay
  • .lay6
  • .ldf
  • .max
  • .mdb
  • .mdf
  • .mid
  • .mkv
  • .mml
  • .mov
  • .mpeg
  • .mpg
  • .ms11 (Security copy)
  • .odb
  • .odg
  • .odp
  • .ods
  • .odt
  • .onetoc2
  • .otg
  • .otp
  • .ots
  • .ott
  • .pas
  • .pdf
  • .pem
  • .php
  • .png
  • .pot
  • .potm
  • .potx
  • .ppam
  • .pps
  • .ppsm
  • .ppsx
  • .pptm
  • .pptx
  • .psd
  • .pst
  • .qcow2
  • .rar
  • .raw
  • .sch
  • .sldm
  • .sldx
  • .slk
  • .sql
  • .stc
  • .std
  • .sti
  • .stw
  • .svg
  • .swf
  • .sxc
  • .sxd
  • .sxi
  • .sxm
  • .sxw
  • .tar
  • .tar.bz2
  • .tbk
  • .tgz
  • .tif
  • .tiff
  • .txt
  • .uop
  • .uot
  • .vbs
  • .vdi
  • .vmdk
  • .vmx
  • .vob
  • .wav
  • .wks
  • .wma
  • .wmv
  • .xlc
  • .xlm
  • .xlsb
  • .xlsm
  • .xlsx
  • .xlt
  • .xltm
  • .xltx
  • .xlw
  • .xml
  • .zip
  • wallet.dat

It does the following:

  • It prevents to encrypt files containing any of the strings in its full pathname:
    • tmp
    • winnt
    • Application Data
    • AppData
    • Program Files (x86)
    • Program Files
    • temp
    • thumbs.db
    • $Recycle.Bin
    • System Volume Information
    • Boot
    • Windows
  • It encrypts files on all fixed drives, removable drives and RAM disk drives.
  • It executes the following command to delete shadow copies:

    vssadmin.exe Delete Shadows /All /Quiet

  • It sends information to its C&C using the following parameters:
    • id - generated victim ID
    • act - has 3 control commands

      where the control commands can be any of the following:

      • stats - Statistics of encryption and paths of encrypted files
      • getkey - Request RSA public key from C&C
      • gettext - Request ransomware text in specific language


It gathers the following information and reports it to its servers:

  • Operating System version
  • 32 or 64 bit version
  • Service Pack
  • System Language

  SOLUTION

Minimum Scan Engine: 9.800
FIRST VSAPI PATTERN FILE: 12.402.08
FIRST VSAPI PATTERN DATE: 14 Mar 2016
VSAPI OPR PATTERN File: 12.403.00
VSAPI OPR PATTERN Date: 15 Mar 2016

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\Control Panel\Desktop
    • Wallpaper = "%Desktop%\_Locky_recover_instructions.bmp"

Step 5

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

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.
  • %Desktop%\_Locky_recover_instructions.txt
  • %Desktop%\_Locky_recover_instructions.bmp
  • {Folders containing encrypted files}\_Locky_recover_instructions.txt

Step 7

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

Restore encrypted files from backup.


Did this description help? Tell us how we did.