Posts

Malicious Embedded Office File inside PDF is delivering REMCOS RAT

SonicWall Capture Labs Threat Research team has observed a malicious PDF file, comes as an e-mail attachment, detected by SonicWall RTDMI ™ engine which is delivering REMCOS RAT as the final payload.


Infection Cycle:

The PDF file has a malicious embedded doc file, which is dropped and executed from %temp% folder. PDF file has an OpenAction tag, set to a javascript which is embedded in PDF. On opening the PDF file the script is executed. Embedded DOC file name is “has been verified. However PDF, SVG, xlsx, .docx”.

Java Script inside PDF, which drops and executes DOC file

The DOC file has a reference to an external URL, which is a RTF file. It loads the RTF file from “hxxps://shortener[.]vc/fSpur”, whose final redirected URL is “hxxp://45[.]85[.]190[.]156/receipt/290.doc”. This RTF file has a CVE-2017-11882 exploit, which further downloads an .Net executable at “C:\Users\Public\vbc.exe” and executes it.

External Frame Object Link in webSettings.xml.rels

The .Net executable ‘vbc.exe’ makes a copy of itself in %APPDATA% as ‘doc.exe’, and creates RUN registry entry for it as ‘wix’. And then executes doc.exe.

The .Net executable file has a compressed .Net DLL file in its ‘AppPropsLib.Documents.resources’ resource object named as ‘_22’. It decompresses the resource and loads the obfuscated DLL(internal name of the DLL is Periodicity.dll) in the memory and calls its second export, and passes it three string arguments “5374617469634172726179496E69745479706553697A65”, “7157624F” and “AppPropsLib”. First argument is “StaticArrayInitTypeSize” (passed in hex format) name of another Bitmap object present in the doc.exe resource, second argument is the decryption key “qWbO” (passed in hex format) and third argument is the resource name in doc.exe.

Then Periodicity.dll loads the bitmap resource present in doc.exe and extracts ARGB values for all the pixels in an array. It then gets the encrypted data size from the first pixel ARGB value and copies the encrypted data into another array, then starts decrypting it using the key passed as an argument and the last byte of the encrypted data array.

Loading ARGB value of pixels in an array

Decrypting using the key passed in the argument

The decrypted data is yet another .Net highly obfuscated DLL file whose internal name is Thookinieng.dll. The .Net DLL has encrypted resources, one of which is  REMCOS RAT. Its decrypted data has some interesting string :

Strings Used to check Sandbox or VM

Powershell command to add ExclusionPath for Defender

REMCOS keeps the configuration information in the resource named as settings. The very first byte tells us the RC4 key size, followed by RC4 key which is further followed by the encrypted configuration information:

The version of REMCOS Rat payload is ‘v3.4.0 Pro’ .It reads the key from the resource and decrypts configuration data using RC4 algorithm which contains Command and Control (C&C) server’s IP address, port number, password, REMCOS executable’s name and key logging filename etc.:

 

Malicious PDF hashes:

  • f33170bbdf2c134c5de88cd931f850db16c093a9a26694040f889cea2c485cec
  • 677011006f557a3c25befb217086f099708077c6d27e091e16be15f619fa9547
  • 1f8a033bf8d5ab6d08b618980565c7f633985c154f5b8f6086f48b3d8304f906
  • baa63cbb933cd6b69e18a9db664b95eb03902deb49767d94ab5b23322aeed650
  • 3c29a03355bf0daea04e1c9f14523f71b88d839a3aab4ef52326f5632973d747
  • d762702d22cbd585c26f778dd47cbb6807679f7a5b7e7b8eedb63676db0bcf71

The file is detected by few security vendors on popular threat intelligence sharing portal VirusTotal at the time of writing this blog, this indicates its spreading potential:

Evidence of detection by RTDMI ™ engine can be seen below in the Capture ATP report for this file:

Old Microsoft Office vulnerability CVE-2017-11882 actively being exploited in the wild

Attacks exploiting an one and half year old vulnerability in Microsoft office (CVE-2017-11882), are active in the wild again.

A remote code execution vulnerability exists in Microsoft Office software when the software fails to properly handle objects in memory. An attacker who successfully exploits the vulnerability could run arbitrary code in the context of the current user.

The vulnerability is caused by the Equation Editor, which fails to properly handle OLE objects in memory. This allows the attacker to execute arbitrary code in RTF files without interaction. Microsoft had patched this on 11/14/2017 . Recently Sonicwall Capture Labs threat research team observed a wave of exploits in the wild attacking this vulnerability.

