TrojanSpy.Win32.BEAHNY.THCACAI

 Analysis by: Earle Maui Earnshaw

 ALIASES:

Trojan:Win32/Beahny (Microsoft); BScope.Trojan.Azden (VBA32)

 PLATFORM:

Windows

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

  • Threat Type: Trojan Spy

  • Destructiveness: No

  • Encrypted: No

  • In the wild: Yes

  OVERVIEW

Infection Channel:

Downloaded from the Internet, Dropped by other malware


This Trojan Spy arrives on a system as a file dropped by other malware or as a file downloaded unknowingly by users when visiting malicious sites.

It connects to a website to send and receive information.

  TECHNICAL DETAILS

File Size:

139,448 bytes

File Type:

EXE

Memory Resident:

Yes

Initial Samples Received Date:

15 Mar 2019

Payload:

Connects to URLs/IPs, Steals information, Drops files

Arrival Details

This Trojan Spy 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 Spy drops the following files:

  • %Start Menu%\{8 random characters}.exe -> Modified Copy of File
  • %Windows%\{8 random characters}.exe ->Modified Copy of File
  • %Application Data%\{8 random characters}.exe ->Modified Copy of File
  • %User Temp%\{7 random numerical characters}.bat -> 3 files will be created for dropping of malware file in %Windows%, %Application Data% and %Start Menu% directories.

(Note: %Start Menu% is the current user's Start Menu folder, which is usually C:\Windows\Start Menu or C:\Documents and Settings\{User name}\Start Menu on Windows 2000, XP, and Server 2003, or C:\Users\{user name}\AppData\Roaming\Microsoft\Windows\Start Menu on Windows Vista, 7, and 8.. %Windows% is the Windows folder, where it usually is C:\Windows on all Windows operating system versions.. %Application Data% is the current user's Application Data folder, which is usually C:\Documents and Settings\{user name}\Application Data on Windows 2000, XP, and Server 2003, or C:\Users\{user name}\AppData\Roaming on Windows Vista, 7, and 8.. %User Temp% is the current user's Temp folder, which is usually C:\Documents and Settings\{user name}\Local Settings\Temp on Windows 2000, XP, and Server 2003, or C:\Users\{user name}\AppData\Local\Temp on Windows Vista, 7, and 8.)

It adds the following processes:

  • /c "%User Temp%\{7 random numerical characters}.bat" -> Copies the malware file into %Windows%, %Application Data%, %Start Menu%, then deletes "%User Temp%\{7 random numerical characters}.bat" after execution
  • cmd /c start /b sc start Schedule&ping localhost&sc query Schedule|findstr RUNNING&&(schtasks /delete /TN {10 random characters} /f&schtasks /create /ru system /sc MINUTE /mo 50 /ST 07:00:00 /TN {10 random characters} /tr "cmd.exe /c %Windows%\{8 random characters}.exe"&schtasks /run /TN {10 random characters}) -> process that checks for the scheduled task, ping's local host and creates scheduled task
  • schtasks /create /ru system /sc MINUTE /mo 50 /ST 07:00:00 /TN {10 random characters} /tr "cmd.exe /c %Windows%\{8 random characters}.exe" -> creates scheduled task
  • %Application Data%\{8 Random Characters}.exe
  • wmic csproduct get UUID -> to get the machine's GUID
  • wmic nic where netconnectionid!=NULL get macaddress -> to get the machine's MAC Address
  • Wmic Path Win32_VideoController Get Description -> to get the Graphics Memory information

(Note: %Start Menu% is the current user's Start Menu folder, which is usually C:\Windows\Start Menu or C:\Documents and Settings\{User name}\Start Menu on Windows 2000, XP, and Server 2003, or C:\Users\{user name}\AppData\Roaming\Microsoft\Windows\Start Menu on Windows Vista, 7, and 8.)

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

  • AH0a4hnqzh3gQp

Backdoor Routine

This Trojan Spy connects to the following websites to send and receive information:

  • http://{BLOCKED}i.{BLOCKED}g.com/t.php?ID={Computer Name}&GUID={GUID}&MAC={MAC ADDRESS}&OS={OS Version&BIT={32/64}&CARD={VIDEO CARD INFORMATION}&_T={TIME}
  • http://{BLOCKED}p.{BLOCKED}y.com/t.php?ID={Computer Name}&GUID={GUID}&MAC={MAC ADDRESS}&OS={OS Version&BIT={32/64}&CARD={VIDEO CARD INFORMATION}&_T={TIME}
  • http://{BLOCKED}o.{BLOCKED}h.com/t.php?ID={Computer Name}&GUID={GUID}&MAC={MAC ADDRESS}&OS={OS Version&BIT={32/64}&CARD={VIDEO CARD INFORMATION}&_T={TIME}

Information Theft

This Trojan Spy gathers the following data:

  • Computer Name
  • Machine's GUID
  • MAC Address
  • OS Version
  • Graphics Memory Information
  • System Time

Other Details

This Trojan Spy does the following:

  • The dropped file is a copy of itself that has been modified by appends junk code for anti-sandbox.

It adds the following scheduled tasks:

  • Task Name: {10 Random Characters}
    Action: executes %Windows%\{8 random characters}.exe

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

  SOLUTION

Minimum Scan Engine:

9.850

FIRST VSAPI PATTERN FILE:

14.886.02

FIRST VSAPI PATTERN DATE:

21 Mar 2019

VSAPI OPR PATTERN File:

14.887.00

VSAPI OPR PATTERN Date:

22 Mar 2019

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

Identify and terminate files detected as TrojanSpy.Win32.BEAHNY.THCACAI

[ Learn More ]
  1. Windows Task Manager may not display all running processes. In this case, please use a third-party process viewer, preferably Process Explorer, to terminate the malware/grayware/spyware file. You may download the said tool here.
  2. If the detected file is displayed in either Windows Task Manager or Process Explorer but you cannot delete it, restart your computer in safe mode. To do this, refer to this link for the complete steps.
  3. If the detected file is not displayed in either Windows Task Manager or Process Explorer, continue doing the next steps.

Step 4

Deleting Scheduled Tasks

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

  • schtasks  /create /ru system /sc MINUTE /mo 50 /ST 07:00:00 /TN PE9lHrkumd /tr "cmd.exe /c %Windows%\{8 random characters}.exe"

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

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.  
  • %Start Menu%\{8 random characters}.exe
  • %Windows%\{8 random characters}.exe
  • %Application Data%\{8 random characters}.exe

Step 6

Scan your computer with your Trend Micro product to delete files detected as TrojanSpy.Win32.BEAHNY.THCACAI. 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 the following Trend Micro Support pages for more information:


Did this description help? Tell us how we did.