The malicious rtf file has equation object

Microsoft has this warning about equation editor.

In the current wave of attacks, the malicious office document files are attached in the emails. The sender lures the user to open the file. The file has some content but the in background it exploits this vulnerability to download malicious payload on the victims computer.

The spam emails look like this:

 

 

 

 

 

 

 

The file when opened looks like this

The rtf file drops file and contacts the attacker-controlled server.

These types of attacks are a reminder to the importance of keeping systems updated with latest security patches.

SonicWall Capture Labs Threat Research team provides protection against this exploit with the following signatures:

  • SPY 5046 Malformed-File rtf.MP.22
  • GAV MalAgent.J_37354
  • GAV CB_3 (Exploit)
  • GAV H_12144 (Trojan)
  • GAV CB_4 (Exploit)
  • GAV CB_5 (Exploit)
  • GAV CB_6 (Exploit)
  • GAV BX_10 (Exploit)
  • GAV BS_4 (Exploit)
  • GAV AS (Exploit)

SonicWall Capture Advanced Threat Protection (ATP) with RTDMI provides protection against this threat.

Threat Graph:

IoC:

Rtf files :

760ff63642a0c236c4d1f88a8a6c94de1d4087010d3373a6122ab48fa505aed3

2af097a6fe6cc30943ef386c8950787492c5a20ae5de2d15b7d8a248b0c44a8c

cf00a1c2a61cc6a684e768b71bbca78436a28d37e8f982af409eaea1881f1f1f

ab618f0fc42cd3dd63d4901a678cfef419ee06ee374d6425d2ea27668c207b62

b865e203294170ed4de563371dee3a5c4e42d3bf19345ae72c5b2b463121edfb

5b5e9b8165cc731fe242796422dabd8721433a07426de4717f248e3c250439a5

Email:

9ccb84d16ff5ea5b1837bfe4951934b3382ce0bc2b9dd2ffd795a75232303831

7ba7a39fc505601966e88c31ecc3521a3f44ab9397ec24f1b2d5c136fe8c60c2

Most exploited vulnerabilities in this month

SonicWall Threat Research Lab has observed the vulnerabilities that are actively being exploited from the beginning of this month. Please find below the list of vulnerabilities, vendor advisory information  and the SonicWall signatures to protect against these exploits 

CVE-2017-11882 | Microsoft Office EQNEDT32 Stack Buffer Overflow

This is a stack buffer overflow vulnerability in Microsoft Office. The vulnerability is due to incorrect handling of embedded Equation Editor OLE objects in Office documents. A remote attacker could exploit this vulnerability by enticing a user to open a specially crafted file. Successful exploitation could lead to arbitrary code execution under the context of the currently logged on user.

https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-11882

GAV: 21982  Malformed.doc.MP.10
GAV: 4094 JScript.Doc_229

CVE-2017-0147 | Microsoft Windows SMB Server SMBv1 CVE-2017-0147 Information Disclosure

This is an information disclosure vulnerability in the SMBv1 component of Microsoft Windows SMB server. The vulnerability is due to improper handling of SMBv1 requests. A remote, unauthenticated attacker could exploit this vulnerability by sending crafted SMB messages to a target server. Successful exploitation could result in the disclosure of sensitive information from the target server

https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-0147

GAV Cloud ID: 55251134 WannaCrypt

CVE-2010-2568 | Microsoft Windows LNK File Code Execution

This exists in Microsoft Windows that may allow execution of arbitrary code on the target machine. The vulnerability is due to a design weakness in Windows Shell which incorrectly parses shortcuts in such a way that malicious code may be executed when the crafted file is opened either manually or automatically with Windows Explorer. This can be most likely exploited through removable drives containing malicious LNK files, especially on systems that have AutoPlay enabled.

https://docs.microsoft.com/en-us/security-updates/securitybulletins/2010/ms10-046

IPS: 13508 LNK File HTTP Download 2

CVE-2017-8570 | Microsoft Office Remote Code Execution Vulnerability

This is a remote code execution vulnerability in Microsoft Office. The vulnerability is due to incorrect handling of embedded OLE objects in Office documents. A remote attacker could exploit this vulnerability by enticing a user to open a specially crafted file. Successful exploitation could lead to arbitrary code execution under the context of the currently logged on user. 

https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2017-8570

GAV: 32260 JScript.RTF_4

CVE-2013-3346 | Adobe Acrobat Reader ToolButton Use After Free

A use after free vulnerability exists in Adobe Acrobat and Reader. The vulnerability is due to an error in the handling of callback functions associated with ToolButton objects. A remote attacker can exploit this vulnerability by enticing the user to open a specially crafted file. Successful exploitation could result in arbitrary code execution in the context of the currently affected user.

http://www.adobe.com/support/security/bulletins/apsb13-15.html

IPS: 6207 HTTP Client Shellcode Exploit 42

CVE-2010-2883 | Adobe Acrobat and Reader CoolType.dll Stack Buffer Overflow

A code execution vulnerability exists in Adobe Acrobat and Reader. The vulnerability is due to a stack-based buffer overflow error within the CoolType.dll module when handling PDF files containing TTF fonts. Remote attackers could exploit this vulnerability by enticing target users to open a malicious PDF document. Successful exploitation would result in arbitrary code execution in the context of the logged on user.

http://www.adobe.com/support/security/advisories/apsa10-02.html

GAV– 43643 Malformed.pdf.MT.2

CVE-2015-1641| Microsoft Office Component CVE-2015-1641 Use After Free

This is a remote code execution vulnerability in Microsoft Office. The vulnerability is due to improper manipulation of objects in memory while parsing specially crafted Office files. A remote attacker can exploit this vulnerability by enticing a user open a maliciously crafted Office file. Successful exploitation could result in code execution in the context of the affected user.

https://technet.microsoft.com/en-us/library/security/ms15-033.aspx

GAV: 43643 Malformed.pdf.MT.2

CVE-2018-8174 | Microsoft Windows VBScript Engine CVE-2018-8174 Use After Free

A memory corruption vulnerability exists in the Microsoft Windows VBScript engine. The vulnerability is due to the way that the VBScript engine handles certain objects in memory.
A remote attacker can exploit this vulnerability by enticing a user to open a crafted web page using Internet Explorer or a crafted Microsoft Office document.

https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2018-8174

IPS: 4604 HTTP Client Shellcode Exploit 1

CVE-2018-8120 | Win32k Elevation of Privilege Vulnerability

An elevation of privilege vulnerability exists in Windows when the Win32k component fails to properly handle objects in memory. This affects Win32k, Windows, Windows Kernel, Windows Common Log File System Driver, DirectX Graphics Kernel & Windows Image. A local, authenticated attacker could exploit these vulnerabilities by running a maliciously crafted application on the target system. Successful exploitation allows the attacker elevate their privileges to an administrative level on the target.

https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2018-8120

GAV Cloud Id: 66194921 Btrojan Exploit

The risk posed by these vulnerabilities can be mitigated by upgrading to the latest non-vulnerable version

RTF exploits in the wild

SonicWall Threat Research lab is seeing a huge volume of RTF exploits with embedded OLE objects exploiting the Microsoft vulnerabilities (CVE-2017-11882  &  CVE-2017-0199 ). CVE-2017-11882 is because of incorrect handling of embedded Equation Editor OLE objects in Office documents and  CVE-2017-0199  is due to incorrect parsing of embedded OLE2Link objects. Successful exploitation in both the cases can lead to arbitrary code execution under the context of the host.

Infection cycle:

This gets started by sending phishing campaign to the target user either with an attachment or a link to a compromised website hosting the malicious document. Malicious document can either be a Word or PDF  with embedded (.rtf) Rich Text Format file.  Upon launching the main document, embedded .rtf file which actually exploits the above mentioned vulnerabilities get exported & executed. When .rtf file is done exploiting, control returns to the attacker’s specified address where the shell code is present. When shell code gets executed, it brings down the payload from the remote server and execute it on the compromised machine. We see many variants of final payloads getting delivered through these exploits and upon execution they create a reverse shell and give the attacker control over the host.

 

Trend Graph:

The trend line below shows how this attack is being used in the wild today:

 

Prevalence Map:

This can be mitigated by using the up-to-date software with all the security patches. Enable protected view for office documents and do not allow editing of RTF files.  Review carefully before editing or doing anything that requires Protected View to be disabled.

SonicWALL Threat Research Lab provides protection against this threat via the following signatures

  • GAV: 23807  CVE2017-11882.BJ_2
  • SPY: 5164 Malformed-File pdf.MP.316

Microsoft Security Bulletin Coverage for November 2017

SonicWall Capture Labs Threat Research teamhas analyzed and addressed Microsoft’s security advisories for the month of November, 2017. A list of issues reported, along with SonicWall coverage information are as follows:

Microsoft Coverages

  • CVE-2017-11768 Windows Media Player Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11770 .NET CORE Denial Of Service Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11788 Windows Search Denial of Service Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11791 Scripting Engine Information Disclosure Vulnerability
    IPS:13065 Scripting Engine Memory Corruption Vulnerability (Nov 17) 9

  • CVE-2017-11803 Microsoft Edge Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11827 Microsoft Browser Memory Corruption Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11830 Device Guard Security Feature Bypass Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11831 Windows Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11832 Windows EOT Font Engine Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11833 Microsoft Edge Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11834 Scripting Engine Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11835 Windows EOT Font Engine Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11836 Scripting Engine Memory Corruption Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11837 Scripting Engine Memory Corruption Vulnerability
    IPS:13066 Scripting Engine Memory Corruption Vulnerability (Nov 17) 5

  • CVE-2017-11838 Scripting Engine Memory Corruption Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11839 Scripting Engine Memory Corruption Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11840 Scripting Engine Memory Corruption Vulnerability
    IPS:13067 Scripting Engine Memory Corruption Vulnerability (Nov 17) 6

  • CVE-2017-11841 Scripting Engine Memory Corruption Vulnerability
    IPS:13068 Scripting Engine Memory Corruption Vulnerability (Nov 17) 7

  • CVE-2017-11842 Windows Kernel Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11843 Scripting Engine Memory Corruption Vulnerability
    IPS:13069 Scripting Engine Memory Corruption Vulnerability (Nov 17) 8

  • CVE-2017-11844 Microsoft Edge Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11845 Microsoft Edge Memory Corruption Vulnerability

    SPY:1616 Malformed-File html.MP.66

  • CVE-2017-11846 Scripting Engine Memory Corruption Vulnerability
    IPS:12784 Scripting Engine Memory Corruption Vulnerability (MAY 17) 4

  • CVE-2017-11847 Windows Kernel Elevation of Privilege Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11848 Internet Explorer Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11849 Windows Kernel Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11850 Microsoft Graphics Component Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11851 Windows Kernel Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11852 Windows GDI Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11853 Windows Kernel Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11854 Microsoft Word Memory Corruption Vulnerability
    SPY:1614 Malformed-File rtf.MP.21

  • CVE-2017-11855 Internet Explorer Memory Corruption Vulnerability
    IPS:13071 Internet Explorer Memory Corruption Vulnerability (NOV 17) 1

  • CVE-2017-11856 Internet Explorer Memory Corruption Vulnerability
    IPS:13072 Internet Explorer Memory Corruption Vulnerability (NOV 17) 2

  • CVE-2017-11858 Scripting Engine Memory Corruption Vulnerability
    IPS:13059 Scripting Engine Memory Corruption Vulnerability (Nov 17) 1

  • CVE-2017-11861 Scripting Engine Memory Corruption Vulnerability
    IPS:13060 Scripting Engine Memory Corruption Vulnerability (Nov 17) 2

  • CVE-2017-11862 Scripting Engine Memory Corruption Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11863 Microsoft Edge Security Feature Bypass Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11866 Scripting Engine Memory Corruption Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11869 Scripting Engine Memory Corruption Vulnerability
    IPS:13062 Scripting Engine Memory Corruption Vulnerability (Nov 17) 3

  • CVE-2017-11870 Scripting Engine Memory Corruption Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11871 Scripting Engine Memory Corruption Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11872 Microsoft Edge Security Feature Bypass Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11873 Scripting Engine Memory Corruption Vulnerability
    IPS:13063 Scripting Engine Memory Corruption Vulnerability (Nov 17) 4

  • CVE-2017-11874 Microsoft Edge Security Feature Bypass Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11876 Microsoft Project Server Elevation of Privilege Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11877 Microsoft Excel Security Feature Bypass Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11878 Microsoft Excel Memory Corruption Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11879 ASP.NET Core Elevation Of Privilege Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11880 Windows Information Disclosure Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-11882 Microsoft Office Memory Corruption Vulnerability
    There are no known exploits in the wild.
    CVE-2017-11884 Microsoft Office Memory Corruption Vulnerability
    There are no known exploits in the wild.
  • CVE-2017-8700 ASP.NET Core Information Disclosure Vulnerability
    There are no known exploits in the wild.